From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by dpdk.org (Postfix) with ESMTP id EAB295A74 for ; Thu, 5 Mar 2015 07:23:32 +0100 (CET) Received: by pabrd3 with SMTP id rd3so6437812pab.6 for ; Wed, 04 Mar 2015 22:23:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=973Ix39GfbO9bZBNJhb3rifjJBKSlF6JyHmH5OfqiiU=; b=S7CNSy3bof0jKqKGQJrIgtbtB6ZIfkIyAHHweEjUsSCv+w369uQB9TAqakAh6mWiO5 JpB+SrGBpZX8aWqoQ3cD0ISA5zxTz6X75RBx3rQx7xRp8R+s09h7jndP0elQtI6qmiuM X2oWjSMfv3/cMAXf0B7DxKxntuqvcvvG+6C/q+VlMB/xsaC5Lr7uiKv1F7h6F8qkbp86 ywIRYszmz6fiR2aH3agA8Tjajjx3Rt6/l5McRfw2mOXtfLJYVl154I5LSsEbR5aFbMXo BFV5kTibVVVLIGV85a2SWEw0Ojx5otVzYHGNu0dSTgWv9v22znNykxlxNVC7Krg11T01 tPFA== X-Gm-Message-State: ALoCoQmMmHNbPLG9Gkrv7AgwdwaUSP+SQWTCMNBkqrr6rqz8SRm+1IOqykpCGTkXPbWlg3FOC+3G X-Received: by 10.70.40.237 with SMTP id a13mr13408324pdl.82.1425536612201; Wed, 04 Mar 2015 22:23:32 -0800 (PST) Received: from [10.16.129.101] (napt.igel.co.jp. [219.106.231.132]) by mx.google.com with ESMTPSA id g11sm5876099pat.24.2015.03.04.22.23.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2015 22:23:31 -0800 (PST) Message-ID: <54F7F660.8060609@igel.co.jp> Date: Thu, 05 Mar 2015 15:23:28 +0900 From: Tetsuya Mukawa User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: "De Lara Guarch, Pablo" 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: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: "dev@dpdk.org" 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: Thu, 05 Mar 2015 06:23:33 -0000 On 2015/03/04 0:54, De Lara Guarch, Pablo wrote: > 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 >> >> 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=eth0) >> - port_id: port identifier >> >> v15: >> - Replace rte_eal_dev_attach() by rte_eth_dev_attach() >> - Replace rte_eal_dev_detach() by rte_eth_dev_detach() >> >> 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. >> >> 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"); >> >> - for (pi = 0; pi < nb_ports; pi++) { >> - if (pid < nb_ports && pid != pi) >> + FOREACH_PORT(pi, ports) { >> + if (!port_id_is_invalid(pid, DISABLED_WARN) && pid != pi) > If using "port stop all", this function does not work as it should. > Problem is that pid = RTE_PORT_ALL = 255, and then ports[255].enabled is undefined, > 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? Hi Pablo, Thanks for reporting. Yes, it should be fixed. Could you please check a patch I will send later? I'll fix it same as start_port(). Thanks, Tetsuya > > Thanks, > Pablo > >> continue; >> >> port = &ports[pi]; >> @@ -1463,7 +1514,7 @@ stop_port(portid_t pid) >> need_check_link_status = 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); >> >> printf("Done\n"); >> }