[dpdk-stable] [PATCH] app/testpmd: fix core dump

simei simei.su at intel.com
Fri May 17 02:31:25 CEST 2019


This patch avoids NULL pointer exception when starting VF testpmd
with setting rx queue number and tx queue number with 0.

Fixes: ce8d561418d4 ("app/testpmd: add port configuration settings")
Cc: stable at dpdk.org

Signed-off-by: Simei Su <simei.su at intel.com>
---
 app/test-pmd/cmdline.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index c1042dd..ab24c86 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1829,7 +1829,7 @@ struct cmd_config_rx_tx {
 		return;
 	}
 	if (!strcmp(res->name, "rxq")) {
-		if (!res->value && !nb_txq) {
+		if (!res->value && nb_txq) {
 			printf("Warning: Either rx or tx queues should be non zero\n");
 			return;
 		}
@@ -1838,7 +1838,7 @@ struct cmd_config_rx_tx {
 		nb_rxq = res->value;
 	}
 	else if (!strcmp(res->name, "txq")) {
-		if (!res->value && !nb_rxq) {
+		if (!res->value && nb_rxq) {
 			printf("Warning: Either rx or tx queues should be non zero\n");
 			return;
 		}
-- 
1.8.3.1



More information about the stable mailing list