From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0073.outbound.protection.outlook.com [104.47.32.73]) by dpdk.org (Postfix) with ESMTP id 6186F29CB; Sun, 4 Mar 2018 15:59:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ZHeEf62ziVXRYpo91rj3372sOt+j5WVxo33TpPfQqO0=; b=Nn2gCsC8YehOVrJQC62ZT/VOzsbBIIgbmyGX+QvvSbCnKdfbTXubRF/m8YcxMcbF1KLZbkQtl/+TcZ3Qu9pxNMyx2JicL9bkeOI6H2Pg45gs0c4TCib5AMhY85bQmy4lN1MYjrgHs5ZETX2CBdBt64PfOJdNempONhHn8XfVk44= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by DM5PR07MB3466.namprd07.prod.outlook.com (2603:10b6:4:67::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Sun, 4 Mar 2018 14:59:11 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com, pablo.de.lara.guarch@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh , stable@dpdk.org Date: Sun, 4 Mar 2018 20:28:31 +0530 Message-Id: <20180304145831.26416-1-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.16.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PS1PR0601CA0106.apcprd06.prod.outlook.com (2603:1096:803:1::32) To DM5PR07MB3466.namprd07.prod.outlook.com (2603:10b6:4:67::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 22bdca09-5832-4379-34db-08d581e07e93 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:DM5PR07MB3466; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3466; 3:QfQwAfQ8IyoXYxWk/HylBU1aZya+sSbVcui6aurmWssc4ollvDGHrfV7HA/MgD/PVh/XNJQiGG0PBJA1egXxXKGnu+MkWni0+hcWvXLT0sQx8VHJBtANwTTIz34/UkprsCKePc/UoH42G8UGOI5Co7s0LXCicup/eV2uLcqbiFfWypgmkpLLlAGm5XVyi5cJkV3aouXLhcisk0TV+/3yh9Fro2C8/p4jg1ydBfYxSwZgNrStlXhN6bh5xUgd4zSl; 25:PwI/WUJ8voW77lHH4vZd02YuHIHBkzbaIrjGI+ItGsLKXWMd/3b/SMcz50ULiMNWML8e+BxBF45LgPS0Lru5mtexq9Ld9PlUrY4+nb6YPT+ocAuTDrGTj2MovsrivsV0wB3oETwdD43qJJcW81EDXKknFuTM4FytxdA8XkDzWrtBITigIqq/5UvZcnhxzjzDI49taoDTOJt8+sILxL1mnQ0hXpvL6NELDPUqYPBd9QQAnNbrfaMlrfNDKNiiuCEfBPi9KbKsLTOdm6hf2rM1lRWjIP8sAqTPODZntNQs1oZajVRjkw3VDTvmIB9rs6XUTaFIkOcVUMpMJsZ2o6cmTg==; 31:A/oGFqnt8xcQabNGdtcSe9PNSclUADGqz4e1v2TI0VczF1KnkaRToHcp0nG3AcpyYkLKDcMlAy6uD0bO+a5jom+5aUScnVmkNgske2iqDhevDv3s8iO188lcgb1AGPx0H+ZGiTkYqi1GgOAtSXAhkXwWmrJ+VV/O9pDLma/r9nbqmtNoF7ZANyYyWbNZ5MOfy+LmekJ0pC5y8MTQu5F6uCyr8WwLlJU6J3kvsK5ymJA= X-MS-TrafficTypeDiagnostic: DM5PR07MB3466: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3466; 20:a8PrLKrSJPdNyTYvu0jfaGvPsx9o+EMB4K9UuwuaOupuhbxmO7e72dHkVwilZC3URinKZsam4IaGiEETu1ItLA9yojJcgkubkoTkEv4tZ9D5fq5fQB2CpQ97ZIn+klHzcBvpgeyzRr7PvIOfb+39+V18dPbX3fQqmCiWG5E4pSR3aQQjAzCUSHaH8+7usd1qulS5xx8LOM9m1/f18/nKuTGv5lc9XbyTdWO9xX0KoSTfB6Z++UAQLhu5t8/0Rz0+PTvCPaIrWDe13b8JBAd7kLeAjeAoMnHqZMjNGa0C1UpVVK1Fpf7sgISbwV5fdHx334ySmoayBcq+eheOcJUj+4flHNEai0jSZ1iDGunSsVO6DstbPBcI/9Hb3sggnhdC7q//ZZrB+Ud28h9p+tVr4lZViitKBDmddo3yxeRQiI4KYTgdUCBaK6KulJu0naVANXNywJDIKz4WdRuphmA4JIO4cOeMQF5ganT/E+tofGkmg2//5knbSgzXeYX94cnYEmV8n+2S3/ei6yQaFCx9MzvvQKgQEBY1GMuLH9PZ1hp+qQFj4oW9nppU8oEcc2L1W7p0rDb2UczwdwM6Kgc8iMo1hqKBchN01IvQUHmOMDg=; 4:iWeHFJal42XsnnW9a7ePoQWsKYCW2r9wAEa4tCBwHUAFrdQ6SGzmUcYGv1GUk7hCvemNmDeYKWvbgRshPyTcNC4z+XntOidZ2LaaXPidnp2qvlsiI6y4boidV26CmilfBPQpXzoeVXdcqkmRCdos210lH6lv3Cin8BGN2DlWFF3uo/EMvqh6jIP9YjNZUYt5z5zdb02KAb+41q+sAwZqZqKeNCx/GBOpMHdB2ZcMNDkXRjADJWfG2QyoJ7gpOF7p4rHC4joJL6UP9NaJ5ulyfg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040501)(2401047)(5005006)(8121501046)(3231220)(944501244)(52105095)(10201501046)(93006095)(3002001)(6041288)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM5PR07MB3466; BCL:0; PCL:0; RULEID:; SRVR:DM5PR07MB3466; X-Forefront-PRVS: 060166847D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(6069001)(39380400002)(366004)(39850400004)(396003)(346002)(376002)(199004)(189003)(4326008)(478600001)(16526019)(26005)(6506007)(97736004)(50226002)(81156014)(81166006)(25786009)(386003)(53936002)(6512007)(68736007)(5660300001)(1857600001)(47776003)(6486002)(66066001)(16586007)(59450400001)(50466002)(48376002)(8676002)(72206003)(1076002)(52116002)(51416003)(105586002)(6666003)(316002)(7736002)(8936002)(2906002)(106356001)(6116002)(36756003)(3846002)(42882007)(305945005)(5009440100003)(42262002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3466; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR07MB3466; 23:5swkY6BHG3jap8KXlCWPhYPFx/Qrw/HPtsSAS5S6Y?= =?us-ascii?Q?YRJmSihqHb+NmJdhnpfhVFMBJA3iFlxdzFfh4m2e8fCvxWCxfJQ51HYGWHCX?= =?us-ascii?Q?9eadEn0Pl2YJCNpNtONF5ki8BJcnkWNdhxS+/5UXFfSEx5jmJ2yB1viVljU/?= =?us-ascii?Q?QlGWOOzxKJCW9yIPlEROd3IvnWIerFh+P0215QY9SAx252jrGGDYig8ePQC0?= =?us-ascii?Q?fIAahzc4Y6fNLRcSx6kd3wQjbgdugJdJ2ihduTsiaUzdLzo8DWp6xIdMtL4z?= =?us-ascii?Q?EOMKpcIT95MhPq9DieLo0n0xD/NGum9ciQSkwmOqm+pnA1eTKLHaENiDQ/Dm?= =?us-ascii?Q?XXQsVTVaaQdwMxPlIaUMaRQI2UKEBha9zw6qAo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gAemNHRel4yLKxX1WZ3SZkC7owoLnchydckxKbusqiRVh5nRiMkbAT+bm7B+AF8fgBL23PQi0XckJ360HX3QdBuH4hvu+ytFKt7KK7UuMGZjXcgU3QbXkk/WBzJCftRQ/Aj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2018 14:59:11.4026 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 22bdca09-5832-4379-34db-08d581e07e93 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3466 Subject: [dpdk-dev] [PATCH] hash: fix missing spinlock unlock in add key 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, 04 Mar 2018 14:59:16 -0000 Fix missing spinlock unlock during add key when key is already present. Fixes: be856325cba3 ("hash: add scalable multi-writer insertion with Intel TSX") Cc: stable@dpdk.org Signed-off-by: Pavan Nikhilesh --- lib/librte_hash/rte_cuckoo_hash.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c index 9b1387b5e..a07543a29 100644 --- a/lib/librte_hash/rte_cuckoo_hash.c +++ b/lib/librte_hash/rte_cuckoo_hash.c @@ -552,7 +552,8 @@ __rte_hash_add_key_with_hash(const struct rte_hash *h, const void *key, * Return index where key is stored, * subtracting the first dummy index */ - return prim_bkt->key_idx[i] - 1; + ret = prim_bkt->key_idx[i] - 1; + goto failure; } } } @@ -572,7 +573,8 @@ __rte_hash_add_key_with_hash(const struct rte_hash *h, const void *key, * Return index where key is stored, * subtracting the first dummy index */ - return sec_bkt->key_idx[i] - 1; + ret = sec_bkt->key_idx[i] - 1; + goto failure; } } } -- 2.16.2