From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E11F8A04B5; Tue, 27 Oct 2020 07:42:56 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 962702BD5; Tue, 27 Oct 2020 07:42:54 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 29C9129C6; Tue, 27 Oct 2020 07:42:52 +0100 (CET) IronPort-SDR: rVGmd7knGLPPgqCGgusRn2s6S8rSn7NJ2dHwiI/u4tu3g/OE5GqAc765R2cHEy4BrIvtLcTYv4 5wEKsiZeDfyQ== X-IronPort-AV: E=McAfee;i="6000,8403,9786"; a="155813641" X-IronPort-AV: E=Sophos;i="5.77,422,1596524400"; d="scan'208";a="155813641" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2020 23:42:51 -0700 IronPort-SDR: 9VLJXTe8qhezUXnLasOxiY5Nw4g5DLjzZ7dVEIIocL1pAisKR+3Q1kNtMboZyU1og2/dG+ZBAd q3su8ilwNQqA== X-IronPort-AV: E=Sophos;i="5.77,422,1596524400"; d="scan'208";a="535670613" Received: from zhoudada.sh.intel.com ([10.240.183.54]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2020 23:42:49 -0700 From: Zhou Zhenghua To: Wenzhuo Lu , Beilei Xing , Bernard Iremonger Cc: dev@dpdk.org, Zhou Zhenghua , stable@dpdk.org Date: Tue, 27 Oct 2020 06:42:52 +0000 Message-Id: <20201027064252.9624-1-zhenghuax.zhou@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] app/testpmd: don't allow to dynamic change nbcore X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When changing the number of forwarding cores in runtime, two issues may be encountered: - If the setting nbcore little than current nbcore, the forwarding thread will still running on the extra cores. Therefore, trying to stop forwarding will hang testpmd, since it will wait for the extra cores to stop. - If the setting nbcore greate than actual nbcore, the newly added cores are not allocated resources. This will face the problem of dynamic resource allocation, so it's not allow to changes nbcore number when forwarding is running. Fixes: 0c0db76f42ed ("app/testpmd: separate forward config setup from display") Cc: bernard.iremonger@intel.com Cc: stable@dpdk.org Signed-off-by: Zhou Zhenghua --- app/test-pmd/config.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 1668ae323..e9245053d 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -3504,6 +3504,10 @@ set_fwd_lcores_mask(uint64_t lcoremask) void set_fwd_lcores_number(uint16_t nb_lc) { + if (test_done == 0) { + printf("Please stop forwarding first\n"); + return; + } if (nb_lc > nb_cfg_lcores) { printf("nb fwd cores %u > %u (max. number of configured " "lcores) - ignored\n", -- 2.17.1