Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf Hering <ohering@suse.de>2017-10-20 12:20:33 +0200
committerOlaf Hering <ohering@suse.de>2017-10-20 12:23:29 +0200
commit68d6b87d1aac30c380d10a7e18158aef01557321 (patch)
tree9ca7197a2ae45c31f3db72299fdaaa4f9ce372c1
parent0893ec804ba4d0f4339d8e94473428a83c3ec2fc (diff)
netvsc: cleanup datapath switch (fate#323887).
-rw-r--r--patches.suse/msft-hv-1455-netvsc-cleanup-datapath-switch.patch84
-rw-r--r--series.conf1
2 files changed, 85 insertions, 0 deletions
diff --git a/patches.suse/msft-hv-1455-netvsc-cleanup-datapath-switch.patch b/patches.suse/msft-hv-1455-netvsc-cleanup-datapath-switch.patch
new file mode 100644
index 0000000000..ecdba381be
--- /dev/null
+++ b/patches.suse/msft-hv-1455-netvsc-cleanup-datapath-switch.patch
@@ -0,0 +1,84 @@
+From: Stephen Hemminger <stephen@networkplumber.org>
+Date: Thu, 31 Aug 2017 16:16:12 -0700
+Patch-mainline: v4.14-rc1
+Subject: netvsc: cleanup datapath switch
+Git-commit: 9a0c48df0d77602da3958a4c8fc2abb9521b0ade
+References: fate#323887
+
+Use one routine for datapath up/down. Don't need to reopen
+the rndis layer.
+
+Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Olaf Hering <ohering@suse.de>
+---
+ drivers/net/hyperv/netvsc_drv.c | 38 +++++++-------------------------------
+ 1 file changed, 7 insertions(+), 31 deletions(-)
+
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -1847,11 +1847,13 @@ static int netvsc_register_vf(struct net_device *vf_netdev)
+ return NOTIFY_OK;
+ }
+
+-static int netvsc_vf_up(struct net_device *vf_netdev)
++/* VF up/down change detected, schedule to change data path */
++static int netvsc_vf_changed(struct net_device *vf_netdev)
+ {
+ struct net_device_context *net_device_ctx;
+ struct netvsc_device *netvsc_dev;
+ struct net_device *ndev;
++ bool vf_is_up = netif_running(vf_netdev);
+
+ ndev = get_netvsc_byref(vf_netdev);
+ if (!ndev)
+@@ -1862,34 +1864,9 @@ static int netvsc_vf_up(struct net_device *vf_netdev)
+ if (!netvsc_dev)
+ return NOTIFY_DONE;
+
+- /* Bump refcount when datapath is acvive - Why? */
+- rndis_filter_open(netvsc_dev);
+-
+- /* notify the host to switch the data path. */
+- netvsc_switch_datapath(ndev, true);
+- netdev_info(ndev, "Data path switched to VF: %s\n", vf_netdev->name);
+-
+- return NOTIFY_OK;
+-}
+-
+-static int netvsc_vf_down(struct net_device *vf_netdev)
+-{
+- struct net_device_context *net_device_ctx;
+- struct netvsc_device *netvsc_dev;
+- struct net_device *ndev;
+-
+- ndev = get_netvsc_byref(vf_netdev);
+- if (!ndev)
+- return NOTIFY_DONE;
+-
+- net_device_ctx = netdev_priv(ndev);
+- netvsc_dev = rtnl_dereference(net_device_ctx->nvdev);
+- if (!netvsc_dev)
+- return NOTIFY_DONE;
+-
+- netvsc_switch_datapath(ndev, false);
+- netdev_info(ndev, "Data path switched from VF: %s\n", vf_netdev->name);
+- rndis_filter_close(netvsc_dev);
++ netvsc_switch_datapath(ndev, vf_is_up);
++ netdev_info(ndev, "Data path switched %s VF: %s\n",
++ vf_is_up ? "to" : "from", vf_netdev->name);
+
+ return NOTIFY_OK;
+ }
+@@ -2099,9 +2076,8 @@ static int netvsc_netdev_event(struct notifier_block *this,
+ case NETDEV_UNREGISTER:
+ return netvsc_unregister_vf(event_dev);
+ case NETDEV_UP:
+- return netvsc_vf_up(event_dev);
+ case NETDEV_DOWN:
+- return netvsc_vf_down(event_dev);
++ return netvsc_vf_changed(event_dev);
+ default:
+ return NOTIFY_DONE;
+ }
diff --git a/series.conf b/series.conf
index 82c9052298..a5b998767d 100644
--- a/series.conf
+++ b/series.conf
@@ -1703,6 +1703,7 @@
patches.suse/msft-hv-1452-scsi-storvsc-fix-memory-leak-on-ring-buffer-busy.patch
patches.suse/msft-hv-1453-x86-hyper-v-Support-extended-CPU-ranges-for-TLB-flus.patch
patches.suse/msft-hv-1454-tracing-hyper-v-Trace-hyperv_mmu_flush_tlb_others.patch
+ patches.suse/msft-hv-1455-netvsc-cleanup-datapath-switch.patch
patches.suse/suse-hv-guest-os-id.patch
patches.suse/suse-hv-kvp_on_msg.dbg.patch