patch 'net/sfc: invalidate dangling MAE flow action FW resource IDs' has been queued to stable release 22.11.3

Xueming Li xuemingl at nvidia.com
Sun Jun 25 08:34:17 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=88cf99ed018ef7ea2e7fdd29687835af71032806

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 88cf99ed018ef7ea2e7fdd29687835af71032806 Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov at arknetworks.am>
Date: Sun, 21 May 2023 12:36:31 +0400
Subject: [PATCH] net/sfc: invalidate dangling MAE flow action FW resource IDs
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit cf1e1a8e869b49ac9e2e097bbd272e94cc4f2c74 ]

When reinserting a flow (on port restart, for instance)
FW resource IDs found in the action set specification
need to be invalidated so that the new (reallocated)
FW resource IDs can be accepted by libefx again.

Fixes: 1bbd1ec2348a ("net/sfc: support action VXLAN encap in MAE backend")

Signed-off-by: Ivan Malov <ivan.malov at arknetworks.am>
Reviewed-by: Andy Moreton <amoreton at xilinx.com>
Tested-by: Denis Pryazhennikov <denis.pryazhennikov at arknetworks.am>
Acked-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
---
 .mailmap                               |  1 +
 drivers/common/sfc_efx/base/efx.h      | 14 ++++++++++++++
 drivers/common/sfc_efx/base/efx_impl.h |  4 ++++
 drivers/common/sfc_efx/base/efx_mae.c  | 15 +++++++++++----
 drivers/common/sfc_efx/version.map     |  1 +
 drivers/net/sfc/sfc_mae.c              |  2 ++
 6 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/.mailmap b/.mailmap
index 8d8c19d582..73f729c4c6 100644
--- a/.mailmap
+++ b/.mailmap
@@ -298,6 +298,7 @@ Deepak Khandelwal <deepak.khandelwal at intel.com>
 Deepak Kumar Jain <deepak.k.jain at intel.com>
 Deirdre O'Connor <deirdre.o.connor at intel.com>
 Dekel Peled <dekelp at nvidia.com> <dekelp at mellanox.com>
+Denis Pryazhennikov <denis.pryazhennikov at arknetworks.am>
 Dennis Marinus <dmarinus at amazon.com>
 Derek Chickles <derek.chickles at caviumnetworks.com>
 Des O Dea <des.j.o.dea at intel.com>
diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h
index f4fa88f169..49e29dcc1c 100644
--- a/drivers/common/sfc_efx/base/efx.h
+++ b/drivers/common/sfc_efx/base/efx.h
@@ -4748,6 +4748,20 @@ efx_mae_action_set_fill_in_counter_id(
 	__in				efx_mae_actions_t *spec,
 	__in				const efx_counter_t *counter_idp);
 
