[dpdk-stable] patch 'common/sfc_efx/base: fix MAE match spec class comparison API' has been queued to stable release 20.11.1

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Feb 5 12:17:07 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/07/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/ccae4e808af42dffdfb7064bb1cd984eda4d22d6

Thanks.

Luca Boccassi

---
>From ccae4e808af42dffdfb7064bb1cd984eda4d22d6 Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov at oktetlabs.ru>
Date: Wed, 6 Jan 2021 13:06:00 +0300
Subject: [PATCH] common/sfc_efx/base: fix MAE match spec class comparison API

[ upstream commit 76631541aa2de49562e262af085f9e4afdeb1baf ]

The helper exits once it encounters a field which hasn't its
capability status reported by the FW. Handle the corner case
when the two mask-value pairs match for the field, which, in
the absence of capability information, is sufficient to deem
the class unaffected by the field. Explain this in a comment.

Fixes: bb71f7e0a35a ("common/sfc_efx/base: add match specs class comparison API")

Reviewed-by: Andy Moreton <amoreton at xilinx.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
Signed-off-by: Ivan Malov <ivan.malov at oktetlabs.ru>
---
 drivers/common/sfc_efx/base/efx.h     |  5 +++++
 drivers/common/sfc_efx/base/efx_mae.c | 32 ++++++++++++++++++---------
 2 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h
index 3b40e28b4e..ccf9c7ab8a 100644
--- a/drivers/common/sfc_efx/base/efx.h
+++ b/drivers/common/sfc_efx/base/efx.h
@@ -4283,6 +4283,11 @@ efx_mae_action_set_specs_equal(
  * Conduct a comparison to check whether two match specifications
  * of equal rule type (action / outer) and priority would map to
  * the very same rule class from the firmware's standpoint.
+ *
+ * For match specification fields that are not supported by firmware,
+ * the rule class only matches if the mask/value pairs for that field
+ * are equal. Clients should use efx_mae_match_spec_is_valid() before
+ * calling this API to detect usage of unsupported fields.
  */
 LIBEFX_API
 extern	__checkReturn			efx_rc_t
diff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c
index 7fd42218f6..eb91753ec5 100644
--- a/drivers/common/sfc_efx/base/efx_mae.c
+++ b/drivers/common/sfc_efx/base/efx_mae.c
@@ -1426,18 +1426,32 @@ efx_mae_match_specs_class_cmp(
 	     ++field_id) {
 		const efx_mae_mv_desc_t *descp = &desc_setp[field_id];
 		efx_mae_field_cap_id_t field_cap_id = descp->emmd_field_cap_id;
+		const uint8_t *lmaskp = mvpl + descp->emmd_mask_offset;
+		const uint8_t *rmaskp = mvpr + descp->emmd_mask_offset;
+		size_t mask_size = descp->emmd_mask_size;
+		const uint8_t *lvalp = mvpl + descp->emmd_value_offset;
+		const uint8_t *rvalp = mvpr + descp->emmd_value_offset;
+		size_t value_size = descp->emmd_value_size;
 
-		if (descp->emmd_mask_size == 0)
+		if (mask_size == 0)
 			continue; /* Skip array gap */
 
-		if ((unsigned int)field_cap_id >= field_ncaps)
-			break;
+		if ((unsigned int)field_cap_id >= field_ncaps) {
+			/*
+			 * The FW has not reported capability status for this
+			 * field. It's unknown whether any difference between
+			 * the two masks / values affects the class. The only
+			 * case when the class must be the same is when these
+			 * mask-value pairs match. Otherwise, report mismatch.
+			 */
+			if ((memcmp(lmaskp, rmaskp, mask_size) == 0) &&
+			    (memcmp(lvalp, rvalp, value_size) == 0))
+				continue;
+			else
+				break;
+		}
 
 		if (field_caps[field_cap_id].emfc_mask_affects_class) {
-			const uint8_t *lmaskp = mvpl + descp->emmd_mask_offset;
-			const uint8_t *rmaskp = mvpr + descp->emmd_mask_offset;
-			size_t mask_size = descp->emmd_mask_size;
-
 			if (memcmp(lmaskp, rmaskp, mask_size) != 0) {
 				have_same_class = B_FALSE;
 				break;
@@ -1445,10 +1459,6 @@ efx_mae_match_specs_class_cmp(
 		}
 
 		if (field_caps[field_cap_id].emfc_match_affects_class) {
-			const uint8_t *lvalp = mvpl + descp->emmd_value_offset;
-			const uint8_t *rvalp = mvpr + descp->emmd_value_offset;
-			size_t value_size = descp->emmd_value_size;
-
 			if (memcmp(lvalp, rvalp, value_size) != 0) {
 				have_same_class = B_FALSE;
 				break;
-- 
2.29.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-02-05 11:18:35.458044857 +0000
+++ 0141-common-sfc_efx-base-fix-MAE-match-spec-class-compari.patch	2021-02-05 11:18:29.026695300 +0000
@@ -1 +1 @@
-From 76631541aa2de49562e262af085f9e4afdeb1baf Mon Sep 17 00:00:00 2001
+From ccae4e808af42dffdfb7064bb1cd984eda4d22d6 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 76631541aa2de49562e262af085f9e4afdeb1baf ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list