From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 403E3FE5 for ; Wed, 6 Sep 2017 12:21:20 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id D9BEE21873; Wed, 6 Sep 2017 06:21:19 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 06 Sep 2017 06:21:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=VWEPQb9G4GP+/6i 0kjpFTo3Bx8B1Fi3AL38ukW9YlN8=; b=I3PdfjIQaYvafBXMObTcjAWsp++zMPv GeSn8n19X2hU3qmU+P5Z32orHoDV/T64Tvflg5//2eNyuEeklTiXciLKWAQ6XQP2 UcPk+2z8FarSOuzIHEUVNp5RwAzuiTd3DbLbtm1QJj2O3R7nxCZgVcFNhx+/ukfV a0IsNDuP6FZY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=VWEPQb9G4GP+/6i0kjpFTo3Bx8B1Fi3AL38ukW9YlN8=; b=mRpYgUrw 2+sCsPVa169TRhKbZDpuQk9kHVajlWNOmXFmegl/0E4sq4TgKHGWUKFrUa9MvUVP Bhjnkdw3rNjlTZHCzUkA0y6yyKHhJJEoU4SNJfjDna++Ls5girpBYCMRW0DGquvx cqi9wTddBhJMTPy41FUVFqGP9F2oYLZMx7EhHliT6R6WfbK5kCNDrB3YfoYP7TP+ /PDGBm5qyI2B78nZ+WcQC+dqjADnuJV25VSWx5HgytaheJdGgwMdy8+VTN3VH/Hs t2RQsWyKDyCZmKV5nffjIcizjJX50xXldCHAqORxyWC8vfmTLG0cRY2zciQLnJAl nMnlnx3lVLG4OA== X-ME-Sender: X-Sasl-enc: AszQcCrWk7T/bYKLE/yoIaqOqjgBzZNmbSjwR+aPxHId 1504693279 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 879EA7E101; Wed, 6 Sep 2017 06:21:19 -0400 (EDT) From: Thomas Monjalon To: =?ISO-8859-1?Q?Ga=EBtan?= Rivet , Matan Azrad Cc: Jingjing Wu , dev@dpdk.org, Ori Kam Date: Wed, 06 Sep 2017 12:21:18 +0200 Message-ID: <1766803.K7SpHi0fzz@xps> In-Reply-To: <20170904095231.GD21444@bidouze.vm.6wind.com> References: <1504444747-56298-1-git-send-email-matan@mellanox.com> <20170904095231.GD21444@bidouze.vm.6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] app/testpmd: fix forward port ids setting X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Sep 2017 10:21:20 -0000 04/09/2017 11:52, Ga=EBtan Rivet: > On Mon, Sep 04, 2017 at 09:25:04AM +0000, Matan Azrad wrote: > > From: Ga=EBtan Rivet [mailto:gaetan.rivet@6wind.com] > > > On Sun, Sep 03, 2017 at 04:19:07PM +0300, Matan Azrad wrote: > > > > Hi All > > > > I would like to bring up a discussion to complete this bug fix. > > > > > > > > When user wants to set the list of forwarding ports by "set portlis= t" > > > > (testpmd command line), the testpmd application checks the > > > > availability of the ports by rte_eth_dev_is_valid_port API. > > > > By this way, it gets the DEFERRED port as valid port and will try to > > > > recieve\send packets via this port. > > > > > > > > This scenario will cause the same error as this patch fixes. > > > > > > > > Should testpmd allow user to run traffic by DEFERRED port directly? > > > > > > > > If any application wants to check a port availability for device us= age > > > > (conf\rxtx), Which API should be used? > > > > > > > > According to the patch cb894d99eceb ("ethdev: add deferred > > > > intermediate device state"), DEFERRED ports should be invisible to > > > > application, So maybe the rte_eth_dev_is_valid_port API should be > > > > internal and a new ethdev API should be created for applications. > > > > > > > > What do you think? > > > > > > >=20 > > > I think that regardless of the semantic of the DEFERRED state or any = other > > > port handling, the correct assumption is to consider any port iterate= d over by > > > RTE_ETH_FOREACH_DEV to be the exact set of devices that are supposed = to > > > be usable. In the event of an API evolution regarding port states, th= is macro > > > should remain correct. > > >=20 > > > So I think your fix is correct, and that the implication of > > > RTE_ETH_FOREACH_DEV avoiding DEFERRED devices is correct. > > >=20 > >=20 > > This patch fixes the default forward ports setting (actually when user = don't use --portmask param or "set portlist"), > > But it don't fix the port validation which PMD does for "set portlist" = command. > > So, the discussion is how to fix this port validation. >=20 > You could make a static rte_eth_dev_is_valid_port with a different name, > declare both RTE_ETH_VALID_PORT* macros within rte_ethdev.c > and introduce a new rte_eth_dev_is_valid_port which would restrict > devices to those ATTACHED. >=20 > I'm not sure this would be interesting for applications. Currently this > check is performed internally by the ether layer, I guess most > applications rely on it. Making the "extended" version (ATTACHED + > DEFERRED) private with the strict one public would probably not change > behaviors, thus it would probably have little to no effect. >=20 > So my opinion is "why not, but the risk is adding dead code for no real > benefit". >=20 > > In current code, testpmd uses rte_eth_dev_is_valid_port which return t= he DEFERRED device too for forwarding. > > Should it use the RTE_ETH_FOREACH_DEV iterator for one port validation= ?=20 > > Don't you think we need new API for one port? Please, let's continue this ethdev discussion in a separate thread. I've started a new one: http://dpdk.org/ml/archives/dev/2017-September/074656.html