]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
RDMA/efa: Expose new extended max inline buff size
authorYonatan Nachum <ynachum@amazon.com>
Tue, 17 Feb 2026 11:23:03 +0000 (11:23 +0000)
committerLeon Romanovsky <leon@kernel.org>
Wed, 25 Feb 2026 11:22:20 +0000 (06:22 -0500)
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>
Link: https://patch.msgid.link/20260217112304.36849-3-ynachum@amazon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/efa/efa_admin_cmds_defs.h
drivers/infiniband/hw/efa/efa_com_cmd.c
drivers/infiniband/hw/efa/efa_com_cmd.h
drivers/infiniband/hw/efa/efa_verbs.c
include/uapi/rdma/efa-abi.h

index 5bbc765b6e3f36fb48deb1fa4a97db8b82f2522d..ad34ea5da6b07632b3c4edc0c7bd200c57c5fb84 100644 (file)
@@ -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;
index 592c420e4473ced4a4ee8777240fa4ab25044c5a..63c7f07806a822b34c1216353d61105bae35e32a 100644 (file)
@@ -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,
index 3ac2686abba1f96714a1c33fcc94b16661e8132b..ef15b3c38429cf60ea0d3a91962f52de492e5656 100644 (file)
@@ -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;
index b5b93b42e6c4be046736ccb4c6766c8d06ea699c..6eb8cf8ecf80da4999028336a89da1c2de742e59 100644 (file)
@@ -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>
@@ -1988,6 +1988,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;
index 98b71b9979f8d5398b9a9d1c2f4635f1238c5d5c..13225b038124b4bbf8a1b752d6c7a4bdadea3ea1 100644 (file)
@@ -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 {