[ovs-dev] [PATCH 5/5] datapath: provide dev_get_stats copat code for v2.6.35
Simon Horman
simon.horman at netronome.com
Fri Dec 18 04:50:04 UTC 2015
From: Simon Horman <horms at verge.net.au>
struct link_stats64 was introduced in v2.6.35, however,
it was not used directly by dev_get_stats until v2.6.36.
Fixes: e23775f20e1a ("datapath: Add support for lwtunnel")
Signed-off-by: Simon Horman <horms at verge.net.au>
---
.travis.yml | 1 +
datapath/linux/compat/include/linux/netdevice.h | 3 ++-
datapath/linux/compat/netdevice.c | 3 ++-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index be9ad9ff8caf..32c2ca6bca57 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -36,6 +36,7 @@ env:
- KERNEL=2.6.38.8
- KERNEL=2.6.37.6
- KERNEL=2.6.36.4
+ - KERNEL=2.6.35.14
- 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 71de4e54389a..8169d64a0357 100644
--- a/datapath/linux/compat/include/linux/netdevice.h
+++ b/datapath/linux/compat/include/linux/netdevice.h
@@ -254,7 +254,8 @@ static inline void *skb_gro_remcsum_process(struct sk_buff *skb, void *ptr,
#endif
#endif
-#ifndef HAVE_RTNL_LINK_STATS64
+#if defined(HAVE_RTNL_LINK_STATS64) || \
+ LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
#define dev_get_stats rpl_dev_get_stats
struct rtnl_link_stats64 *rpl_dev_get_stats(struct net_device *dev,
struct rtnl_link_stats64 *storage);
diff --git a/datapath/linux/compat/netdevice.c b/datapath/linux/compat/netdevice.c
index e28b878eea16..6d206603fe2b 100644
--- a/datapath/linux/compat/netdevice.c
+++ b/datapath/linux/compat/netdevice.c
@@ -196,7 +196,8 @@ int rpl_eth_gro_complete(struct sk_buff *skb, int nhoff)
#endif
#endif /* HAVE_UDP_OFFLOAD */
-#ifndef HAVE_RTNL_LINK_STATS64
+#if !defined(HAVE_RTNL_LINK_STATS64) || \
+ LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
#undef dev_get_stats
struct rtnl_link_stats64 *rpl_dev_get_stats(struct net_device *dev,
struct rtnl_link_stats64 *storage)
--
2.1.4
More information about the dev
mailing list