From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10055.outbound.protection.outlook.com [40.107.1.55]) by dpdk.org (Postfix) with ESMTP id C51C6325F for ; Mon, 22 Jan 2018 12:22:18 +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=ZJpwCgzmAzOvfkv+6ODESo8s7MoSPRU1Tp32oGP/+Jg=; b=QVRDHFzp2JDsQzubvKFbpzoYG/gXYCXt/w6+BQ3p+R05mP3JJf0KUTB0tKwgxCtemQt+p8Saii+gtqr5fFSBWr72rOd4be/YkUZRpFsAlYSyJkWexnphVd3l53eYYlaWN0LOJIK0SRdOCKQ7TXlEQnoqkJULuxYoHlYKKIkTsdM= Received: from AM6PR0502MB3797.eurprd05.prod.outlook.com (52.133.21.26) by AM6PR0502MB3767.eurprd05.prod.outlook.com (52.133.21.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Mon, 22 Jan 2018 11:22:17 +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.0428.019; Mon, 22 Jan 2018 11:22:17 +0000 From: Matan Azrad To: =?iso-8859-1?Q?Ga=EBtan_Rivet?= CC: "Ananyev, Konstantin" , Thomas Monjalon , "Wu, Jingjing" , "dev@dpdk.org" , Neil Horman , "Richardson, Bruce" Thread-Topic: [PATCH v3 7/7] app/testpmd: adjust ethdev port ownership Thread-Index: AQHTkSJSs9wv4iQCB0Cv+2LP7vySOKN7IsfQgAAIKACAAAHXQIAAHWSAgAG5pVCAAq5BgIAADHpw Date: Mon, 22 Jan 2018 11:22:16 +0000 Message-ID: References: <1515318351-4756-1-git-send-email-matan@mellanox.com> <1516293317-30748-1-git-send-email-matan@mellanox.com> <1516293317-30748-8-git-send-email-matan@mellanox.com> <2601191342CEEE43887BDE71AB97725886280A68@irsmsx105.ger.corp.intel.com> <2601191342CEEE43887BDE71AB97725886280AE8@irsmsx105.ger.corp.intel.com> <20180119150017.mljpcdmldqx32mkq@bidouze.vm.6wind.com> <20180122101711.ecgbqvzuitataygk@bidouze.vm.6wind.com> In-Reply-To: <20180122101711.ecgbqvzuitataygk@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; AM6PR0502MB3767; 7:qETYxO9Rdk1syubxdAE450b+bF9pEZeIw6c5NAAuyBW7joDjPTkuT6xEE+8NpV/KhwQprq+K+KPg2JbUIRvPb/OeT03/Y5yCPTsQk98OJ4rfflUacT8TiJUTHutBs7bnEELeMDrqjIhSg06htw3OT2hD1gQtgt+IU9pbgsRHKAgEPuj03MxYOnCwwZav+aBmcC13xZNU7F1dgzruyEh1H4bDeTfvZrxKjmOPRsqQvaolL0z18bHjAIIw9hat3jMZ x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 909040d1-338b-4b21-e17b-08d5618a650a 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:AM6PR0502MB3767; x-ms-traffictypediagnostic: AM6PR0502MB3767: 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:(6040501)(2401047)(8121501046)(5005006)(3231023)(2400081)(944501161)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041288)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:AM6PR0502MB3767; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM6PR0502MB3767; x-forefront-prvs: 0560A2214D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39380400002)(39860400002)(346002)(396003)(57704003)(43544003)(199004)(189003)(14454004)(9686003)(6246003)(26005)(3280700002)(4326008)(53936002)(316002)(2900100001)(7736002)(97736004)(86362001)(5250100002)(54906003)(6436002)(2950100002)(8936002)(99286004)(229853002)(93886005)(74316002)(3660700001)(68736007)(6916009)(66066001)(5660300001)(33656002)(6506007)(305945005)(478600001)(102836004)(3846002)(6116002)(106356001)(105586002)(7696005)(2906002)(8676002)(81166006)(81156014)(55016002)(25786009)(76176011)(59450400001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0502MB3767; 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: eLDuOrEE2YzR29VFhWAtr4m8hIjstCISs9txHCJmbw8sbkK+6ajOS/O/WxVBVeM3rGuS0XREVirDc6iQXnAKZA== 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: 909040d1-338b-4b21-e17b-08d5618a650a X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jan 2018 11:22:17.0136 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0502MB3767 Subject: Re: [dpdk-dev] [PATCH v3 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: Mon, 22 Jan 2018 11:22:19 -0000 Hi Gaetan From: Ga=EBtan Rivet, Monday, January 22, 2018 12:17 PM > Hi Matan, >=20 > On Sat, Jan 20, 2018 at 06:14:13PM +0000, Matan Azrad wrote: >=20 > >=20 > > > > > > > > @@ -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) { > > > > > > > > > > > > > > Why do we need all these changes? > > > > > > > As I understand you changed definition of > > > > > > > RTE_ETH_FOREACH_DEV(), so no testpmd should work ok default > (no_owner case). > > > > > > > Am I missing something here? > > > > > > > > > > > > Now, After Gaetan suggestion RTE_ETH_FOREACH_DEV(pid) will > > > > > > iterate > > > > > over all valid and ownerless ports. >=20 > To be clear: you did not implement what I suggested, but your own > interpretation of it. Please do not write as if I validated this interpre= tation. >=20 > Essentially, the NO_OWNER semantic is completely different from a default > owner. A default owner would protect ports from race conditions and force > port ownership requests to go through proper channels protected by critic= al > sections. >=20 Please explain it more. Do you want any created port will be owned by default owner(app)? So, how can other DPDK entity to take control on a port?=20 > NO_OWNER means that anyone is free to take any ownerless port at any > time. And as a result, your are thus forced here to fix this by modifying= an > existing application for any entity using your ownership API to function = with > it. > Yes, I think is should be explicit! Because hotplug is in the game and a port can be created\released any time= , Any dpdk entity should know about its ports and own them. > This is very different from what I suggested. What I said was that I want= ed > the most common case to be taken care of, and for existing applications t= o > continue working. It entails having a more complicated API, but I think t= his is > a price we should pay. >=20 So, please define what is the common case you are talking about. And if you have an idea how to adjust port ownership to take care of it, I = will be happy to hear. > You are implementing the most common case in testpmd (the app entity > creating an owner and putting its valid ports within). Your API should ea= se > that up as much as possible before considering forcing everyone to work > with it. I don't think it is complicated. > ~*~ >=20 > You implemented a way for the failsafe to capture existing ports. > How does it work without the channels for requesting ports suggested > above? If the port is without an owner, it will just take ownership of it and will= manage it, else will try to take ownership in the next hotplug alarm.=20 >=20 > Regards, > -- > Ga=EBtan Rivet > 6WIND