From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 455DFA0524 for ; Fri, 5 Feb 2021 12:38:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3F64E188A51; Fri, 5 Feb 2021 12:38:32 +0100 (CET) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mails.dpdk.org (Postfix) with ESMTP id C0D56188A5B for ; Fri, 5 Feb 2021 12:38:31 +0100 (CET) Received: by mail-wr1-f50.google.com with SMTP id a1so7336704wrq.6 for ; Fri, 05 Feb 2021 03:38:31 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=FA9/4iVfwP6z9uvyeRtYBCPpwHpXOjHM7d1UApbyIyQ=; b=ht/bNWHUNYyzw1iyMzbGjLB36tKe9cHDLoRTFtoq6tK9Gc12Ue6jTb5Y1bl71SHCac W8VTJW8RhH1dFItZ/aovInNrZ5YWyO8/mMt+PAn5KOX0kVH8stIQy/hncR/03ZT5itoN n1HmIQnWlAK55idwIkLQawRXHgRLX3BHFtbb6V38CkQdAiyTI4N3n2Kvru4o3uZeu/d8 v+o+KZ9AbNxqWLm1yLmQW3vV8hNhEZ/NvFQ+we+18Co57aQBjRYyIANOPgXrUJ0erMf7 NWPgjzhktN8DhU09z3LsfWmCpJuZ8AtK/ld9LpVXqcHyZ+SjWDoBpk4iJ4K059bJbR+N 8NtQ== 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:mime-version:content-transfer-encoding; bh=FA9/4iVfwP6z9uvyeRtYBCPpwHpXOjHM7d1UApbyIyQ=; b=eH5t3tcjsPgO4sBbVFyGrVVcvu+EdDc+ljysVmoa0uD6JozFZy7g5CWu+2xbnyD5dV hNo5FccNdVY3ciBwVvbLrCTs/c7xobXOmQ8LNK7fb4kDXvpXSHGm2dGeCKEDAdlxWB6L a8MPkKNN88sY+b/ecn55lcHf0CulmQrPg8b8Lnte4DcoXSjs81UUExQhQB1qwV/7pyoP HP6FAHtUiGdcuesPeQ25wwnEPkcX4TwcJ/hrUcKOBiDz57kYdQPziOavp3a9OV93RDde lxGGccS7com2tJXzheAutqcsa+UDUF78PdNbJjBK92zYEL8EKNLvkSvgR4PTXdFEgIMO pkpg== X-Gm-Message-State: AOAM532WnC6GygBEszZYTH9Hwuh8Gu477Q1+nWAVu9LXtEhpNS9TMbeh Vey92DFNSByDoeSRwfIhSOcJZfasTPdc5W6w X-Google-Smtp-Source: ABdhPJwaJCbhv06QJyYbU/lTM5ISA7UkDVMgA7vtSXzeCUeeLmNOqdwAOWD6W23poEV7J/hv6/2xmw== X-Received: by 2002:a5d:4574:: with SMTP id a20mr4519549wrc.201.1612525111591; Fri, 05 Feb 2021 03:38:31 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id b4sm11404211wrn.12.2021.02.05.03.38.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:38:30 -0800 (PST) From: luca.boccassi@gmail.com To: Matan Azrad Cc: Xueming Li , Maxime Coquelin , dpdk stable Date: Fri, 5 Feb 2021 11:18:56 +0000 Message-Id: <20210205111920.1272063-250-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'vdpa/mlx5: fix configuration mutex cleanup' has been queued to stable release 20.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/07/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/9bf462abbe3a3e688c8d97bc836d21f6ad4b7f70 Thanks. Luca Boccassi --- >From 9bf462abbe3a3e688c8d97bc836d21f6ad4b7f70 Mon Sep 17 00:00:00 2001 From: Matan Azrad Date: Wed, 6 Jan 2021 06:43:29 +0000 Subject: [PATCH] vdpa/mlx5: fix configuration mutex cleanup [ upstream commit f00e5a15af5a0c5df1a7390364b6454d34586335 ] When the vDPA device is closed, the driver polling thread is canceled. The polling thread locks the configuration mutex while it polls the CQs. When the cancellation happens, it may terminate the thread inside the critical section what remains the configuration mutex locked. After device close, the driver may be configured again, in this case, for example, when the first queue state is updated, the driver tries to lock the mutex again and deadlock appears. Initialize the mutex after the polling thread cancellation. Fixes: 99abbd62c272 ("vdpa/mlx5: fix queue update synchronization") Signed-off-by: Matan Azrad Acked-by: Xueming Li Acked-by: Maxime Coquelin --- drivers/vdpa/mlx5/mlx5_vdpa.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c index b64f364eb7..0b2f1ab68e 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa.c @@ -295,6 +295,8 @@ mlx5_vdpa_dev_close(int vid) } priv->configured = 0; priv->vid = 0; + /* The mutex may stay locked after event thread cancel - initiate it. */ + pthread_mutex_init(&priv->vq_config_lock, NULL); DRV_LOG(INFO, "vDPA device %d was closed.", vid); return ret; } -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:40.197745984 +0000 +++ 0250-vdpa-mlx5-fix-configuration-mutex-cleanup.patch 2021-02-05 11:18:29.262699793 +0000 @@ -1 +1 @@ -From f00e5a15af5a0c5df1a7390364b6454d34586335 Mon Sep 17 00:00:00 2001 +From 9bf462abbe3a3e688c8d97bc836d21f6ad4b7f70 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit f00e5a15af5a0c5df1a7390364b6454d34586335 ] + @@ -19 +20,0 @@ -Cc: stable@dpdk.org @@ -29 +30 @@ -index 0f22a863a3..4c2d886bd7 100644 +index b64f364eb7..0b2f1ab68e 100644