From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 4BC9637B2 for ; Wed, 20 Apr 2016 14:53:31 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 20 Apr 2016 05:53:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,509,1455004800"; d="scan'208";a="962686266" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 20 Apr 2016 05:53:12 -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 u3KCrA0L027572; Wed, 20 Apr 2016 13:53:10 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id u3KCrApR024799; Wed, 20 Apr 2016 13:53:10 +0100 Received: (from bairemon@localhost) by sivswdev01.ir.intel.com with id u3KCrA9V024795; Wed, 20 Apr 2016 13:53:10 +0100 From: Bernard Iremonger To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, Bernard Iremonger Date: Wed, 20 Apr 2016 13:52:59 +0100 Message-Id: <1461156779-24737-5-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1461156779-24737-1-git-send-email-bernard.iremonger@intel.com> References: <1461156779-24737-1-git-send-email-bernard.iremonger@intel.com> Subject: [dpdk-dev] [PATCH 4/4] testpmd: reconfigure forwarding after changing portlist 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: Wed, 20 Apr 2016 12:53:31 -0000 Set nb_fwd_ports to zero on quit. Check portlist has been set before displaying forwarding configuration. Fixes: d3a274ce9dee ("app/testpmd: handle SIGINT and SIGTERM") Fixes: af75078fece3 ("first public release") Signed-off-by: Bernard Iremonger --- app/test-pmd/config.c | 8 ++++++-- app/test-pmd/testpmd.c | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index db6b52b..ff040d1 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 @@ -1529,6 +1531,8 @@ set_fwd_ports_list(unsigned int *portlist, unsigned int nb_pt) (unsigned int) nb_fwd_ports, nb_pt); nb_fwd_ports = (portid_t) nb_pt; } + + fwd_config_setup(); } void diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 7ccafd3..11e7fe0 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1560,6 +1560,7 @@ pmd_test_exit(void) if (ports != NULL) { no_link_check = 1; + nb_fwd_ports = 0; FOREACH_PORT(pt_id, ports) { printf("\nShutting down port %d...\n", pt_id); fflush(stdout); -- 2.6.3