The build was failing with following error: ---- CC [M] /home/sabyasse/Linux/src/sandbox/ovs_v1/datapath/linux/vport.o /home/sabyasse/Linux/src/sandbox/ovs_v1/datapath/linux/vport.c: In function ‘ovs_vport_get_stats’: /home/sabyasse/Linux/src/sandbox/ovs_v1/datapath/linux/vport.c:328: error: implicit declaration of function ‘dev_get_stats64’ ----
The issue is fixed by checking for existence of dev_get_stats64 in netdevice.h and then using it (in C6.7+, 2.6.32-594 kernels). For previous kernels use compat rpl_dev_get_stats. Signed-off-by: Sabyasachi Sengupta <sabyasachi.sengu...@alcatel-lucent.com> Signed-off-by: Wanlong Gao <wanlong....@easystack.cn> --- This issue still exists and should be backported to LTS branch-2.5. Thanks, Wanlong Gao acinclude.m4 | 1 + datapath/linux/compat/include/linux/netdevice.h | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index acd7ce7..fd67598 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -399,6 +399,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ [OVS_DEFINE([HAVE_SOCK_CREATE_KERN_NET])]) OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_disable_lro]) OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_get_stats]) + OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_get_stats64]) OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_get_by_index_rcu]) OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_recursion_level]) OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [__skb_gso_segment]) diff --git a/datapath/linux/compat/include/linux/netdevice.h b/datapath/linux/compat/include/linux/netdevice.h index e9fa995..71fef90 100644 --- a/datapath/linux/compat/include/linux/netdevice.h +++ b/datapath/linux/compat/include/linux/netdevice.h @@ -229,7 +229,13 @@ struct rtnl_link_stats64 *rpl_dev_get_stats(struct net_device *dev, #if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0) /* Only required on RHEL 6. */ +#ifdef HAVE_DEV_GET_STATS64 #define dev_get_stats dev_get_stats64 +#else +#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); +#endif #endif #ifndef netdev_dbg -- 2.5.0 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev