forked from Freescale/linux-fslc
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net: Introduce generic failover module
The failover module provides a generic interface for paravirtual drivers to register a netdev and a set of ops with a failover instance. The ops are used as event handlers that get called to handle netdev register/ unregister/link change/name change events on slave pci ethernet devices with the same mac address as the failover netdev. This enables paravirtual drivers to use a VF as an accelerated low latency datapath. It also allows migration of VMs with direct attached VFs by failing over to the paravirtual datapath when the VF is unplugged. Signed-off-by: Sridhar Samudrala <[email protected]> Signed-off-by: David S. Miller <[email protected]>
- Loading branch information
1 parent
cb16039
commit 30c8bd5
Showing
7 changed files
with
407 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.. SPDX-License-Identifier: GPL-2.0 | ||
======== | ||
FAILOVER | ||
======== | ||
|
||
Overview | ||
======== | ||
|
||
The failover module provides a generic interface for paravirtual drivers | ||
to register a netdev and a set of ops with a failover instance. The ops | ||
are used as event handlers that get called to handle netdev register/ | ||
unregister/link change/name change events on slave pci ethernet devices | ||
with the same mac address as the failover netdev. | ||
|
||
This enables paravirtual drivers to use a VF as an accelerated low latency | ||
datapath. It also allows live migration of VMs with direct attached VFs by | ||
failing over to the paravirtual datapath when the VF is unplugged. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5411,6 +5411,14 @@ S: Maintained | |
F: Documentation/hwmon/f71805f | ||
F: drivers/hwmon/f71805f.c | ||
|
||
FAILOVER MODULE | ||
M: Sridhar Samudrala <[email protected]> | ||
L: [email protected] | ||
S: Supported | ||
F: net/core/failover.c | ||
F: include/net/failover.h | ||
F: Documentation/networking/failover.rst | ||
|
||
FANOTIFY | ||
M: Jan Kara <[email protected]> | ||
R: Amir Goldstein <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
/* Copyright (c) 2018, Intel Corporation. */ | ||
|
||
#ifndef _FAILOVER_H | ||
#define _FAILOVER_H | ||
|
||
#include <linux/netdevice.h> | ||
|
||
struct failover_ops { | ||
int (*slave_pre_register)(struct net_device *slave_dev, | ||
struct net_device *failover_dev); | ||
int (*slave_register)(struct net_device *slave_dev, | ||
struct net_device *failover_dev); | ||
int (*slave_pre_unregister)(struct net_device *slave_dev, | ||
struct net_device *failover_dev); | ||
int (*slave_unregister)(struct net_device *slave_dev, | ||
struct net_device *failover_dev); | ||
int (*slave_link_change)(struct net_device *slave_dev, | ||
struct net_device *failover_dev); | ||
int (*slave_name_change)(struct net_device *slave_dev, | ||
struct net_device *failover_dev); | ||
rx_handler_result_t (*slave_handle_frame)(struct sk_buff **pskb); | ||
}; | ||
|
||
struct failover { | ||
struct list_head list; | ||
struct net_device __rcu *failover_dev; | ||
struct failover_ops __rcu *ops; | ||
}; | ||
|
||
struct failover *failover_register(struct net_device *dev, | ||
struct failover_ops *ops); | ||
void failover_unregister(struct failover *failover); | ||
int failover_slave_unregister(struct net_device *slave_dev); | ||
|
||
#endif /* _FAILOVER_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.