On 2024/12/4 22:11, Leon Romanovsky wrote:
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@xxxxxxxxxxxxxxxxx>
Reviewed-by: Cheng Xu <chengyou@xxxxxxxxxxxxxxxxx>
---
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
Hi, Leon,
Thank you for your suggestion. We will fix the problem in the patch v2.
Thanks,
Boshi Yu