From: Pablo de Lara Date: Tue, 10 Feb 2015 14:53:17 +0000 (+0000) Subject: app/testpmd: force user to stop forwarding when changing port/core list X-Git-Tag: spdx-start~9768 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e20511e4b2f676bbcc38432edcbb5dbf47eb6a16;p=dpdk.git app/testpmd: force user to stop forwarding when changing port/core list 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 --- diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index d5f31f26a5..516e15ab68 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"))