All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Cheng Xu <chengyou@linux.alibaba.com>
Cc: jgg@ziepe.ca, linux-rdma@vger.kernel.org, KaiShen@linux.alibaba.com
Subject: Re: [PATCH for-next 1/2] RDMA/erdma: Introduce dma pool for hardware responses of CMDQ requests
Date: Wed, 20 Dec 2023 12:12:43 +0200	[thread overview]
Message-ID: <20231220101243.GD136797@unreal> (raw)
In-Reply-To: <20231220085424.97407-2-chengyou@linux.alibaba.com>

On Wed, Dec 20, 2023 at 04:54:23PM +0800, Cheng Xu wrote:
> Hardware response, such as the result of query statistics, may be too
> long to be directly accommodated within the CQE structure. To address
> this, we introduce a DMA pool to hold the hardware's responses of CMDQ
> requests.
> 
> Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
> ---
>  drivers/infiniband/hw/erdma/erdma.h      |  2 ++
>  drivers/infiniband/hw/erdma/erdma_main.c | 38 ++++++++++++++++++++++--
>  2 files changed, 38 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/erdma/erdma.h b/drivers/infiniband/hw/erdma/erdma.h
> index f190111840e9..5df401a30cb9 100644
> --- a/drivers/infiniband/hw/erdma/erdma.h
> +++ b/drivers/infiniband/hw/erdma/erdma.h
> @@ -212,6 +212,8 @@ struct erdma_dev {
>  
>  	atomic_t num_ctx;
>  	struct list_head cep_list;
> +
> +	struct dma_pool *resp_pool;
>  };
>  
>  static inline void *get_queue_entry(void *qbuf, u32 idx, u32 depth, u32 shift)
> diff --git a/drivers/infiniband/hw/erdma/erdma_main.c b/drivers/infiniband/hw/erdma/erdma_main.c
> index 0880c79a978c..541e77aea494 100644
> --- a/drivers/infiniband/hw/erdma/erdma_main.c
> +++ b/drivers/infiniband/hw/erdma/erdma_main.c
> @@ -168,18 +168,48 @@ static void erdma_comm_irq_uninit(struct erdma_dev *dev)
>  	free_irq(dev->comm_irq.msix_vector, dev);
>  }
>  
> +static int erdma_dma_pools_init(struct erdma_dev *dev)
> +{
> +	dev->resp_pool = dma_pool_create("erdma_resp_pool", &dev->pdev->dev,
> +					 ERDMA_HW_RESP_SIZE, ERDMA_HW_RESP_SIZE,
> +					 0);
> +	if (!dev->resp_pool)
> +		return -ENOMEM;
> +
> +	return 0;
> +}
> +
> +static void erdma_dma_pools_destroy(struct erdma_dev *dev)
> +{
> +	dma_pool_destroy(dev->resp_pool);
> +}

Please don't add extra layer of functions which will be called in same
file anyway. Call directly to dma_pool_destroy(), same goes for dma_pool_create().

Thanks

  reply	other threads:[~2023-12-20 10:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-20  8:54 [PATCH for-next 0/2] RDMA/erdma: Introduce hardware statistics support Cheng Xu
2023-12-20  8:54 ` [PATCH for-next 1/2] RDMA/erdma: Introduce dma pool for hardware responses of CMDQ requests Cheng Xu
2023-12-20 10:12   ` Leon Romanovsky [this message]
2023-12-23  7:14     ` Cheng Xu
2023-12-20  8:54 ` [PATCH for-next 2/2] RDMA/erdma: Add hardware statistics support Cheng Xu
2023-12-20 10:16   ` Leon Romanovsky
2023-12-23  7:26     ` Cheng Xu

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=20231220101243.GD136797@unreal \
    --to=leon@kernel.org \
    --cc=KaiShen@linux.alibaba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.