git: 83b69b72facf - main - fixup! IB/mlx5: Expose multi-packet RQ capabilities

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

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

commit 83b69b72facf89989e4d72b436fbbb08f091e07f
Author:     Ariel Ehrenberg <aehrenberg@nvidia.com>
AuthorDate: 2026-07-28 12:02:49 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-09-16 14:12:09 +0000

    fixup! IB/mlx5: Expose multi-packet RQ capabilities
    
    Import Linux upstream commit ccc870879027 ("IB/mlx5: Allow creation of a
    multi-packet RQ").
    
    Only the create_rq() part was missing: the striding RQ parameters we
    validate and store on the WQ never reached the firmware.  Program
    two_byte_shift_en, single_stride_log_num_of_bytes and
    single_wqe_log_num_of_strides, with the two log values encoded relative to
    their MLX5_MIN_* bases so the 3-bit firmware fields do not truncate them.
    Upstream renamed these WQ context fields later on, so the names used here
    are the ones this tree's mlx5_ifc.h still carries.
    
    Sponsored by:   NVidia networking
    MFC after:      1 month
---
 sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c
index 6d504471994c..41d3251c8b63 100644
--- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c
+++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c
@@ -4741,6 +4741,15 @@ static int  create_rq(struct mlx5_ib_rwq *rwq, struct ib_pd *pd,
 		 MLX5_WQ_TYPE_CYCLIC_STRIDING_RQ : MLX5_WQ_TYPE_CYCLIC);
 	MLX5_SET(wq, wq, end_padding_mode, MLX5_WQ_END_PAD_MODE_ALIGN);
 	MLX5_SET(wq, wq, log_wq_stride, rwq->log_rq_stride);
+	if (rwq->create_flags & MLX5_IB_WQ_FLAGS_STRIDING_RQ) {
+		MLX5_SET(wq, wq, two_byte_shift_en, rwq->two_byte_shift_en);
+		MLX5_SET(wq, wq, single_stride_log_num_of_bytes,
+			 rwq->single_stride_log_num_of_bytes -
+			 MLX5_MIN_SINGLE_STRIDE_LOG_NUM_BYTES);
+		MLX5_SET(wq, wq, single_wqe_log_num_of_strides,
+			 rwq->log_num_strides -
+			 MLX5_MIN_SINGLE_WQE_LOG_NUM_STRIDES);
+	}
 	MLX5_SET(wq, wq, log_wq_sz, rwq->log_rq_size);
 	MLX5_SET(wq, wq, pd, to_mpd(pd)->pdn);
 	MLX5_SET(wq, wq, page_offset, rwq->rq_page_offset);