git: c0019f294ceb - main - IB/mlx5: Report mlx5 multi packet WQE capabilities when querying device

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Wed, 16 Sep 2026 14:12:56 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=c0019f294ceb8fe9c4aa8f83de7bacfc41b1d598

commit c0019f294ceb8fe9c4aa8f83de7bacfc41b1d598
Author:     Vag Singh <vag.singh@oneconvergence.com>
AuthorDate: 2025-08-14 06:14:42 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-09-16 14:12:07 +0000

    IB/mlx5: Report mlx5 multi packet WQE capabilities when querying device
    
    PATCH 13/31] FreeBSD OFED support for DPDK MLX5 PMD
    
    The capabilities whether hardware support multi packet WQE or not is
    exposed to user space through query_device by uhw.
    
    Differential revision:  https://reviews.freebsd.org/D32187
    MFC after:      1 month
---
 sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c   | 11 +++++++++++
 sys/ofed/include/uapi/rdma/mlx5-abi.h |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
index a4b1ec8807d3..2d8a7f97d9a9 100644
--- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
+++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
@@ -859,6 +859,17 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
 		}
 	}
 
+	if (field_avail(typeof(resp), mlx5_ib_support_multi_pkt_send_wqes,
+			uhw->outlen)) {
+		resp.mlx5_ib_support_multi_pkt_send_wqes =
+			MLX5_CAP_ETH(mdev, multi_pkt_send_wqe);
+		resp.response_length +=
+			sizeof(resp.mlx5_ib_support_multi_pkt_send_wqes);
+	}
+
+	if (field_avail(typeof(resp), reserved, uhw->outlen))
+		resp.response_length += sizeof(resp.reserved);
+
 	if (uhw->outlen) {
 		err = ib_copy_to_udata(uhw, &resp, resp.response_length);
 
diff --git a/sys/ofed/include/uapi/rdma/mlx5-abi.h b/sys/ofed/include/uapi/rdma/mlx5-abi.h
index 52d6f061970a..daa233cfcb58 100644
--- a/sys/ofed/include/uapi/rdma/mlx5-abi.h
+++ b/sys/ofed/include/uapi/rdma/mlx5-abi.h
@@ -163,6 +163,8 @@ struct mlx5_ib_query_device_resp {
 	struct	mlx5_ib_tso_caps tso_caps;
 	struct	mlx5_ib_rss_caps rss_caps;
 	struct	mlx5_ib_cqe_comp_caps cqe_comp_caps;
+	__u32	mlx5_ib_support_multi_pkt_send_wqes;
+	__u32   reserved;
 };
 
 enum mlx5_ib_create_cq_flags {