public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-next v3 0/3] RDMA/efa: Expose extended max inline buffer size
@ 2026-02-17 11:23 Yonatan Nachum
  2026-02-17 11:23 ` [PATCH for-next v3 1/3] RDMA/efa: Rename admin queue attributes struct name for extendability Yonatan Nachum
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Yonatan Nachum @ 2026-02-17 11:23 UTC (permalink / raw)
  To: jgg, leon, linux-rdma
  Cc: mrgolin, sleybo, matua, gal.pressman, Yonatan Nachum

Changelog:
v3:
 * Use right enum value for new device query.
v2: https://lore.kernel.org/all/20260216133351.14896-1-ynachum@amazon.com/
 * Added patch 3 to use the extended inline buffer size for validation
   in QP creation.
v1: https://lore.kernel.org/all/20260215120451.18053-1-ynachum@amazon.com/

-------------------------------------------------------------------------
This series adds support for querying an extended max inline buffer size
from the EFA device.

The first patch renames the existing queue attributes structure to prepare
for adding a second queue attributes query.

The second patch introduces the new extended max inline buffer size query
and exposes this value to userspace.

The third patch updates the inline validation to use the extended inline
buffer size.

Yonatan Nachum (3):
  RDMA/efa: Rename admin queue attributes struct name for extendability
  RDMA/efa: Expose new extended max inline buff size
  RDMA/efa: Use extended inline buff size for inline validation

 .../infiniband/hw/efa/efa_admin_cmds_defs.h   | 23 ++++++--
 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         |  7 ++-
 include/uapi/rdma/efa-abi.h                   |  5 +-
 5 files changed, 62 insertions(+), 31 deletions(-)

-- 
2.47.3


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH for-next v3 1/3] RDMA/efa: Rename admin queue attributes struct name for extendability
  2026-02-17 11:23 [PATCH for-next v3 0/3] RDMA/efa: Expose extended max inline buffer size Yonatan Nachum
@ 2026-02-17 11:23 ` Yonatan Nachum
  2026-02-17 11:23 ` [PATCH for-next v3 2/3] RDMA/efa: Expose new extended max inline buff size Yonatan Nachum
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Yonatan Nachum @ 2026-02-17 11:23 UTC (permalink / raw)
  To: jgg, leon, linux-rdma
  Cc: mrgolin, sleybo, matua, gal.pressman, Yonatan Nachum

As preparation for adding a second queue attributes query, change the
name of the existing queue attributes.

Reviewed-by: Michael Margolin <mrgolin@amazon.com>
Signed-off-by: Yonatan Nachum <ynachum@amazon.com>
---
 .../infiniband/hw/efa/efa_admin_cmds_defs.h   |  8 ++--
 drivers/infiniband/hw/efa/efa_com_cmd.c       | 40 +++++++++----------
 2 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/infiniband/hw/efa/efa_admin_cmds_defs.h b/drivers/infiniband/hw/efa/efa_admin_cmds_defs.h
index 57178dad5eb7..5bbc765b6e3f 100644
--- a/drivers/infiniband/hw/efa/efa_admin_cmds_defs.h
+++ b/drivers/infiniband/hw/efa/efa_admin_cmds_defs.h
@@ -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,7 +38,7 @@ 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,
@@ -744,7 +744,7 @@ 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;
 
@@ -872,7 +872,7 @@ 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_event_queue_attr_desc event_queue_attr;
 
diff --git a/drivers/infiniband/hw/efa/efa_com_cmd.c b/drivers/infiniband/hw/efa/efa_com_cmd.c
index 9ead02800ac7..592c420e4473 100644
--- a/drivers/infiniband/hw/efa/efa_com_cmd.c
+++ b/drivers/infiniband/hw/efa/efa_com_cmd.c
@@ -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.
  */
 
 #include "efa_com.h"
@@ -479,31 +479,31 @@ int efa_com_get_device_attr(struct efa_com_dev *edev,
 
 	edev->supported_features = resp.u.device_attr.supported_features;
 	err = efa_com_get_feature(edev, &resp,
-				  EFA_ADMIN_QUEUE_ATTR);
+				  EFA_ADMIN_QUEUE_ATTR_1);
 	if (err) {
 		ibdev_err_ratelimited(edev->efa_dev,
-				      "Failed to get queue attributes %d\n",
+				      "Failed to get queue attributes1 %d\n",
 				      err);
 		return err;
 	}
 
-	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;
+	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;
 
 	err = efa_com_get_feature(edev, &resp, EFA_ADMIN_NETWORK_ATTR);
 	if (err) {
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH for-next v3 2/3] RDMA/efa: Expose new extended max inline buff size
  2026-02-17 11:23 [PATCH for-next v3 0/3] RDMA/efa: Expose extended max inline buffer size Yonatan Nachum
  2026-02-17 11:23 ` [PATCH for-next v3 1/3] RDMA/efa: Rename admin queue attributes struct name for extendability Yonatan Nachum
