public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Boshi Yu <boshiyu@linux.alibaba.com>
Cc: jgg@ziepe.ca, linux-rdma@vger.kernel.org,
	kaishen@linux.alibaba.com, chengyou@linux.alibaba.com
Subject: Re: [PATCH for-next 4/8] RDMA/erdma: Add address handle implementation
Date: Wed, 4 Dec 2024 16:11:02 +0200	[thread overview]
Message-ID: <20241204141102.GP1245331@unreal> (raw)
In-Reply-To: <20241126070351.92787-5-boshiyu@linux.alibaba.com>

On Tue, Nov 26, 2024 at 02:59:10PM +0800, Boshi Yu wrote:
> The address handle contains the necessary information to transmit
> messages to a remote peer in the RoCEv2 protocol. This commit
> implements the erdma_create_ah(), erdma_destroy_ah(), and
> erdma_query_ah() interfaces, which are used to create, destroy,
> and query an address handle, respectively.
> 
> Signed-off-by: Boshi Yu <boshiyu@linux.alibaba.com>
> Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com>
> ---
>  drivers/infiniband/hw/erdma/erdma.h       |   4 +-
>  drivers/infiniband/hw/erdma/erdma_hw.h    |  34 ++++++
>  drivers/infiniband/hw/erdma/erdma_main.c  |   4 +
>  drivers/infiniband/hw/erdma/erdma_verbs.c | 135 +++++++++++++++++++++-
>  drivers/infiniband/hw/erdma/erdma_verbs.h |  28 +++++
>  5 files changed, 203 insertions(+), 2 deletions(-)

<...>

> +static void erdma_av_to_attr(struct erdma_av *av, struct rdma_ah_attr *attr)
> +{
> +	attr->type = RDMA_AH_ATTR_TYPE_ROCE;
> +
> +	rdma_ah_set_sl(attr, av->sl);
> +	rdma_ah_set_port_num(attr, av->port);
> +	rdma_ah_set_ah_flags(attr, IB_AH_GRH);
> +
> +	rdma_ah_set_grh(attr, NULL, av->flow_label, av->sgid_index,
> +			av->hop_limit, av->traffic_class);
> +	rdma_ah_set_dgid_raw(attr, av->dgid);
> +}

<...>

> +int erdma_query_ah(struct ib_ah *ibah, struct rdma_ah_attr *ah_attr)
> +{
> +	struct erdma_ah *ah = to_eah(ibah);
> +
> +	memset(ah_attr, 0, sizeof(*ah_attr));
> +	erdma_av_to_attr(&ah->av, ah_attr);

This function is used only once and in this file. There is no need to
create useless indirection. The same comment applicable to other
functions as well.

Thanks

  reply	other threads:[~2024-12-04 14:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-26  6:59 [PATCH for-next 0/8] RDMA/erdma: Support the RoCEv2 protocol Boshi Yu
2024-11-26  6:59 ` [PATCH for-next 1/8] RDMA/erdma: Probe the erdma RoCEv2 device Boshi Yu
2024-11-26 15:36   ` Zhu Yanjun
2024-11-28  2:07     ` Cheng Xu
2024-11-28 13:07       ` Zhu Yanjun
2024-12-04 14:03   ` Leon Romanovsky
2024-12-05  2:46     ` Boshi Yu
2024-11-26  6:59 ` [PATCH for-next 2/8] RDMA/erdma: Add GID table management interfaces Boshi Yu
2024-11-26 15:51   ` Zhu Yanjun
2024-11-28  2:35     ` Boshi Yu
2024-11-29  8:54       ` Zhu Yanjun
2024-11-29 11:18         ` Boshi Yu
2024-11-29 18:40           ` Zhu Yanjun
2024-11-26  6:59 ` [PATCH for-next 3/8] RDMA/erdma: Add the erdma_query_pkey() interface Boshi Yu
2024-11-26  6:59 ` [PATCH for-next 4/8] RDMA/erdma: Add address handle implementation Boshi Yu
2024-12-04 14:11   ` Leon Romanovsky [this message]
2024-12-05  2:54     ` Boshi Yu
2024-11-26  6:59 ` [PATCH for-next 5/8] RDMA/erdma: Add erdma_modify_qp_rocev2() interface Boshi Yu
2024-11-26  6:59 ` [PATCH for-next 6/8] RDMA/erdma: Reformat the code of the modify_qp interface Boshi Yu
2024-11-26  6:59 ` [PATCH for-next 7/8] RDMA/erdma: Add the query_qp command to the cmdq Boshi Yu
2024-11-26  6:59 ` [PATCH for-next 8/8] RDMA/erdma: Support UD QPs and UD WRs Boshi Yu

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=20241204141102.GP1245331@unreal \
    --to=leon@kernel.org \
    --cc=boshiyu@linux.alibaba.com \
    --cc=chengyou@linux.alibaba.com \
    --cc=jgg@ziepe.ca \
    --cc=kaishen@linux.alibaba.com \
    --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