From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10066.outbound.protection.outlook.com [40.107.1.66]) by dpdk.org (Postfix) with ESMTP id 68693A48D for ; Wed, 17 Jan 2018 09:51:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=bJfH1Ers2BqDWk3q2CqV8mNaXDSdggyFhmCZA8whkTI=; b=GI7C7hCQhR14UF/kyFc0JeVnK7xLu09SzHi9ZxHc4d99brHIsH0sKXaAS5f7y13ZC4j/fLci34CdpcZ1ihnqC3eQzWviRgiRYxymr+8dBgq3g/hIxDdKn35xC4HSnlNICk0qjqkess/xfpkhj8FKAx9cfmTE6HZ8HxhCnkxdc70= Received: from AM6PR0502MB3797.eurprd05.prod.outlook.com (52.133.21.26) by AM6PR0502MB3687.eurprd05.prod.outlook.com (52.133.20.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Wed, 17 Jan 2018 08:51:00 +0000 Received: from AM6PR0502MB3797.eurprd05.prod.outlook.com ([fe80::6c28:c6b3:de94:a733]) by AM6PR0502MB3797.eurprd05.prod.outlook.com ([fe80::6c28:c6b3:de94:a733%13]) with mapi id 15.20.0407.012; Wed, 17 Jan 2018 08:51:00 +0000 From: Matan Azrad To: "Lu, Wenzhuo" , Thomas Monjalon , Gaetan Rivet , "Wu, Jingjing" CC: "dev@dpdk.org" , Neil Horman , "Richardson, Bruce" , "Ananyev, Konstantin" Thread-Topic: [dpdk-dev] [PATCH v2 6/6] app/testpmd: adjust ethdev port ownership Thread-Index: AQHTh5yRif+v8SuDCkascYTAxHDFK6N2DXkAgAAkn6CAARf0AIAAhKIg Date: Wed, 17 Jan 2018 08:51:00 +0000 Message-ID: References: <1511870281-15282-1-git-send-email-matan@mellanox.com> <1515318351-4756-1-git-send-email-matan@mellanox.com> <1515318351-4756-7-git-send-email-matan@mellanox.com> <6A0DE07E22DDAD4C9103DF62FEBC09093B7110ED@shsmsx102.ccr.corp.intel.com> <6A0DE07E22DDAD4C9103DF62FEBC09093B711969@shsmsx102.ccr.corp.intel.com> In-Reply-To: <6A0DE07E22DDAD4C9103DF62FEBC09093B711969@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM6PR0502MB3687; 6:cSgegR2G1ffr66z+EOZXUveEtPtnASAz7AODP1ZHAWYPsTigxYDMJXHxmaPgShji9ZokO7+Z81ZJ+GS8TN2fm5WF3qUn9whY/GksVzzEoTS4gozwczM32So0BWQAhGoAo8BA4zA4401XDu4QI/aIp8bUkRVO2hnhsjb2Owg/AFAwyrzHJT0ICleqTm8cMS1LBMw3fIUXQOJnC78CxLbfMDsQLZ27N8t699uLlNNINKdvnySco03ODFZ4IEl1N1OFuzuJ8+Ho0W8jpkUUfLEzL7XQV5MVO9EFrcimyN3UHqkswR6+HG1ytFc7TzgGXKTSVQve71Wyy5C4lAatgbHihugKhg4C9eOIq4S5BFlWji5Dq51D4Lp2BXBSnVAKXnwe; 5:gNamp+F2V0cerdYL29OCkJzULshQ+mMQpSCZBpxxEk+8Ap5X6tj6lygfX1oe1jjw5wRrDkZOsBBY4NhdslXbBSrbLRg5hMCmpI69ZHEqUjoQTr8IgRdS9K0VEYScyGasGGoW9rcJPx9HLWxw9I6m7HWs0dYEa7Nsl5w+pnKx3HU=; 24:4T677b6nbBAK11ppckmvX9WvXOAT1fkvbCr5BNqTs6T6iYDOdlScP6qYX5tdzO4WDla2ifmwGu9t9akYeKdNNhm0gHLQ4gqHuvVtvdmXJsY=; 7:piNZoB2pFHzL5NiyN7i9loQQFHK4+3mZKRPutv/riEpGDHpiqLdmcpFw3txsQNnM2WTR+StOEKdV+MISR2UnIecrbKEGblMElO5qb7037GvEQD6wBKF4AVyWYjXPsudyF0RVkaY6IPwxYnMl+AF2QOls6n5c1HtZ8/ZkZVaV4xtJiWQAVcY2N5I4uDXZNojSKzr8umkNwvZ+VLkckMbKcTImSGiZ2MCWpEmA/hIbgxXi7FtA25pERLftE7S46aFv x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 2ff0d186-b6f2-416e-b2b2-08d55d876f1b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(3008032)(48565401081)(2017052603307)(7153060)(7193020); SRVR:AM6PR0502MB3687; x-ms-traffictypediagnostic: AM6PR0502MB3687: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(60795455431006)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3231023)(944501161)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041268)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011); SRVR:AM6PR0502MB3687; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM6PR0502MB3687; x-forefront-prvs: 0555EC8317 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(346002)(39860400002)(366004)(39380400002)(199004)(189003)(13464003)(229853002)(2950100002)(6246003)(74316002)(305945005)(7736002)(6116002)(3846002)(478600001)(26005)(7696005)(4326008)(3280700002)(33656002)(5250100002)(59450400001)(76176011)(105586002)(106356001)(5660300001)(93886005)(99286004)(55016002)(14454004)(3660700001)(316002)(68736007)(8936002)(6506007)(110136005)(86362001)(53546011)(25786009)(2900100001)(66066001)(81166006)(9686003)(102836004)(97736004)(54906003)(2906002)(81156014)(6436002)(53936002)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0502MB3687; H:AM6PR0502MB3797.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: RzRe/JZwvDBQ0Ki6uFV3LJaChQPldge2e3F/fnVlD0AIkaZyqyJ4XHxmUKVY3wdNmXSWGMR3kq77wdhNyqo8dA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ff0d186-b6f2-416e-b2b2-08d55d876f1b X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jan 2018 08:51:00.7597 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0502MB3687 Subject: Re: [dpdk-dev] [PATCH v2 6/6] 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: Wed, 17 Jan 2018 08:51:02 -0000 Hi Lu From: Lu, Wenzhuo, Wednesday, January 17, 2018 2:47 AM > Hi Matan, >=20 > > -----Original Message----- > > From: Matan Azrad [mailto:matan@mellanox.com] > > Sent: Tuesday, January 16, 2018 4:16 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 v2 6/6] app/testpmd: adjust ethdev port > > ownership > > > > Hi Lu > > From: Lu, Wenzhuo, Tuesday, January 16, 2018 7:54 AM > > > Hi Matan, > > > > > > > > > > -----Original Message----- > > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Matan Azrad > > > > Sent: Sunday, January 7, 2018 5:46 PM > > > > To: Thomas Monjalon ; Gaetan Rivet > > > > ; Wu, Jingjing > > > > Cc: dev@dpdk.org; Neil Horman ; > Richardson, > > > > Bruce ; Ananyev, Konstantin > > > > > > > > Subject: [dpdk-dev] [PATCH v2 6/6] 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. > > > Sorry I don't follow all the discussion as there's too much. So it > > > may be a silly question. > > > > No problem, I'm here for any question :) > > > > > Testpmd already has the parameter " --pci-whitelist" to only use the > > > assigned devices. > > > > It is an EAL parameter. No? just say to EAL which devices to create.. > > > > > When using this parameter, all the devices are owned by the current > > > APP. > > > > No, what's about vdev? vdevs may manage devices(even whitlist PCI > > devices) by themselves and want to prevent any app to use these > > devices(see fail- safe PMD). > I'm not an expert of EAL and vdev. Suppose this would be discussed in oth= er > patches. > I don't want to bother you again here as testpmd is only used to show the > result. > So I think if this patch is needed just depends on if other patches are > accepted :) >=20 Sure! > > > > > So I don't know why need to set/check the ownership. > > > BTW, in this patch, seem all the change is for ownership checking. I > > > don't find the setting code. Do I miss something? > > > > Yes, see in main function (the first FOREACH). > I think you mean this change, >=20 > @@ -2394,7 +2406,12 @@ uint8_t port_is_bonding_slave(portid_t > slave_pid) > rte_pdump_init(NULL); > #endif >=20 > - nb_ports =3D (portid_t) rte_eth_dev_count(); > + if (rte_eth_dev_owner_new(&my_owner.id)) > + rte_panic("Failed to get unique owner identifier\n"); > + snprintf(my_owner.name, sizeof(my_owner.name), > TESTPMD_OWNER_NAME); > + RTE_ETH_FOREACH_DEV_OWNED_BY(port_id, > RTE_ETH_DEV_NO_OWNER) > + if (rte_eth_dev_owner_set(port_id, &my_owner) =3D=3D 0) > + nb_ports++; > if (nb_ports =3D=3D 0) > RTE_LOG(WARNING, EAL, "No probed ethernet devices\n"); Yes. > But I thought about some code to assign a specific device to a specific A= PP > explicitly. > This code looks like just occupying the devices with no owner. So, it mea= ns > the first APP will occupy all the devices? It makes me confused as I don'= t see > the benefit or the difference than before. Remember that in EAL init some drivers may create ports and take ownership = of them, so this code owns all the ownerless ports. So, ports which are already owned by another DPDK entity will not success t= o take ownership here. Since Testpmd wanted to manage all the ports before this feature( by mistak= e ), I guess this is the right behavior now, just use the ports which are n= ot used. =20 >=20 > > > > Thanks, Matan.