|
@@ -29,6 +29,7 @@
|
|
#include <linux/netdevice.h>
|
|
#include <linux/netdevice.h>
|
|
#include <linux/inetdevice.h>
|
|
#include <linux/inetdevice.h>
|
|
#include <linux/etherdevice.h>
|
|
#include <linux/etherdevice.h>
|
|
|
|
+#include <linux/pci.h>
|
|
#include <linux/skbuff.h>
|
|
#include <linux/skbuff.h>
|
|
#include <linux/if_vlan.h>
|
|
#include <linux/if_vlan.h>
|
|
#include <linux/in.h>
|
|
#include <linux/in.h>
|
|
@@ -2039,12 +2040,16 @@ static int netvsc_register_vf(struct net_device *vf_netdev)
|
|
{
|
|
{
|
|
struct net_device *ndev;
|
|
struct net_device *ndev;
|
|
struct net_device_context *net_device_ctx;
|
|
struct net_device_context *net_device_ctx;
|
|
|
|
+ struct device *pdev = vf_netdev->dev.parent;
|
|
struct netvsc_device *netvsc_dev;
|
|
struct netvsc_device *netvsc_dev;
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
if (vf_netdev->addr_len != ETH_ALEN)
|
|
if (vf_netdev->addr_len != ETH_ALEN)
|
|
return NOTIFY_DONE;
|
|
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
|
|
* We will use the MAC address to locate the synthetic interface to
|
|
* associate with the VF interface. If we don't find a matching
|
|
* associate with the VF interface. If we don't find a matching
|