From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0061.outbound.protection.outlook.com [104.47.1.61]) by dpdk.org (Postfix) with ESMTP id C5A861B1D9 for ; Thu, 18 Jan 2018 21:21:36 +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=nR9NtuMa8XsdeVA4QEpknctldjfL+JPQM7m1owKzvpc=; b=foWWA1zkIP5G5Tt7mgEHo+XOcY25dC3ZKtqrXPUWRAmM0c1WGNcz2ikWKkEYS4rFx9yoN3chSdXxZTbX7SyymsaKGj51y3ghNpIXbTJJ63LPO4FPBlZbPwWnK20ROaCGFkKtXOSME400E2/yIEnHnW+ZO9p/K2V2sFLYuR/N7ws= Received: from AM6PR0502MB3797.eurprd05.prod.outlook.com (52.133.21.26) by AM6PR0502MB4087.eurprd05.prod.outlook.com (52.133.31.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Thu, 18 Jan 2018 20:21:34 +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.014; Thu, 18 Jan 2018 20:21:34 +0000 From: Matan Azrad To: Neil Horman CC: "Ananyev, Konstantin" , Thomas Monjalon , Gaetan Rivet , "Wu, Jingjing" , "dev@dpdk.org" , "Richardson, Bruce" Thread-Topic: [PATCH v2 2/6] ethdev: add port ownership Thread-Index: AQHTihf/M9xg8LYorUSRFqZtTc27hqNtNdVQgAFomACAAAOCwIAAuwQAgABvY+CABQwJgIAAEk3ggABinoCAANUIAIAAxQGAgAAGCnCAAQnKAIAAAmNwgAApSwCAADKGAIABUdOAgAAMD/CAADKfgIAAAbBAgAAcRwCAABk1cA== Date: Thu, 18 Jan 2018 20:21:34 +0000 Message-ID: References: <2601191342CEEE43887BDE71AB9772588627E954@irsmsx105.ger.corp.intel.com> <2601191342CEEE43887BDE71AB9772588627EE60@irsmsx105.ger.corp.intel.com> <20180117140020.GA5432@hmswarspite.think-freely.org> <2601191342CEEE43887BDE71AB9772588627F0E9@irsmsx105.ger.corp.intel.com> <20180118131017.GA1622@hmswarspite.think-freely.org> <20180118165436.GD1622@hmswarspite.think-freely.org> <20180118184152.GA22115@neilslaptop.think-freely.org> In-Reply-To: <20180118184152.GA22115@neilslaptop.think-freely.org> 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: [85.64.136.190] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM6PR0502MB4087; 7:EYEjXZm6d+eWsJLC874pT3eZZFSXn1BOAvqbxTI+TQJrqAuqcDiaWJn2gdhvW0tZ2AEA012NRX3u7jlNxZPqNTOrRYtyd9ruwVJ2H6QjHj0tbR4PPBMcgINZ7Hzr8PhCk6nEd7CuA1R+ltXYwSrLJx/1PYUPFf0yWm2Y94nhPC/rhUu8W4zMunt9xPMVjabN75BKshLGurSWTRhzznQXcck7gCpz9N6HcuLpE5AUYUQjdw3PQsmBesfvj7HihZbs x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 9da8e45b-f6b1-41fc-c7f0-08d55eb111f0 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:AM6PR0502MB4087; x-ms-traffictypediagnostic: AM6PR0502MB4087: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(60795455431006); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(3231023)(2400066)(944501161)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041268)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM6PR0502MB4087; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM6PR0502MB4087; x-forefront-prvs: 05568D1FF7 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(366004)(346002)(396003)(39380400002)(199004)(189003)(55016002)(9686003)(105586002)(106356001)(33656002)(229853002)(53936002)(2900100001)(5250100002)(102836004)(305945005)(59450400001)(26005)(3280700002)(3660700001)(6506007)(76176011)(97736004)(7696005)(93886005)(2906002)(74316002)(7736002)(6246003)(99286004)(54906003)(8936002)(25786009)(4326008)(81166006)(68736007)(8676002)(316002)(81156014)(86362001)(66066001)(14454004)(6436002)(6116002)(5660300001)(2950100002)(478600001)(3846002)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0502MB4087; 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: IhOQ5kWWOeTZdlEhJCAgvkHJHww7fo5vjWtyWosV/3YpillB8kOrVmCY6SewpiKhstwZ6VzWQHUUTHkCdKyTsw== 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: 9da8e45b-f6b1-41fc-c7f0-08d55eb111f0 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Jan 2018 20:21:34.5070 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0502MB4087 Subject: Re: [dpdk-dev] [PATCH v2 2/6] ethdev: add 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, 18 Jan 2018 20:21:37 -0000 Hi Neil. From: Neil Horman, Thursday, January 18, 2018 8:42 PM > > > But thats not all. The determination of success or failure in > > > claiming ownership is largely dependent on the behavior of other > > > threads actions, not a function of the state of the system at the mom= ent > ownership is requested. > > > That is to say, if you have N threads, and they all create ownership > > > objects identified as X, x+1, X+2...X+N, only the thread with id X+N > > > will be able to claim ownership of any port, because they all will > > > have incremented the shared nex_id variable. > > > > Why? Each one will get its owner id according to some order(The critica= l > section is protected by spinlock). > > > Yes, and thats my issue here, the ordering. Perhaps my issue is one of > perception. When I consider an ownership library, what I really think ab= out is > mutual exclusion (i.e. guaranteing that only one entity is capable of acc= ess to > a resource at any one time). This semantics of this library don't really > conform to any semantics that you usually see with other mutual exclusion > mechanisms. That is to say a spinlock or a mutex succedes locking if its= prior > state is unlocked. This library succeeds aqusition of the resource it pr= otects if > and only if allocation of ownership records occurs in a particular order = relative > to one another. That just seems odd to me. What advantage do these new > semantics have over more traditional established semantics? >=20 >=20 > > > Determination of ownership by the programmer will have to be done > > > via debugging, and errors will likely be transient dependent on the > > > order in which threads execute (subject to scheduling jitter). > > > > > Yes. > > > But why put yourself through that pain? Traditional semantics are far si= mpler > to comprehend, with and without a debugger. >=20 Looks like I missed you, sorry: Please describe next: 1. What exactly do you want to improve?(in details) 2. Which API specifically do you want to change(\ part of code)? 3. What is the missing in current code(you can answer it in V3 I sent if yo= u want) which should be fixed? sorry for that, I think it is not relevant continue discussion if we= are not fully understand each other. So let's start from the beginning "wi= th good order :)" by answering the above questions.