From: Greg Kroah-Hartman Date: Wed, 17 Oct 2018 13:18:14 +0000 (+0200) Subject: drop hv_netvsc-pair-vf-based-on-serial-number.patch from 4.18 X-Git-Tag: v4.9.134~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2f8f60ac35eb6bb56116e11f2abf7226ae938e96;p=thirdparty%2Fkernel%2Fstable-queue.git drop hv_netvsc-pair-vf-based-on-serial-number.patch from 4.18 --- diff --git a/queue-4.18/hv_netvsc-pair-vf-based-on-serial-number.patch b/queue-4.18/hv_netvsc-pair-vf-based-on-serial-number.patch deleted file mode 100644 index f729bc6d7a8..00000000000 --- a/queue-4.18/hv_netvsc-pair-vf-based-on-serial-number.patch +++ /dev/null @@ -1,118 +0,0 @@ -From foo@baz Tue Oct 16 11:10:21 CEST 2018 -From: Stephen Hemminger -Date: Fri, 14 Sep 2018 12:54:57 -0700 -Subject: hv_netvsc: pair VF based on serial number - -From: Stephen Hemminger - -[ Upstream commit 00d7ddba1143623b31bc2c15d18216e2da031b14 ] - -Matching network device based on MAC address is problematic -since a non VF network device can be creted with a duplicate MAC -address causing confusion and problems. The VMBus API does provide -a serial number that is a better matching method. - -Signed-off-by: Stephen Hemminger -Signed-off-by: David S. Miller -Signed-off-by: Sasha Levin -Signed-off-by: Greg Kroah-Hartman ---- - drivers/net/hyperv/netvsc.c | 3 ++ - drivers/net/hyperv/netvsc_drv.c | 58 ++++++++++++++++++++++------------------ - 2 files changed, 36 insertions(+), 25 deletions(-) - ---- a/drivers/net/hyperv/netvsc.c -+++ b/drivers/net/hyperv/netvsc.c -@@ -1203,6 +1203,9 @@ static void netvsc_send_vf(struct net_de - - net_device_ctx->vf_alloc = nvmsg->msg.v4_msg.vf_assoc.allocated; - net_device_ctx->vf_serial = nvmsg->msg.v4_msg.vf_assoc.serial; -+ netdev_info(ndev, "VF slot %u %s\n", -+ net_device_ctx->vf_serial, -+ net_device_ctx->vf_alloc ? "added" : "removed"); - } - - static void netvsc_receive_inband(struct net_device *ndev, ---- a/drivers/net/hyperv/netvsc_drv.c -+++ b/drivers/net/hyperv/netvsc_drv.c -@@ -1794,20 +1794,6 @@ out_unlock: - rtnl_unlock(); - } - --static struct net_device *get_netvsc_bymac(const u8 *mac) --{ -- struct net_device_context *ndev_ctx; -- -- list_for_each_entry(ndev_ctx, &netvsc_dev_list, list) { -- struct net_device *dev = hv_get_drvdata(ndev_ctx->device_ctx); -- -- if (ether_addr_equal(mac, dev->perm_addr)) -- return dev; -- } -- -- return NULL; --} -- - static struct net_device *get_netvsc_byref(struct net_device *vf_netdev) - { - struct net_device_context *net_device_ctx; -@@ -1936,26 +1922,48 @@ static void netvsc_vf_setup(struct work_ - rtnl_unlock(); - } - -+/* Find netvsc by VMBus serial number. -+ * The PCI hyperv controller records the serial number as the slot. -+ */ -+static struct net_device *get_netvsc_byslot(const struct net_device *vf_netdev) -+{ -+ struct device *parent = vf_netdev->dev.parent; -+ struct net_device_context *ndev_ctx; -+ struct pci_dev *pdev; -+ -+ if (!parent || !dev_is_pci(parent)) -+ return NULL; /* not a PCI device */ -+ -+ pdev = to_pci_dev(parent); -+ if (!pdev->slot) { -+ netdev_notice(vf_netdev, "no PCI slot information\n"); -+ return NULL; -+ } -+ -+ list_for_each_entry(ndev_ctx, &netvsc_dev_list, list) { -+ if (!ndev_ctx->vf_alloc) -+ continue; -+ -+ if (ndev_ctx->vf_serial == pdev->slot->number) -+ return hv_get_drvdata(ndev_ctx->device_ctx); -+ } -+ -+ netdev_notice(vf_netdev, -+ "no netdev found for slot %u\n", pdev->slot->number); -+ return NULL; -+} -+ - static int netvsc_register_vf(struct net_device *vf_netdev) - { -- struct net_device *ndev; - struct net_device_context *net_device_ctx; -- struct device *pdev = vf_netdev->dev.parent; - struct netvsc_device *netvsc_dev; -+ struct net_device *ndev; - int ret; - - if (vf_netdev->addr_len != ETH_ALEN) - return NOTIFY_DONE; - -- if (!pdev || !dev_is_pci(pdev) || dev_is_pf(pdev)) -- return NOTIFY_DONE; -- -- /* -- * We will use the MAC address to locate the synthetic interface to -- * associate with the VF interface. If we don't find a matching -- * synthetic interface, move on. -- */ -- ndev = get_netvsc_bymac(vf_netdev->perm_addr); -+ ndev = get_netvsc_byslot(vf_netdev); - if (!ndev) - return NOTIFY_DONE; - diff --git a/queue-4.18/series b/queue-4.18/series index e5a422c1d0f..0fdb900d472 100644 --- a/queue-4.18/series +++ b/queue-4.18/series @@ -97,7 +97,6 @@ net-ethernet-ti-add-missing-generic_allocator-dependency.patch net-macb-disable-scatter-gather-for-macb-on-sama5d3.patch arm-dts-at91-add-new-compatibility-string-for-macb-on-sama5d3.patch pci-hv-support-reporting-serial-number-as-slot-information.patch -hv_netvsc-pair-vf-based-on-serial-number.patch clk-x86-add-ether_clk-alias-for-bay-trail-cherry-trail.patch clk-x86-stop-marking-clocks-as-clk_is_critical.patch pinctrl-cannonlake-fix-gpio-base-for-gpp-e.patch