[PATCH 1/2] app/testpmd: fix quit testpmd with vfs and pf
wenxuanx.wu at intel.com
wenxuanx.wu at intel.com
Thu Feb 17 11:14:27 CET 2022
From: wenxuan wu <wenxuanx.wu at intel.com>
When testpmd startups with pf and vfs,this error occurs when quitting,
results in pf is released before vfs ,so the vf would access an
freed heap memory.
The solution is that release our allocated ports in reverse
order,add two macros RTE_ETH_FOREACH_DEV_REVERSE_OWNED_BY and
RTE_ETH_FOREACH_DEV_REVERSE,which would be used in quit procedure of
testpmd, error is fixed.
Fixes: d3a274ce9dee ("app/testpmd: handle SIGINT and SIGTERM")
Cc: stable at dpdk.org
Signed-off-by: wenxuan wu <wenxuanx.wu at intel.com>
---
app/test-pmd/testpmd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index e1da961311..698b6d8cc4 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3384,12 +3384,12 @@ pmd_test_exit(void)
#endif
if (ports != NULL) {
no_link_check = 1;
- RTE_ETH_FOREACH_DEV(pt_id) {
+ RTE_ETH_FOREACH_DEV_REVERSE(pt_id) {
printf("\nStopping port %d...\n", pt_id);
fflush(stdout);
stop_port(pt_id);
}
- RTE_ETH_FOREACH_DEV(pt_id) {
+ RTE_ETH_FOREACH_DEV_REVERSE(pt_id) {
printf("\nShutting down port %d...\n", pt_id);
fflush(stdout);
close_port(pt_id);
--
2.25.1
More information about the dev
mailing list