^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /* Copyright (c) 2018, Intel Corporation. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) #ifndef _NET_FAILOVER_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #define _NET_FAILOVER_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #include <net/failover.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) /* failover state */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) struct net_failover_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) /* primary netdev with same MAC */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) struct net_device __rcu *primary_dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) /* standby netdev */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) struct net_device __rcu *standby_dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) /* primary netdev stats */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) struct rtnl_link_stats64 primary_stats;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) /* standby netdev stats */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) struct rtnl_link_stats64 standby_stats;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) /* aggregated stats */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) struct rtnl_link_stats64 failover_stats;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) /* spinlock while updating stats */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) spinlock_t stats_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) struct failover *net_failover_create(struct net_device *standby_dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) void net_failover_destroy(struct failover *failover);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #define FAILOVER_VLAN_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) NETIF_F_HIGHDMA | NETIF_F_LRO)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #define FAILOVER_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) NETIF_F_RXCSUM | NETIF_F_ALL_TSO)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) #endif /* _NET_FAILOVER_H */