app/testpmd: fix invalid Tx queue number setting
authorWei Dai <wei.dai@intel.com>
Fri, 12 Jan 2018 11:31:22 +0000 (19:31 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 17 Jan 2018 17:49:38 +0000 (18:49 +0100)
commit36db4f6c70b43f307dd2a1ece19d910a3548349d
tree551386147cb17e7a04b5858421d1c637cf60de27
parent3f7311ba0beee75068c52fe521fff021ff506a14
app/testpmd: fix invalid Tx queue number setting

If an invalid number of TX queues is configured from testpmd run-time
command like "port config all txq number" or from --txq in the command
to start testpmd, the global variable nb_txq is updated by this invalid
value without this patch. It may cause testpmd crash. This patch refuses
invalid txq setting and keeps its last correct value.

Fixes: ce8d561418d4 ("app/testpmd: add port configuration settings")
Cc: stable@dpdk.org
Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
app/test-pmd/cmdline.c
app/test-pmd/parameters.c
app/test-pmd/testpmd.c
app/test-pmd/testpmd.h