From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 34368187 for ; Mon, 30 Apr 2018 16:06:43 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id x12so11539759wmc.0 for ; Mon, 30 Apr 2018 07:06:43 -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=ADQL3nChHq5Xflxy3gwvBCQdDLlgM/tXtgv4Q28XrOI=; b=T52vJfL0OPS28Vd4dfwd2a2oyMNABnnn2ID3dvczFo/kC6l5f/YL6CTirPUI8J8oGc zCpWZSCNTQ25mqnRtiHEIvFpvrv6iSa/FWai3RYspcJEHk5Kde2+/LLbU+i+MuuhiA77 xl6np0TL9c88XsGiR/6Pf8cwQPP+AlfOUmHHSl5thk4+JNcn/Ws4KTJpenmH7r2c22gR sPRLGH5nKP3IQwBbJgiHFAqXp++fTjq1GdClaeE2ObgeUC2bNUAYh+WA8Lr+nZdazEUR jGkYkhGCAlmq293C4g4EYiZR1m5F9Vv5VgvXVyI84GEFzvp/v+r/I9UNKQ8UutqN53gR sXGg== 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=ADQL3nChHq5Xflxy3gwvBCQdDLlgM/tXtgv4Q28XrOI=; b=WNDzOh/C/a6QODzRzH1S3T/3lMWRuJ72G4xFuIxXqHY0t5DUQg4IgkhU5BGOgwOxA/ 2srzia+irD5r3wAw8kOIpG3Z4+oxORZpxJUkaZLraRbBw4lm9J0UsbsjJUuwsYYMpKb7 QsZyYg+qlE1SXDyIkr9/K7oT7QDWYaFLYFfzrp8KMUSF1y3b2ZZj0idK+wek1gfCg3Sf /GxpcggDYDKzeT4LErF/j4o/hUVPdxeYTe8RhQRYMV0fQ2Nzeg/sqJOBF6eJkLF1NKWH HjfR0McfLuKLuQPkLIYsPcAJcqh8Q1XSA9rfX0qgDHh99KKSJbhCDqeGvqOQ17mf6w/s BiPA== X-Gm-Message-State: ALQs6tDDwGz5d6xRorr2KV4j7mGyg3qBPpw2eEzJInnNVSwZPMbU64PE SZ6vsNqdWS3Vpuqw9E1wSLuF6UgrupU= X-Google-Smtp-Source: AB8JxZpbYtC5hZVgYiyfz8HRyPyGQcEvNgp1I47xm9/e+X2fdXOpzj9edWOyj4DkA7IaDPJ8w3tmJQ== X-Received: by 10.28.4.4 with SMTP id 4mr6961226wme.23.1525097203644; Mon, 30 Apr 2018 07:06:43 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id p35-v6sm10300318wrb.12.2018.04.30.07.06.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 07:06:42 -0700 (PDT) From: luca.boccassi@gmail.com To: Anatoly Burakov Cc: Jianfeng Tan , dpdk stable Date: Mon, 30 Apr 2018 15:02:49 +0100 Message-Id: <20180430140606.4615-11-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180430140606.4615-1-luca.boccassi@gmail.com> References: <20180430140606.4615-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'eal: fix race condition in IPC request' has been queued to stable release 18.02.2 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: Mon, 30 Apr 2018 14:06:44 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/02/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From a5e34315c77ba67440c715f5f8340750d8b9e36c Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Fri, 2 Mar 2018 08:41:37 +0000 Subject: [PATCH] eal: fix race condition in IPC request [ upstream commit da5957821bdd684a50dcb639fb7798936fb2d981 ] Unlocking the action list before sending message and locking it again afterwards introduces a window where a response might arrive before we have a chance to start waiting on a condition, resulting in timeouts on valid messages. Fixes: 783b6e54971d ("eal: add synchronous multi-process communication") Signed-off-by: Anatoly Burakov Acked-by: Jianfeng Tan --- lib/librte_eal/common/eal_common_proc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c index 3a1088e2f..da7930f56 100644 --- a/lib/librte_eal/common/eal_common_proc.c +++ b/lib/librte_eal/common/eal_common_proc.c @@ -561,10 +561,10 @@ mp_request_one(const char *dst, struct rte_mp_msg *req, exist = find_sync_request(dst, req->name); if (!exist) TAILQ_INSERT_TAIL(&sync_requests.requests, &sync_req, next); - pthread_mutex_unlock(&sync_requests.lock); if (exist) { RTE_LOG(ERR, EAL, "A pending request %s:%s\n", dst, req->name); rte_errno = EEXIST; + pthread_mutex_unlock(&sync_requests.lock); return -1; } @@ -578,7 +578,6 @@ mp_request_one(const char *dst, struct rte_mp_msg *req, reply->nb_sent++; - pthread_mutex_lock(&sync_requests.lock); do { pthread_cond_timedwait(&sync_req.cond, &sync_requests.lock, ts); /* Check spurious wakeups */ -- 2.14.2