DPDK patches and discussions
 help / color / mirror / Atom feed
From: Feifei Wang <Feifei.Wang2@arm.com>
To: Feifei Wang <Feifei.Wang2@arm.com>,
	Matan Azrad <matan@nvidia.com>,
	Shahaf Shuler <shahafs@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, nd <nd@arm.com>,
	"shahafs@mellanox.com" <shahafs@mellanox.com>,
	"stable@dpdk.org" <stable@dpdk.org>,
	Ruifeng Wang <Ruifeng.Wang@arm.com>, nd <nd@arm.com>
Subject: [dpdk-dev] 回复: [PATCH] net/mlx5: fix incorrect r/w lock usage in DMA unmap
Date: Tue, 22 Jun 2021 01:54:17 +0000	[thread overview]
Message-ID: <AS8PR08MB6919A718981CDCA35AB54C78C8099@AS8PR08MB6919.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <20210527094806.1383353-1-feifei.wang2@arm.com>

Hi, Slava

Would you please help review this patch?
Thanks.

Best Regards
Feifei

> -----邮件原件-----
> 发件人: Feifei Wang <feifei.wang2@arm.com>
> 发送时间: 2021年5月27日 17:48
> 收件人: Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> <shahafs@nvidia.com>; Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> 抄送: dev@dpdk.org; nd <nd@arm.com>; Feifei Wang
> <Feifei.Wang2@arm.com>; shahafs@mellanox.com; stable@dpdk.org;
> Ruifeng Wang <Ruifeng.Wang@arm.com>
> 主题: [PATCH] net/mlx5: fix incorrect r/w lock usage in DMA unmap
> 
> 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")
> Cc: shahafs@mellanox.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> ---
>  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
> e791b6338d..45a122f4f9 100644
> --- a/drivers/net/mlx5/mlx5_mr.c
> +++ b/drivers/net/mlx5/mlx5_mr.c
> @@ -395,10 +395,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);
> @@ -423,7 +423,7 @@ mlx5_dma_unmap(struct rte_pci_device *pdev, void
> *addr,
>  	DRV_LOG(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.25.1


  reply	other threads:[~2021-06-22  1:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27  9:48 [dpdk-dev] " Feifei Wang
2021-06-22  1:54 ` Feifei Wang [this message]
2021-07-01 14:26   ` Slava Ovsiienko
2021-07-02  1:02     ` [dpdk-dev] 回复: " Feifei Wang
2021-07-06  9:34 ` [dpdk-dev] " Raslan Darawsheh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AS8PR08MB6919A718981CDCA35AB54C78C8099@AS8PR08MB6919.eurprd08.prod.outlook.com \
    --to=feifei.wang2@arm.com \
    --cc=Ruifeng.Wang@arm.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=nd@arm.com \
    --cc=shahafs@mellanox.com \
    --cc=shahafs@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).