From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 3F2C91B1C8 for ; Fri, 26 Jan 2018 01:50:18 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jan 2018 16:50:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,414,1511856000"; d="scan'208";a="25541536" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga001.fm.intel.com with ESMTP; 25 Jan 2018 16:50:17 -0800 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 25 Jan 2018 16:50:17 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 25 Jan 2018 16:50:17 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.124]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.130]) with mapi id 14.03.0319.002; Fri, 26 Jan 2018 08:50:15 +0800 From: "Lu, Wenzhuo" To: Matan Azrad , Thomas Monjalon , Gaetan Rivet , "Wu, Jingjing" CC: "dev@dpdk.org" , Neil Horman , "Richardson, Bruce" , "Ananyev, Konstantin" Thread-Topic: [dpdk-dev] [PATCH v5 7/7] app/testpmd: adjust ethdev port ownership Thread-Index: AQHTk5++qA93A4PUNUy/71nGo/KTWaOD1J2Q///riQCAAZOUgA== Date: Fri, 26 Jan 2018 00:50:14 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09093B71CA8B@shsmsx102.ccr.corp.intel.com> References: <1516483468-9048-1-git-send-email-matan@mellanox.com> <1516639103-27166-1-git-send-email-matan@mellanox.com> <1516639103-27166-8-git-send-email-matan@mellanox.com> <6A0DE07E22DDAD4C9103DF62FEBC09093B715E03@shsmsx102.ccr.corp.intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v5 7/7] app/testpmd: adjust ethdev port ownership 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: Fri, 26 Jan 2018 00:50:19 -0000 > -----Original Message----- > From: Matan Azrad [mailto:matan@mellanox.com] > Sent: Thursday, January 25, 2018 4:30 PM > To: Lu, Wenzhuo ; Thomas Monjalon > ; Gaetan Rivet ; Wu, > Jingjing > Cc: dev@dpdk.org; Neil Horman ; Richardson, > Bruce ; Ananyev, Konstantin > > Subject: RE: [dpdk-dev] [PATCH v5 7/7] app/testpmd: adjust ethdev port > ownership >=20 > Hi Lu >=20 > From: Lu, Wenzhuo [mailto:wenzhuo.lu@intel.com] > > Hi Matan, > > > > > > > -----Original Message----- > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Matan Azrad > > > Sent: Tuesday, January 23, 2018 12:38 AM > > > To: Thomas Monjalon ; Gaetan Rivet > > > ; Wu, Jingjing > > > Cc: dev@dpdk.org; Neil Horman ; Richardson, > > > Bruce ; Ananyev, Konstantin > > > > > > Subject: [dpdk-dev] [PATCH v5 7/7] app/testpmd: adjust ethdev port > > > ownership > > > > > > Testpmd should not use ethdev ports which are managed by other DPDK > > > entities. > > > > > > Set Testpmd ownership to each port which is not used by other entity > > > and prevent any usage of ethdev ports which are not owned by Testpmd. > > > > > > Signed-off-by: Matan Azrad > > > --- > > > app/test-pmd/cmdline.c | 89 +++++++++++++++++++----------------= ----- > > ----- > > > app/test-pmd/cmdline_flow.c | 2 +- > > > app/test-pmd/config.c | 37 ++++++++++--------- > > > app/test-pmd/parameters.c | 4 +- > > > app/test-pmd/testpmd.c | 63 ++++++++++++++++++++------------ > > > app/test-pmd/testpmd.h | 3 ++ > > > 6 files changed, 103 insertions(+), 95 deletions(-) > > > > > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > > > 9f12c0f..36dba6c 100644 > > > --- a/app/test-pmd/cmdline.c > > > +++ b/app/test-pmd/cmdline.c > > > @@ -1394,7 +1394,7 @@ struct cmd_config_speed_all { > > > &link_speed) < 0) > > > return; > > > > > > - RTE_ETH_FOREACH_DEV(pid) { > > > + RTE_ETH_FOREACH_DEV_OWNED_BY(pid, my_owner.id) { > > I see my_owner is a global variable, so, don't know why we need the > > parameter 'my_owner.id' here. >=20 > Yes it is a testpmd global variable (which was initiated in testpmd main > function - you can see it in this patch) as a lot of variables in testpmd= . > RTE_ETH_FOREACH_DEV_OWNED_BY iterator is an ethdev iterator -> not > only for testpmd\applications. > So, each dpdk entity(application, PMDs, any other libs) should use this > iterator with its specific owner id to get its owned ports. Sorry, I may express myself too simple to understand. I think about that RTE use a callback to get the owner ID and even other ne= cessary info from APP. RTE can use the callback in RTE_ETH_FOREACH_DEV. The= n APP need hardly change anything. Only need register a callback. I think i= t's more friendly to the users. Or even APP defines its own macro ' FOREACH_DEV_OWNED(pid)' to wrap ' RTE_E= TH_FOREACH_DEV_OWNED_BY(pid, my_owner.id) ' looks better. >=20 > > I think we can still use > > RTE_ETH_FOREACH_DEV and check 'my_owner' in it. If there's some reason > > and you don't want change RTE_ETH_FOREACH_DEV, I think ' > > RTE_ETH_FOREACH_DEV_OWNED(pid) {' is better.