[RFC,V2,2/2] app/testpmd: fix starting failed with queue-stats-mapping
diff mbox series

Message ID 1603182389-10087-3-git-send-email-humin29@huawei.com
State RFC
Delegated to: Ferruh Yigit
Headers show
Series
  • fix queue stats mapping
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Min Hu (Connor) Oct. 20, 2020, 8:26 a.m. UTC
From: Huisong Li <lihuisong@huawei.com>

testpmd fails to start with "--rx-queue-stats-mapping" and
"--tx-queue-stats-mapping", which is caused by the failure and exit of
'map_port_queue_stats_mapping_registers' function. By default,
the configuration of queue statistics mapping in the initialization
process is implemented in the 'init_port_config' function. However,
the dev_configure interface is not called to configure the NIC
and dev->data-nb_rx/tx_queues is zero. As a result,
'rte_eth_dev_set_tx/rx_queue_stats_mapping' function fails to verify
the queue_id. Therefore, it is necessary to move
'map_port_queue_stats_mapping_registers' from 'init_port_config'
to 'start_port' function.

Fixes: 013af9b6b64f6e7 ("app/testpmd: various updates")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
 app/test-pmd/testpmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 86e3271..e4fe2a6 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2742,6 +2742,7 @@  start_port(portid_t pid)
 		need_check_link_status = 1;
 
 		pl[cfg_pi++] = pi;
+		map_port_queue_stats_mapping_registers(pi, port);
 	}
 
 	if (need_check_link_status == 1 && !no_link_check)
@@ -3600,7 +3601,6 @@  init_port_config(void)
 		if (ret != 0)
 			return;
 
-		map_port_queue_stats_mapping_registers(pid, port);
 #if defined RTE_LIBRTE_IXGBE_PMD && defined RTE_LIBRTE_IXGBE_BYPASS
 		rte_pmd_ixgbe_bypass_init(pid);
 #endif