net_failover.h 1023 B

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