[ovs-dev] [PATCH] datapath: compat: Fix ndo_size in RHEL 7.5 backport

Yi-Hung Wei yihung.wei at gmail.com
Thu May 17 19:39:51 UTC 2018


If 'ndo_size' is not set in 'struct net_device_ops', RHEL kernel will not
make use of functions in 'struct net_device_ops_extended'.

Fixes: 39ca338374ab ("datapath: compat: Fix build on RHEL 7.5")
Reported-by: Jiri Benc <jbenc at redhat.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2018-May/347070.html
Signed-off-by: Yi-Hung Wei <yihung.wei at gmail.com>
---
 datapath/linux/compat/geneve.c | 1 +
 datapath/linux/compat/ip_gre.c | 1 +
 datapath/linux/compat/lisp.c   | 1 +
 datapath/linux/compat/stt.c    | 1 +
 datapath/linux/compat/vxlan.c  | 2 ++
 5 files changed, 6 insertions(+)

diff --git a/datapath/linux/compat/geneve.c b/datapath/linux/compat/geneve.c
index eacffb2c5b2a..0fcc6e51d708 100644
--- a/datapath/linux/compat/geneve.c
+++ b/datapath/linux/compat/geneve.c
@@ -1272,6 +1272,7 @@ static const struct net_device_ops geneve_netdev_ops = {
 	.ndo_start_xmit		= geneve_dev_xmit,
 	.ndo_get_stats64	= ip_tunnel_get_stats64,
 #ifdef	HAVE_RHEL7_MAX_MTU
+	.ndo_size		= sizeof(struct net_device_ops),
 	.extended.ndo_change_mtu = geneve_change_mtu,
 #else
 	.ndo_change_mtu		= geneve_change_mtu,
diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c
index 2f297a548e30..a4cae626e174 100644
--- a/datapath/linux/compat/ip_gre.c
+++ b/datapath/linux/compat/ip_gre.c
@@ -492,6 +492,7 @@ static const struct net_device_ops gre_tap_netdev_ops = {
 	.ndo_set_mac_address	= eth_mac_addr,
 	.ndo_validate_addr	= eth_validate_addr,
 #ifdef	HAVE_RHEL7_MAX_MTU
+	.ndo_size		= sizeof(struct net_device_ops),
 	.extended.ndo_change_mtu = ip_tunnel_change_mtu,
 #else
 	.ndo_change_mtu		= ip_tunnel_change_mtu,
diff --git a/datapath/linux/compat/lisp.c b/datapath/linux/compat/lisp.c
index 4882a636a33e..5055b862f2c0 100644
--- a/datapath/linux/compat/lisp.c
+++ b/datapath/linux/compat/lisp.c
@@ -547,6 +547,7 @@ static const struct net_device_ops lisp_netdev_ops = {
 	.ndo_stop               = lisp_stop,
 	.ndo_start_xmit         = lisp_dev_xmit,
 #ifdef  HAVE_RHEL7_MAX_MTU
+	.ndo_size		= sizeof(struct net_device_ops),
 	.extended.ndo_change_mtu = lisp_change_mtu,
 #else
 	.ndo_change_mtu         = lisp_change_mtu,
diff --git a/datapath/linux/compat/stt.c b/datapath/linux/compat/stt.c
index ee1c7aa0a78d..c57c2bee0161 100644
--- a/datapath/linux/compat/stt.c
+++ b/datapath/linux/compat/stt.c
@@ -1858,6 +1858,7 @@ static const struct net_device_ops stt_netdev_ops = {
 	.ndo_start_xmit         = stt_dev_xmit,
 	.ndo_get_stats64        = ip_tunnel_get_stats64,
 #ifdef  HAVE_RHEL7_MAX_MTU
+	.ndo_size		= sizeof(struct net_device_ops),
 	.extended.ndo_change_mtu = stt_change_mtu,
 #else
 	.ndo_change_mtu         = stt_change_mtu,
diff --git a/datapath/linux/compat/vxlan.c b/datapath/linux/compat/vxlan.c
index 40cb12b1329d..fa4e7b11cee4 100644
--- a/datapath/linux/compat/vxlan.c
+++ b/datapath/linux/compat/vxlan.c
@@ -1482,6 +1482,7 @@ static const struct net_device_ops vxlan_netdev_ether_ops = {
 	.ndo_get_stats64	= ip_tunnel_get_stats64,
 	.ndo_set_rx_mode	= vxlan_set_multicast_list,
 #ifdef	HAVE_RHEL7_MAX_MTU
+	.ndo_size		= sizeof(struct net_device_ops),
 	.extended.ndo_change_mtu = vxlan_change_mtu,
 #else
 	.ndo_change_mtu		= vxlan_change_mtu,
@@ -1501,6 +1502,7 @@ static const struct net_device_ops vxlan_netdev_raw_ops = {
 	.ndo_start_xmit		= vxlan_dev_xmit,
 	.ndo_get_stats64	= ip_tunnel_get_stats64,
 #ifdef	HAVE_RHEL7_MAX_MTU
+	.ndo_size		= sizeof(struct net_device_ops),
 	.extended.ndo_change_mtu = vxlan_change_mtu,
 #else
 	.ndo_change_mtu		= vxlan_change_mtu,
-- 
2.7.4



More information about the dev mailing list