diff mbox series

[ovs-dev,3/3] datapath: compat: Fix RHEL 7.5 build warning from ip_tunnel_get_stats64()

Message ID 1528764623-19974-3-git-send-email-yihung.wei@gmail.com
State Accepted
Headers show
Series [ovs-dev,1/3] datapath: Fix max MTU size on RHEL 7.5 kernel | expand

Commit Message

Yi-Hung Wei June 12, 2018, 12:50 a.m. UTC
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: 436d36db ("compat: Fixups for newer kernels")
Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
---
 datapath/linux/compat/include/net/ip_tunnels.h | 2 +-
 datapath/linux/compat/ip_tunnels_core.c        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Gregory Rose June 12, 2018, 10:28 p.m. UTC | #1
On 6/11/2018 5:50 PM, Yi-Hung Wei wrote:
> 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: 436d36db ("compat: Fixups for newer kernels")
> Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
> ---
>   datapath/linux/compat/include/net/ip_tunnels.h | 2 +-
>   datapath/linux/compat/ip_tunnels_core.c        | 4 ++--
>   2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/datapath/linux/compat/include/net/ip_tunnels.h b/datapath/linux/compat/include/net/ip_tunnels.h
> index b1c383dc8036..d187a12d29ae 100644
> --- a/datapath/linux/compat/include/net/ip_tunnels.h
> +++ b/datapath/linux/compat/include/net/ip_tunnels.h
> @@ -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
> diff --git a/datapath/linux/compat/ip_tunnels_core.c b/datapath/linux/compat/ip_tunnels_core.c
> index fcb08905ef2f..38fb801e9411 100644
> --- a/datapath/linux/compat/ip_tunnels_core.c
> +++ b/datapath/linux/compat/ip_tunnels_core.c
> @@ -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
> @@ -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
>   }

Also looks good.

Reviewed-by: Greg Rose <gvrose8192@gmail.com>
Tested-by: Greg Rose <gvrose8192@gmail.com>
diff mbox series

Patch

diff --git a/datapath/linux/compat/include/net/ip_tunnels.h b/datapath/linux/compat/include/net/ip_tunnels.h
index b1c383dc8036..d187a12d29ae 100644
--- a/datapath/linux/compat/include/net/ip_tunnels.h
+++ b/datapath/linux/compat/include/net/ip_tunnels.h
@@ -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
diff --git a/datapath/linux/compat/ip_tunnels_core.c b/datapath/linux/compat/ip_tunnels_core.c
index fcb08905ef2f..38fb801e9411 100644
--- a/datapath/linux/compat/ip_tunnels_core.c
+++ b/datapath/linux/compat/ip_tunnels_core.c
@@ -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
@@ -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
 }