Skip to content

Commit

Permalink
netvsc: transparent VF management
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
shemminger authored and davem330 committed Aug 2, 2017
1 parent 638ce0f commit 0c19556
Show file tree
Hide file tree
Showing 2 changed files with 342 additions and 89 deletions.
12 changes: 12 additions & 0 deletions drivers/net/hyperv/hyperv_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,15 @@ struct netvsc_ethtool_stats {
unsigned long tx_busy;
};

struct netvsc_vf_pcpu_stats {
u64 rx_packets;
u64 rx_bytes;
u64 tx_packets;
u64 tx_bytes;
struct u64_stats_sync syncp;
u32 tx_dropped;
};

struct netvsc_reconfig {
struct list_head list;
u32 event;
Expand Down Expand Up @@ -713,6 +722,9 @@ struct net_device_context {

/* State to manage the associated VF interface. */
struct net_device __rcu *vf_netdev;
struct netvsc_vf_pcpu_stats __percpu *vf_stats;
struct work_struct vf_takeover;
struct work_struct vf_notify;

/* 1: allocated, serial number is valid. 0: not allocated */
u32 vf_alloc;
Expand Down
Loading

0 comments on commit 0c19556

Please sign in to comment.