patch 'common/cnxk: fix flow aging on application exit' has been queued to stable release 23.11.2

Xueming Li xuemingl at nvidia.com
Mon Aug 12 14:48:03 CEST 2024


Hi,

FYI, your patch has been queued to stable release 23.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/14/24. 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=23.11-staging

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

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From d859544e45c512464d85761a7d3a404c2972cd93 Mon Sep 17 00:00:00 2001
From: Kiran Kumar K <kirankumark at marvell.com>
Date: Mon, 17 Jun 2024 16:57:54 +0530
Subject: [PATCH] common/cnxk: fix flow aging on application exit
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit a4878294318eda0ea242562419a5797bf5440862 ]

If flow aging is enabled application termination may take time
equivalent to aging timeout. This is because on termination flow
thread uses a sleep call which is uninterruptible.

Fixes: 357f5ebc8a24 ("common/cnxk: support flow aging")

Signed-off-by: Kiran Kumar K <kirankumark at marvell.com>
Signed-off-by: Harman Kalra <hkalra at marvell.com>
---
 drivers/common/cnxk/roc_npc_aging.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/common/cnxk/roc_npc_aging.c b/drivers/common/cnxk/roc_npc_aging.c
index 15f6e61d76..1e85033e2a 100644
--- a/drivers/common/cnxk/roc_npc_aging.c
+++ b/drivers/common/cnxk/roc_npc_aging.c
@@ -133,6 +133,21 @@ exit:
 	return rc;
 }
 
+static void
+npc_age_wait_until(struct roc_npc_flow_age *flow_age)
+{
+#define NPC_AGE_WAIT_TIMEOUT_MS 1000
+#define NPC_AGE_WAIT_TIMEOUT_US (NPC_AGE_WAIT_TIMEOUT_MS * NPC_AGE_WAIT_TIMEOUT_MS)
+	uint64_t timeout = 0;
+	uint64_t sleep = 10 * NPC_AGE_WAIT_TIMEOUT_MS;
+
+	do {
+		plt_delay_us(sleep);
+		timeout += sleep;
+	} while (!flow_age->aged_flows_get_thread_exit &&
+		 (timeout < (flow_age->aging_poll_freq * NPC_AGE_WAIT_TIMEOUT_US)));
+}
+
 uint32_t
 npc_aged_flows_get(void *args)
 {
@@ -197,7 +212,7 @@ npc_aged_flows_get(void *args)
 		plt_seqcount_write_end(&flow_age->seq_cnt);
 
 lbl_sleep:
-		sleep(flow_age->aging_poll_freq);
+		npc_age_wait_until(flow_age);
 	}
 
 	return 0;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-08-12 20:44:02.844139342 +0800
+++ 0006-common-cnxk-fix-flow-aging-on-application-exit.patch	2024-08-12 20:44:01.895069255 +0800
@@ -1 +1 @@
-From a4878294318eda0ea242562419a5797bf5440862 Mon Sep 17 00:00:00 2001
+From d859544e45c512464d85761a7d3a404c2972cd93 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit a4878294318eda0ea242562419a5797bf5440862 ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list