public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Boshi Yu <boshiyu@alibaba-inc.com>
Cc: jgg@ziepe.ca, linux-rdma@vger.kernel.org,
	chengyou@linux.alibaba.com, KaiShen@linux.alibaba.com
Subject: Re: [PATCH for-next 3/3] RDMA/erdma: Remove unnecessary __GFP_ZERO flag
Date: Tue, 12 Mar 2024 12:53:05 +0200	[thread overview]
Message-ID: <20240312105305.GR12921@unreal> (raw)
In-Reply-To: <20240311113821.22482-4-boshiyu@alibaba-inc.com>

On Mon, Mar 11, 2024 at 07:38:21PM +0800, Boshi Yu wrote:
> From: Boshi Yu <boshiyu@linux.alibaba.com>
> 
> The dma_alloc_coherent() interface automatically zero the memory returned.

Can you please point to the DMA code which does that?

> Thus, we do not need to specify the __GFP_ZERO flag explicitly when we call
> dma_alloc_coherent().
> 
> Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com>
> Signed-off-by: Boshi Yu <boshiyu@linux.alibaba.com>
> ---
>  drivers/infiniband/hw/erdma/erdma_cmdq.c | 6 ++----
>  drivers/infiniband/hw/erdma/erdma_eq.c   | 6 ++----
>  2 files changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/erdma/erdma_cmdq.c b/drivers/infiniband/hw/erdma/erdma_cmdq.c
> index 0ac2683cfccf..43ff40b5a09d 100644
> --- a/drivers/infiniband/hw/erdma/erdma_cmdq.c
> +++ b/drivers/infiniband/hw/erdma/erdma_cmdq.c
> @@ -127,8 +127,7 @@ static int erdma_cmdq_cq_init(struct erdma_dev *dev)
>  
>  	cq->depth = cmdq->sq.depth;
>  	cq->qbuf = dma_alloc_coherent(&dev->pdev->dev, cq->depth << CQE_SHIFT,
> -				      &cq->qbuf_dma_addr,
> -				      GFP_KERNEL | __GFP_ZERO);
> +				      &cq->qbuf_dma_addr, GFP_KERNEL);
>  	if (!cq->qbuf)
>  		return -ENOMEM;
>  
> @@ -162,8 +161,7 @@ static int erdma_cmdq_eq_init(struct erdma_dev *dev)
>  
>  	eq->depth = cmdq->max_outstandings;
>  	eq->qbuf = dma_alloc_coherent(&dev->pdev->dev, eq->depth << EQE_SHIFT,
> -				      &eq->qbuf_dma_addr,
> -				      GFP_KERNEL | __GFP_ZERO);
> +				      &eq->qbuf_dma_addr, GFP_KERNEL);
>  	if (!eq->qbuf)
>  		return -ENOMEM;
>  
> diff --git a/drivers/infiniband/hw/erdma/erdma_eq.c b/drivers/infiniband/hw/erdma/erdma_eq.c
> index 0a4746e6d05c..84ccdd8144c9 100644
> --- a/drivers/infiniband/hw/erdma/erdma_eq.c
> +++ b/drivers/infiniband/hw/erdma/erdma_eq.c
> @@ -87,8 +87,7 @@ int erdma_aeq_init(struct erdma_dev *dev)
>  	eq->depth = ERDMA_DEFAULT_EQ_DEPTH;
>  
>  	eq->qbuf = dma_alloc_coherent(&dev->pdev->dev, eq->depth << EQE_SHIFT,
> -				      &eq->qbuf_dma_addr,
> -				      GFP_KERNEL | __GFP_ZERO);
> +				      &eq->qbuf_dma_addr, GFP_KERNEL);
>  	if (!eq->qbuf)
>  		return -ENOMEM;
>  
> @@ -237,8 +236,7 @@ static int erdma_ceq_init_one(struct erdma_dev *dev, u16 ceqn)
>  
>  	eq->depth = ERDMA_DEFAULT_EQ_DEPTH;
>  	eq->qbuf = dma_alloc_coherent(&dev->pdev->dev, eq->depth << EQE_SHIFT,
> -				      &eq->qbuf_dma_addr,
> -				      GFP_KERNEL | __GFP_ZERO);
> +				      &eq->qbuf_dma_addr, GFP_KERNEL);
>  	if (!eq->qbuf)
>  		return -ENOMEM;
>  
> -- 
> 2.39.3
> 
> 

  reply	other threads:[~2024-03-12 10:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-11 11:38 [PATCH for-next 0/3] RDMA/erdma: A series of fixes for the erdma driver Boshi Yu
2024-03-11 11:38 ` [PATCH for-next 1/3] RDMA/erdma: Allocate doorbell records from dma pool Boshi Yu
2024-03-13 16:20   ` Zhu Yanjun
2024-03-14 10:23     ` Zhu Yanjun
2024-03-11 11:38 ` [PATCH for-next 2/3] RDMA/erdma: Unify the names related to doorbell records Boshi Yu
2024-03-11 11:38 ` [PATCH for-next 3/3] RDMA/erdma: Remove unnecessary __GFP_ZERO flag Boshi Yu
2024-03-12 10:53   ` Leon Romanovsky [this message]
2024-03-13  2:40     ` Boshi Yu
2024-03-13  9:31       ` Leon Romanovsky
2024-03-12 10:54 ` [PATCH for-next 0/3] RDMA/erdma: A series of fixes for the erdma driver Leon Romanovsky
2024-04-01 11:46 ` Leon Romanovsky

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=20240312105305.GR12921@unreal \
    --to=leon@kernel.org \
    --cc=KaiShen@linux.alibaba.com \
    --cc=boshiyu@alibaba-inc.com \
    --cc=chengyou@linux.alibaba.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-rdma@vger.kernel.org \
    /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