From patchwork Sun Jun 12 15:23:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Iremonger, Bernard" X-Patchwork-Id: 13473 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 6239E3977; Sun, 12 Jun 2016 17:23:35 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 6118E2BE0 for ; Sun, 12 Jun 2016 17:23:31 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 12 Jun 2016 08:23:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.26,462,1459839600"; d="scan'208"; a="1000374477" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 12 Jun 2016 08:23:31 -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 u5CFNSGc023279; Sun, 12 Jun 2016 16:23:28 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id u5CFNSdn015546; Sun, 12 Jun 2016 16:23:28 +0100 Received: (from bairemon@localhost) by sivswdev01.ir.intel.com with id u5CFNS1N015542; Sun, 12 Jun 2016 16:23:28 +0100 From: Bernard Iremonger To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, Bernard Iremonger Date: Sun, 12 Jun 2016 16:23:10 +0100 Message-Id: <1465744997-15487-3-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 2/9] app/testpmd: don't update fwding config when attaching/detaching a port 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" Remove checks on test_done variable. Remove code to update forwarding configuration. Fixes: edab33b1c01d ("app/testpmd: support port hotplug") Signed-off-by: Bernard Iremonger --- app/test-pmd/testpmd.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index dd6b046..7a1e470 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1517,7 +1517,7 @@ close_port(portid_t pid) void attach_port(char *identifier) { - portid_t i, j, pi = 0; + portid_t pi = 0; printf("Attaching a new port...\n"); @@ -1526,11 +1526,6 @@ attach_port(char *identifier) return; } - if (test_done == 0) { - printf("Please stop forwarding first\n"); - return; - } - if (rte_eth_dev_attach(identifier, &pi)) return; @@ -1540,16 +1535,6 @@ attach_port(char *identifier) nb_ports = rte_eth_dev_count(); - /* set_default_fwd_ports_config(); */ - memset(fwd_ports_ids, 0, sizeof(fwd_ports_ids)); - i = 0; - FOREACH_PORT(j, ports) { - fwd_ports_ids[i] = j; - i++; - } - nb_cfg_ports = nb_ports; - nb_fwd_ports++; - ports[pi].port_status = RTE_PORT_STOPPED; printf("Port %d is attached. Now total ports is %d\n", pi, nb_ports); @@ -1559,7 +1544,6 @@ attach_port(char *identifier) void detach_port(uint8_t port_id) { - portid_t i, pi = 0; char name[RTE_ETH_NAME_MAX_LEN]; printf("Detaching a port...\n"); @@ -1575,16 +1559,6 @@ detach_port(uint8_t port_id) ports[port_id].enabled = 0; nb_ports = rte_eth_dev_count(); - /* set_default_fwd_ports_config(); */ - memset(fwd_ports_ids, 0, sizeof(fwd_ports_ids)); - i = 0; - FOREACH_PORT(pi, ports) { - fwd_ports_ids[i] = pi; - i++; - } - nb_cfg_ports = nb_ports; - nb_fwd_ports--; - printf("Port '%s' is detached. Now total ports is %d\n", name, nb_ports); printf("Done\n");