Skip to contentSkip to conversation

net/ice: fix silent drop of MAC addrs in ACL rules

PATCH In review Bruce Richardson 2 participants 3 messages Nov 18 – Nov 20 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ice: fix silent drop of MAC addrs in ACL rules

For devices with 4 or more ports, the size of the ACL rules supported is narrower, so MAC addresess are not handled there (see [1]). Reject such rules in the ACL block rather than silently accepting them with missing filter fields. Those rules can then be passed to other engines which may be able to accept and correctly implement them.

[1] https://github.com/DPDK/dpdk/blob/main/drivers/net/intel/ice/ice_acl_filter.c#L170

Fixes 40d466fa9f76 ("net/ice: support ACL filter in DCF")
---
 drivers/net/intel/ice/ice_acl_filter.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/intel/ice/ice_acl_filter.c +9 -0
index 0f913126de..931c5469d2 100644
@@ -998,6 +998,15 @@ ice_acl_parse(struct ice_adapter *ad,
 		goto error;
 	}
 
+	/* MAC fields are only in the ACL profile with fewer than 4 PFs */
+	if (ad->hw.dev_caps.num_funcs >= 4 &&
+			(input_set & (ICE_INSET_SMAC | ICE_INSET_DMAC)) != 0) {
+		ret = rte_flow_error_set(error, EINVAL,
+				RTE_FLOW_ERROR_TYPE_ITEM_SPEC, pattern,
+				"MAC address match not supported by ACL on this device");
+		goto error;
+	}
+
 	ret = ice_acl_parse_action(&parsed_actions, filter, error);
 	if (ret)
 		goto error;
Signature · 1 line
2.55.0
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines

Subject: [PATCH] net/ice: fix silent drop of MAC addrs in ACL rules

For devices with 4 or more ports, the size of the ACL rules supported is narrower, so MAC addresess are not handled there (see [1]). Reject such

Typo: addresses

Quoted 7 lines

rules in the ACL block rather than silently accepting them with missing filter fields. Those rules can then be passed to other engines which may be able to accept and correctly implement them.

[1]
https://github.com/DPDK/dpdk/blob/main/drivers/net/intel/ice/ice_acl_filter
.c#L170

This line reference will be stale once that file is updated on main. I don't think the footnote is necessary. If you want to point to something you could point to the function name eg. "see acl_add_prof_prepare()" If you want to keep a URL, use a SHA that will remain constant.

Quoted 5 lines
Fixes 40d466fa9f76 ("net/ice: support ACL filter in DCF")

Code LGTM.

Quoted 30 lines
---
 drivers/net/intel/ice/ice_acl_filter.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/intel/ice/ice_acl_filter.c +9 -0
index 0f913126de..931c5469d2 100644
@@ -998,6 +998,15 @@ ice_acl_parse(struct ice_adapter *ad,
 		goto error;
 	}
 
+	/* MAC fields are only in the ACL profile with fewer than 4 PFs */
+	if (ad->hw.dev_caps.num_funcs >= 4 &&
+			(input_set & (ICE_INSET_SMAC | ICE_INSET_DMAC))
 != 0) {
+		ret = rte_flow_error_set(error, EINVAL,
+				RTE_FLOW_ERROR_TYPE_ITEM_SPEC,
 pattern,
+				"MAC address match not supported by ACL
 on this device");
+		goto error;
+	}
+
drivers/net/intel/ice/ice_acl_filter.c +0 -1
 	ret = ice_acl_parse_action(&parsed_actions, filter, error);
 	if (ret)
 		goto error;
--

2.55.0

author Applied
#2 lore raw
Quoted 21 lines · Ciara
Quoted 4 lines

Subject: [PATCH] net/ice: fix silent drop of MAC addrs in ACL rules

For devices with 4 or more ports, the size of the ACL rules supported is narrower, so MAC addresess are not handled there (see [1]). Reject such

Typo: addresses

Quoted 7 lines

rules in the ACL block rather than silently accepting them with missing filter fields. Those rules can then be passed to other engines which may be able to accept and correctly implement them.

[1]
https://github.com/DPDK/dpdk/blob/main/drivers/net/intel/ice/ice_acl_filter
.c#L170

This line reference will be stale once that file is updated on main. I don't think the footnote is necessary. If you want to point to something you could point to the function name eg. "see acl_add_prof_prepare()" If you want to keep a URL, use a SHA that will remain constant.

Quoted 1 line
Quoted 9 lines
Quoted 4 lines
Fixes 40d466fa9f76 ("net/ice: support ACL filter in DCF")

Code LGTM.

Applied to dpdk-next-net-intel with suggested commit log change (and spelling correction on "addresses").

/Bruce