From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 8F5875A83 for ; Tue, 3 Mar 2015 16:54:57 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 03 Mar 2015 07:54:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,682,1418112000"; d="scan'208";a="686215412" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by fmsmga002.fm.intel.com with ESMTP; 03 Mar 2015 07:54:54 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.218]) by IRSMSX107.ger.corp.intel.com ([169.254.10.35]) with mapi id 14.03.0195.001; Tue, 3 Mar 2015 15:54:54 +0000 From: "De Lara Guarch, Pablo" To: Tetsuya Mukawa , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v15] testpmd: Add port hotplug support Thread-Index: AQHQUTIpKDuY5zA2XU+p61HcBjxOV50K755g Date: Tue, 3 Mar 2015 15:54:53 +0000 Message-ID: References: <1424837093-5661-13-git-send-email-mukawa@igel.co.jp> <1424892749-31862-1-git-send-email-mukawa@igel.co.jp> <1424892749-31862-16-git-send-email-mukawa@igel.co.jp> In-Reply-To: <1424892749-31862-16-git-send-email-mukawa@igel.co.jp> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v15] testpmd: Add port hotplug support 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: Tue, 03 Mar 2015 15:54:58 -0000 Hi Tetsuya, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Tetsuya Mukawa > Sent: Wednesday, February 25, 2015 7:32 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v15] testpmd: Add port hotplug support >=20 > The patch introduces following commands. > - port attach [ident] > - port detach [port_id] > - attach: attaching a port > - detach: detaching a port > - ident: pci address of physical device. > Or device name and parameters of virtual device. > (ex. 0000:02:00.0, eth_pcap0,iface=3Deth0) > - port_id: port identifier >=20 > v15: > - Replace rte_eal_dev_attach() by rte_eth_dev_attach() > - Replace rte_eal_dev_detach() by rte_eth_dev_detach() >=20 > v7: > - Fix doc. > (Thanks to Iremonger, Bernard) > - Fix port checking implementation of star_port(); > (Thanks to Qiu, Michael) > v5: > - Add testpmd documentation. > (Thanks to Iremonger, Bernard) > v4: > - Fix strings of command help. >=20 > Signed-off-by: Tetsuya Mukawa > --- > app/test-pmd/cmdline.c | 137 +++++++++++++++---- > app/test-pmd/config.c | 102 ++++++++------ > app/test-pmd/parameters.c | 22 ++- > app/test-pmd/testpmd.c | 199 +++++++++++++++++++++-= ------ > app/test-pmd/testpmd.h | 18 ++- > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 57 ++++++++ [...] > @@ -1446,8 +1497,8 @@ stop_port(portid_t pid) > } > printf("Stopping ports...\n"); >=20 > - for (pi =3D 0; pi < nb_ports; pi++) { > - if (pid < nb_ports && pid !=3D pi) > + FOREACH_PORT(pi, ports) { > + if (!port_id_is_invalid(pid, DISABLED_WARN) && pid !=3D pi) If using "port stop all", this function does not work as it should. Problem is that pid =3D RTE_PORT_ALL =3D 255, and then ports[255].enabled i= s undefined,=20 as ports array is allocated only for RTE_MAX_ETHPORTS (32 by default). So, the solution could be either increasing the ports array to 256 items, or check if we are passing RTE_PORT_ALL in pid. What do you think? Thanks, Pablo > continue; >=20 > port =3D &ports[pi]; > @@ -1463,7 +1514,7 @@ stop_port(portid_t pid) > need_check_link_status =3D 1; > } > if (need_check_link_status && !no_link_check) > - check_all_ports_link_status(nb_ports, RTE_PORT_ALL); > + check_all_ports_link_status(RTE_PORT_ALL); >=20 > printf("Done\n"); > }