diff mbox

[ovs-dev,4/5] datapath: restrict usage of tstats to kernels older than 2.6.37

Message ID 1450414204-9038-5-git-send-email-simon.horman@netronome.com
State Changes Requested
Headers show

Commit Message

Simon Horman Dec. 18, 2015, 4:50 a.m. UTC
From: Simon Horman <horms@verge.net.au>

tstats field was added to struct net_device in v2.6.37.

Fixes: e23775f20e1a ("datapath: Add support for lwtunnel")
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 .travis.yml                                     | 1 +
 datapath/linux/compat/include/linux/netdevice.h | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Pravin B Shelar Dec. 23, 2015, 10:16 p.m. UTC | #1
On Thu, Dec 17, 2015 at 8:50 PM, Simon Horman
<simon.horman@netronome.com> wrote:
> From: Simon Horman <horms@verge.net.au>
>
> tstats field was added to struct net_device in v2.6.37.
>
> Fixes: e23775f20e1a ("datapath: Add support for lwtunnel")
> Signed-off-by: Simon Horman <horms@verge.net.au>
> ---
>  .travis.yml                                     | 1 +
>  datapath/linux/compat/include/linux/netdevice.h | 3 ++-
>  2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/.travis.yml b/.travis.yml
> index d6376ff51bd2..be9ad9ff8caf 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -35,6 +35,7 @@ env:
>    - KERNEL=2.6.39.4
>    - KERNEL=2.6.38.8
>    - KERNEL=2.6.37.6
> +  - KERNEL=2.6.36.4
>    - KERNEL=2.6.33.20
>    - KERNEL=2.6.32.68
>
> diff --git a/datapath/linux/compat/include/linux/netdevice.h b/datapath/linux/compat/include/linux/netdevice.h
> index 19a7b8ef53d2..71de4e54389a 100644
> --- a/datapath/linux/compat/include/linux/netdevice.h
> +++ b/datapath/linux/compat/include/linux/netdevice.h
> @@ -261,7 +261,8 @@ struct rtnl_link_stats64 *rpl_dev_get_stats(struct net_device *dev,
>
>  #else
>  #define HAVE_DEV_TSTATS
> -#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0)
> +#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0) || \
> +    LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)

If we add the kernel version test, then the previous test related to
RHEL version becomes redundant.

>  #undef HAVE_DEV_TSTATS
>  #endif
>  #endif
> --
> 2.1.4
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
diff mbox

Patch

diff --git a/.travis.yml b/.travis.yml
index d6376ff51bd2..be9ad9ff8caf 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -35,6 +35,7 @@  env:
   - KERNEL=2.6.39.4
   - KERNEL=2.6.38.8
   - KERNEL=2.6.37.6
+  - KERNEL=2.6.36.4
   - KERNEL=2.6.33.20
   - KERNEL=2.6.32.68
 
diff --git a/datapath/linux/compat/include/linux/netdevice.h b/datapath/linux/compat/include/linux/netdevice.h
index 19a7b8ef53d2..71de4e54389a 100644
--- a/datapath/linux/compat/include/linux/netdevice.h
+++ b/datapath/linux/compat/include/linux/netdevice.h
@@ -261,7 +261,8 @@  struct rtnl_link_stats64 *rpl_dev_get_stats(struct net_device *dev,
 
 #else
 #define HAVE_DEV_TSTATS
-#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0)
+#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0) || \
+    LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
 #undef HAVE_DEV_TSTATS
 #endif
 #endif