+/*
+ * Clears dangling FW object IDs (counter ID, for instance) in
+ * the action set specification. Useful for adapter restarts,
+ * when all MAE objects need to be reallocated by the driver.
+ *
+ * This method only clears the IDs in the specification.
+ * The driver is still responsible for keeping the IDs
+ * separately and freeing them when stopping the port.
+ */
+LIBEFX_API
+extern					void
+efx_mae_action_set_clear_fw_rsrc_ids(
+	__in				efx_mae_actions_t *spec);
+
 /* Action set ID */
 typedef struct efx_mae_aset_id_s {
 	uint32_t id;
diff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h
index 9a5d465fa0..45e99d01c5 100644
--- a/drivers/common/sfc_efx/base/efx_impl.h
+++ b/drivers/common/sfc_efx/base/efx_impl.h
@@ -1800,6 +1800,10 @@ typedef struct efx_mae_action_vlan_push_s {
 	uint16_t			emavp_tci_be;
 } efx_mae_action_vlan_push_t;
 
+/*
+ * Helper efx_mae_action_set_clear_fw_rsrc_ids() is responsible
+ * to initialise every field in this structure to INVALID value.
+ */
 typedef struct efx_mae_actions_rsrc_s {
 	efx_mae_mac_id_t		emar_dst_mac_id;
 	efx_mae_mac_id_t		emar_src_mac_id;
diff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c
index 7732d99992..4c33471f28 100644
--- a/drivers/common/sfc_efx/base/efx_mae.c
+++ b/drivers/common/sfc_efx/base/efx_mae.c
@@ -1394,10 +1394,7 @@ efx_mae_action_set_spec_init(
 		goto fail1;
 	}
 
-	spec->ema_rsrc.emar_dst_mac_id.id = EFX_MAE_RSRC_ID_INVALID;
-	spec->ema_rsrc.emar_src_mac_id.id = EFX_MAE_RSRC_ID_INVALID;
-	spec->ema_rsrc.emar_eh_id.id = EFX_MAE_RSRC_ID_INVALID;
-	spec->ema_rsrc.emar_counter_id.id = EFX_MAE_RSRC_ID_INVALID;
+	efx_mae_action_set_clear_fw_rsrc_ids(spec);
 
 	/*
 	 * Helpers which populate v2 actions must reject them when v2 is not
@@ -3027,6 +3024,16 @@ fail1:
 	return (rc);
 }
 
+					void
+efx_mae_action_set_clear_fw_rsrc_ids(
+	__in				efx_mae_actions_t *spec)
+{
+	spec->ema_rsrc.emar_dst_mac_id.id = EFX_MAE_RSRC_ID_INVALID;
+	spec->ema_rsrc.emar_src_mac_id.id = EFX_MAE_RSRC_ID_INVALID;
+	spec->ema_rsrc.emar_eh_id.id = EFX_MAE_RSRC_ID_INVALID;
+	spec->ema_rsrc.emar_counter_id.id = EFX_MAE_RSRC_ID_INVALID;
+}
+
 	__checkReturn			efx_rc_t
 efx_mae_counters_alloc(
 	__in				efx_nic_t *enp,
diff --git a/drivers/common/sfc_efx/version.map b/drivers/common/sfc_efx/version.map
index aabc354118..d9b04a611d 100644
--- a/drivers/common/sfc_efx/version.map
+++ b/drivers/common/sfc_efx/version.map
@@ -89,6 +89,7 @@ INTERNAL {
 	efx_mae_action_rule_insert;
 	efx_mae_action_rule_remove;
 	efx_mae_action_set_alloc;
+	efx_mae_action_set_clear_fw_rsrc_ids;
 	efx_mae_action_set_fill_in_counter_id;
 	efx_mae_action_set_fill_in_dst_mac_id;
 	efx_mae_action_set_fill_in_eh_id;
diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index 29b8bb9e25..c7d28eae71 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -1180,6 +1180,8 @@ sfc_mae_action_set_disable(struct sfc_adapter *sa,
 	}
 
 	if (fw_rsrc->refcnt == 1) {
+		efx_mae_action_set_clear_fw_rsrc_ids(action_set->spec);
+
 		rc = efx_mae_action_set_free(sa->nic, &fw_rsrc->aset_id);
 		if (rc == 0) {
 			sfc_dbg(sa, "disabled action_set=%p with AS_ID=0x%08x",
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-06-25 14:31:59.571234300 +0800
+++ 0039-net-sfc-invalidate-dangling-MAE-flow-action-FW-resou.patch	2023-06-25 14:31:58.345773900 +0800
@@ -1 +1 @@
-From cf1e1a8e869b49ac9e2e097bbd272e94cc4f2c74 Mon Sep 17 00:00:00 2001
+From 88cf99ed018ef7ea2e7fdd29687835af71032806 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit cf1e1a8e869b49ac9e2e097bbd272e94cc4f2c74 ]
@@ -12 +14,0 @@
-Cc: stable at dpdk.org
@@ -28 +30 @@
-index 034fb27843..863dbecdb0 100644
+index 8d8c19d582..73f729c4c6 100644
@@ -31 +33 @@
-@@ -301,6 +301,7 @@ Deepak Khandelwal <deepak.khandelwal at intel.com>
+@@ -298,6 +298,7 @@ Deepak Khandelwal <deepak.khandelwal at intel.com>
@@ -125 +127 @@
-index e5e9257998..60b9fdc290 100644
+index 29b8bb9e25..c7d28eae71 100644


More information about the stable mailing list