From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <wei.dai@intel.com>
Received: from mga04.intel.com (mga04.intel.com [192.55.52.120])
 by dpdk.org (Postfix) with ESMTP id C280B2C57;
 Fri, 12 Jan 2018 09:26:19 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga005.jf.intel.com ([10.7.209.41])
 by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 12 Jan 2018 00:26:18 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.46,348,1511856000"; d="scan'208";a="193294817"
Received: from dpdk6.bj.intel.com ([172.16.182.87])
 by orsmga005.jf.intel.com with ESMTP; 12 Jan 2018 00:26:16 -0800
From: Wei Dai <wei.dai@intel.com>
To: yuan.peng@intel.com, konstantin.ananyev@intel.com, wenzhuo.lu@intel.com,
 beilei.xing@intel.com
Cc: dev@dpdk.org,
	Wei Dai <wei.dai@intel.com>,
	stable@dpdk.org
Date: Fri, 12 Jan 2018 16:10:01 +0800
Message-Id: <1515744603-60457-1-git-send-email-wei.dai@intel.com>
X-Mailer: git-send-email 2.7.5
In-Reply-To: <1515646700-56892-1-git-send-email-wei.dai@intel.com>
References: <1515646700-56892-1-git-send-email-wei.dai@intel.com>
Subject: [dpdk-stable] [PATCH v5 0/2] app/testpmd: fix invalid rxq and txq
	nubmer settings
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 12 Jan 2018 08:26:20 -0000

If an invlaid number of RX or TX queues is configured from testpmd
command like "port config all rxq number" or "port config all txq number".
or from --rxq and --txq in the command to start testpmd. The global variable
nb_rxq or nb_txq is updated by the invalid input.
This can cause testpmd crash. For example, if the maximum number of
RX or TX queues is 4, testpmd will crash after running commands
"port config all rxq 5", "port config all txq 5" and "start" in sequence.

With these 2 patches, if an invalid input is detected, it is refused and
testpmd keeps last correct values of  nb_rxq and nb_txq.

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

Signed-off-by: Wei Dai <wei.dai@intel.com>
Aced-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

---
v5: fix building failure with -Werror=maybe-uninitialized by gcc 5.3.1
    fix typo error

v4: update git log message and rename 2 new added functions

v3: follow the guide from Konstantin to use functions to check
    input rxq and txq instead of usage of new added global variables.

v2: fix a bug in v1


Wei Dai (2):
  app/testpmd: fix invalid rxq number setting
  app/testpmd: fix invalid txq number setting

 app/test-pmd/cmdline.c    |  4 +++
 app/test-pmd/parameters.c | 13 +++----
 app/test-pmd/testpmd.c    | 92 +++++++++++++++++++++++++++++++++++++++++++++++
 app/test-pmd/testpmd.h    |  5 +++
 4 files changed, 108 insertions(+), 6 deletions(-)

-- 
2.7.5