From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 2BE3398 for ; Tue, 24 Jul 2018 18:09:18 +0200 (CEST) Received: by mail-wr1-f66.google.com with SMTP id j5-v6so4690197wrr.8 for ; Tue, 24 Jul 2018 09:09:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=x8Sfuzs09IPcNeSKJFbF3XU4cN80GE7/SnOAXMRv+cc=; b=HXTn385Fhk+CyiOXrH3tEkE2JrrhPtZlZN5vgfB435x3LBlWYirPFTMAujN5P34N9B NwMb0JnfW9GRywK1Sm3BQe0+ngW1PXOg+yff5lI/WU3R4MtP6rFc0X/6YrP/o5ChuJFr iC5TrGvGOATA2MJaVoalpTTtDOsiJI8X9cxjICgQHoLfSk2lJZm8ABmWxLhVCUUfr9W0 5ob1wZQFJDPvKtU18PAHvA4izGpFd5Ny/pQZVh1vLeLlztVBS5aj6KdMxdul2TzF5046 XSzYOO/qE4UyDzJQV5zUwPtgG4/FmVZ8jpJBLM07H+IHNO0z3ikyyYwWRcGHf3l9168F wUYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=x8Sfuzs09IPcNeSKJFbF3XU4cN80GE7/SnOAXMRv+cc=; b=Cwq6w7UAcTnguusJy0XvVRW63CIAu66d3QJXQJW49vi4CwDjPHVOOyEA/f+I1i7+Cw 5+aCTSlAs/h815A1gZHVvKiK7GjL0WgDUmvosOgyrO/BmF3OmQErIKkOa7f24sV4497f bXbNb/WIh7fYdRyoc1ssztucMSY2v5BlhOJxAGlrZhw6MilC/4TO/M6a4KV7NGeNFFLo y+n8hTDTNQgJXgEGR48I3G/TG84VpfJxA4fp8auLsQF6M3sz+5Npu+C3WigzQ++cKRGz v/KECAL18oR07kho2xm+Khu+9Jy/CdhUdXHJme8nrPhecrPXsS41FP5+wrHk/8sqi4V4 qflg== X-Gm-Message-State: AOUpUlH85ldIp1qpQSSoMh2IQpLsF1M0QPoTwWUYFXfA+hMhvKfM+n4f tECpRGBTClJMY5T/mYcii1g= X-Google-Smtp-Source: AAOMgpfhGnxGmfAI3Jfvf09bZionsQxn7nXG0ppH/vEXpes0uVnakPkcvNoH0P1uTWlVfwJMesj7bQ== X-Received: by 2002:adf:eb4c:: with SMTP id u12-v6mr12816645wrn.174.1532448557967; Tue, 24 Jul 2018 09:09:17 -0700 (PDT) Received: from localhost ([2a00:23c5:be94:4600:7b12:f8a0:fd52:f87d]) by smtp.gmail.com with ESMTPSA id z2-v6sm2942049wma.3.2018.07.24.09.09.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Jul 2018 09:09:16 -0700 (PDT) From: luca.boccassi@gmail.com To: Yipeng Wang Cc: Pablo de Lara , dpdk stable Date: Tue, 24 Jul 2018 17:07:48 +0100 Message-Id: <20180724160752.20287-30-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180724160752.20287-1-luca.boccassi@gmail.com> References: <20180724160752.20287-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'hash: fix a multi-writer race condition' has been queued to LTS release 16.11.8 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2018 16:09:18 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.8 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From e26dac448835a5a3f7c213cd797e96e0f7bda599 Mon Sep 17 00:00:00 2001 From: Yipeng Wang Date: Tue, 10 Jul 2018 09:59:55 -0700 Subject: [PATCH] hash: fix a multi-writer race condition [ upstream commit eb067d431d9411a0054bc3ec084b0e9eadbb0a16 ] Current multi-writer implementation uses Intel TSX to protect the cuckoo path moving but not the cuckoo path searching. After searching, we need to verify again if the same empty slot still exists at the beginning of the TSX region. Otherwise another writer could occupy the empty slot before the TSX region. Current code does not verify. Fixes: be856325cba3 ("hash: add scalable multi-writer insertion with Intel TSX") Signed-off-by: Yipeng Wang Acked-by: Pablo de Lara --- lib/librte_hash/rte_cuckoo_hash_x86.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/librte_hash/rte_cuckoo_hash_x86.h b/lib/librte_hash/rte_cuckoo_hash_x86.h index 0c94244a6..a2f1663ec 100644 --- a/lib/librte_hash/rte_cuckoo_hash_x86.h +++ b/lib/librte_hash/rte_cuckoo_hash_x86.h @@ -95,6 +95,9 @@ rte_hash_cuckoo_move_insert_mw_tm(const struct rte_hash *h, while (try < RTE_HASH_TSX_MAX_RETRY) { status = rte_xbegin(); if (likely(status == RTE_XBEGIN_STARTED)) { + /* In case empty slot was gone before entering TSX */ + if (curr_bkt->key_idx[curr_slot] != EMPTY_SLOT) + rte_xabort(RTE_XABORT_CUCKOO_PATH_INVALIDED); while (likely(curr_node->prev != NULL)) { prev_node = curr_node->prev; prev_bkt = prev_node->bkt; -- 2.18.0