1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (C) 2018-2021, Intel Corporation. */
7 #include <linux/netdevice.h>
9 /* LAG roles for netdev */
17 #define ICE_LAG_INVALID_PORT 0xFF
19 #define ICE_LAG_RESET_RETRIES 5
20 #define ICE_SW_DEFAULT_PROFILE 0
21 #define ICE_FV_PROT_MDID 255
22 #define ICE_LP_EXT_BUF_OFFSET 32
27 struct ice_lag_netdev_list {
28 struct list_head node;
29 struct net_device *netdev;
34 struct ice_pf *pf; /* backlink to PF struct */
35 struct net_device *netdev; /* this PF's netdev */
36 struct net_device *upper_netdev; /* upper bonding netdev */
37 struct list_head *netdev_head;
38 struct notifier_block notif_block;
40 u16 bond_swid; /* swid for primary interface */
41 u8 active_port; /* lport value for the current active port */
42 u8 bonded:1; /* currently bonded */
43 u8 primary:1; /* this is primary */
53 /* LAG workqueue struct */
55 struct work_struct lag_task;
56 struct ice_lag_netdev_list netdev_list;
59 struct net_device *event_netdev;
61 struct netdev_notifier_changeupper_info changeupper_info;
62 struct netdev_notifier_bonding_info bonding_info;
63 struct netdev_notifier_info notifier_info;
67 void ice_lag_move_new_vf_nodes(struct ice_vf *vf);
68 int ice_init_lag(struct ice_pf *pf);
69 void ice_deinit_lag(struct ice_pf *pf);
70 void ice_lag_rebuild(struct ice_pf *pf);
71 bool ice_lag_is_switchdev_running(struct ice_pf *pf);
72 void ice_lag_move_vf_nodes_cfg(struct ice_lag *lag, u8 src_prt, u8 dst_prt);
73 #endif /* _ICE_LAG_H_ */