diff options
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_switch.h')
-rw-r--r-- | drivers/net/ethernet/intel/ice/ice_switch.h | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_switch.h b/drivers/net/ethernet/intel/ice/ice_switch.h index e12940e70000..c188bbc3de2a 100644 --- a/drivers/net/ethernet/intel/ice/ice_switch.h +++ b/drivers/net/ethernet/intel/ice/ice_switch.h | |||
@@ -42,6 +42,14 @@ enum ice_sw_lkup_type { | |||
42 | ICE_SW_LKUP_LAST | 42 | ICE_SW_LKUP_LAST |
43 | }; | 43 | }; |
44 | 44 | ||
45 | /* type of filter src id */ | ||
46 | enum ice_src_id { | ||
47 | ICE_SRC_ID_UNKNOWN = 0, | ||
48 | ICE_SRC_ID_VSI, | ||
49 | ICE_SRC_ID_QUEUE, | ||
50 | ICE_SRC_ID_LPORT, | ||
51 | }; | ||
52 | |||
45 | struct ice_fltr_info { | 53 | struct ice_fltr_info { |
46 | /* Look up information: how to look up packet */ | 54 | /* Look up information: how to look up packet */ |
47 | enum ice_sw_lkup_type lkup_type; | 55 | enum ice_sw_lkup_type lkup_type; |
@@ -56,6 +64,7 @@ struct ice_fltr_info { | |||
56 | 64 | ||
57 | /* Source VSI for LOOKUP_TX or source port for LOOKUP_RX */ | 65 | /* Source VSI for LOOKUP_TX or source port for LOOKUP_RX */ |
58 | u16 src; | 66 | u16 src; |
67 | enum ice_src_id src_id; | ||
59 | 68 | ||
60 | union { | 69 | union { |
61 | struct { | 70 | struct { |
@@ -77,7 +86,10 @@ struct ice_fltr_info { | |||
77 | u16 ethertype; | 86 | u16 ethertype; |
78 | u8 mac_addr[ETH_ALEN]; /* optional */ | 87 | u8 mac_addr[ETH_ALEN]; /* optional */ |
79 | } ethertype_mac; | 88 | } ethertype_mac; |
80 | } l_data; | 89 | } l_data; /* Make sure to zero out the memory of l_data before using |
90 | * it or only set the data associated with lookup match | ||
91 | * rest everything should be zero | ||
92 | */ | ||
81 | 93 | ||
82 | /* Depending on filter action */ | 94 | /* Depending on filter action */ |
83 | union { | 95 | union { |
@@ -85,12 +97,16 @@ struct ice_fltr_info { | |||
85 | * queue id in case of ICE_FWD_TO_QGRP. | 97 | * queue id in case of ICE_FWD_TO_QGRP. |
86 | */ | 98 | */ |
87 | u16 q_id:11; | 99 | u16 q_id:11; |
88 | u16 vsi_id:10; | 100 | u16 hw_vsi_id:10; |
89 | u16 vsi_list_id:10; | 101 | u16 vsi_list_id:10; |
90 | } fwd_id; | 102 | } fwd_id; |
91 | 103 | ||
104 | /* Sw VSI handle */ | ||
105 | u16 vsi_handle; | ||
106 | |||
92 | /* Set to num_queues if action is ICE_FWD_TO_QGRP. This field | 107 | /* Set to num_queues if action is ICE_FWD_TO_QGRP. This field |
93 | * determines the range of queues the packet needs to be forwarded to | 108 | * determines the range of queues the packet needs to be forwarded to. |
109 | * Note that qgrp_size must be set to a power of 2. | ||
94 | */ | 110 | */ |
95 | u8 qgrp_size; | 111 | u8 qgrp_size; |
96 | 112 | ||
@@ -129,6 +145,8 @@ struct ice_vsi_list_map_info { | |||
129 | struct list_head list_entry; | 145 | struct list_head list_entry; |
130 | DECLARE_BITMAP(vsi_map, ICE_MAX_VSI); | 146 | DECLARE_BITMAP(vsi_map, ICE_MAX_VSI); |
131 | u16 vsi_list_id; | 147 | u16 vsi_list_id; |
148 | /* counter to track how many rules are reusing this VSI list */ | ||
149 | u16 ref_cnt; | ||
132 | }; | 150 | }; |
133 | 151 | ||
134 | struct ice_fltr_list_entry { | 152 | struct ice_fltr_list_entry { |
@@ -159,25 +177,25 @@ struct ice_fltr_mgmt_list_entry { | |||
159 | 177 | ||
160 | /* VSI related commands */ | 178 | /* VSI related commands */ |
161 | enum ice_status | 179 | enum ice_status |
162 | ice_aq_update_vsi(struct ice_hw *hw, struct ice_vsi_ctx *vsi_ctx, | ||
163 | struct ice_sq_cd *cd); | ||
164 | enum ice_status | ||
165 | ice_add_vsi(struct ice_hw *hw, u16 vsi_handle, struct ice_vsi_ctx *vsi_ctx, | 180 | ice_add_vsi(struct ice_hw *hw, u16 vsi_handle, struct ice_vsi_ctx *vsi_ctx, |
166 | struct ice_sq_cd *cd); | 181 | struct ice_sq_cd *cd); |
167 | enum ice_status | 182 | enum ice_status |
168 | ice_free_vsi(struct ice_hw *hw, u16 vsi_handle, struct ice_vsi_ctx *vsi_ctx, | 183 | ice_free_vsi(struct ice_hw *hw, u16 vsi_handle, struct ice_vsi_ctx *vsi_ctx, |
169 | bool keep_vsi_alloc, struct ice_sq_cd *cd); | 184 | bool keep_vsi_alloc, struct ice_sq_cd *cd); |
185 | enum ice_status | ||
186 | ice_update_vsi(struct ice_hw *hw, u16 vsi_handle, struct ice_vsi_ctx *vsi_ctx, | ||
187 | struct ice_sq_cd *cd); | ||
170 | enum ice_status ice_get_initial_sw_cfg(struct ice_hw *hw); | 188 | enum ice_status ice_get_initial_sw_cfg(struct ice_hw *hw); |
171 | 189 | ||
172 | /* Switch/bridge related commands */ | 190 | /* Switch/bridge related commands */ |
173 | enum ice_status ice_update_sw_rule_bridge_mode(struct ice_hw *hw); | 191 | enum ice_status ice_update_sw_rule_bridge_mode(struct ice_hw *hw); |
174 | enum ice_status ice_add_mac(struct ice_hw *hw, struct list_head *m_lst); | 192 | enum ice_status ice_add_mac(struct ice_hw *hw, struct list_head *m_lst); |
175 | enum ice_status ice_remove_mac(struct ice_hw *hw, struct list_head *m_lst); | 193 | enum ice_status ice_remove_mac(struct ice_hw *hw, struct list_head *m_lst); |
176 | void ice_remove_vsi_fltr(struct ice_hw *hw, u16 vsi_id); | 194 | void ice_remove_vsi_fltr(struct ice_hw *hw, u16 vsi_handle); |
177 | enum ice_status ice_add_vlan(struct ice_hw *hw, struct list_head *m_list); | 195 | enum ice_status ice_add_vlan(struct ice_hw *hw, struct list_head *m_list); |
178 | enum ice_status ice_remove_vlan(struct ice_hw *hw, struct list_head *v_list); | 196 | enum ice_status ice_remove_vlan(struct ice_hw *hw, struct list_head *v_list); |
179 | enum ice_status | 197 | enum ice_status |
180 | ice_cfg_dflt_vsi(struct ice_hw *hw, u16 vsi_id, bool set, u8 direction); | 198 | ice_cfg_dflt_vsi(struct ice_hw *hw, u16 vsi_handle, bool set, u8 direction); |
181 | 199 | ||
182 | enum ice_status ice_replay_all_fltr(struct ice_hw *hw); | 200 | enum ice_status ice_replay_all_fltr(struct ice_hw *hw); |
183 | 201 | ||