From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00041.outbound.protection.outlook.com [40.107.0.41]) by dpdk.org (Postfix) with ESMTP id E4C554C96 for ; Wed, 3 Oct 2018 19:33:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eIPbvKFOneUiU4Ejv1vlWMdFCrOHC7hqDQdX1qfBNNI=; b=IGfWhDJOS/1cOQ+wkrRCdP5QrCvc7g8Qy+7hsrjiZPHBdFl3RjmXNPZpLhnXecJLxRswpU5+hY5FXiSF2DFaiBvMULfX/RB/eM2vWc0IcNitNk0uuAeFMBiwtzNq9BA9GaiCTO7GOoaYci747B0NkUFANJD5z4OZ/a4JfR7bjLA= Received: from AM6PR08MB3672.eurprd08.prod.outlook.com (20.177.115.29) by AM6PR08MB3061.eurprd08.prod.outlook.com (52.135.163.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.25; Wed, 3 Oct 2018 17:32:59 +0000 Received: from AM6PR08MB3672.eurprd08.prod.outlook.com ([fe80::f423:e46a:a03c:e928]) by AM6PR08MB3672.eurprd08.prod.outlook.com ([fe80::f423:e46a:a03c:e928%2]) with mapi id 15.20.1185.026; Wed, 3 Oct 2018 17:32:59 +0000 From: Honnappa Nagarahalli To: "Wang, Yipeng1" , "Van Haaren, Harry" , "Richardson, Bruce" CC: "De Lara Guarch, Pablo" , "dev@dpdk.org" , "Gavin Hu (Arm Technology China)" , Steve Capper , Ola Liljedahl , nd , "Gobriel, Sameh" Thread-Topic: [dpdk-dev] [PATCH 3/4] hash: fix rw concurrency while moving keys Thread-Index: AQHUWQ2TA27X9NBsCE+C+fB5/YkDUqUJ4m0AgAKJQACAAD1o4IABIbUw Date: Wed, 3 Oct 2018 17:32:59 +0000 Message-ID: References: <1536253938-192391-1-git-send-email-honnappa.nagarahalli@arm.com> <1536253938-192391-4-git-send-email-honnappa.nagarahalli@arm.com> <20180928082610.GA7592@bricha3-MOBL.ger.corp.intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Honnappa.Nagarahalli@arm.com; x-originating-ip: [217.140.111.135] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM6PR08MB3061; 6:oDA6rYBTLKqe6u2w0x+kmtARgBz8AWDUwyLQESdU3j77xQ0AJtq8zrngcPA5LFDZgwd6vg++Xv+S0zkcvAhaggHvhgt6X+aDJT/YLd8RkgUzKdX46Ib5QASCPFmbTjAUcYUsT4IZmer2l4FD996uHka5wdixSzz57Pwg6YcOB6jtoTFY40Pwq436+0Y8qXTFDmkfflIkVbNUgphB/Y8M+bOqClnppwcbGVYzJu5Ab7jxr8D7B57oG70ZhJy4LulF79DfW4IBOM944syD2kGMpKb6Lkgkc3yaYdBJ4Rbu6lvW4OzI8PC87U+F90EWmbQp+yvX8wdsAC0/VHhiw8BCZPSe+/Ae5PBaFUBpNgGXHJJmbFv/0ZSme4hFH5G7B4kFj8Fz20ykxsPiU6Z/c3xPvLgOcP+2ZS5j4f+CKNNJWMLXPCJEm6ATxzDXyWYwtKUeHooTCtevlVICmRYweXWXLg==; 5:RM7rphnAJ8e9qFKyJEv1t1i1/BACXVe/cdN/r3drHF1wXiQKRUQQiCzatWjjgrwssYOXzWJ81jK5hE7G9FZ8/nxCpHe5TtMaqrQOH51QOzTkxRINGvtpkQous12p8IiGKe4QM6KRwBlU8Y+f6PbnHDUPH54UtbbZ6X9Hh0uNfFI=; 7:Iy2pkgslHxyD1dBcpI9qu+Ln5xoRRdolwykJ1eABE+yFKb9u0GIhjF+z2sz4Rk4wkz3M4bkHkIYB/t9jc53skk+mhzyegc65voYoJQ9h0xt5mcMbytd0GXC8ol7DOpa57T/lUOCpUZS2i1WBC5OuQW2BZ9adLt9wgh7xDaYuspsU2emDgtLaOvP5rQQOLKgbOuqH0J0ln8Y7PvFWgese2/KHLSW7fz9fjWFR6RhP00o/CO3ZqlXx+XPx+XzjgD7s x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-ms-office365-filtering-correlation-id: 0a6c0d53-38cc-42bd-7619-08d6295643b0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR08MB3061; x-ms-traffictypediagnostic: AM6PR08MB3061: nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231355)(944501410)(52105095)(10201501046)(3002001)(6055026)(149066)(150057)(6041310)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699051)(76991048); SRVR:AM6PR08MB3061; BCL:0; PCL:0; RULEID:; SRVR:AM6PR08MB3061; x-forefront-prvs: 0814A2C7A3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(136003)(346002)(366004)(396003)(13464003)(57704003)(199004)(189003)(105586002)(5250100002)(54906003)(110136005)(102836004)(68736007)(8936002)(97736004)(66066001)(3846002)(6116002)(478600001)(72206003)(256004)(14454004)(14444005)(25786009)(93886005)(99286004)(71190400001)(33656002)(316002)(2906002)(4326008)(71200400001)(7696005)(81156014)(81166006)(76176011)(53936002)(5660300001)(55016002)(74316002)(86362001)(186003)(476003)(6246003)(229853002)(2900100001)(486006)(26005)(106356001)(446003)(9686003)(6506007)(11346002)(7736002)(305945005)(6436002)(6306002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR08MB3061; H:AM6PR08MB3672.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 3r3mKnhNR5GMxkIZ7OeqV77wqKdRkkze7kzjHPLOCasN1fKZura0g7d4aidGD1epdKiOOmpzPg34DgB9qZ2HH72gSFfxeHpK5m1a1lh2z6XVUPGh6Ri+vwaJM1ssZnkkAtJAMIwZhIQ2CPJWH1E4L80W4jzsms3P2KqHRNGb+KAjc8gt+3SqAk+hdfqsPA4x/cHCFz32GAvFQ41HjNDioWrjvRvyexmZoSQ325jQ3ECGwcC1UhY9JGxSxVMN9bmseYpFbhQvVMiL015V6SIPXepeDUjThaokuycP4iVAlxDx8jryZ4YpF1dughZWb8QzSVsHTrW/5A2tclHRPqDuiastUvr3uHK1dZWz1TuPIcE= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a6c0d53-38cc-42bd-7619-08d6295643b0 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2018 17:32:59.8130 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3061 Subject: Re: [dpdk-dev] [PATCH 3/4] hash: fix rw concurrency while moving keys 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, 03 Oct 2018 17:33:02 -0000 > >-----Original Message----- > >From: Van Haaren, Harry > >> > > > > /** > >> > > > > * Add a key to an existing hash table. > >> > > > >@@ -222,7 +222,7 @@ rte_hash_add_key(const struct rte_hash *h, > >> > > > >const void > >> > > *key); > >> > > > > * array of user data. This value is unique for this key. > >> > > > > */ > >> > > > > int32_t > >> > > > >-rte_hash_add_key_with_hash(const struct rte_hash *h, const > >> > > > >void *key, > >> > > hash_sig_t sig); > >> > > > >+rte_hash_add_key_with_hash(struct rte_hash *h, const void > >> > > > >+*key, > >> > > hash_sig_t sig); > >> > > > > > >> > > > > / > >> > > > > >> > > > I think the above changes will break ABI by changing the > >> > > > parameter > >> type? > >> > > Other people may know better on this. > >> > > > >> > > Just removing a const should not change the ABI, I believe, since > >> > > the const is just advisory hint to the compiler. Actual parameter > >> > > size and count remains unchanged so I don't believe there is an is= sue. > >> > > [ABI experts, please correct me if I'm wrong on this] > >> > > >> > > >> > [Certainly no ABI expert, but...] > >> > > >> > I think this is an API break, not ABI break. > >> > > >> > Given application code as follows, it will fail to compile - even > >> > though > >> running > >> > the new code as a .so wouldn't cause any issues (AFAIK). > >> > > >> > void do_hash_stuff(const struct rte_hash *h, ...) { > >> > /* parameter passed in is const, but updated function prototype > >> > is > >> non- > >> > const */ > >> > rte_hash_add_key_with_hash(h, ...); } > >> > > >> > This means that we can't recompile apps against latest patch > >> > without application code changes, if the app was passing a const > >> > rte_hash struct > >> as > >> > the first parameter. > >> > > >> Agree. Do we need to do anything for this? > > > >I think we should try to avoid breaking API wherever possible. > >If we must, then I suppose we could follow the ABI process of a > >deprecation notice. > > > >From my reading of the versioning docs, it doesn't document this case: > >https://doc.dpdk.org/guides/contributing/versioning.html > > > >I don't recall a similar situation in DPDK previously - so I suggest > >you ask Tech board for input here. > > > >Hope that helps! -Harry > [Wang, Yipeng] > Honnappa, how about use a pointer to the counter in the rte_hash struct > instead of the counter? Will this avoid API change? I think it defeats the purpose of 'const' parameter to the API and provides= incorrect information to the user. IMO, DPDK should have guidelines on how to handle the API compatibility bre= aks. I will send an email to tech board on this. We can also solve this by having counters on the bucket. I was planning to = do this little bit later. I will look at the effort involved and may be do = it now.