From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id E4B352629 for ; Thu, 25 Jan 2018 02:47:23 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jan 2018 17:47:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,409,1511856000"; d="scan'208";a="24528836" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga004.fm.intel.com with ESMTP; 24 Jan 2018 17:47:22 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 24 Jan 2018 17:47:22 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.189]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.159]) with mapi id 14.03.0319.002; Thu, 25 Jan 2018 09:47:21 +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 Date: Thu, 25 Jan 2018 01:47:21 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09093B715E03@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> In-Reply-To: <1516639103-27166-8-git-send-email-matan@mellanox.com> 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: Thu, 25 Jan 2018 01:47:24 -0000 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 >=20 > Testpmd should not use ethdev ports which are managed by other DPDK > entities. >=20 > 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. >=20 > 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(-) >=20 > 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; >=20 > - 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 paramet= er 'my_owner.id' here. I think we can still use RTE_ETH_FOREACH_DEV and che= ck 'my_owner' in it. If there's some reason and you don't want change RTE_E= TH_FOREACH_DEV, I think ' RTE_ETH_FOREACH_DEV_OWNED(pid) {' is better.