diff mbox

[ovs-dev,4/8] datapath/linux/compat: Implement upstream net device free change

Message ID 1500497833-30066-5-git-send-email-gvrose8192@gmail.com
State Superseded
Delegated to: Joe Stringer
Headers show

Commit Message

Gregory Rose July 19, 2017, 8:57 p.m. UTC
Upstream commit cf124db566e6 ("net: Fix inconsistent teardown and
release of private netdev state.") removed the destructor member
of the net_device structure and replaced it with a boolean flag
indicating that the net device resource needs freeing.  Use
compat flag HAVE_NEEDS_FREE_NETDEV to indicate whether the new
flag should be used.

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
---
 datapath/linux/compat/lisp.c | 4 ++++
 datapath/linux/compat/stt.c  | 4 ++++
 2 files changed, 8 insertions(+)
diff mbox

Patch

diff --git a/datapath/linux/compat/lisp.c b/datapath/linux/compat/lisp.c
index 15f851d..c505fad 100644
--- a/datapath/linux/compat/lisp.c
+++ b/datapath/linux/compat/lisp.c
@@ -580,7 +580,11 @@  static void lisp_setup(struct net_device *dev)
 
 	dev->netdev_ops = &lisp_netdev_ops;
 	dev->ethtool_ops = &lisp_ethtool_ops;
+#ifndef HAVE_NEEDS_FREE_NETDEV
 	dev->destructor = free_netdev;
+#else
+	dev->needs_free_netdev = true;
+#endif
 
 	SET_NETDEV_DEVTYPE(dev, &lisp_type);
 
diff --git a/datapath/linux/compat/stt.c b/datapath/linux/compat/stt.c
index ca9f039..964d993 100644
--- a/datapath/linux/compat/stt.c
+++ b/datapath/linux/compat/stt.c
@@ -1882,7 +1882,11 @@  static void stt_setup(struct net_device *dev)
 
 	dev->netdev_ops = &stt_netdev_ops;
 	dev->ethtool_ops = &stt_ethtool_ops;
+#ifndef HAVE_NEEDS_FREE_NETDEV
 	dev->destructor = free_netdev;
+#else
+	dev->needs_free_netdev = true;
+#endif
 
 	SET_NETDEV_DEVTYPE(dev, &stt_type);