aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_switch.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_switch.c')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_switch.c108
1 files changed, 54 insertions, 54 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c
index 7dcd9ddf54f7..ad6bb0fce5d1 100644
--- a/drivers/net/ethernet/intel/ice/ice_switch.c
+++ b/drivers/net/ethernet/intel/ice/ice_switch.c
@@ -19,7 +19,7 @@
19 * byte 6 = 0x2: to identify it as locally administered SA MAC 19 * byte 6 = 0x2: to identify it as locally administered SA MAC
20 * byte 12 = 0x81 & byte 13 = 0x00: 20 * byte 12 = 0x81 & byte 13 = 0x00:
21 * In case of VLAN filter first two bytes defines ether type (0x8100) 21 * In case of VLAN filter first two bytes defines ether type (0x8100)
22 * and remaining two bytes are placeholder for programming a given VLAN id 22 * and remaining two bytes are placeholder for programming a given VLAN ID
23 * In case of Ether type filter it is treated as header without VLAN tag 23 * In case of Ether type filter it is treated as header without VLAN tag
24 * and byte 12 and 13 is used to program a given Ether type instead 24 * and byte 12 and 13 is used to program a given Ether type instead
25 */ 25 */
@@ -51,7 +51,7 @@ static const u8 dummy_eth_header[DUMMY_ETH_HDR_LEN] = { 0x2, 0, 0, 0, 0, 0,
51 51
52/** 52/**
53 * ice_aq_alloc_free_res - command to allocate/free resources 53 * ice_aq_alloc_free_res - command to allocate/free resources
54 * @hw: pointer to the hw struct 54 * @hw: pointer to the HW struct
55 * @num_entries: number of resource entries in buffer 55 * @num_entries: number of resource entries in buffer
56 * @buf: Indirect buffer to hold data parameters and response 56 * @buf: Indirect buffer to hold data parameters and response
57 * @buf_size: size of buffer for indirect commands 57 * @buf_size: size of buffer for indirect commands
@@ -87,7 +87,7 @@ ice_aq_alloc_free_res(struct ice_hw *hw, u16 num_entries,
87 87
88/** 88/**
89 * ice_init_def_sw_recp - initialize the recipe book keeping tables 89 * ice_init_def_sw_recp - initialize the recipe book keeping tables
90 * @hw: pointer to the hw struct 90 * @hw: pointer to the HW struct
91 * 91 *
92 * Allocate memory for the entire recipe table and initialize the structures/ 92 * Allocate memory for the entire recipe table and initialize the structures/
93 * entries corresponding to basic recipes. 93 * entries corresponding to basic recipes.
@@ -163,7 +163,7 @@ ice_aq_get_sw_cfg(struct ice_hw *hw, struct ice_aqc_get_sw_cfg_resp *buf,
163 163
164/** 164/**
165 * ice_aq_add_vsi 165 * ice_aq_add_vsi
166 * @hw: pointer to the hw struct 166 * @hw: pointer to the HW struct
167 * @vsi_ctx: pointer to a VSI context struct 167 * @vsi_ctx: pointer to a VSI context struct
168 * @cd: pointer to command details structure or NULL 168 * @cd: pointer to command details structure or NULL
169 * 169 *
@@ -206,7 +206,7 @@ ice_aq_add_vsi(struct ice_hw *hw, struct ice_vsi_ctx *vsi_ctx,
206 206
207/** 207/**
208 * ice_aq_free_vsi 208 * ice_aq_free_vsi
209 * @hw: pointer to the hw struct 209 * @hw: pointer to the HW struct
210 * @vsi_ctx: pointer to a VSI context struct 210 * @vsi_ctx: pointer to a VSI context struct
211 * @keep_vsi_alloc: keep VSI allocation as part of this PF's resources 211 * @keep_vsi_alloc: keep VSI allocation as part of this PF's resources
212 * @cd: pointer to command details structure or NULL 212 * @cd: pointer to command details structure or NULL
@@ -242,7 +242,7 @@ ice_aq_free_vsi(struct ice_hw *hw, struct ice_vsi_ctx *vsi_ctx,
242 242
243/** 243/**
244 * ice_aq_update_vsi 244 * ice_aq_update_vsi
245 * @hw: pointer to the hw struct 245 * @hw: pointer to the HW struct
246 * @vsi_ctx: pointer to a VSI context struct 246 * @vsi_ctx: pointer to a VSI context struct
247 * @cd: pointer to command details structure or NULL 247 * @cd: pointer to command details structure or NULL
248 * 248 *
@@ -279,7 +279,7 @@ ice_aq_update_vsi(struct ice_hw *hw, struct ice_vsi_ctx *vsi_ctx,
279 279
280/** 280/**
281 * ice_is_vsi_valid - check whether the VSI is valid or not 281 * ice_is_vsi_valid - check whether the VSI is valid or not
282 * @hw: pointer to the hw struct 282 * @hw: pointer to the HW struct
283 * @vsi_handle: VSI handle 283 * @vsi_handle: VSI handle
284 * 284 *
285 * check whether the VSI is valid or not 285 * check whether the VSI is valid or not
@@ -290,11 +290,11 @@ bool ice_is_vsi_valid(struct ice_hw *hw, u16 vsi_handle)
290} 290}
291 291
292/** 292/**
293 * ice_get_hw_vsi_num - return the hw VSI number 293 * ice_get_hw_vsi_num - return the HW VSI number
294 * @hw: pointer to the hw struct 294 * @hw: pointer to the HW struct
295 * @vsi_handle: VSI handle 295 * @vsi_handle: VSI handle
296 * 296 *
297 * return the hw VSI number 297 * return the HW VSI number
298 * Caution: call this function only if VSI is valid (ice_is_vsi_valid) 298 * Caution: call this function only if VSI is valid (ice_is_vsi_valid)
299 */ 299 */
300u16 ice_get_hw_vsi_num(struct ice_hw *hw, u16 vsi_handle) 300u16 ice_get_hw_vsi_num(struct ice_hw *hw, u16 vsi_handle)
@@ -304,7 +304,7 @@ u16 ice_get_hw_vsi_num(struct ice_hw *hw, u16 vsi_handle)
304 304
305/** 305/**
306 * ice_get_vsi_ctx - return the VSI context entry for a given VSI handle 306 * ice_get_vsi_ctx - return the VSI context entry for a given VSI handle
307 * @hw: pointer to the hw struct 307 * @hw: pointer to the HW struct
308 * @vsi_handle: VSI handle 308 * @vsi_handle: VSI handle
309 * 309 *
310 * return the VSI context entry for a given VSI handle 310 * return the VSI context entry for a given VSI handle
@@ -316,7 +316,7 @@ struct ice_vsi_ctx *ice_get_vsi_ctx(struct ice_hw *hw, u16 vsi_handle)
316 316
317/** 317/**
318 * ice_save_vsi_ctx - save the VSI context for a given VSI handle 318 * ice_save_vsi_ctx - save the VSI context for a given VSI handle
319 * @hw: pointer to the hw struct 319 * @hw: pointer to the HW struct
320 * @vsi_handle: VSI handle 320 * @vsi_handle: VSI handle
321 * @vsi: VSI context pointer 321 * @vsi: VSI context pointer
322 * 322 *
@@ -330,7 +330,7 @@ ice_save_vsi_ctx(struct ice_hw *hw, u16 vsi_handle, struct ice_vsi_ctx *vsi)
330 330
331/** 331/**
332 * ice_clear_vsi_ctx - clear the VSI context entry 332 * ice_clear_vsi_ctx - clear the VSI context entry
333 * @hw: pointer to the hw struct 333 * @hw: pointer to the HW struct
334 * @vsi_handle: VSI handle 334 * @vsi_handle: VSI handle
335 * 335 *
336 * clear the VSI context entry 336 * clear the VSI context entry
@@ -348,7 +348,7 @@ static void ice_clear_vsi_ctx(struct ice_hw *hw, u16 vsi_handle)
348 348
349/** 349/**
350 * ice_clear_all_vsi_ctx - clear all the VSI context entries 350 * ice_clear_all_vsi_ctx - clear all the VSI context entries
351 * @hw: pointer to the hw struct 351 * @hw: pointer to the HW struct
352 */ 352 */
353void ice_clear_all_vsi_ctx(struct ice_hw *hw) 353void ice_clear_all_vsi_ctx(struct ice_hw *hw)
354{ 354{
@@ -360,7 +360,7 @@ void ice_clear_all_vsi_ctx(struct ice_hw *hw)
360 360
361/** 361/**
362 * ice_add_vsi - add VSI context to the hardware and VSI handle list 362 * ice_add_vsi - add VSI context to the hardware and VSI handle list
363 * @hw: pointer to the hw struct 363 * @hw: pointer to the HW struct
364 * @vsi_handle: unique VSI handle provided by drivers 364 * @vsi_handle: unique VSI handle provided by drivers
365 * @vsi_ctx: pointer to a VSI context struct 365 * @vsi_ctx: pointer to a VSI context struct
366 * @cd: pointer to command details structure or NULL 366 * @cd: pointer to command details structure or NULL
@@ -383,7 +383,7 @@ ice_add_vsi(struct ice_hw *hw, u16 vsi_handle, struct ice_vsi_ctx *vsi_ctx,
383 return status; 383 return status;
384 tmp_vsi_ctx = ice_get_vsi_ctx(hw, vsi_handle); 384 tmp_vsi_ctx = ice_get_vsi_ctx(hw, vsi_handle);
385 if (!tmp_vsi_ctx) { 385 if (!tmp_vsi_ctx) {
386 /* Create a new vsi context */ 386 /* Create a new VSI context */
387 tmp_vsi_ctx = devm_kzalloc(ice_hw_to_dev(hw), 387 tmp_vsi_ctx = devm_kzalloc(ice_hw_to_dev(hw),
388 sizeof(*tmp_vsi_ctx), GFP_KERNEL); 388 sizeof(*tmp_vsi_ctx), GFP_KERNEL);
389 if (!tmp_vsi_ctx) { 389 if (!tmp_vsi_ctx) {
@@ -403,7 +403,7 @@ ice_add_vsi(struct ice_hw *hw, u16 vsi_handle, struct ice_vsi_ctx *vsi_ctx,
403 403
404/** 404/**
405 * ice_free_vsi- free VSI context from hardware and VSI handle list 405 * ice_free_vsi- free VSI context from hardware and VSI handle list
406 * @hw: pointer to the hw struct 406 * @hw: pointer to the HW struct
407 * @vsi_handle: unique VSI handle 407 * @vsi_handle: unique VSI handle
408 * @vsi_ctx: pointer to a VSI context struct 408 * @vsi_ctx: pointer to a VSI context struct
409 * @keep_vsi_alloc: keep VSI allocation as part of this PF's resources 409 * @keep_vsi_alloc: keep VSI allocation as part of this PF's resources
@@ -428,7 +428,7 @@ ice_free_vsi(struct ice_hw *hw, u16 vsi_handle, struct ice_vsi_ctx *vsi_ctx,
428 428
429/** 429/**
430 * ice_update_vsi 430 * ice_update_vsi
431 * @hw: pointer to the hw struct 431 * @hw: pointer to the HW struct
432 * @vsi_handle: unique VSI handle 432 * @vsi_handle: unique VSI handle
433 * @vsi_ctx: pointer to a VSI context struct 433 * @vsi_ctx: pointer to a VSI context struct
434 * @cd: pointer to command details structure or NULL 434 * @cd: pointer to command details structure or NULL
@@ -447,8 +447,8 @@ ice_update_vsi(struct ice_hw *hw, u16 vsi_handle, struct ice_vsi_ctx *vsi_ctx,
447 447
448/** 448/**
449 * ice_aq_alloc_free_vsi_list 449 * ice_aq_alloc_free_vsi_list
450 * @hw: pointer to the hw struct 450 * @hw: pointer to the HW struct
451 * @vsi_list_id: VSI list id returned or used for lookup 451 * @vsi_list_id: VSI list ID returned or used for lookup
452 * @lkup_type: switch rule filter lookup type 452 * @lkup_type: switch rule filter lookup type
453 * @opc: switch rules population command type - pass in the command opcode 453 * @opc: switch rules population command type - pass in the command opcode
454 * 454 *
@@ -504,7 +504,7 @@ ice_aq_alloc_free_vsi_list_exit:
504 504
505/** 505/**
506 * ice_aq_sw_rules - add/update/remove switch rules 506 * ice_aq_sw_rules - add/update/remove switch rules
507 * @hw: pointer to the hw struct 507 * @hw: pointer to the HW struct
508 * @rule_list: pointer to switch rule population list 508 * @rule_list: pointer to switch rule population list
509 * @rule_list_sz: total size of the rule list in bytes 509 * @rule_list_sz: total size of the rule list in bytes
510 * @num_rules: number of switch rules in the rule_list 510 * @num_rules: number of switch rules in the rule_list
@@ -653,7 +653,7 @@ static void ice_fill_sw_info(struct ice_hw *hw, struct ice_fltr_info *fi)
653 * 1. The switch is a VEB AND 653 * 1. The switch is a VEB AND
654 * 2 654 * 2
655 * 2.1 The lookup is a directional lookup like ethertype, 655 * 2.1 The lookup is a directional lookup like ethertype,
656 * promiscuous, ethertype-mac, promiscuous-vlan 656 * promiscuous, ethertype-MAC, promiscuous-VLAN
657 * and default-port OR 657 * and default-port OR
658 * 2.2 The lookup is VLAN, OR 658 * 2.2 The lookup is VLAN, OR
659 * 2.3 The lookup is MAC with mcast or bcast addr for MAC, OR 659 * 2.3 The lookup is MAC with mcast or bcast addr for MAC, OR
@@ -821,7 +821,7 @@ ice_fill_sw_rule(struct ice_hw *hw, struct ice_fltr_info *f_info,
821 * @hw: pointer to the hardware structure 821 * @hw: pointer to the hardware structure
822 * @m_ent: the management entry for which sw marker needs to be added 822 * @m_ent: the management entry for which sw marker needs to be added
823 * @sw_marker: sw marker to tag the Rx descriptor with 823 * @sw_marker: sw marker to tag the Rx descriptor with
824 * @l_id: large action resource id 824 * @l_id: large action resource ID
825 * 825 *
826 * Create a large action to hold software marker and update the switch rule 826 * Create a large action to hold software marker and update the switch rule
827 * entry pointed by m_ent with newly created large action 827 * entry pointed by m_ent with newly created large action
@@ -833,8 +833,8 @@ ice_add_marker_act(struct ice_hw *hw, struct ice_fltr_mgmt_list_entry *m_ent,
833 struct ice_aqc_sw_rules_elem *lg_act, *rx_tx; 833 struct ice_aqc_sw_rules_elem *lg_act, *rx_tx;
834 /* For software marker we need 3 large actions 834 /* For software marker we need 3 large actions
835 * 1. FWD action: FWD TO VSI or VSI LIST 835 * 1. FWD action: FWD TO VSI or VSI LIST
836 * 2. GENERIC VALUE action to hold the profile id 836 * 2. GENERIC VALUE action to hold the profile ID
837 * 3. GENERIC VALUE action to hold the software marker id 837 * 3. GENERIC VALUE action to hold the software marker ID
838 */ 838 */
839 const u16 num_lg_acts = 3; 839 const u16 num_lg_acts = 3;
840 enum ice_status status; 840 enum ice_status status;
@@ -897,13 +897,13 @@ ice_add_marker_act(struct ice_hw *hw, struct ice_fltr_mgmt_list_entry *m_ent,
897 ice_fill_sw_rule(hw, &m_ent->fltr_info, rx_tx, 897 ice_fill_sw_rule(hw, &m_ent->fltr_info, rx_tx,
898 ice_aqc_opc_update_sw_rules); 898 ice_aqc_opc_update_sw_rules);
899 899
900 /* Update the action to point to the large action id */ 900 /* Update the action to point to the large action ID */
901 rx_tx->pdata.lkup_tx_rx.act = 901 rx_tx->pdata.lkup_tx_rx.act =
902 cpu_to_le32(ICE_SINGLE_ACT_PTR | 902 cpu_to_le32(ICE_SINGLE_ACT_PTR |
903 ((l_id << ICE_SINGLE_ACT_PTR_VAL_S) & 903 ((l_id << ICE_SINGLE_ACT_PTR_VAL_S) &
904 ICE_SINGLE_ACT_PTR_VAL_M)); 904 ICE_SINGLE_ACT_PTR_VAL_M));
905 905
906 /* Use the filter rule id of the previously created rule with single 906 /* Use the filter rule ID of the previously created rule with single
907 * act. Once the update happens, hardware will treat this as large 907 * act. Once the update happens, hardware will treat this as large
908 * action 908 * action
909 */ 909 */
@@ -926,10 +926,10 @@ ice_add_marker_act(struct ice_hw *hw, struct ice_fltr_mgmt_list_entry *m_ent,
926 * @hw: pointer to the hardware structure 926 * @hw: pointer to the hardware structure
927 * @vsi_handle_arr: array of VSI handles to set in the VSI mapping 927 * @vsi_handle_arr: array of VSI handles to set in the VSI mapping
928 * @num_vsi: number of VSI handles in the array 928 * @num_vsi: number of VSI handles in the array
929 * @vsi_list_id: VSI list id generated as part of allocate resource 929 * @vsi_list_id: VSI list ID generated as part of allocate resource
930 * 930 *
931 * Helper function to create a new entry of VSI list id to VSI mapping 931 * Helper function to create a new entry of VSI list ID to VSI mapping
932 * using the given VSI list id 932 * using the given VSI list ID
933 */ 933 */
934static struct ice_vsi_list_map_info * 934static struct ice_vsi_list_map_info *
935ice_create_vsi_list_map(struct ice_hw *hw, u16 *vsi_handle_arr, u16 num_vsi, 935ice_create_vsi_list_map(struct ice_hw *hw, u16 *vsi_handle_arr, u16 num_vsi,
@@ -957,13 +957,13 @@ ice_create_vsi_list_map(struct ice_hw *hw, u16 *vsi_handle_arr, u16 num_vsi,
957 * @hw: pointer to the hardware structure 957 * @hw: pointer to the hardware structure
958 * @vsi_handle_arr: array of VSI handles to form a VSI list 958 * @vsi_handle_arr: array of VSI handles to form a VSI list
959 * @num_vsi: number of VSI handles in the array 959 * @num_vsi: number of VSI handles in the array
960 * @vsi_list_id: VSI list id generated as part of allocate resource 960 * @vsi_list_id: VSI list ID generated as part of allocate resource
961 * @remove: Boolean value to indicate if this is a remove action 961 * @remove: Boolean value to indicate if this is a remove action
962 * @opc: switch rules population command type - pass in the command opcode 962 * @opc: switch rules population command type - pass in the command opcode
963 * @lkup_type: lookup type of the filter 963 * @lkup_type: lookup type of the filter
964 * 964 *
965 * Call AQ command to add a new switch rule or update existing switch rule 965 * Call AQ command to add a new switch rule or update existing switch rule
966 * using the given VSI list id 966 * using the given VSI list ID
967 */ 967 */
968static enum ice_status 968static enum ice_status
969ice_update_vsi_list_rule(struct ice_hw *hw, u16 *vsi_handle_arr, u16 num_vsi, 969ice_update_vsi_list_rule(struct ice_hw *hw, u16 *vsi_handle_arr, u16 num_vsi,
@@ -1020,7 +1020,7 @@ exit:
1020 1020
1021/** 1021/**
1022 * ice_create_vsi_list_rule - Creates and populates a VSI list rule 1022 * ice_create_vsi_list_rule - Creates and populates a VSI list rule
1023 * @hw: pointer to the hw struct 1023 * @hw: pointer to the HW struct
1024 * @vsi_handle_arr: array of VSI handles to form a VSI list 1024 * @vsi_handle_arr: array of VSI handles to form a VSI list
1025 * @num_vsi: number of VSI handles in the array 1025 * @num_vsi: number of VSI handles in the array
1026 * @vsi_list_id: stores the ID of the VSI list to be created 1026 * @vsi_list_id: stores the ID of the VSI list to be created
@@ -1114,7 +1114,7 @@ ice_create_pkt_fwd_rule_exit:
1114 * @f_info: filter information for switch rule 1114 * @f_info: filter information for switch rule
1115 * 1115 *
1116 * Call AQ command to update a previously created switch rule with a 1116 * Call AQ command to update a previously created switch rule with a
1117 * VSI list id 1117 * VSI list ID
1118 */ 1118 */
1119static enum ice_status 1119static enum ice_status
1120ice_update_pkt_fwd_rule(struct ice_hw *hw, struct ice_fltr_info *f_info) 1120ice_update_pkt_fwd_rule(struct ice_hw *hw, struct ice_fltr_info *f_info)
@@ -1141,7 +1141,7 @@ ice_update_pkt_fwd_rule(struct ice_hw *hw, struct ice_fltr_info *f_info)
1141 1141
1142/** 1142/**
1143 * ice_update_sw_rule_bridge_mode 1143 * ice_update_sw_rule_bridge_mode
1144 * @hw: pointer to the hw struct 1144 * @hw: pointer to the HW struct
1145 * 1145 *
1146 * Updates unicast switch filter rules based on VEB/VEPA mode 1146 * Updates unicast switch filter rules based on VEB/VEPA mode
1147 */ 1147 */
@@ -1196,7 +1196,7 @@ enum ice_status ice_update_sw_rule_bridge_mode(struct ice_hw *hw)
1196 * Allocate a new VSI list and add two VSIs 1196 * Allocate a new VSI list and add two VSIs
1197 * to this list using switch rule command 1197 * to this list using switch rule command
1198 * Update the previously created switch rule with the 1198 * Update the previously created switch rule with the
1199 * newly created VSI list id 1199 * newly created VSI list ID
1200 * if a VSI list was previously created 1200 * if a VSI list was previously created
1201 * Add the new VSI to the previously created VSI list set 1201 * Add the new VSI to the previously created VSI list set
1202 * using the update switch rule command 1202 * using the update switch rule command
@@ -1277,7 +1277,7 @@ ice_add_update_vsi_list(struct ice_hw *hw,
1277 return 0; 1277 return 0;
1278 1278
1279 /* Update the previously created VSI list set with 1279 /* Update the previously created VSI list set with
1280 * the new VSI id passed in 1280 * the new VSI ID passed in
1281 */ 1281 */
1282 vsi_list_id = cur_fltr->fwd_id.vsi_list_id; 1282 vsi_list_id = cur_fltr->fwd_id.vsi_list_id;
1283 opcode = ice_aqc_opc_update_sw_rules; 1283 opcode = ice_aqc_opc_update_sw_rules;
@@ -1285,7 +1285,7 @@ ice_add_update_vsi_list(struct ice_hw *hw,
1285 status = ice_update_vsi_list_rule(hw, &vsi_handle, 1, 1285 status = ice_update_vsi_list_rule(hw, &vsi_handle, 1,
1286 vsi_list_id, false, opcode, 1286 vsi_list_id, false, opcode,
1287 new_fltr->lkup_type); 1287 new_fltr->lkup_type);
1288 /* update VSI list mapping info with new VSI id */ 1288 /* update VSI list mapping info with new VSI ID */
1289 if (!status) 1289 if (!status)
1290 set_bit(vsi_handle, m_entry->vsi_list_info->vsi_map); 1290 set_bit(vsi_handle, m_entry->vsi_list_info->vsi_map);
1291 } 1291 }
@@ -1327,7 +1327,7 @@ ice_find_rule_entry(struct ice_hw *hw, u8 recp_id, struct ice_fltr_info *f_info)
1327 * @hw: pointer to the hardware structure 1327 * @hw: pointer to the hardware structure
1328 * @recp_id: lookup type for which VSI lists needs to be searched 1328 * @recp_id: lookup type for which VSI lists needs to be searched
1329 * @vsi_handle: VSI handle to be found in VSI list 1329 * @vsi_handle: VSI handle to be found in VSI list
1330 * @vsi_list_id: VSI list id found containing vsi_handle 1330 * @vsi_list_id: VSI list ID found containing vsi_handle
1331 * 1331 *
1332 * Helper function to search a VSI list with single entry containing given VSI 1332 * Helper function to search a VSI list with single entry containing given VSI
1333 * handle element. This can be extended further to search VSI list with more 1333 * handle element. This can be extended further to search VSI list with more
@@ -1358,7 +1358,7 @@ ice_find_vsi_list_entry(struct ice_hw *hw, u8 recp_id, u16 vsi_handle,
1358/** 1358/**
1359 * ice_add_rule_internal - add rule for a given lookup type 1359 * ice_add_rule_internal - add rule for a given lookup type
1360 * @hw: pointer to the hardware structure 1360 * @hw: pointer to the hardware structure
1361 * @recp_id: lookup type (recipe id) for which rule has to be added 1361 * @recp_id: lookup type (recipe ID) for which rule has to be added
1362 * @f_entry: structure containing MAC forwarding information 1362 * @f_entry: structure containing MAC forwarding information
1363 * 1363 *
1364 * Adds or updates the rule lists for a given recipe 1364 * Adds or updates the rule lists for a given recipe
@@ -1403,7 +1403,7 @@ ice_add_rule_internal(struct ice_hw *hw, u8 recp_id,
1403/** 1403/**
1404 * ice_remove_vsi_list_rule 1404 * ice_remove_vsi_list_rule
1405 * @hw: pointer to the hardware structure 1405 * @hw: pointer to the hardware structure
1406 * @vsi_list_id: VSI list id generated as part of allocate resource 1406 * @vsi_list_id: VSI list ID generated as part of allocate resource
1407 * @lkup_type: switch rule filter lookup type 1407 * @lkup_type: switch rule filter lookup type
1408 * 1408 *
1409 * The VSI list should be emptied before this function is called to remove the 1409 * The VSI list should be emptied before this function is called to remove the
@@ -1528,7 +1528,7 @@ ice_rem_update_vsi_list(struct ice_hw *hw, u16 vsi_handle,
1528/** 1528/**
1529 * ice_remove_rule_internal - Remove a filter rule of a given type 1529 * ice_remove_rule_internal - Remove a filter rule of a given type
1530 * @hw: pointer to the hardware structure 1530 * @hw: pointer to the hardware structure
1531 * @recp_id: recipe id for which the rule needs to removed 1531 * @recp_id: recipe ID for which the rule needs to removed
1532 * @f_entry: rule entry containing filter information 1532 * @f_entry: rule entry containing filter information
1533 */ 1533 */
1534static enum ice_status 1534static enum ice_status
@@ -1578,7 +1578,7 @@ ice_remove_rule_internal(struct ice_hw *hw, u8 recp_id,
1578 status = ice_rem_update_vsi_list(hw, vsi_handle, list_elem); 1578 status = ice_rem_update_vsi_list(hw, vsi_handle, list_elem);
1579 if (status) 1579 if (status)
1580 goto exit; 1580 goto exit;
1581 /* if vsi count goes to zero after updating the vsi list */ 1581 /* if VSI count goes to zero after updating the VSI list */
1582 if (list_elem->vsi_count == 0) 1582 if (list_elem->vsi_count == 0)
1583 remove_rule = true; 1583 remove_rule = true;
1584 } 1584 }
@@ -1656,7 +1656,7 @@ ice_add_mac(struct ice_hw *hw, struct list_head *m_list)
1656 return ICE_ERR_PARAM; 1656 return ICE_ERR_PARAM;
1657 hw_vsi_id = ice_get_hw_vsi_num(hw, vsi_handle); 1657 hw_vsi_id = ice_get_hw_vsi_num(hw, vsi_handle);
1658 m_list_itr->fltr_info.fwd_id.hw_vsi_id = hw_vsi_id; 1658 m_list_itr->fltr_info.fwd_id.hw_vsi_id = hw_vsi_id;
1659 /* update the src in case it is vsi num */ 1659 /* update the src in case it is VSI num */
1660 if (m_list_itr->fltr_info.src_id != ICE_SRC_ID_VSI) 1660 if (m_list_itr->fltr_info.src_id != ICE_SRC_ID_VSI)
1661 return ICE_ERR_PARAM; 1661 return ICE_ERR_PARAM;
1662 m_list_itr->fltr_info.src = hw_vsi_id; 1662 m_list_itr->fltr_info.src = hw_vsi_id;
@@ -1732,7 +1732,7 @@ ice_add_mac(struct ice_hw *hw, struct list_head *m_list)
1732 ((u8 *)r_iter + (elem_sent * s_rule_size)); 1732 ((u8 *)r_iter + (elem_sent * s_rule_size));
1733 } 1733 }
1734 1734
1735 /* Fill up rule id based on the value returned from FW */ 1735 /* Fill up rule ID based on the value returned from FW */
1736 r_iter = s_rule; 1736 r_iter = s_rule;
1737 list_for_each_entry(m_list_itr, m_list, list_entry) { 1737 list_for_each_entry(m_list_itr, m_list, list_entry) {
1738 struct ice_fltr_info *f_info = &m_list_itr->fltr_info; 1738 struct ice_fltr_info *f_info = &m_list_itr->fltr_info;
@@ -1792,7 +1792,7 @@ ice_add_vlan_internal(struct ice_hw *hw, struct ice_fltr_list_entry *f_entry)
1792 ice_get_hw_vsi_num(hw, f_entry->fltr_info.vsi_handle); 1792 ice_get_hw_vsi_num(hw, f_entry->fltr_info.vsi_handle);
1793 new_fltr = &f_entry->fltr_info; 1793 new_fltr = &f_entry->fltr_info;
1794 1794
1795 /* VLAN id should only be 12 bits */ 1795 /* VLAN ID should only be 12 bits */
1796 if (new_fltr->l_data.vlan.vlan_id > ICE_MAX_VLAN_ID) 1796 if (new_fltr->l_data.vlan.vlan_id > ICE_MAX_VLAN_ID)
1797 return ICE_ERR_PARAM; 1797 return ICE_ERR_PARAM;
1798 1798
@@ -1850,7 +1850,7 @@ ice_add_vlan_internal(struct ice_hw *hw, struct ice_fltr_list_entry *f_entry)
1850 } 1850 }
1851 } 1851 }
1852 } else if (v_list_itr->vsi_list_info->ref_cnt == 1) { 1852 } else if (v_list_itr->vsi_list_info->ref_cnt == 1) {
1853 /* Update existing VSI list to add new VSI id only if it used 1853 /* Update existing VSI list to add new VSI ID only if it used
1854 * by one VLAN rule. 1854 * by one VLAN rule.
1855 */ 1855 */
1856 cur_fltr = &v_list_itr->fltr_info; 1856 cur_fltr = &v_list_itr->fltr_info;
@@ -1860,7 +1860,7 @@ ice_add_vlan_internal(struct ice_hw *hw, struct ice_fltr_list_entry *f_entry)
1860 /* If VLAN rule exists and VSI list being used by this rule is 1860 /* If VLAN rule exists and VSI list being used by this rule is
1861 * referenced by more than 1 VLAN rule. Then create a new VSI 1861 * referenced by more than 1 VLAN rule. Then create a new VSI
1862 * list appending previous VSI with new VSI and update existing 1862 * list appending previous VSI with new VSI and update existing
1863 * VLAN rule to point to new VSI list id 1863 * VLAN rule to point to new VSI list ID
1864 */ 1864 */
1865 struct ice_fltr_info tmp_fltr; 1865 struct ice_fltr_info tmp_fltr;
1866 u16 vsi_handle_arr[2]; 1866 u16 vsi_handle_arr[2];
@@ -2192,7 +2192,7 @@ ice_add_to_vsi_fltr_list(struct ice_hw *hw, u16 vsi_handle,
2192 struct ice_fltr_mgmt_list_entry *fm_entry; 2192 struct ice_fltr_mgmt_list_entry *fm_entry;
2193 enum ice_status status = 0; 2193 enum ice_status status = 0;
2194 2194
2195 /* check to make sure VSI id is valid and within boundary */ 2195 /* check to make sure VSI ID is valid and within boundary */
2196 if (!ice_is_vsi_valid(hw, vsi_handle)) 2196 if (!ice_is_vsi_valid(hw, vsi_handle))
2197 return ICE_ERR_PARAM; 2197 return ICE_ERR_PARAM;
2198 2198
@@ -2247,7 +2247,7 @@ static u8 ice_determine_promisc_mask(struct ice_fltr_info *fi)
2247/** 2247/**
2248 * ice_remove_promisc - Remove promisc based filter rules 2248 * ice_remove_promisc - Remove promisc based filter rules
2249 * @hw: pointer to the hardware structure 2249 * @hw: pointer to the hardware structure
2250 * @recp_id: recipe id for which the rule needs to removed 2250 * @recp_id: recipe ID for which the rule needs to removed
2251 * @v_list: list of promisc entries 2251 * @v_list: list of promisc entries
2252 */ 2252 */
2253static enum ice_status 2253static enum ice_status
@@ -2572,7 +2572,7 @@ void ice_remove_vsi_fltr(struct ice_hw *hw, u16 vsi_handle)
2572 * ice_replay_vsi_fltr - Replay filters for requested VSI 2572 * ice_replay_vsi_fltr - Replay filters for requested VSI
2573 * @hw: pointer to the hardware structure 2573 * @hw: pointer to the hardware structure
2574 * @vsi_handle: driver VSI handle 2574 * @vsi_handle: driver VSI handle
2575 * @recp_id: Recipe id for which rules need to be replayed 2575 * @recp_id: Recipe ID for which rules need to be replayed
2576 * @list_head: list for which filters need to be replayed 2576 * @list_head: list for which filters need to be replayed
2577 * 2577 *
2578 * Replays the filter of recipe recp_id for a VSI represented via vsi_handle. 2578 * Replays the filter of recipe recp_id for a VSI represented via vsi_handle.
@@ -2596,7 +2596,7 @@ ice_replay_vsi_fltr(struct ice_hw *hw, u16 vsi_handle, u8 recp_id,
2596 f_entry.fltr_info = itr->fltr_info; 2596 f_entry.fltr_info = itr->fltr_info;
2597 if (itr->vsi_count < 2 && recp_id != ICE_SW_LKUP_VLAN && 2597 if (itr->vsi_count < 2 && recp_id != ICE_SW_LKUP_VLAN &&
2598 itr->fltr_info.vsi_handle == vsi_handle) { 2598 itr->fltr_info.vsi_handle == vsi_handle) {
2599 /* update the src in case it is vsi num */ 2599 /* update the src in case it is VSI num */
2600 if (f_entry.fltr_info.src_id == ICE_SRC_ID_VSI) 2600 if (f_entry.fltr_info.src_id == ICE_SRC_ID_VSI)
2601 f_entry.fltr_info.src = hw_vsi_id; 2601 f_entry.fltr_info.src = hw_vsi_id;
2602 status = ice_add_rule_internal(hw, recp_id, &f_entry); 2602 status = ice_add_rule_internal(hw, recp_id, &f_entry);
@@ -2611,7 +2611,7 @@ ice_replay_vsi_fltr(struct ice_hw *hw, u16 vsi_handle, u8 recp_id,
2611 clear_bit(vsi_handle, itr->vsi_list_info->vsi_map); 2611 clear_bit(vsi_handle, itr->vsi_list_info->vsi_map);
2612 f_entry.fltr_info.vsi_handle = vsi_handle; 2612 f_entry.fltr_info.vsi_handle = vsi_handle;
2613 f_entry.fltr_info.fltr_act = ICE_FWD_TO_VSI; 2613 f_entry.fltr_info.fltr_act = ICE_FWD_TO_VSI;
2614 /* update the src in case it is vsi num */ 2614 /* update the src in case it is VSI num */
2615 if (f_entry.fltr_info.src_id == ICE_SRC_ID_VSI) 2615 if (f_entry.fltr_info.src_id == ICE_SRC_ID_VSI)
2616 f_entry.fltr_info.src = hw_vsi_id; 2616 f_entry.fltr_info.src = hw_vsi_id;
2617 if (recp_id == ICE_SW_LKUP_VLAN) 2617 if (recp_id == ICE_SW_LKUP_VLAN)
@@ -2651,7 +2651,7 @@ enum ice_status ice_replay_vsi_all_fltr(struct ice_hw *hw, u16 vsi_handle)
2651 2651
2652/** 2652/**
2653 * ice_rm_all_sw_replay_rule_info - deletes filter replay rules 2653 * ice_rm_all_sw_replay_rule_info - deletes filter replay rules
2654 * @hw: pointer to the hw struct 2654 * @hw: pointer to the HW struct
2655 * 2655 *
2656 * Deletes the filter replay rules. 2656 * Deletes the filter replay rules.
2657 */ 2657 */