@ 2026-02-17 11:23 ` Yonatan Nachum
  2026-02-17 11:23 ` [PATCH for-next v3 3/3] RDMA/efa: Use extended inline buff size for inline validation Yonatan Nachum
  2026-02-25 11:22 ` [PATCH for-next v3 0/3] RDMA/efa: Expose extended max inline buffer size Leon Romanovsky
  3 siblings, 0 replies; 5+ messages in thread
From: Yonatan Nachum @ 2026-02-17 11:23 UTC (permalink / raw)
  To: jgg, leon, linux-rdma
  Cc: mrgolin, sleybo, matua, gal.pressman, Yonatan Nachum,
	Firas Jahjah

Add new extended max inline query and report the new value to userspace.

Reviewed-by: Firas Jahjah <firasj@amazon.com>
Reviewed-by: Michael Margolin <mrgolin@amazon.com>
Signed-off-by: Yonatan Nachum <ynachum@amazon.com>
---
 drivers/infiniband/hw/efa/efa_admin_cmds_defs.h | 15 ++++++++++++++-
 drivers/infiniband/hw/efa/efa_com_cmd.c         | 15 +++++++++++++++
 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, 36 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/hw/efa/efa_admin_cmds_defs.h b/drivers/infiniband/hw/efa/efa_admin_cmds_defs.h
index 5bbc765b6e3f..ad34ea5da6b0 100644
--- a/drivers/infiniband/hw/efa/efa_admin_cmds_defs.h
+++ b/drivers/infiniband/hw/efa/efa_admin_cmds_defs.h
@@ -42,6 +42,7 @@ enum efa_admin_aq_feature_id {
 	EFA_ADMIN_HW_HINTS                          = 5,
 	EFA_ADMIN_HOST_INFO                         = 6,
 	EFA_ADMIN_EVENT_QUEUE_ATTR                  = 7,
+	EFA_ADMIN_QUEUE_ATTR_2                      = 9,
 };
 
 /* QP transport type */
@@ -751,7 +752,12 @@ struct efa_admin_feature_queue_attr_desc_1 {
 	/* 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 on
+	 * supporting devices)
+	 */
 	u32 inline_buf_size;
 
 	/* Maximum number of buffer descriptors per Recv Queue */
@@ -805,6 +811,11 @@ struct efa_admin_feature_queue_attr_desc_1 {
 	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;
@@ -874,6 +885,8 @@ struct efa_admin_get_feature_resp {
 
 		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;
 
 		struct efa_admin_hw_hints hw_hints;
diff --git a/drivers/infiniband/hw/efa/efa_com_cmd.c b/drivers/infiniband/hw/efa/efa_com_cmd.c
index 592c420e4473..63c7f07806a8 100644
--- a/drivers/infiniband/hw/efa/efa_com_cmd.c
+++ b/drivers/infiniband/hw/efa/efa_com_cmd.c
@@ -505,6 +505,21 @@ int efa_com_get_device_attr(struct efa_com_dev *edev,
 	result->max_tx_batch = resp.u.queue_attr_1.max_tx_batch;
 	result->min_sq_depth = resp.u.queue_attr_1.min_sq_depth;
 
+	if (efa_com_check_supported_feature_id(edev, EFA_ADMIN_QUEUE_ATTR_2)) {
+		err = efa_com_get_feature(edev, &resp,
+					  EFA_ADMIN_QUEUE_ATTR_2);
+		if (err) {
+			ibdev_err_ratelimited(
+				edev->efa_dev,
+				"Failed to get queue attributes2 %d\n", err);
+			return err;
+		}
+
+		result->inline_buf_size_ex = resp.u.queue_attr_2.inline_buf_size_ex;
+	} else {
+		result->inline_buf_size_ex = result->inline_buf_size;
+	}
+
 	err = efa_com_get_feature(edev, &resp, EFA_ADMIN_NETWORK_ATTR);
 	if (err) {
 		ibdev_err_ratelimited(edev->efa_dev,
diff --git a/drivers/infiniband/hw/efa/efa_com_cmd.h b/drivers/infiniband/hw/efa/efa_com_cmd.h
index 3ac2686abba1..ef15b3c38429 100644
--- a/drivers/infiniband/hw/efa/efa_com_cmd.h
+++ b/drivers/infiniband/hw/efa/efa_com_cmd.h
@@ -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;
diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c
index 22d3e25c3b9d..85c3a7dd4335 100644
--- a/drivers/infiniband/hw/efa/efa_verbs.c
+++ b/drivers/infiniband/hw/efa/efa_verbs.c
@@ -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;
diff --git a/include/uapi/rdma/efa-abi.h b/include/uapi/rdma/efa-abi.h
index 98b71b9979f8..13225b038124 100644
--- a/include/uapi/rdma/efa-abi.h
+++ b/include/uapi/rdma/efa-abi.h
@@ -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 {
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH for-next v3 3/3] RDMA/efa: Use extended inline buff size for inline validation
  2026-02-17 11:23 [PATCH for-next v3 0/3] RDMA/efa: Expose extended max inline buffer size Yonatan Nachum
  2026-02-17 11:23 ` [PATCH for-next v3 1/3] RDMA/efa: Rename admin queue attributes struct name for extendability Yonatan Nachum
  2026-02-17 11:23 ` [PATCH for-next v3 2/3] RDMA/efa: Expose new extended max inline buff size Yonatan Nachum
@ 2026-02-17 11:23 ` Yonatan Nachum
  2026-02-25 11:22 ` [PATCH for-next v3 0/3] RDMA/efa: Expose extended max inline buffer size Leon Romanovsky
  3 siblings, 0 replies; 5+ messages in thread
From: Yonatan Nachum @ 2026-02-17 11:23 UTC (permalink / raw)
  To: jgg, leon, linux-rdma
  Cc: mrgolin, sleybo, matua, gal.pressman, Yonatan Nachum

On QP creation we validate the requested max inline size is supported by
the device. Use the new extended max inline size instead of the old one
to support actual max inline available.

Reviewed-by: Michael Margolin <mrgolin@amazon.com>
Signed-off-by: Yonatan Nachum <ynachum@amazon.com>
---
 drivers/infiniband/hw/efa/efa_verbs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c
index 85c3a7dd4335..e5756b479eba 100644
--- a/drivers/infiniband/hw/efa/efa_verbs.c
+++ b/drivers/infiniband/hw/efa/efa_verbs.c
@@ -641,11 +641,11 @@ static int efa_qp_validate_cap(struct efa_dev *dev,
 			  init_attr->cap.max_recv_sge, dev->dev_attr.max_rq_sge);
 		return -EINVAL;
 	}
-	if (init_attr->cap.max_inline_data > dev->dev_attr.inline_buf_size) {
+	if (init_attr->cap.max_inline_data > dev->dev_attr.inline_buf_size_ex) {
 		ibdev_dbg(&dev->ibdev,
 			  "qp: requested inline data[%u] exceeds the max[%u]\n",
 			  init_attr->cap.max_inline_data,
-			  dev->dev_attr.inline_buf_size);
+			  dev->dev_attr.inline_buf_size_ex);
 		return -EINVAL;
 	}
 
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH for-next v3 0/3] RDMA/efa: Expose extended max inline buffer size
  2026-02-17 11:23 [PATCH for-next v3 0/3] RDMA/efa: Expose extended max inline buffer size Yonatan Nachum
                   ` (2 preceding siblings ...)
  2026-02-17 11:23 ` [PATCH for-next v3 3/3] RDMA/efa: Use extended inline buff size for inline validation Yonatan Nachum
@ 2026-02-25 11:22 ` Leon Romanovsky
  3 siblings, 0 replies; 5+ messages in thread
