From: Pravin B Shelar Date: Tue, 3 Sep 2013 18:02:40 +0000 (-0700) Subject: datapath: Move kernel version check to configure. X-Git-Tag: sliver-openvswitch-2.0.90-1~16^2~12 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=d76aabead8bb20614e56a7330dfb08f1c8b1b5d0 datapath: Move kernel version check to configure. Rather than having compile time check in datapath.c, its better to check kernel version at configuration step. Signed-off-by: Pravin B Shelar Acked-by: Jesse Gross --- diff --git a/acinclude.m4 b/acinclude.m4 index 73ee5ce30..8145340a6 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -134,14 +134,16 @@ AC_DEFUN([OVS_CHECK_LINUX], [ AC_MSG_RESULT([$kversion]) if test "$version" -ge 3; then - : # Linux 3.x - elif test "$version" = 2 && test "$patchlevel" -ge 6; then - : # Linux 2.6.x + if test "$version" = 3 && test "$patchlevel" -le 10; then + : # Linux 3.x + else + AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 3.10.x is not supported]) + fi else - if test "$KBUILD" = "$KSRC"; then - AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version 2.6 or later is required]) + if test "$version" -le 1 || test "$patchlevel" -le 5 || test "$sublevel" -le 31; then + AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version 2.6.32 or later is required]) else - AC_ERROR([Linux kernel in build tree $KBUILD (source tree $KSRC) is version $kversion, but version 2.6 or later is required]) + : # Linux 2.6.x fi fi if (test ! -e "$KBUILD"/include/linux/version.h && \ diff --git a/datapath/datapath.c b/datapath/datapath.c index 98651a47b..b6410c4e4 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -61,11 +61,6 @@ #include "vport-internal_dev.h" #include "vport-netdev.h" -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) || \ - LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) -#error Kernels before 2.6.32 or after 3.10 are not supported by this version of Open vSwitch. -#endif - #define REHASH_FLOW_INTERVAL (10 * 60 * HZ) static void rehash_flow_table(struct work_struct *work); static DECLARE_DELAYED_WORK(rehash_flow_wq, rehash_flow_table);