[rds-commits] zab commits r92 - in trunk: . kapi-compat linux/net/rds

svn-commits@oss.oracle.com svn-commits at oss.oracle.com
Thu Jun 1 13:56:17 CDT 2006


Author: zab
Date: 2006-06-01 13:56:15 -0500 (Thu, 01 Jun 2006)
New Revision: 92

Added:
   trunk/kapi-compat/use-pf-21.h
Modified:
   trunk/configure.in
   trunk/linux/net/rds/af_rds.c
Log:
Add a hack to build with PF_ 21 for testing without rebuilding kernels.


Modified: trunk/configure.in
===================================================================
--- trunk/configure.in	2006-06-01 17:44:06 UTC (rev 91)
+++ trunk/configure.in	2006-06-01 18:56:15 UTC (rev 92)
@@ -37,7 +37,7 @@
 fi
 AC_SUBST(KERNELCC)
 
-AC_MSG_CHECKING(for debugging)
+AC_MSG_CHECKING(whether debugging is enabled)
 AC_ARG_ENABLE(debug, [  --enable-debug=[yes/no]         Turn on debugging [default=no]],,enable_debug=no)
 DEBUG_CFLAGS=""
 if test "x$enable_debug" = "xyes"; then
@@ -46,6 +46,8 @@
 AC_SUBST(DEBUG_CFLAGS)
 AC_MSG_RESULT($enable_debug)
 
+AC_ARG_ENABLE(pf21, [  --enable-pf21=[yes/no]         steal PF_ 21 [default=no]],,enable_pf21=no)
+
 kernelroot="/lib/modules/`uname -r`"
 AC_MSG_CHECKING(for directory with kernel build tree)
 AC_ARG_WITH(kernel, [  --with-kernel=dir       Path to the kernel build tree [[/lib/modules/`uname -r`]]], kerneldir="$withval", [
@@ -99,6 +101,22 @@
 KERNEL_COMPAT_HEADER(inet_ehashfn, net/inet_hashtables.h)
 KERNEL_COMPAT_HEADER(setup_timer, linux/timer.h)
 
+GREP_KERNEL_INCLUDE([PR_RDS in linux/socket.h], linux/socket.h,
+	have_pf_rds=yes, , [PF_RDS])
+
+if test "x$have_pf_rds" != "xyes"; then
+	AC_MSG_CHECKING([whether to steal PF_ 21])
+	if test "x$enable_pf21" != "xyes" ; then
+		AC_MSG_RESULT(no)
+		AC_MSG_ERROR([
+PF_RDS is not defined in $KERNELSRC/include/linux/socket.h
+You probably want to apply a patch like
+2.6-kernel-patches/add-rds-defines.patch in the source distribution.])
+	fi
+	AC_MSG_RESULT([yes, DO NOT DISTRIBUTE])
+	KAPI_COMPAT_HEADERS="$KAPI_COMPAT_HEADERS use-pf-21.h"
+fi
+
 # boy is this awful, but the be16 change seems to be near
 # the last argument change :( :(
 GREP_KERNEL_INCLUDE([packet_type.func orig dev argument], linux/netdevice.h,

Added: trunk/kapi-compat/use-pf-21.h
===================================================================
--- trunk/kapi-compat/use-pf-21.h	2006-06-01 17:44:06 UTC (rev 91)
+++ trunk/kapi-compat/use-pf-21.h	2006-06-01 18:56:15 UTC (rev 92)
@@ -0,0 +1,4 @@
+
+#define PF_RDS 21
+#define AF_RDS PF_RDS
+#define SOL_RDS 12345

Modified: trunk/linux/net/rds/af_rds.c
===================================================================
--- trunk/linux/net/rds/af_rds.c	2006-06-01 17:44:06 UTC (rev 91)
+++ trunk/linux/net/rds/af_rds.c	2006-06-01 18:56:15 UTC (rev 92)
@@ -338,6 +338,17 @@
 {
 	int ret;
 
+#ifndef KERNEL_HAS_NOT_DEFINED
+	/* the strange ifdef above has scripts/makepatch.sh strip this out */
+#if PF_RDS == 21
+	printk(KERN_ERR "!!! This build of RDS is using PF 21 which is not "
+	       "reserved\n");
+	printk(KERN_ERR "!!! This is only suitable for testing, DO NOT "
+	       "RELEASE THIS.\n");
+	printk(KERN_ERR "!!! No, seriously.\n");
+#endif
+#endif
+
 	ret = rds_conn_init();
 	if (ret)
 		goto out;




More information about the rds-commits mailing list