patch 'app/testpmd: cleanup port resources after implicit close' has been queued to stable release 21.11.2
Kevin Traynor
ktraynor at redhat.com
Tue Jun 28 17:19:21 CEST 2022
Hi,
FYI, your patch has been queued to stable release 21.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 06/30/22. 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/2a4ad9bb84854736a79e3264f9b5a630f036407c
Thanks.
Kevin
---
>From 2a4ad9bb84854736a79e3264f9b5a630f036407c Mon Sep 17 00:00:00 2001
From: Dmitry Kozlyuk <dkozlyuk at nvidia.com>
Date: Thu, 16 Jun 2022 02:12:12 +0300
Subject: [PATCH] app/testpmd: cleanup port resources after implicit close
[ upstream commit 4b27989d24f4d662f95bb42b5ad892c9a5d9b60f ]
When a port is closed implicitly by the PMD, for example,
if it is a representor port and its master port is detached,
flow indirect actions could remain with their handles no longer valid.
If a newly attached device is assigned the same ID as the closed port,
those indirect actions became accessible again.
Any attempt to use them resulted in an undefined behavior.
Flow flex items had no such issue on close, but had it on detach.
Introduce flush_port_owned_resources() function for consistent
cleanup and call it when a port is closed or detached.
Make it flush flow rules and multicast addresses too
because they logically belong to the port being removed.
Fixes: 55509e3a49fb ("app/testpmd: support shared flow action")
Fixes: 59f3a8acbcdb ("app/testpmd: add flex item commands")
Signed-off-by: Dmitry Kozlyuk <dkozlyuk at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
---
app/test-pmd/testpmd.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 389b7c3c69..3699c5fd64 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3204,4 +3204,13 @@ remove_invalid_ports(void)
}
+static void
+flush_port_owned_resources(portid_t pi)
+{
+ mcast_addr_pool_destroy(pi);
+ port_flow_flush(pi);
+ port_flex_item_flush(pi);
+ port_action_handle_flush(pi);
+}
+
static void
clear_bonding_slave_device(portid_t *slave_pids, uint16_t num_slaves)
@@ -3268,8 +3277,5 @@ close_port(portid_t pid)
if (is_proc_primary()) {
- mcast_addr_pool_destroy(pi);
- port_flow_flush(pi);
- port_flex_item_flush(pi);
- port_action_handle_flush(pi);
+ flush_port_owned_resources(pi);
#ifdef RTE_NET_BOND
if (port->bond_flag == 1)
@@ -3428,5 +3434,5 @@ detach_device(struct rte_device *dev)
return;
}
- port_flow_flush(sibling);
+ flush_port_owned_resources(sibling);
}
}
@@ -3495,5 +3501,5 @@ detach_devargs(char *identifier)
return;
}
- port_flow_flush(port_id);
+ flush_port_owned_resources(port_id);
}
}
--
2.34.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2022-06-28 16:18:04.251250473 +0100
+++ 0009-app-testpmd-cleanup-port-resources-after-implicit-cl.patch 2022-06-28 16:18:04.010387176 +0100
@@ -1 +1 @@
-From 4b27989d24f4d662f95bb42b5ad892c9a5d9b60f Mon Sep 17 00:00:00 2001
+From 2a4ad9bb84854736a79e3264f9b5a630f036407c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4b27989d24f4d662f95bb42b5ad892c9a5d9b60f ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org
@@ -31 +32 @@
-index e6321bdedb..addcbcac85 100644
+index 389b7c3c69..3699c5fd64 100644
@@ -34 +35 @@
-@@ -3207,4 +3207,13 @@ remove_invalid_ports(void)
+@@ -3204,4 +3204,13 @@ remove_invalid_ports(void)
@@ -48 +49 @@
-@@ -3271,8 +3280,5 @@ close_port(portid_t pid)
+@@ -3268,8 +3277,5 @@ close_port(portid_t pid)
@@ -58 +59 @@
-@@ -3431,5 +3437,5 @@ detach_device(struct rte_device *dev)
+@@ -3428,5 +3434,5 @@ detach_device(struct rte_device *dev)
@@ -65 +66 @@
-@@ -3498,5 +3504,5 @@ detach_devargs(char *identifier)
+@@ -3495,5 +3501,5 @@ detach_devargs(char *identifier)
More information about the stable
mailing list