[ovs-dev] [PATCH 2/2] datapath: Work around debugging for csum_and_copy_to_user().

Jesse Gross jesse at nicira.com
Tue Nov 2 23:53:10 UTC 2010


Certain versions of XenServer add debugging to csum_and_copy_to_user()
in such a way that it changes the function signature.  This adds a
check and a workaround to allow us to build on these versions.

Signed-off-by: Jesse Gross <jesse at nicira.com>
---
 acinclude.m4                                       |    3 +++
 .../linux-2.6/compat-2.6/include/net/checksum.h    |    8 ++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 7ef9e75..8b13739 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -152,6 +152,9 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [
   mkdir -p datapath/linux-2.6
   : > datapath/linux-2.6/kcompat.h.new
 
+  OVS_GREP_IFELSE([$KSRC26/arch/x86/include/asm/checksum_32.h], [src_err,],
+                  [OVS_DEFINE([HAVE_CSUM_COPY_DBG])])
+
   OVS_GREP_IFELSE([$KSRC26/include/linux/err.h], [ERR_CAST],
                   [OVS_DEFINE([HAVE_ERR_CAST])])
 
diff --git a/datapath/linux-2.6/compat-2.6/include/net/checksum.h b/datapath/linux-2.6/compat-2.6/include/net/checksum.h
index 3b6debb..96fd3a6 100644
--- a/datapath/linux-2.6/compat-2.6/include/net/checksum.h
+++ b/datapath/linux-2.6/compat-2.6/include/net/checksum.h
@@ -10,4 +10,12 @@ static inline __wsum csum_unfold(__sum16 n)
 }
 #endif /* !HAVE_CSUM_UNFOLD */
 
+/* Workaround for debugging included in certain versions of XenServer.  It only
+ * applies to 32-bit x86.
+ */
+#if defined(HAVE_CSUM_COPY_DBG) && defined(CONFIG_X86_32)
+#define csum_and_copy_to_user(src, dst, len, sum, err_ptr) \
+	csum_and_copy_to_user(src, dst, len, sum, NULL, err_ptr)
+#endif
+
 #endif /* checksum.h */
-- 
1.7.1





More information about the dev mailing list