From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 6279B37B8 for ; Sun, 12 Jun 2016 17:23:33 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 12 Jun 2016 08:23:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,462,1459839600"; d="scan'208";a="826523524" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga003.jf.intel.com with ESMTP; 12 Jun 2016 08:23:32 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u5CFNVb5023285; Sun, 12 Jun 2016 16:23:31 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id u5CFNVvl015560; Sun, 12 Jun 2016 16:23:31 +0100 Received: (from bairemon@localhost) by sivswdev01.ir.intel.com with id u5CFNVK6015556; Sun, 12 Jun 2016 16:23:31 +0100 From: Bernard Iremonger To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, Bernard Iremonger Date: Sun, 12 Jun 2016 16:23:12 +0100 Message-Id: <1465744997-15487-5-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1465744997-15487-1-git-send-email-bernard.iremonger@intel.com> References: <1462462795-18767-1-git-send-email-bernard.iremonger@intel.com> <1465744997-15487-1-git-send-email-bernard.iremonger@intel.com> Subject: [dpdk-dev] [PATCH v3 4/9] app/testpmd: remove fwd_config_setup from fwd_config_display 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: , X-List-Received-Date: Sun, 12 Jun 2016 15:23:33 -0000 Remove fwd_config_setup from fwd_config_display and check that forwarding has been setup before displaying forwarding configuration. Add call to fwd_config_setup for corelist, coremask, nbcore setup. Add call to fwd_config_setup for portlist, portmask, nbport setup. Signed-off-by: Bernard Iremonger --- app/test-pmd/cmdline.c | 23 ++++++++++++++++------- app/test-pmd/config.c | 6 ++++-- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index fd389ac..2c2a0c7 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -2520,16 +2520,20 @@ static void cmd_set_list_parsed(void *parsed_result, nb_item = parse_item_list(res->list_of_items, "core", RTE_MAX_LCORE, parsed_items.lcorelist, 1); - if (nb_item > 0) + if (nb_item > 0) { set_fwd_lcores_list(parsed_items.lcorelist, nb_item); + fwd_config_setup(); + } return; } if (!strcmp(res->list_name, "portlist")) { nb_item = parse_item_list(res->list_of_items, "port", RTE_MAX_ETHPORTS, parsed_items.portlist, 1); - if (nb_item > 0) + if (nb_item > 0) { set_fwd_ports_list(parsed_items.portlist, nb_item); + fwd_config_setup(); + } } } @@ -2573,10 +2577,13 @@ static void cmd_set_mask_parsed(void *parsed_result, printf("Please stop forwarding first\n"); return; } - if (!strcmp(res->mask, "coremask")) + if (!strcmp(res->mask, "coremask")) { set_fwd_lcores_mask(res->hexavalue); - else if (!strcmp(res->mask, "portmask")) + fwd_config_setup(); + } else if (!strcmp(res->mask, "portmask")) { set_fwd_ports_mask(res->hexavalue); + fwd_config_setup(); + } } cmdline_parse_token_string_t cmd_setmask_set = @@ -2613,11 +2620,13 @@ static void cmd_set_parsed(void *parsed_result, __attribute__((unused)) void *data) { struct cmd_set_result *res = parsed_result; - if (!strcmp(res->what, "nbport")) + if (!strcmp(res->what, "nbport")) { set_fwd_ports_number(res->value); - else if (!strcmp(res->what, "nbcore")) + fwd_config_setup(); + } else if (!strcmp(res->what, "nbcore")) { set_fwd_lcores_number(res->value); - else if (!strcmp(res->what, "burst")) + fwd_config_setup(); + } else if (!strcmp(res->what, "burst")) set_nb_pkt_per_burst(res->value); else if (!strcmp(res->what, "verbose")) set_verbose_level(res->value); diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index f434999..8ef9c85 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1424,8 +1424,10 @@ pkt_fwd_config_display(struct fwd_config *cfg) void fwd_config_display(void) { - fwd_config_setup(); - pkt_fwd_config_display(&cur_fwd_config); + if (cur_fwd_config.nb_fwd_ports) + pkt_fwd_config_display(&cur_fwd_config); + else + printf("Please set portlist first\n"); } int -- 2.6.3