Loading...
Note: File does not exist in v5.4.
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Copyright (C) 2018-2021, Intel Corporation. */
3
4#ifndef _ICE_LAG_H_
5#define _ICE_LAG_H_
6
7#include <linux/netdevice.h>
8
9/* LAG roles for netdev */
10enum ice_lag_role {
11 ICE_LAG_NONE,
12 ICE_LAG_PRIMARY,
13 ICE_LAG_BACKUP,
14 ICE_LAG_UNSET
15};
16
17#define ICE_LAG_INVALID_PORT 0xFF
18
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
23
24struct ice_pf;
25struct ice_vf;
26
27struct ice_lag_netdev_list {
28 struct list_head node;
29 struct net_device *netdev;
30};
31
32/* LAG info struct */
33struct ice_lag {
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;
39 s32 bond_mode;
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 */
44 u16 pf_recipe;
45 u16 lport_recipe;
46 u16 pf_rx_rule_id;
47 u16 pf_tx_rule_id;
48 u16 cp_rule_idx;
49 u16 lport_rule_idx;
50 u8 role;
51};
52
53/* LAG workqueue struct */
54struct ice_lag_work {
55 struct work_struct lag_task;
56 struct ice_lag_netdev_list netdev_list;
57 struct ice_lag *lag;
58 unsigned long event;
59 struct net_device *event_netdev;
60 union {
61 struct netdev_notifier_changeupper_info changeupper_info;
62 struct netdev_notifier_bonding_info bonding_info;
63 struct netdev_notifier_info notifier_info;
64 } info;
65};
66
67void ice_lag_move_new_vf_nodes(struct ice_vf *vf);
68int ice_init_lag(struct ice_pf *pf);
69void ice_deinit_lag(struct ice_pf *pf);
70void ice_lag_rebuild(struct ice_pf *pf);
71bool ice_lag_is_switchdev_running(struct ice_pf *pf);
72void ice_lag_move_vf_nodes_cfg(struct ice_lag *lag, u8 src_prt, u8 dst_prt);
73#endif /* _ICE_LAG_H_ */