From: Leon Romanovsky @ 2026-02-25 11:22 UTC (permalink / raw)
  To: linux-rdma, Jason Gunthorpe, Yonatan Nachum
  Cc: mrgolin, sleybo, matua, gal.pressman


On Tue, 17 Feb 2026 11:23:01 +0000, Yonatan Nachum wrote:
> Changelog:
> v3:
>  * Use right enum value for new device query.
> v2: https://lore.kernel.org/all/20260216133351.14896-1-ynachum@amazon.com/
>  * Added patch 3 to use the extended inline buffer size for validation
>    in QP creation.
> v1: https://lore.kernel.org/all/20260215120451.18053-1-ynachum@amazon.com/
> 
> [...]

Applied, thanks!

[1/3] RDMA/efa: Rename admin queue attributes struct name for extendability
      https://git.kernel.org/rdma/rdma/c/6b8d5a0cdb1961
[2/3] RDMA/efa: Expose new extended max inline buff size
      https://git.kernel.org/rdma/rdma/c/e736a223ab1506
[3/3] RDMA/efa: Use extended inline buff size for inline validation
      https://git.kernel.org/rdma/rdma/c/d1fc91be263d0a

Best regards,
-- 
Leon Romanovsky <leon@kernel.org>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-02-25 11:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-17 11:23 [PATCH for-next v3 0/3] RDMA/efa: Expose extended max inline buffer size Yonatan Nachum
2026-02-17 11:23 ` [PATCH for-next v3 1/3] RDMA/efa: Rename admin queue attributes struct name for extendability Yonatan Nachum
2026-02-17 11:23 ` [PATCH for-next v3 2/3] RDMA/efa: Expose new extended max inline buff size Yonatan Nachum
2026-02-17 11:23 ` [PATCH for-next v3 3/3] RDMA/efa: Use extended inline buff size for inline validation Yonatan Nachum
2026-02-25 11:22 ` [PATCH for-next v3 0/3] RDMA/efa: Expose extended max inline buffer size Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox