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

Kevin Traynor ktraynor at redhat.com
Thu Jul 20 17:17:41 CEST 2023


Hi,

FYI, your patch has been queued to stable release 21.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/25/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://github.com/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
>From fbfa671cbf1613e01b5fe25dd721821a9d768f7c 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

[ 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 575405b454..5e85db906b 100644
--- a/.mailmap
+++ b/.mailmap
@@ -298,4 +298,5 @@ 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>
diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h
index d70060c18b..398eb8dbd2 100644
--- a/drivers/common/sfc_efx/base/efx.h
+++ b/drivers/common/sfc_efx/base/efx.h
@@ -4702,4 +4702,18 @@ efx_mae_action_set_fill_in_counter_id(
 	__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 {
diff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h
index ba00eeeb47..99a6a732f4 100644
--- a/drivers/common/sfc_efx/base/efx_impl.h
+++ b/drivers/common/sfc_efx/base/efx_impl.h
@@ -1800,4 +1800,8 @@ typedef struct efx_mae_action_vlan_push_s {
 } 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;
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
@@ -1395,8 +1395,5 @@ efx_mae_action_set_spec_init(
 	}
 
-	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);
 
 	/*
@@ -3028,4 +3025,14 @@ fail1:
 }
 
+					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(
diff --git a/drivers/common/sfc_efx/version.map b/drivers/common/sfc_efx/version.map
index 9ce76ea6e8..9387bc6ce8 100644
--- a/drivers/common/sfc_efx/version.map
+++ b/drivers/common/sfc_efx/version.map
@@ -90,4 +90,5 @@ INTERNAL {
 	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;
diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index 733105bc6e..76b7c59ac0 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -1181,4 +1181,6 @@ 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) {
-- 
2.41.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-07-20 16:17:58.676024334 +0100
+++ 0030-net-sfc-invalidate-dangling-MAE-flow-action-FW-resou.patch	2023-07-20 16:17:54.555750075 +0100
@@ -1 +1 @@
-From cf1e1a8e869b49ac9e2e097bbd272e94cc4f2c74 Mon Sep 17 00:00:00 2001
+From fbfa671cbf1613e01b5fe25dd721821a9d768f7c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit cf1e1a8e869b49ac9e2e097bbd272e94cc4f2c74 ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -28 +29 @@
-index 034fb27843..863dbecdb0 100644
+index 575405b454..5e85db906b 100644
@@ -31 +32 @@
-@@ -302,4 +302,5 @@ Deepak Kumar Jain <deepak.k.jain at intel.com>
+@@ -298,4 +298,5 @@ Deepak Kumar Jain <deepak.k.jain at intel.com>
@@ -38 +39 @@
-index f4fa88f169..49e29dcc1c 100644
+index d70060c18b..398eb8dbd2 100644
@@ -41 +42 @@
-@@ -4749,4 +4749,18 @@ efx_mae_action_set_fill_in_counter_id(
+@@ -4702,4 +4702,18 @@ efx_mae_action_set_fill_in_counter_id(
@@ -61 +62 @@
-index 9a5d465fa0..45e99d01c5 100644
+index ba00eeeb47..99a6a732f4 100644
@@ -64 +65 @@
-@@ -1801,4 +1801,8 @@ typedef struct efx_mae_action_vlan_push_s {
+@@ -1800,4 +1800,8 @@ typedef struct efx_mae_action_vlan_push_s {
@@ -103 +104 @@
-index aabc354118..d9b04a611d 100644
+index 9ce76ea6e8..9387bc6ce8 100644
@@ -113 +114 @@
-index e5e9257998..60b9fdc290 100644
+index 733105bc6e..76b7c59ac0 100644



More information about the stable mailing list