Skip to content

Commit dadb011

Browse files
shemmingergregkh
authored andcommitted
hv_netvsc: ignore devices that are not PCI
[ Upstream commit b93c1b5 ] Registering another device with same MAC address (such as TAP, VPN or DPDK KNI) will confuse the VF autobinding logic. Restrict the search to only run if the device is known to be a PCI attached VF. Fixes: e8ff40d ("hv_netvsc: improve VF device matching") Signed-off-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent bf82c2c commit dadb011

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/hyperv/netvsc_drv.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <linux/netdevice.h>
3030
#include <linux/inetdevice.h>
3131
#include <linux/etherdevice.h>
32+
#include <linux/pci.h>
3233
#include <linux/skbuff.h>
3334
#include <linux/if_vlan.h>
3435
#include <linux/in.h>
@@ -1895,11 +1896,15 @@ static int netvsc_register_vf(struct net_device *vf_netdev)
18951896
{
18961897
struct net_device *ndev;
18971898
struct net_device_context *net_device_ctx;
1899+
struct device *pdev = vf_netdev->dev.parent;
18981900
struct netvsc_device *netvsc_dev;
18991901

19001902
if (vf_netdev->addr_len != ETH_ALEN)
19011903
return NOTIFY_DONE;
19021904

1905+
if (!pdev || !dev_is_pci(pdev) || dev_is_pf(pdev))
1906+
return NOTIFY_DONE;
1907+
19031908
/*
19041909
* We will use the MAC address to locate the synthetic interface to
19051910
* associate with the VF interface. If we don't find a matching

0 commit comments

Comments
 (0)