Skip to content

Commit

Permalink
datapath: compat: Fix RHEL 7.5 build warning from ip_tunnel_get_stats…
Browse files Browse the repository at this point in the history
…64()

This patch fixes warning as the following in RHEL 7.5 kernel.

  CC [M]  /root/git/ovs/datapath/linux/geneve.o
/root/git/ovs/datapath/linux/geneve.c:1273:2: warning: initialization
from incompatible pointer type [enabled by default]
  .ndo_get_stats64 = ip_tunnel_get_stats64,
  ^
/root/git/ovs/datapath/linux/geneve.c:1273:2: warning: (near
initialization for ‘geneve_netdev_ops.<anonymous>.ndo_get_stats64’)
[enabled by default]
/root/git/ovs/datapath/linux/ip_gre.c:1162:2: warning: initialization
from incompatible pointer type [enabled by default]
  .ndo_get_stats64 = ip_tunnel_get_stats64,
  ^
/root/git/ovs/datapath/linux/ip_gre.c:1162:2: warning: (near
initialization for ‘ipgre_netdev_ops.<anonymous>.ndo_get_stats64’)
[enabled by default]
/root/git/ovs/datapath/linux/ip_gre.c:1180:2: warning: initialization
from incompatible pointer type [enabled by default]
  .ndo_get_stats64 = ip_tunnel_get_stats64,
  ^

Fixes: 436d36d ("compat: Fixups for newer kernels")
Signed-off-by: Yi-Hung Wei <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
Reviewed-by: Greg Rose <[email protected]>
Tested-by: Greg Rose <[email protected]>
  • Loading branch information
YiHungWei authored and blp committed Jun 14, 2018
1 parent 2fe15e8 commit 582c78f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion datapath/linux/compat/include/net/ip_tunnels.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ static inline int ovs_ip_tunnel_encap(struct sk_buff *skb, struct ip_tunnel *t,
}

#define ip_tunnel_get_stats64 rpl_ip_tunnel_get_stats64
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0) && !defined(HAVE_RHEL7_MAX_MTU)
struct rtnl_link_stats64 *rpl_ip_tunnel_get_stats64(struct net_device *dev,
struct rtnl_link_stats64 *tot);
#else
Expand Down
4 changes: 2 additions & 2 deletions datapath/linux/compat/ip_tunnels_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ static void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64,
}
#endif

#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0) && !defined(HAVE_RHEL7_MAX_MTU)
struct rtnl_link_stats64 *rpl_ip_tunnel_get_stats64(struct net_device *dev,
struct rtnl_link_stats64 *tot)
#else
Expand Down Expand Up @@ -306,7 +306,7 @@ void rpl_ip_tunnel_get_stats64(struct net_device *dev,
tot->tx_bytes += tx_bytes;
}

#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0) && !defined(HAVE_RHEL7_MAX_MTU)
return tot;
#endif
}
Expand Down

0 comments on commit 582c78f

Please sign in to comment.