Skip to content

Commit e247267

Browse files
Marcin Szycikanguy11
authored andcommitted
ice: Remove unused struct ice_prot_lkup_ext members
Remove field_off as it's never used. Remove done bitmap, as its value is only checked and never assigned. Reusing sub-recipes while creating new root recipes is currently not supported in the driver. Reviewed-by: Przemek Kitszel <[email protected]> Signed-off-by: Marcin Szycik <[email protected]> Tested-by: Sujai Buvaneswaran <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 58f9416 commit e247267

File tree

2 files changed

+19
-29
lines changed

2 files changed

+19
-29
lines changed

drivers/net/ethernet/intel/ice/ice_protocol_type.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,13 +452,9 @@ struct ice_prot_lkup_ext {
452452
u16 prot_type;
453453
u8 n_val_words;
454454
/* create a buffer to hold max words per recipe */
455-
u16 field_off[ICE_MAX_CHAIN_WORDS];
456455
u16 field_mask[ICE_MAX_CHAIN_WORDS];
457456

458457
struct ice_fv_word fv_words[ICE_MAX_CHAIN_WORDS];
459-
460-
/* Indicate field offsets that have field vector indices assigned */
461-
DECLARE_BITMAP(done, ICE_MAX_CHAIN_WORDS);
462458
};
463459

464460
struct ice_pref_recipe_group {

drivers/net/ethernet/intel/ice/ice_switch.c

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4918,33 +4918,27 @@ ice_create_first_fit_recp_def(struct ice_hw *hw,
49184918

49194919
*recp_cnt = 0;
49204920

4921-
/* Walk through every word in the rule to check if it is not done. If so
4922-
* then this word needs to be part of a new recipe.
4923-
*/
4924-
for (j = 0; j < lkup_exts->n_val_words; j++)
4925-
if (!test_bit(j, lkup_exts->done)) {
4926-
if (!grp ||
4927-
grp->n_val_pairs == ICE_NUM_WORDS_RECIPE) {
4928-
struct ice_recp_grp_entry *entry;
4929-
4930-
entry = devm_kzalloc(ice_hw_to_dev(hw),
4931-
sizeof(*entry),
4932-
GFP_KERNEL);
4933-
if (!entry)
4934-
return -ENOMEM;
4935-
list_add(&entry->l_entry, rg_list);
4936-
grp = &entry->r_group;
4937-
(*recp_cnt)++;
4938-
}
4939-
4940-
grp->pairs[grp->n_val_pairs].prot_id =
4941-
lkup_exts->fv_words[j].prot_id;
4942-
grp->pairs[grp->n_val_pairs].off =
4943-
lkup_exts->fv_words[j].off;
4944-
grp->mask[grp->n_val_pairs] = lkup_exts->field_mask[j];
4945-
grp->n_val_pairs++;
4921+
for (j = 0; j < lkup_exts->n_val_words; j++) {
4922+
if (!grp || grp->n_val_pairs == ICE_NUM_WORDS_RECIPE) {
4923+
struct ice_recp_grp_entry *entry;
4924+
4925+
entry = devm_kzalloc(ice_hw_to_dev(hw), sizeof(*entry),
4926+
GFP_KERNEL);
4927+
if (!entry)
4928+
return -ENOMEM;
4929+
4930+
list_add(&entry->l_entry, rg_list);
4931+
grp = &entry->r_group;
4932+
(*recp_cnt)++;
49464933
}
49474934

4935+
grp->pairs[grp->n_val_pairs].prot_id =
4936+
lkup_exts->fv_words[j].prot_id;
4937+
grp->pairs[grp->n_val_pairs].off = lkup_exts->fv_words[j].off;
4938+
grp->mask[grp->n_val_pairs] = lkup_exts->field_mask[j];
4939+
grp->n_val_pairs++;
4940+
}
4941+
49484942
return 0;
49494943
}
49504944

0 commit comments

Comments
 (0)