From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 92E64A00E6 for ; Fri, 17 May 2019 03:12:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 59FA32B86; Fri, 17 May 2019 03:12:55 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 7598B2B86 for ; Fri, 17 May 2019 03:12:53 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 May 2019 18:12:52 -0700 X-ExtLoop1: 1 Received: from npg-dpdk-cvl-simeisu-116d180.sh.intel.com ([10.67.116.180]) by orsmga004.jf.intel.com with ESMTP; 16 May 2019 18:12:51 -0700 From: simei To: beilei.xing@intel.com Cc: simei , stable@dpdk.org Date: Fri, 17 May 2019 08:31:25 +0800 Message-Id: <1558053085-142955-1-git-send-email-simei.su@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-stable] [PATCH] app/testpmd: fix core dump X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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@dpdk.org Signed-off-by: Simei Su --- 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