Skip to content

Commit cfc80d9

Browse files
ssamudraladavem330
authored andcommitted
net: Introduce net_failover driver
The net_failover driver provides an automated failover mechanism via APIs to create and destroy a failover master netdev and manages a primary and standby slave netdevs that get registered via the generic failover infrastructure. The failover netdev acts a master device and controls 2 slave devices. The original paravirtual interface gets registered as 'standby' slave netdev and a passthru/vf device with the same MAC gets registered as 'primary' slave netdev. Both 'standby' and 'failover' netdevs are associated with the same 'pci' device. The user accesses the network interface via 'failover' netdev. The 'failover' netdev chooses 'primary' netdev as default for transmits when it is available with link up and running. This can be used by paravirtual drivers to enable an alternate low latency datapath. It also enables hypervisor controlled live migration of a VM with direct attached VF by failing over to the paravirtual datapath when the VF is unplugged. Signed-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1ff7807 commit cfc80d9

File tree

6 files changed

+923
-0
lines changed

6 files changed

+923
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
============
4+
NET_FAILOVER
5+
============
6+
7+
Overview
8+
========
9+
10+
The net_failover driver provides an automated failover mechanism via APIs
11+
to create and destroy a failover master netdev and mananges a primary and
12+
standby slave netdevs that get registered via the generic failover
13+
infrastructrure.
14+
15+
The failover netdev acts a master device and controls 2 slave devices. The
16+
original paravirtual interface is registered as 'standby' slave netdev and
17+
a passthru/vf device with the same MAC gets registered as 'primary' slave
18+
netdev. Both 'standby' and 'failover' netdevs are associated with the same
19+
'pci' device. The user accesses the network interface via 'failover' netdev.
20+
The 'failover' netdev chooses 'primary' netdev as default for transmits when
21+
it is available with link up and running.
22+
23+
This can be used by paravirtual drivers to enable an alternate low latency
24+
datapath. It also enables hypervisor controlled live migration of a VM with
25+
direct attached VF by failing over to the paravirtual datapath when the VF
26+
is unplugged.

MAINTAINERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9654,6 +9654,14 @@ S: Maintained
96549654
F: Documentation/hwmon/nct6775
96559655
F: drivers/hwmon/nct6775.c
96569656

9657+
NET_FAILOVER MODULE
9658+
M: Sridhar Samudrala <sridhar.samudrala@intel.com>
9659+
L: netdev@vger.kernel.org
9660+
S: Supported
9661+
F: driver/net/net_failover.c
9662+
F: include/net/net_failover.h
9663+
F: Documentation/networking/net_failover.rst
9664+
96579665
NETEFFECT IWARP RNIC DRIVER (IW_NES)
96589666
M: Faisal Latif <faisal.latif@intel.com>
96599667
L: linux-rdma@vger.kernel.org

drivers/net/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,4 +510,16 @@ config NETDEVSIM
510510
To compile this driver as a module, choose M here: the module
511511
will be called netdevsim.
512512

513+
config NET_FAILOVER
514+
tristate "Failover driver"
515+
select FAILOVER
516+
help
517+
This provides an automated failover mechanism via APIs to create
518+
and destroy a failover master netdev and manages a primary and
519+
standby slave netdevs that get registered via the generic failover
520+
infrastructure. This can be used by paravirtual drivers to enable
521+
an alternate low latency datapath. It alsoenables live migration of
522+
a VM with direct attached VF by failing over to the paravirtual
523+
datapath when the VF is unplugged.
524+
513525
endif # NETDEVICES

drivers/net/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,4 @@ obj-$(CONFIG_FUJITSU_ES) += fjes/
7878
thunderbolt-net-y += thunderbolt.o
7979
obj-$(CONFIG_THUNDERBOLT_NET) += thunderbolt-net.o
8080
obj-$(CONFIG_NETDEVSIM) += netdevsim/
81+
obj-$(CONFIG_NET_FAILOVER) += net_failover.o

0 commit comments

Comments
 (0)