@@ -1471,7 +1471,6 @@ int ice_init_def_sw_recp(struct ice_hw *hw)
1471
1471
recps [i ].root_rid = i ;
1472
1472
INIT_LIST_HEAD (& recps [i ].filt_rules );
1473
1473
INIT_LIST_HEAD (& recps [i ].filt_replay_rules );
1474
- INIT_LIST_HEAD (& recps [i ].rg_list );
1475
1474
mutex_init (& recps [i ].filt_rule_lock );
1476
1475
}
1477
1476
@@ -2339,18 +2338,10 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid,
2339
2338
2340
2339
for (sub_recps = 0 ; sub_recps < num_recps ; sub_recps ++ ) {
2341
2340
struct ice_aqc_recipe_data_elem root_bufs = tmp [sub_recps ];
2342
- struct ice_recp_grp_entry * rg_entry ;
2343
2341
u8 i , prof , idx , prot = 0 ;
2344
2342
bool is_root ;
2345
2343
u16 off = 0 ;
2346
2344
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
-
2354
2345
idx = root_bufs .recipe_indx ;
2355
2346
is_root = root_bufs .content .rid & ICE_AQ_RECIPE_ID_IS_ROOT ;
2356
2347
@@ -2364,10 +2355,7 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid,
2364
2355
ICE_MAX_NUM_PROFILES );
2365
2356
for (i = 0 ; i < ICE_NUM_WORDS_RECIPE ; i ++ ) {
2366
2357
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 ]);
2371
2359
2372
2360
/* If the recipe is a chained recipe then all its
2373
2361
* 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,
2378
2366
* has ICE_AQ_RECIPE_LKUP_IGNORE or 0 since it isn't a
2379
2367
* valid offset value.
2380
2368
*/
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 ]))
2384
2373
continue ;
2385
2374
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 );
2388
2377
lkup_exts -> fv_words [fv_word_idx ].prot_id = prot ;
2389
2378
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 ;
2392
2380
fv_word_idx ++ ;
2393
2381
}
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 );
2398
2382
2399
2383
/* Propagate some data to the recipe database */
2400
- recps [idx ].is_root = !!is_root ;
2401
2384
recps [idx ].priority = root_bufs .content .act_ctrl_fwd_priority ;
2402
2385
recps [idx ].need_pass_l2 = root_bufs .content .act_ctrl &
2403
2386
ICE_AQ_RECIPE_ACT_NEED_PASS_L2 ;
2404
2387
recps [idx ].allow_pass_l2 = root_bufs .content .act_ctrl &
2405
2388
ICE_AQ_RECIPE_ACT_ALLOW_PASS_L2 ;
2406
2389
bitmap_zero (recps [idx ].res_idxs , ICE_MAX_FV_WORDS );
2407
2390
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 );
2413
2393
}
2414
2394
2415
2395
if (!is_root ) {
@@ -2429,8 +2409,6 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid,
2429
2409
2430
2410
/* Complete initialization of the root recipe entry */
2431
2411
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 ;
2434
2412
2435
2413
/* Copy result indexes */
2436
2414
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,
5157
5135
return status ;
5158
5136
5159
5137
recipe = & hw -> switch_info -> recp_list [rid ];
5160
- recipe -> is_root = true;
5161
5138
root = & buf [recp_cnt - 1 ];
5162
5139
fill_recipe_template (root , rid , rm );
5163
5140
@@ -5317,9 +5294,7 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
5317
5294
DECLARE_BITMAP (fv_bitmap , ICE_MAX_NUM_PROFILES );
5318
5295
DECLARE_BITMAP (profiles , ICE_MAX_NUM_PROFILES );
5319
5296
struct ice_prot_lkup_ext * lkup_exts ;
5320
- struct ice_recp_grp_entry * r_entry ;
5321
5297
struct ice_sw_fv_list_entry * fvit ;
5322
- struct ice_recp_grp_entry * r_tmp ;
5323
5298
struct ice_sw_fv_list_entry * tmp ;
5324
5299
struct ice_sw_recipe * rm ;
5325
5300
int status = 0 ;
@@ -5361,7 +5336,6 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
5361
5336
* headers being programmed.
5362
5337
*/
5363
5338
INIT_LIST_HEAD (& rm -> fv_list );
5364
- INIT_LIST_HEAD (& rm -> rg_list );
5365
5339
5366
5340
/* Get bitmap of field vectors (profiles) that are compatible with the
5367
5341
* 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,
5465
5439
}
5466
5440
5467
5441
err_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
-
5473
5442
list_for_each_entry_safe (fvit , tmp , & rm -> fv_list , list_entry ) {
5474
5443
list_del (& fvit -> list_entry );
5475
5444
devm_kfree (ice_hw_to_dev (hw ), fvit );
0 commit comments