From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id C648F2617 for ; Wed, 6 Apr 2016 12:32:54 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 06 Apr 2016 03:32:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,447,1455004800"; d="scan'208";a="939403475" Received: from irsmsx153.ger.corp.intel.com ([163.33.192.75]) by fmsmga001.fm.intel.com with ESMTP; 06 Apr 2016 03:32:53 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.13]) by IRSMSX153.ger.corp.intel.com ([169.254.9.60]) with mapi id 14.03.0248.002; Wed, 6 Apr 2016 11:32:52 +0100 From: "De Lara Guarch, Pablo" To: Olivier Matz , "dev@dpdk.org" CC: "Richardson, Bruce" Thread-Topic: [dpdk-dev] [PATCH v3 0/4] fix creation of duplicate lpm and hash Thread-Index: AQHRjzH1/0YQf1ZyqkS1KeffAXmkvZ98v6pA Date: Wed, 6 Apr 2016 10:32:51 +0000 Message-ID: References: <1459841759-23296-1-git-send-email-olivier.matz@6wind.com> <1459857229-9814-1-git-send-email-olivier.matz@6wind.com> In-Reply-To: <1459857229-9814-1-git-send-email-olivier.matz@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjY4MjgwYjMtMDkxNC00YTljLWJlY2EtOTZmMzJkMjAzOTUyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Im5QUEFXbG5ZaHQxZWdNc2x4c0FqNytsa05ZZDI4T2dlWmszWklIMFB3aDg9In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 0/4] fix creation of duplicate lpm and hash X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Apr 2016 10:32:55 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Olivier Matz > Sent: Tuesday, April 05, 2016 12:54 PM > To: dev@dpdk.org > Cc: Richardson, Bruce; De Lara Guarch, Pablo > Subject: [dpdk-dev] [PATCH v3 0/4] fix creation of duplicate lpm and hash >=20 > Seen while trying to fix the func_reentrancy autotest. The > series addresses several issues: >=20 > 1/ Hash and lpm return a pointer to an existing object if the user reques= ts the > creation with an already existing name. This look dangerous: when an > object > is returned, the user does not know if it should be freed or not. >=20 > 2/ There is a race condition in cuckoo_hash as the lock is not held in > rte_hash_create(). We could find some cases where NULL is returned whe= n > the > object already exists (ex: when rte_ring_create() fails). >=20 > 3/ There is a race condition func_reentrancy that can fail even if the te= sted > API behaves correctly. >=20 >=20 > RFC -> v1: >=20 > - split the patch in 4 patches > - on error, set rte_errno to EEXIST when relevant > - fix locking in cuckoo_hash creation >=20 > v1 -> v2: >=20 > - fix compilation issue in cuckoo hash > - update the hash test to conform to the new behavior > - rework locking modification in cuckoo_hash > - passed autotests: hash, lpm, lpm6, func_reentrancy >=20 > v2 -> v3: >=20 > - rebase against head > - add "Fixes:" in commit messages > - properly set lpm or hash pointers to NULL on error before returning >=20 > Olivier Matz (4): > lpm: allocation of an existing object should fail > hash: allocation of an existing object should fail > hash: keep the list locked at creation > autotest: fix func reentrancy >=20 > app/test/test_func_reentrancy.c | 31 +++++++++++------ > app/test/test_hash.c | 65 +++++++++++++--------------------= -- > app/test/test_lpm6.c | 2 +- > lib/librte_hash/rte_cuckoo_hash.c | 72 +++++++++++++++++++++++----------= -- > ---- > lib/librte_hash/rte_fbk_hash.c | 5 ++- > lib/librte_lpm/rte_lpm.c | 10 ++++-- > lib/librte_lpm/rte_lpm6.c | 5 ++- > 7 files changed, 103 insertions(+), 87 deletions(-) >=20 > -- > 2.1.4 I wonder if you should include something in release notes. We are fixing the API, so I guess we don't need to follow the deprecation p= rocess, but at least a note in the documentation? Apart from that, Series-acked-by: Pablo de Lara Thanks!