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 AD6DCA0C4C for ; Mon, 12 Jul 2021 15:15:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A4E8A40685; Mon, 12 Jul 2021 15:15:13 +0200 (CEST) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mails.dpdk.org (Postfix) with ESMTP id C29EA41177 for ; Mon, 12 Jul 2021 15:15:11 +0200 (CEST) Received: by mail-wr1-f41.google.com with SMTP id m2so14537603wrq.2 for ; Mon, 12 Jul 2021 06:15:11 -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 :mime-version:content-transfer-encoding; bh=kqpsP9SUjND13VVYd+4k0BQ3MNASicYX32X7vGvaFnA=; b=Gmj76iiLQjqQxZdW4etx0dBOmPk9Wki69JKpsbtLWZBfnKxROgJkXSC5L8Q5+jBUHF OTckqisH/CF3Lz5SvFEt8zky13+aEohZCtzvsnSzJ5IHrFy083lBj/E8R70p2m9SFB24 g1EVjFGY3PNgCSo/GnDOs1M6PWOHqp+2+Jc7tMqbmOQDYUejyAwY08hKi/LzdgO0/VeK FNqDkQvEoHhjiqNXMCZy9bk9tdYObvkfYHqvgB0Gsjriodj6HmcS5WXeVv0ZMxLH2EiF xXPIcgFnOs2+GfC4OMNi7/00/tkB5Vpz70Ju63p3WHsPcYuQnkAFf8FEPKKeM1b16S/p 04tQ== 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=kqpsP9SUjND13VVYd+4k0BQ3MNASicYX32X7vGvaFnA=; b=YUAoi4tgXMHa3l4pQJzij5gAyufpEEsH7Xp+3oITBKRKJKlcok7h3KVDAWCcfricK3 bjW+B6MFtGzBegVUoEcXySQMW5mSyaE8U9c7pqW4liXqA1COvJ2E+kGk3Rq5KOOaDvoV 2iNZPopJ73JZV5OUPTQMLiGU6QdrQGiR8ZpIxMwXioHgD/MeerfrM3bT+FR05izsQulB b2j7f4JWecNa4SgltNl+xfxWa+a2+R+ZbwMzPj5hifVUGngu5xfISbyU0dnGaCwzKTSd pa7wknyfmp6etrORV3KrEP81cGDDOE6bsgdbPtJK5m/TgD8b2l+7U+wOkcJMZm1QDxfo rPxA== X-Gm-Message-State: AOAM5319olBeP9dlEUY5BW8AqLmWaIroGjD6BWYGQ0MS6ZrbUdsFqOPI p7CX8n0EtOiLf5is4kMEp6w= X-Google-Smtp-Source: ABdhPJyZlfvvXepXhmOF+FnI8VBBUZq6KvTdyNzKYlnmlRI12qCAlFFU9u7DDlfzI+tyJyDWEt2v4A== X-Received: by 2002:adf:ee0a:: with SMTP id y10mr6934586wrn.209.1626095711581; Mon, 12 Jul 2021 06:15:11 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id o6sm6641583wry.91.2021.07.12.06.15.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:15:11 -0700 (PDT) From: luca.boccassi@gmail.com To: Feifei Wang Cc: Ruifeng Wang , Viacheslav Ovsiienko , dpdk stable Date: Mon, 12 Jul 2021 14:05:31 +0100 Message-Id: <20210712130551.2462159-96-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210712130551.2462159-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix r/w lock usage in DMA unmap' has been queued to stable release 20.11.3 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.3 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/14/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/653b095f492f5219ae7f00e904bf23b397a2adb7 Thanks. Luca Boccassi --- >From 653b095f492f5219ae7f00e904bf23b397a2adb7 Mon Sep 17 00:00:00 2001 From: Feifei Wang Date: Thu, 27 May 2021 17:48:06 +0800 Subject: [PATCH] net/mlx5: fix r/w lock usage in DMA unmap [ upstream commit 1c196da274b82e6f1642bde7b1c407a2066caee1 ] For mlx5 DMA unmap, write lock should be used for rebuilding memory region cache table rather than read lock. Fixes: 989e999d9305 ("net/mlx5: support PCI device DMA map and unmap") Signed-off-by: Feifei Wang Reviewed-by: Ruifeng Wang Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_mr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c index 2cce3b9fe8..1dd14ddfe5 100644 --- a/drivers/net/mlx5/mlx5_mr.c +++ b/drivers/net/mlx5/mlx5_mr.c @@ -302,10 +302,10 @@ mlx5_dma_unmap(struct rte_pci_device *pdev, void *addr, } priv = dev->data->dev_private; sh = priv->sh; - rte_rwlock_read_lock(&sh->share_cache.rwlock); + rte_rwlock_write_lock(&sh->share_cache.rwlock); mr = mlx5_mr_lookup_list(&sh->share_cache, &entry, (uintptr_t)addr); if (!mr) { - rte_rwlock_read_unlock(&sh->share_cache.rwlock); + rte_rwlock_write_unlock(&sh->share_cache.rwlock); DRV_LOG(WARNING, "address 0x%" PRIxPTR " wasn't registered " "to PCI device %p", (uintptr_t)addr, (void *)pdev); @@ -330,7 +330,7 @@ mlx5_dma_unmap(struct rte_pci_device *pdev, void *addr, DEBUG("broadcasting local cache flush, gen=%d", sh->share_cache.dev_gen); rte_smp_wmb(); - rte_rwlock_read_unlock(&sh->share_cache.rwlock); + rte_rwlock_write_unlock(&sh->share_cache.rwlock); return 0; } -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:41.529022936 +0100 +++ 0096-net-mlx5-fix-r-w-lock-usage-in-DMA-unmap.patch 2021-07-12 13:41:36.794128943 +0100 @@ -1 +1 @@ -From 1c196da274b82e6f1642bde7b1c407a2066caee1 Mon Sep 17 00:00:00 2001 +From 653b095f492f5219ae7f00e904bf23b397a2adb7 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 1c196da274b82e6f1642bde7b1c407a2066caee1 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index 0b6cfc8cb9..89c43fc9e9 100644 +index 2cce3b9fe8..1dd14ddfe5 100644 @@ -23 +24 @@ -@@ -304,10 +304,10 @@ mlx5_dma_unmap(struct rte_pci_device *pdev, void *addr, +@@ -302,10 +302,10 @@ mlx5_dma_unmap(struct rte_pci_device *pdev, void *addr, @@ -36,3 +37,2 @@ -@@ -327,7 +327,7 @@ mlx5_dma_unmap(struct rte_pci_device *pdev, void *addr, - ++sh->share_cache.dev_gen; - DRV_LOG(DEBUG, "broadcasting local cache flush, gen=%d", +@@ -330,7 +330,7 @@ mlx5_dma_unmap(struct rte_pci_device *pdev, void *addr, + DEBUG("broadcasting local cache flush, gen=%d", @@ -39,0 +40 @@ + rte_smp_wmb();