RDMA/efa: Expose new extended max inline buff size
Subsystems (2)
PATCH 1/1 RDMA/efa: Expose new extended max inline buff size
Add new extended max inline query and report the new value to userspace.
Reviewed-by Firas Jahjah <[email protected]>
Reviewed-by Michael Margolin <[email protected]>
Signed-off-by Yonatan Nachum <[email protected]>
--- .../infiniband/hw/efa/efa_admin_cmds_defs.h | 22 ++++++-- drivers/infiniband/hw/efa/efa_com_cmd.c | 55 ++++++++++++------- drivers/infiniband/hw/efa/efa_com_cmd.h | 3 +- drivers/infiniband/hw/efa/efa_verbs.c | 3 +- include/uapi/rdma/efa-abi.h | 5 +- 5 files changed, 59 insertions(+), 29 deletions(-)
drivers/infiniband/hw/efa/efa_admin_cmds_defs.h +17 -5
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */ /* -* Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All rights reserved. +* Copyright 2018-2026 Amazon.com, Inc. or its affiliates. All rights reserved. */ #ifndef _EFA_ADMIN_CMDS_H_
@@ -38,10 +38,11 @@ enum efa_admin_aq_feature_id {EFA_ADMIN_DEVICE_ATTR =1 ,EFA_ADMIN_AENQ_CONFIG =2 ,EFA_ADMIN_NETWORK_ATTR =3 , -EFA_ADMIN_QUEUE_ATTR =4 , +EFA_ADMIN_QUEUE_ATTR_1 =4 ,EFA_ADMIN_HW_HINTS =5 ,EFA_ADMIN_HOST_INFO =6 ,EFA_ADMIN_EVENT_QUEUE_ATTR =7 , + EFA_ADMIN_QUEUE_ATTR_2 = 8, };/* QP transport type */
@@ -744,14 +745,18 @@ struct efa_admin_feature_device_attr_desc {u32 reserved1; }; -struct efa_admin_feature_queue_attr_desc { +struct efa_admin_feature_queue_attr_desc_1 {/* The maximum number of queue pairs supported */ u32 max_qp;/* Maximum number of WQEs per Send Queue */ u32 max_sq_depth; -/* Maximum size of data that can be sent inline in a Send WQE */ +/* +* Maximum size of data that can be sent inline in a Send WQE +* (deprecated by +* efa_admin_feature_queue_attr_desc_2::inline_buf_size_ex) +*/ u32 inline_buf_size;/* Maximum number of buffer descriptors per Recv Queue */
@@ -805,6 +810,11 @@ struct efa_admin_feature_queue_attr_desc {u16 max_tx_batch; }; +struct efa_admin_feature_queue_attr_desc_2 { +/* Maximum size of data that can be sent inline in a Send WQE */ +u16 inline_buf_size_ex; +}; +struct efa_admin_event_queue_attr_desc {/* The maximum number of event queues supported */ u32 max_eq;
@@ -872,7 +882,9 @@ struct efa_admin_get_feature_resp {struct efa_admin_feature_network_attr_desc network_attr; -struct efa_admin_feature_queue_attr_desc queue_attr; +struct efa_admin_feature_queue_attr_desc_1 queue_attr_1; + +struct efa_admin_feature_queue_attr_desc_2 queue_attr_2;struct efa_admin_event_queue_attr_desc event_queue_attr;
drivers/infiniband/hw/efa/efa_com_cmd.c +35 -20
72 lines not on this page · raw message
drivers/infiniband/hw/efa/efa_com_cmd.h +2 -1
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */ /* -* Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All rights reserved. +* Copyright 2018-2026 Amazon.com, Inc. or its affiliates. All rights reserved. */ #ifndef _EFA_COM_CMD_H_
@@ -127,6 +127,7 @@ struct efa_com_get_device_attr_result {u32 max_cq;u32 max_cq_depth;/* cqes */ u32 inline_buf_size; +u32 inline_buf_size_ex;u32 max_mr;u32 max_pd;u32 max_ah;
drivers/infiniband/hw/efa/efa_verbs.c +2 -1
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* -* Copyright 2018-2024 Amazon.com, Inc. or its affiliates. All rights reserved. +* Copyright 2018-2026 Amazon.com, Inc. or its affiliates. All rights reserved. */ #include <linux/dma-buf.h>
@@ -1994,6 +1994,7 @@ int efa_alloc_ucontext(struct ib_ucontext *ibucontext, struct ib_udata *udata) resp.cmds_supp_udata_mask |=EFA_USER_CMDS_SUPP_UDATA_CREATE_AH ; resp.sub_cqs_per_cq = dev->dev_attr.sub_cqs_per_cq; resp.inline_buf_size = dev->dev_attr.inline_buf_size; + resp.inline_buf_size_ex = dev->dev_attr.inline_buf_size_ex; resp.max_llq_size = dev->dev_attr.max_llq_size; resp.max_tx_batch = dev->dev_attr.max_tx_batch; resp.min_sq_wr = dev->dev_attr.min_sq_depth;
include/uapi/rdma/efa-abi.h +3 -2
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ /* -* Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All rights reserved. +* Copyright 2018-2026 Amazon.com, Inc. or its affiliates. All rights reserved. */ #ifndef EFA_ABI_USER_H
@@ -44,7 +44,8 @@ struct efa_ibv_alloc_ucontext_resp {__u32 max_llq_size;/* bytes */ __u16 max_tx_batch;/* units of 64 bytes */ __u16 min_sq_wr; -__u8 reserved_a0[4 ]; +__u16 inline_buf_size_ex; +__u8 reserved_b0[2 ]; };struct efa_ibv_alloc_pd_resp {
Signature · 1 line
2.47.3
Gal Pressman
reviewerQuoted 13 lines · Yonatan Nachum
include/uapi/rdma/efa-abi.h +1
-1@@ -1,6 +1,6 @@/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ /* -* Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All rights reserved. +* Copyright 2018-2026 Amazon.com, Inc. or its affiliates. All rights reserved. */ #ifndef EFA_ABI_USER_H
include/uapi/rdma/efa-abi.h struct efa_ibv_alloc_ucontext_resp { · line 48
Quoted 6 lines
include/uapi/rdma/efa-abi.h +2
-1@@ -44,7 +44,8 @@ struct efa_ibv_alloc_ucontext_resp {__u32 max_llq_size;/* bytes */ __u16 max_tx_batch;/* units of 64 bytes */ __u16 min_sq_wr; -__u8 reserved_a0[4 ]; +__u16 inline_buf_size_ex; +__u8 reserved_b0[2 ];
Do you need both values exposed to userspace?
Can't you reuse the same uapi field?
Quoted 36 lines · Yonatan Nachum
Add new extended max inline query and report the new value to userspace.
Reviewed-by Firas Jahjah <[email protected]>Reviewed-by Michael Margolin <[email protected]>Signed-off-by Yonatan Nachum <[email protected]>--- .../infiniband/hw/efa/efa_admin_cmds_defs.h | 22 ++++++-- drivers/infiniband/hw/efa/efa_com_cmd.c | 55 ++++++++++++------- drivers/infiniband/hw/efa/efa_com_cmd.h | 3 +- drivers/infiniband/hw/efa/efa_verbs.c | 3 +- include/uapi/rdma/efa-abi.h | 5 +- 5 files changed, 59 insertions(+), 29 deletions(-)drivers/infiniband/hw/efa/efa_admin_cmds_defs.h +3
-2@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */ /* -* Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All rights reserved. +* Copyright 2018-2026 Amazon.com, Inc. or its affiliates. All rights reserved. */ #ifndef _EFA_ADMIN_CMDS_H_@@ -38,10 +38,11 @@ enum efa_admin_aq_feature_id {EFA_ADMIN_DEVICE_ATTR =1 ,EFA_ADMIN_AENQ_CONFIG =2 ,EFA_ADMIN_NETWORK_ATTR =3 , -EFA_ADMIN_QUEUE_ATTR =4 , +EFA_ADMIN_QUEUE_ATTR_1 =4 ,EFA_ADMIN_HW_HINTS =5 ,EFA_ADMIN_HOST_INFO =6 ,EFA_ADMIN_EVENT_QUEUE_ATTR =7 , + EFA_ADMIN_QUEUE_ATTR_2 = 8, };
<...>
Quoted 24 lines
drivers/infiniband/hw/efa/efa_admin_cmds_defs.h +7
-17- result->max_qp = resp.u.queue_attr.max_qp; - result->max_sq_depth = resp.u.queue_attr.max_sq_depth; - result->max_rq_depth = resp.u.queue_attr.max_rq_depth; - result->max_cq = resp.u.queue_attr.max_cq; - result->max_cq_depth = resp.u.queue_attr.max_cq_depth; - result->inline_buf_size = resp.u.queue_attr.inline_buf_size; - result->max_sq_sge = resp.u.queue_attr.max_wr_send_sges; - result->max_rq_sge = resp.u.queue_attr.max_wr_recv_sges; - result->max_mr = resp.u.queue_attr.max_mr; - result->max_mr_pages = resp.u.queue_attr.max_mr_pages; - result->max_pd = resp.u.queue_attr.max_pd; - result->max_ah = resp.u.queue_attr.max_ah; - result->max_llq_size = resp.u.queue_attr.max_llq_size; - result->sub_cqs_per_cq = resp.u.queue_attr.sub_cqs_per_cq; - result->max_wr_rdma_sge = resp.u.queue_attr.max_wr_rdma_sges; - result->max_tx_batch = resp.u.queue_attr.max_tx_batch; - result->min_sq_depth = resp.u.queue_attr.min_sq_depth; + result->max_qp = resp.u.queue_attr_1.max_qp; + result->max_sq_depth = resp.u.queue_attr_1.max_sq_depth; + result->max_rq_depth = resp.u.queue_attr_1.max_rq_depth; + result->max_cq = resp.u.queue_attr_1.max_cq; + result->max_cq_depth = resp.u.queue_attr_1.max_cq_depth; + result->inline_buf_size = resp.u.queue_attr_1.inline_buf_size; + result->max_sq_sge = resp.u.queue_attr_1.max_wr_send_sges;
drivers/infiniband/hw/efa/efa_admin_cmds_defs.h
Quoted 10 lines
drivers/infiniband/hw/efa/efa_admin_cmds_defs.h +10
-0+ result->max_rq_sge = resp.u.queue_attr_1.max_wr_recv_sges; + result->max_mr = resp.u.queue_attr_1.max_mr; + result->max_mr_pages = resp.u.queue_attr_1.max_mr_pages; + result->max_pd = resp.u.queue_attr_1.max_pd; + result->max_ah = resp.u.queue_attr_1.max_ah; + result->max_llq_size = resp.u.queue_attr_1.max_llq_size; + result->sub_cqs_per_cq = resp.u.queue_attr_1.sub_cqs_per_cq; + result->max_wr_rdma_sge = resp.u.queue_attr_1.max_wr_rdma_sges; + result->max_tx_batch = resp.u.queue_attr_1.max_tx_batch; + result->min_sq_depth = resp.u.queue_attr_1.min_sq_depth;
Please split this patch to two: first is rename and second one is addition.
Thanks