From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40056.outbound.protection.outlook.com [40.107.4.56]) by dpdk.org (Postfix) with ESMTP id 0AC1B1DA4 for ; Mon, 1 Oct 2018 00:33:15 +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=GjMqEXuK1E8TEcTi/ZAHNMP8MJlSglGsonDFWF1Ukds=; b=b903XeEu4MOKO3KrzGuVoEWfKhZe148IL9gLB2PUf+AU/1o7gtgO/1eYyGR/8EBdoBE//2Trxamjeu1ggvMWtoRn1RVGINW2ns1xG6wwcf2a4sjqxP89tzcBQObFW+hslS1WMIhQLQ7vjTmEvhya7YDMtmdSVT/t8FmKtHUr5DY= Received: from AM6PR08MB3672.eurprd08.prod.outlook.com (20.177.115.29) by AM6PR08MB3240.eurprd08.prod.outlook.com (52.135.164.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Sun, 30 Sep 2018 22:33:14 +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.024; Sun, 30 Sep 2018 22:33:14 +0000 From: Honnappa Nagarahalli To: "Van Haaren, Harry" , "Richardson, Bruce" , "Wang, Yipeng1" CC: "De Lara Guarch, Pablo" , "dev@dpdk.org" , "Gavin Hu (Arm Technology China)" , Steve Capper , Ola Liljedahl , nd Thread-Topic: [dpdk-dev] [PATCH 3/4] hash: fix rw concurrency while moving keys Thread-Index: AQHUWQ2TA27X9NBsCE+C+fB5/YkDUg== Date: Sun, 30 Sep 2018 22:33:14 +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; AM6PR08MB3240; 6:2vSM60D7eWIOpfLIzQKAGbJVunEF6lSewHJ1zObVDs/9Nz0A79khY9GTNCFsxFu6TNv7+YcDd89puIkFKHFQiu3nO6I4x1k6CtjqpgfxgngOYPcAOMthVhgvFhqZYxxCinx/GBfCM8h5vgBnSDtlV6ZxPcO2xDxh5WhvbnW9BPofIpT7/2GqMMWXQomgt1fqncoHxSd1jgBCYKkKlPPjEwFraeFVlshfGTJW9A3z2e1Gbvvrh4awEkPthbliME+MC+DD83TR7RyvP8EUn0LxvA/ns/gNgIHhbYiZsOfRgrtYQ0eq2df8dIfSt4w1WjhkOI1tiTFfb3a0KzvCuWz54GgKy7v3wfIVUEvUIUf61Dzeg0bg9Rm/iEWukIrAdFPeInISFEPCL61aN2VeYGJ5uf2c9nbWy6Sef+5J4YFlNnFDfXMVqDc76Q1ViwVtHEESjFDgNboYbgxZiBO0v33SdA==; 5:o6+x3gCqxysxRP5QvFkmVa9nJf0QmgiMXagB9pLjQvr6FYbsHD08za1+zdbug0sUbY9SoMtCBusPJnDMaUx1cdXrkkArUfzAAWDczkWFtmfsxRULEBPBUDeCM5NOp9eZyDpB/gGclnis7WrT/sA8Q5OTBkjT91XR+faxxthCzyk=; 7:x9rjlrWUmODmrh8pZ7mZpwu3km568jojhGkfqQe7rpj7aO0wZ8Al0qoOZ94P17zBhUC3X7eD5ZObb6koE6wtEJ1UnKUOjO7fdJMMCIgDXlx5UD7yLzP5JLfI3xpXY2YbRd9uTCtVye5d5SnpLe0q0C2zqHRsbkhK3hxu8OUneb1xEirgSkkndwxMuhQYysL8fDhN1mQzzIaJab2iW6HT7IJi1KYNIW/4rtQI9YkmhjiggkKtftPH+Qza9bJlCESc x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-ms-office365-filtering-correlation-id: 4c91c00f-7174-40bd-e2c7-08d62724b5f0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR08MB3240; x-ms-traffictypediagnostic: AM6PR08MB3240: 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)(10201501046)(3231355)(944501410)(52105095)(3002001)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699051); SRVR:AM6PR08MB3240; BCL:0; PCL:0; RULEID:; SRVR:AM6PR08MB3240; x-forefront-prvs: 08118EFC2B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(39850400004)(366004)(346002)(136003)(376002)(57704003)(199004)(189003)(105586002)(76176011)(316002)(102836004)(7696005)(8936002)(72206003)(68736007)(6506007)(256004)(14454004)(110136005)(99286004)(5250100002)(71190400001)(71200400001)(11346002)(97736004)(476003)(3846002)(6116002)(5660300001)(7736002)(74316002)(305945005)(478600001)(86362001)(6436002)(186003)(81156014)(26005)(53936002)(446003)(229853002)(4326008)(55016002)(81166006)(66066001)(34290500001)(486006)(54906003)(6246003)(106356001)(2900100001)(25786009)(93886005)(33656002)(9686003)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR08MB3240; 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: tQpLjpReDw+pGQ91/6l12NPkTLd6TNzexL3CKBsHEcR7C+axuR4yoSkwPRz/lzhESO+llO4Rw7PqOLEzneF73DsFUc13rwlaJ+qUmx2PnpyETSJwo0exofRuohbFQ1Q4bvs7rOed/pqCtScJW9uLj5qTOfbttmsUxeJFLDTYI+W2OE0GFGoLZ9I8DWDb9M+R7pgwoNpmopc6dUHbLWTPZSlxAYlF6JbauhFLTXVQEB7l++HHARpOisdjVMoaYd+8oXOI9elgly0luLh1LdViw1VhMNf33kg2Iu6SsVfFCa+6NUBHf4gqTZe9mz4NCr5V5i0TOdXfPMNSG3jTBCuTWWhCYBBSuWKeXWhl2ZxNMEU= 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: 4c91c00f-7174-40bd-e2c7-08d62724b5f0 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Sep 2018 22:33:14.2710 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3240 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: Sun, 30 Sep 2018 22:33:16 -0000 > > > > > > > >Reader-writer concurrency issue, caused by moving the keys to their > > > >alternative locations during key insert, is solved by introducing a > > > >global counter(tbl_chng_cnt) indicating a change in table. >=20 > >=20 > > > > /** > > > >@@ -200,7 +200,7 @@ rte_hash_add_key_with_hash_data(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(const struct rte_hash *h, const void *key); > > > >+rte_hash_add_key(struct rte_hash *h, const void *key); > > > > > > > > /** > > > > * 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 ty= pe? > > 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 issue. > > [ABI experts, please correct me if I'm wrong on this] >=20 >=20 > [Certainly no ABI expert, but...] >=20 > I think this is an API break, not ABI break. >=20 > 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). >=20 > void do_hash_stuff(const struct rte_hash *h, ...) { > /* parameter passed in is const, but updated function prototype is no= n- > const */ > rte_hash_add_key_with_hash(h, ...); > } >=20 > 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. >=20 Agree. Do we need to do anything for this? >=20 > -Harry