DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v2] app/testpmd : fix testpmd quit error
@ 2022-03-04  2:37 wenxuanx.wu
  2022-03-04 10:12 ` Zhang, Yuying
  2022-03-04 16:18 ` Ferruh Yigit
  0 siblings, 2 replies; 5+ messages in thread
From: wenxuanx.wu @ 2022-03-04  2:37 UTC (permalink / raw)
  To: qiming.yang, qi.z.zhang, xiaoyun.li, aman.deep.singh, yuying.zhang; +Cc: dev

From: wenxuan wu <wenxuanx.wu@intel.com>

When testpmd use func get_eth_dev_info() while related resource
had been released.

Change the logic of func port_is_bonding_slave, this func 
eth_dev_info_get_print_err while pf is released would result 
in this error. Use ports instead to avoid this bug.

Fixes: 0a0821bcf312 ("app/testpmd: remove most uses of internal ethdev array")
Cc: stable@dpdk.org

Signed-off-by: wenxuan wu <wenxuanx.wu@intel.com>
---
 app/test-pmd/testpmd.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index e1da961311..37038c9183 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3824,19 +3824,9 @@ void clear_port_slave_flag(portid_t slave_pid)
 uint8_t port_is_bonding_slave(portid_t slave_pid)
 {
 	struct rte_port *port;
-	struct rte_eth_dev_info dev_info;
-	int ret;
 
 	port = &ports[slave_pid];
-	ret = eth_dev_info_get_print_err(slave_pid, &dev_info);
-	if (ret != 0) {
-		TESTPMD_LOG(ERR,
-			"Failed to get device info for port id %d,"
-			"cannot determine if the port is a bonded slave",
-			slave_pid);
-		return 0;
-	}
-	if ((*dev_info.dev_flags & RTE_ETH_DEV_BONDED_SLAVE) || (port->slave_flag == 1))
+	if ((*port->dev_info.dev_flags & RTE_ETH_DEV_BONDED_SLAVE) || (port->slave_flag == 1))
 		return 1;
 	return 0;
 }
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-03-10 11:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-04  2:37 [PATCH v2] app/testpmd : fix testpmd quit error wenxuanx.wu
2022-03-04 10:12 ` Zhang, Yuying
2022-03-04 16:18 ` Ferruh Yigit
2022-03-09 10:10   ` Wu, WenxuanX
2022-03-10 11:11     ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).