Skip to content

Commit 0c19556

Browse files
shemmingerdavem330
authored andcommitted
netvsc: transparent VF management
This patch implements transparent fail over from synthetic NIC to SR-IOV virtual function NIC in Hyper-V environment. It is a better alternative to using bonding as is done now. Instead, the receive and transmit fail over is done internally inside the driver. Using bonding driver has lots of issues because it depends on the script being run early enough in the boot process and with sufficient information to make the association. This patch moves all that functionality into the kernel. Signed-off-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 638ce0f commit 0c19556

File tree

2 files changed

+342
-89
lines changed

2 files changed

+342
-89
lines changed

drivers/net/hyperv/hyperv_net.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,15 @@ struct netvsc_ethtool_stats {
680680
unsigned long tx_busy;
681681
};
682682

683+
struct netvsc_vf_pcpu_stats {
684+
u64 rx_packets;
685+
u64 rx_bytes;
686+
u64 tx_packets;
687+
u64 tx_bytes;
688+
struct u64_stats_sync syncp;
689+
u32 tx_dropped;
690+
};
691+
683692
struct netvsc_reconfig {
684693
struct list_head list;
685694
u32 event;
@@ -713,6 +722,9 @@ struct net_device_context {
713722

714723
/* State to manage the associated VF interface. */
715724
struct net_device __rcu *vf_netdev;
725+
struct netvsc_vf_pcpu_stats __percpu *vf_stats;
726+
struct work_struct vf_takeover;
727+
struct work_struct vf_notify;
716728

717729
/* 1: allocated, serial number is valid. 0: not allocated */
718730
u32 vf_alloc;

0 commit comments

Comments
 (0)