@@ -1471,7 +1471,6 @@ int ice_init_def_sw_recp(struct ice_hw *hw)
14711471 recps [i ].root_rid = i ;
14721472 INIT_LIST_HEAD (& recps [i ].filt_rules );
14731473 INIT_LIST_HEAD (& recps [i ].filt_replay_rules );
1474- INIT_LIST_HEAD (& recps [i ].rg_list );
14751474 mutex_init (& recps [i ].filt_rule_lock );
14761475 }
14771476
@@ -2339,18 +2338,10 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid,
23392338
23402339 for (sub_recps = 0 ; sub_recps < num_recps ; sub_recps ++ ) {
23412340 struct ice_aqc_recipe_data_elem root_bufs = tmp [sub_recps ];
2342- struct ice_recp_grp_entry * rg_entry ;
23432341 u8 i , prof , idx , prot = 0 ;
23442342 bool is_root ;
23452343 u16 off = 0 ;
23462344
2347- rg_entry = devm_kzalloc (ice_hw_to_dev (hw ), sizeof (* rg_entry ),
2348- GFP_KERNEL );
2349- if (!rg_entry ) {
2350- status = - ENOMEM ;
2351- goto err_unroll ;
2352- }
2353-
23542345 idx = root_bufs .recipe_indx ;
23552346 is_root = root_bufs .content .rid & ICE_AQ_RECIPE_ID_IS_ROOT ;
23562347
@@ -2364,10 +2355,7 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid,
23642355 ICE_MAX_NUM_PROFILES );
23652356 for (i = 0 ; i < ICE_NUM_WORDS_RECIPE ; i ++ ) {
23662357 u8 lkup_indx = root_bufs .content .lkup_indx [i ];
2367-
2368- rg_entry -> fv_idx [i ] = lkup_indx ;
2369- rg_entry -> fv_mask [i ] =
2370- le16_to_cpu (root_bufs .content .mask [i ]);
2358+ u16 lkup_mask = le16_to_cpu (root_bufs .content .mask [i ]);
23712359
23722360 /* If the recipe is a chained recipe then all its
23732361 * child recipe's result will have a result index.
@@ -2378,38 +2366,30 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid,
23782366 * has ICE_AQ_RECIPE_LKUP_IGNORE or 0 since it isn't a
23792367 * valid offset value.
23802368 */
2381- if (test_bit (rg_entry -> fv_idx [i ], hw -> switch_info -> prof_res_bm [prof ]) ||
2382- rg_entry -> fv_idx [i ] & ICE_AQ_RECIPE_LKUP_IGNORE ||
2383- rg_entry -> fv_idx [i ] == 0 )
2369+ if (!lkup_indx ||
2370+ (lkup_indx & ICE_AQ_RECIPE_LKUP_IGNORE ) ||
2371+ test_bit (lkup_indx ,
2372+ hw -> switch_info -> prof_res_bm [prof ]))
23842373 continue ;
23852374
2386- ice_find_prot_off (hw , ICE_BLK_SW , prof ,
2387- rg_entry -> fv_idx [ i ], & prot , & off );
2375+ ice_find_prot_off (hw , ICE_BLK_SW , prof , lkup_indx ,
2376+ & prot , & off );
23882377 lkup_exts -> fv_words [fv_word_idx ].prot_id = prot ;
23892378 lkup_exts -> fv_words [fv_word_idx ].off = off ;
2390- lkup_exts -> field_mask [fv_word_idx ] =
2391- rg_entry -> fv_mask [i ];
2379+ lkup_exts -> field_mask [fv_word_idx ] = lkup_mask ;
23922380 fv_word_idx ++ ;
23932381 }
2394- /* populate rg_list with the data from the child entry of this
2395- * recipe
2396- */
2397- list_add (& rg_entry -> l_entry , & recps [rid ].rg_list );
23982382
23992383 /* Propagate some data to the recipe database */
2400- recps [idx ].is_root = !!is_root ;
24012384 recps [idx ].priority = root_bufs .content .act_ctrl_fwd_priority ;
24022385 recps [idx ].need_pass_l2 = root_bufs .content .act_ctrl &
24032386 ICE_AQ_RECIPE_ACT_NEED_PASS_L2 ;
24042387 recps [idx ].allow_pass_l2 = root_bufs .content .act_ctrl &
24052388 ICE_AQ_RECIPE_ACT_ALLOW_PASS_L2 ;
24062389 bitmap_zero (recps [idx ].res_idxs , ICE_MAX_FV_WORDS );
24072390 if (root_bufs .content .result_indx & ICE_AQ_RECIPE_RESULT_EN ) {
2408- recps [idx ].chain_idx = root_bufs .content .result_indx &
2409- ~ICE_AQ_RECIPE_RESULT_EN ;
2410- set_bit (recps [idx ].chain_idx , recps [idx ].res_idxs );
2411- } else {
2412- recps [idx ].chain_idx = ICE_INVAL_CHAIN_IND ;
2391+ set_bit (root_bufs .content .result_indx &
2392+ ~ICE_AQ_RECIPE_RESULT_EN , recps [idx ].res_idxs );
24132393 }
24142394
24152395 if (!is_root ) {
@@ -2429,8 +2409,6 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid,
24292409
24302410 /* Complete initialization of the root recipe entry */
24312411 lkup_exts -> n_val_words = fv_word_idx ;
2432- recps [rid ].big_recp = (num_recps > 1 );
2433- recps [rid ].n_grp_count = (u8 )num_recps ;
24342412
24352413 /* Copy result indexes */
24362414 bitmap_copy (recps [rid ].res_idxs , result_bm , ICE_MAX_FV_WORDS );
@@ -5157,7 +5135,6 @@ ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm,
51575135 return status ;
51585136
51595137 recipe = & hw -> switch_info -> recp_list [rid ];
5160- recipe -> is_root = true;
51615138 root = & buf [recp_cnt - 1 ];
51625139 fill_recipe_template (root , rid , rm );
51635140
@@ -5317,9 +5294,7 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
53175294 DECLARE_BITMAP (fv_bitmap , ICE_MAX_NUM_PROFILES );
53185295 DECLARE_BITMAP (profiles , ICE_MAX_NUM_PROFILES );
53195296 struct ice_prot_lkup_ext * lkup_exts ;
5320- struct ice_recp_grp_entry * r_entry ;
53215297 struct ice_sw_fv_list_entry * fvit ;
5322- struct ice_recp_grp_entry * r_tmp ;
53235298 struct ice_sw_fv_list_entry * tmp ;
53245299 struct ice_sw_recipe * rm ;
53255300 int status = 0 ;
@@ -5361,7 +5336,6 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
53615336 * headers being programmed.
53625337 */
53635338 INIT_LIST_HEAD (& rm -> fv_list );
5364- INIT_LIST_HEAD (& rm -> rg_list );
53655339
53665340 /* Get bitmap of field vectors (profiles) that are compatible with the
53675341 * rule request; only these will be searched in the subsequent call to
@@ -5465,11 +5439,6 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
54655439 }
54665440
54675441err_unroll :
5468- list_for_each_entry_safe (r_entry , r_tmp , & rm -> rg_list , l_entry ) {
5469- list_del (& r_entry -> l_entry );
5470- devm_kfree (ice_hw_to_dev (hw ), r_entry );
5471- }
5472-
54735442 list_for_each_entry_safe (fvit , tmp , & rm -> fv_list , list_entry ) {
54745443 list_del (& fvit -> list_entry );
54755444 devm_kfree (ice_hw_to_dev (hw ), fvit );
0 commit comments