From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0042.outbound.protection.outlook.com [104.47.0.42]) by dpdk.org (Postfix) with ESMTP id 6411F1B1A4 for ; Mon, 8 Jan 2018 14:56:01 +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=MIaYWJSfb748+Vh0bmjSGn81ZpC7anTSFwmzIkpoJGc=; b=JYcIzOeQ15qTfVzbkSU4u9tO2jmR4yrlgyDI+ftpVRd+zM6IqyWoy5i0IKCRqG9RNN+DR7MAwGhHYaBMfECrdFedvhlijfCOpBmgb1bkZoUdp0syTTJNlyjn0MHrqN2llFKqJw7xvfDsENTPFVoOGD4qRRsZKikFjcndz4IrFM4= Received: from AM6PR0502MB3797.eurprd05.prod.outlook.com (52.133.21.26) by AM6PR0502MB3799.eurprd05.prod.outlook.com (52.133.21.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Mon, 8 Jan 2018 13:55:52 +0000 Received: from AM6PR0502MB3797.eurprd05.prod.outlook.com ([fe80::b4b4:7de8:cf70:aa3a]) by AM6PR0502MB3797.eurprd05.prod.outlook.com ([fe80::b4b4:7de8:cf70:aa3a%13]) with mapi id 15.20.0386.006; Mon, 8 Jan 2018 13:55:52 +0000 From: Matan Azrad To: =?iso-8859-1?Q?Ga=EBtan_Rivet?= CC: Thomas Monjalon , Jingjing Wu , "dev@dpdk.org" , Neil Horman , Bruce Richardson , Konstantin Ananyev Thread-Topic: [PATCH v2 6/6] app/testpmd: adjust ethdev port ownership Thread-Index: AQHTiHVt5VPixrMnKUK3vfdVuXmfmKNp4uPQgAAV1ICAAAEJkA== Date: Mon, 8 Jan 2018 13:55:52 +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> <20180108113946.hcgxvulamjsiepre@bidouze.vm.6wind.com> <20180108133015.an547uygefjz5gj4@bidouze.vm.6wind.com> In-Reply-To: <20180108133015.an547uygefjz5gj4@bidouze.vm.6wind.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; AM6PR0502MB3799; 7:3+9f57uJwPsUeHaITQN4B4YqNc/rvX92lNB1sKkE8Ye458TTeLERWzyfxbq3WaJzHyQVTW1s5eOlPutzKaDBizXMuOe+fo6rF65o11bgXr8/LuQYrw4oxT6jgtzLHtfLSjlwSoLILZayjn8m8ayI/KB5ac5Sx5WHEALh9J5D59sRo4Yeye3sCGq+nqQbKtznVplgapB7IR3CjVdqArlvSIoNm4rAmumFNcC2R8A1DkYTIbpZqaFS4rJ7lf+rMBGp x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 484f6dfb-001b-456d-0b4a-08d5569f883e x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:AM6PR0502MB3799; x-ms-traffictypediagnostic: AM6PR0502MB3799: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(60795455431006)(278428928389397); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3231023)(944501075)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041268)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM6PR0502MB3799; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM6PR0502MB3799; x-forefront-prvs: 054642504A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(396003)(366004)(39380400002)(376002)(39860400002)(189003)(199004)(24454002)(7696005)(14454004)(3660700001)(105586002)(33656002)(53936002)(4326008)(2950100002)(76176011)(3280700002)(6246003)(6916009)(74316002)(478600001)(66066001)(2906002)(5660300001)(99286004)(305945005)(25786009)(68736007)(7736002)(106356001)(2900100001)(86362001)(97736004)(3846002)(6116002)(55016002)(229853002)(9686003)(5250100002)(316002)(102836004)(54906003)(8936002)(93886005)(6436002)(8676002)(6506007)(81166006)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0502MB3799; H:AM6PR0502MB3797.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:3; A:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Juve4wUIR34XUZebvhJ22Wka+j67PUzmiNqq2OWDxi5701G2ZqY25/mBkWr3Y3UHlZrrMPZu+MBan9fq8IaONw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 484f6dfb-001b-456d-0b4a-08d5569f883e X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2018 13:55:52.6005 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0502MB3799 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: Mon, 08 Jan 2018 13:56:01 -0000 Hi Gaetan From: Ga=EBtan Rivet, Monday, January 8, 2018 3:30 PM > On Mon, Jan 08, 2018 at 12:30:19PM +0000, Matan Azrad wrote: > > > > > > From: Ga=EBtan Rivet, Monday, January 8, 2018 1:40 PM > > > Hi Matan, > > > > > > On Sun, Jan 07, 2018 at 09:45:51AM +0000, Matan Azrad wrote: > > > > 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. > > > > > > > > > > This patch should not be necessary. > > > > > > Ideally, your API evolution should not impact the default case. As > > > such, the default iterator RTE_ETH_FOREACH_DEV should still be used i= n > testpmd. > > > > > Why? We want to adjust testpmd to the port ownership. > > >=20 > This adjustment should be seamless for existing application. >=20 > > > RTE_ETH_FOREACH_DEV should call > RTE_ETH_FOREACH_DEV_OWNED_BY, with > > > the default owner (meaning that it would thus iterate on the > > > application-owned set of device). > > > > > > > It will break the API (we already talked about it). > > There is not any default owner: > > Any DPDK entity includes applications must to allocate an owner ID and = use > it to own the ports they wants to use. > > The application can include more than 1 owner depends on the user needs= . > > Each DPDK entity which can synchronize all its port usage can be a vali= d > DPDK entity for the ownership mechanism. > > >=20 > That's the point of my remark: you did not include a default owner. > I think there should be one, and that all ports should pertain to this de= fault > owner by default when created. >=20 > This would not prevent a user or application from adding new owners speci= fic > to their use and specialize ports if need be. >=20 > However, for other applications that do not care for this specialization,= they > should run with the current API and avoid the ports that are configured b= y > other third parties. >=20 RTE_ETH_FOREACH_DEV means iterate over all devices and should stay as is in= my opinion. I understand your concern about changes in current application, But your "default" suggestion will cause to "non-default" applications to r= eset all the default owners and will complicate them and hurt semantics. > I'm thinking about applications already written that would be used with f= ail- > safe ports: they would use RTE_ETH_FOREACH_DEV, and would thus iterate > over every ports, including those owned by the fail-safe, unless they sta= rt > following the new API. >=20 They should start, it is really not complicated. What's about application which use count=3Drte_eth_dev_count and iterate ov= er all ports from 0 to count-1? We cannot save all the wrong application options. > This is unnecessary: adding a default owner for all created ports and > redefining RTE_ETH_FOREACH_DEV as follow >=20 > #define RTE_ETH_FOREACH_DEV(i) > RTE_ETH_FOREACH_DEV_OWNED_BY(i, RTE_ETH_DEFAULT_OWNER) >=20 > Is simple enough and will simplify the work of DPDK users. Moreover, it > would make fail-safe compatible with all applications using > RTE_ETH_FOREACH_DEV without additional evolution. It would actually make > any code using your API supported by those same applications, which I thi= nk > would help its adoption. >=20 Will break API, will hurt semantic of FOREACH , and will complicate ownersh= ip care applications as I wrote above. > -- > Ga=EBtan Rivet > 6WIND