hv_netvsc: improve VF device matching
authorStephen Hemminger <sthemmin@microsoft.com>
Thu, 22 Sep 2016 23:56:32 +0000 (16:56 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Sep 2016 12:39:49 +0000 (08:39 -0400)
commite8ff40d4bff1f3b6a588e29ed1fbdfd943642856
tree6add1d59d1087110a15f98e637cb820b2fe9ed5e
parentee837a137304290a1ae26980c73a367f7afef54f
hv_netvsc: improve VF device matching

The code to associate netvsc and VF devices can be made less error prone
by using a better matching algorithms.

On registration, use the permanent address which avoids any possible
issues caused by device MAC address being changed. For all other callbacks,
search by the netdevice pointer value to ensure getting the correct
network device.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/netvsc_drv.c