From patchwork Tue Feb 10 14:53:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "De Lara Guarch, Pablo" X-Patchwork-Id: 3115 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 1DE333208; Tue, 10 Feb 2015 15:53:34 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 0A9EFDE0 for ; Tue, 10 Feb 2015 15:53:31 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 10 Feb 2015 06:53:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,551,1418112000"; d="scan'208";a="664317647" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 10 Feb 2015 06:53:18 -0800 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t1AErHde021404 for ; Tue, 10 Feb 2015 14:53:17 GMT Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t1AErHCL022051 for ; Tue, 10 Feb 2015 14:53:17 GMT Received: (from pdelarax@localhost) by sivswdev02.ir.intel.com with id t1AErHQZ022047 for dev@dpdk.org; Tue, 10 Feb 2015 14:53:17 GMT From: Pablo de Lara To: dev@dpdk.org Date: Tue, 10 Feb 2015 14:53:17 +0000 Message-Id: <1423579997-22014-1-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] testpmd: force user to stop forwarding when changing port/core list X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Testpmd has the capability of changing the forwarding cores and ports in runtime. If these are changed when forwarding, two issues may be encountered: - If "show config fwd" is used, changes made in the core list are applied. Therefore, trying to stop forwarding may hang testpmd, since it could be waiting for cores to stop that are not actually running anything - If the port list is changed, when stopping forwarding, it may miss the stats of some of the ports that were actually being used. Signed-off-by: Pablo de Lara Acked-by: Helin Zhang --- app/test-pmd/cmdline.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 590e427..46d4bf9 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -2316,6 +2316,11 @@ static void cmd_set_list_parsed(void *parsed_result, } parsed_items; unsigned int nb_item; + if (test_done == 0) { + printf("Please stop forwarding first\n"); + return; + } + res = parsed_result; if (!strcmp(res->list_name, "corelist")) { nb_item = parse_item_list(res->list_of_items, "core", @@ -2370,6 +2375,10 @@ static void cmd_set_mask_parsed(void *parsed_result, { struct cmd_setmask_result *res = parsed_result; + if (test_done == 0) { + printf("Please stop forwarding first\n"); + return; + } if (!strcmp(res->mask, "coremask")) set_fwd_lcores_mask(res->hexavalue); else if (!strcmp(res->mask, "portmask"))