hv_netvsc: don't lose VF information

struct netvsc_device is not suitable for storing VF information as this
structure is being destroyed on MTU change / set channel operation (see
rndis_filter_device_remove()). Move all VF related stuff to struct
net_device_context which is persistent.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Acked-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Vitaly Kuznetsov
2016-08-15 17:48:39 +02:00
committed by David S. Miller
parent 3d7b332092
commit f9a7da9130
3 changed files with 45 additions and 42 deletions

View File

@@ -647,7 +647,7 @@ struct netvsc_reconfig {
struct garp_wrk {
struct work_struct dwrk;
struct net_device *netdev;
struct netvsc_device *netvsc_dev;
struct net_device_context *net_device_ctx;
};
/* The context of the netvsc device */
@@ -678,6 +678,15 @@ struct net_device_context {
/* the device is going away */
bool start_remove;
/* State to manage the associated VF interface. */
struct net_device *vf_netdev;
bool vf_inject;
atomic_t vf_use_cnt;
/* 1: allocated, serial number is valid. 0: not allocated */
u32 vf_alloc;
/* Serial number of the VF to team with */
u32 vf_serial;
};
/* Per netvsc device */
@@ -733,15 +742,7 @@ struct netvsc_device {
u32 max_pkt; /* max number of pkt in one send, e.g. 8 */
u32 pkt_align; /* alignment bytes, e.g. 8 */
/* 1: allocated, serial number is valid. 0: not allocated */
u32 vf_alloc;
/* Serial number of the VF to team with */
u32 vf_serial;
atomic_t open_cnt;
/* State to manage the associated VF interface. */
bool vf_inject;
struct net_device *vf_netdev;
atomic_t vf_use_cnt;
};
static inline struct netvsc_device *