Skip to contentSkip to conversation

net/ice: fix ACL entry limit on devices with 8 ports

PATCH Applied Ciara Loftus 2 participants 3 messages Nov 9 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ice: fix ACL entry limit on devices with 8 ports

Currently, the ACL table depth is halved on devices with more than 4 PFs, but the driver still assumes 256 entries are available. The base code reserves only 50% of the scenario for the NORMAL priority band, so on an 8-port device adding the 129th rule fails and the flow silently falls back to the switch engine.

Fix it by deriving the entry limit from the configured depth so the driver rejects rules beyond the NORMAL band with an explicit error.

Fixes 17a8fc206178 ("net/ice: fix initialization with 8 ports")
---
 drivers/net/intel/ice/ice_acl_filter.c | 9 ++++++---
 drivers/net/intel/ice/ice_ethdev.h     | 1 +
 2 files changed, 7 insertions(+), 3 deletions(-)
drivers/net/intel/ice/ice_acl_filter.c +6 -3
index 94c9ea89fdc..0f913126ded 100644
@@ -134,6 +134,9 @@ ice_acl_setup(struct ice_pf *pf)
 	if (err)
 		return err;
 
+	/* Only the NORMAL priority band (50% of the scenario) is used. */
+	pf->acl.max_entries = params.depth / 2;
+
 	return 0;
 }
 
@@ -449,7 +452,7 @@ ice_acl_hw_set_conf(struct ice_pf *pf, struct ice_fdir_fltr *input,
 	/* For IPV4_OTHER type, should add entry for all types.
 	 * For IPV4_UDP/TCP/SCTP type, only add entry for each.
 	 */
-	if (slot_id < MAX_ACL_NORMAL_ENTRIES) {
+	if (slot_id < pf->acl.max_entries) {
 		entry_id = ((uint64_t)flow_type << 32) | slot_id;
 		ret = ice_flow_add_entry(hw, blk, flow_type,
 					 entry_id, pf->main_vsi->idx,
@@ -463,8 +466,8 @@ ice_acl_hw_set_conf(struct ice_pf *pf, struct ice_fdir_fltr *input,
 		rule->entry_id[entry_idx] = entry_id;
 		pf->acl.hw_entry_id[slot_id] = hw_entry;
 	} else {
-		PMD_DRV_LOG(ERR, "Exceed the maximum entry number(%d)"
-			    " HW supported!", MAX_ACL_NORMAL_ENTRIES);
+		PMD_DRV_LOG(ERR, "Exceed the maximum entry number(%u)"
+			    " HW supported!", pf->acl.max_entries);
 		rte_bitmap_set(pf->acl.slots, slot_id);
 		return -1;
 	}
drivers/net/intel/ice/ice_ethdev.h +1 -0
index 945e765c2c2..7a3d164143b 100644
@@ -498,6 +498,7 @@ struct ice_acl_conf {
  */
 struct ice_acl_info {
 	struct rte_bitmap *slots;
+	uint16_t max_entries;
 	uint64_t hw_entry_id[MAX_ACL_NORMAL_ENTRIES];
 };
 
Signature · 1 line
2.43.0
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Ciara Loftus

Currently, the ACL table depth is halved on devices with more than 4 PFs, but the driver still assumes 256 entries are available. The base code reserves only 50% of the scenario for the NORMAL priority band, so on an 8-port device adding the 129th rule fails and the flow silently falls back to the switch engine.

Fix it by deriving the entry limit from the configured depth so the driver rejects rules beyond the NORMAL band with an explicit error.

Quoted 9 lines
Fixes 17a8fc206178 ("net/ice: fix initialization with 8 ports")
---
 drivers/net/intel/ice/ice_acl_filter.c | 9 ++++++---
 drivers/net/intel/ice/ice_ethdev.h     | 1 +
 2 files changed, 7 insertions(+), 3 deletions(-)
#2 lore raw
Quoted 13 lines · Bruce Richardson
Quoted 12 lines · Ciara Loftus

Currently, the ACL table depth is halved on devices with more than 4 PFs, but the driver still assumes 256 entries are available. The base code reserves only 50% of the scenario for the NORMAL priority band, so on an 8-port device adding the 129th rule fails and the flow silently falls back to the switch engine.

Fix it by deriving the entry limit from the configured depth so the driver rejects rules beyond the NORMAL band with an explicit error.

Fixes 17a8fc206178 ("net/ice: fix initialization with 8 ports")
Quoted 7 lines
Quoted 6 lines
---
 drivers/net/intel/ice/ice_acl_filter.c | 9 ++++++---
 drivers/net/intel/ice/ice_ethdev.h     | 1 +
 2 files changed, 7 insertions(+), 3 deletions(-)

Applied to dpdk-next-net-intel
Thanks,
/Bruce