diff options
author | Sridhar Samudrala <sridhar.samudrala@intel.com> | 2018-05-24 12:55:13 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-28 22:59:54 -0400 |
commit | 30c8bd5aa8b2c78546c3e52337101b9c85879320 (patch) | |
tree | 25da9be5c372249e23b95eeda081fdad34417dc4 /include/linux/netdevice.h | |
parent | cb1603948a0b80f27d2525bb7ac0d4bbb3849926 (diff) |
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 <sridhar.samudrala@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 8452f72087ef..f45b1a4e37ab 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1425,6 +1425,8 @@ struct net_device_ops { | |||
1425 | * entity (i.e. the master device for bridged veth) | 1425 | * entity (i.e. the master device for bridged veth) |
1426 | * @IFF_MACSEC: device is a MACsec device | 1426 | * @IFF_MACSEC: device is a MACsec device |
1427 | * @IFF_NO_RX_HANDLER: device doesn't support the rx_handler hook | 1427 | * @IFF_NO_RX_HANDLER: device doesn't support the rx_handler hook |
1428 | * @IFF_FAILOVER: device is a failover master device | ||
1429 | * @IFF_FAILOVER_SLAVE: device is lower dev of a failover master device | ||
1428 | */ | 1430 | */ |
1429 | enum netdev_priv_flags { | 1431 | enum netdev_priv_flags { |
1430 | IFF_802_1Q_VLAN = 1<<0, | 1432 | IFF_802_1Q_VLAN = 1<<0, |
@@ -1454,6 +1456,8 @@ enum netdev_priv_flags { | |||
1454 | IFF_PHONY_HEADROOM = 1<<24, | 1456 | IFF_PHONY_HEADROOM = 1<<24, |
1455 | IFF_MACSEC = 1<<25, | 1457 | IFF_MACSEC = 1<<25, |
1456 | IFF_NO_RX_HANDLER = 1<<26, | 1458 | IFF_NO_RX_HANDLER = 1<<26, |
1459 | IFF_FAILOVER = 1<<27, | ||
1460 | IFF_FAILOVER_SLAVE = 1<<28, | ||
1457 | }; | 1461 | }; |
1458 | 1462 | ||
1459 | #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN | 1463 | #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN |
@@ -1482,6 +1486,8 @@ enum netdev_priv_flags { | |||
1482 | #define IFF_RXFH_CONFIGURED IFF_RXFH_CONFIGURED | 1486 | #define IFF_RXFH_CONFIGURED IFF_RXFH_CONFIGURED |
1483 | #define IFF_MACSEC IFF_MACSEC | 1487 | #define IFF_MACSEC IFF_MACSEC |
1484 | #define IFF_NO_RX_HANDLER IFF_NO_RX_HANDLER | 1488 | #define IFF_NO_RX_HANDLER IFF_NO_RX_HANDLER |
1489 | #define IFF_FAILOVER IFF_FAILOVER | ||
1490 | #define IFF_FAILOVER_SLAVE IFF_FAILOVER_SLAVE | ||
1485 | 1491 | ||
1486 | /** | 1492 | /** |
1487 | * struct net_device - The DEVICE structure. | 1493 | * struct net_device - The DEVICE structure. |
@@ -4336,6 +4342,16 @@ static inline bool netif_is_rxfh_configured(const struct net_device *dev) | |||
4336 | return dev->priv_flags & IFF_RXFH_CONFIGURED; | 4342 | return dev->priv_flags & IFF_RXFH_CONFIGURED; |
4337 | } | 4343 | } |
4338 | 4344 | ||
4345 | static inline bool netif_is_failover(const struct net_device *dev) | ||
4346 | { | ||
4347 | return dev->priv_flags & IFF_FAILOVER; | ||
4348 | } | ||
4349 | |||
4350 | static inline bool netif_is_failover_slave(const struct net_device *dev) | ||
4351 | { | ||
4352 | return dev->priv_flags & IFF_FAILOVER_SLAVE; | ||
4353 | } | ||
4354 | |||
4339 | /* This device needs to keep skb dst for qdisc enqueue or ndo_start_xmit() */ | 4355 | /* This device needs to keep skb dst for qdisc enqueue or ndo_start_xmit() */ |
4340 | static inline void netif_keep_dst(struct net_device *dev) | 4356 | static inline void netif_keep_dst(struct net_device *dev) |
4341 | { | 4357 | { |