public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Add Reorder Completion Queue (RCQ) support
@ 2026-04-30 12:39 Abhijit Gangurde
  2026-04-30 12:39 ` [PATCH 1/3] net: ionic: Fetch default QP transport mode and RCQ capabilities from firmware Abhijit Gangurde
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Abhijit Gangurde @ 2026-04-30 12:39 UTC (permalink / raw)
  To: jgg, leon, brett.creeley, andrew+netdev, davem, edumazet, kuba,
	pabeni
  Cc: allen.hubbe, nikhil.agarwal, linux-rdma, netdev, linux-kernel,
	Abhijit Gangurde

This series adds support for the Reorder Completion Queue (RCQ) feature in the
ionic RDMA driver, enabling userspace to create and configure QPs.

Patch 1 extends the net/ionic firmware identity structure to expose the
default_qp_transport_mode and rcq_sign_bit fields from the RDMA LIF identity.

Patch 2 plumbs these new firmware capabilities through the RDMA driver's LIF
configuration and exposes them to userspace via the ucontext response,
so that rdma-core can discover device support at context allocation time.

Patch 3 allows userspace to select the QP transport mode during QP creation.
The transport mode maps to the corresponding firmware QP type, and the
RCQ path count is forwarded to firmware during QP modify.

Together, these patches provide the kernel-side plumbing needed for the
rdma-core ionic provider to make use of the RCQ feature on capable hardware.
PR: https://github.com/linux-rdma/rdma-core/pull/1733


Abhijit Gangurde (3):
  net: ionic: Fetch default QP transport mode and RCQ capabilities from
    firmware
  RDMA/ionic: Expose QP transport mode and RCQ sign bit to userspace
  RDMA/ionic: Support QP transport mode selection in create and modify

 .../infiniband/hw/ionic/ionic_controlpath.c   | 20 +++++++++++++------
 drivers/infiniband/hw/ionic/ionic_fw.h        | 18 ++++++++++++++---
 drivers/infiniband/hw/ionic/ionic_ibdev.h     |  1 +
 drivers/infiniband/hw/ionic/ionic_lif_cfg.c   |  2 ++
 drivers/infiniband/hw/ionic/ionic_lif_cfg.h   |  2 ++
 .../net/ethernet/pensando/ionic/ionic_if.h    | 12 ++++++++++-
 include/uapi/rdma/ionic-abi.h                 |  9 +++++++--
 7 files changed, 52 insertions(+), 12 deletions(-)

-- 
2.43.0


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

* [PATCH 1/3] net: ionic: Fetch default QP transport mode and RCQ capabilities from firmware
  2026-04-30 12:39 [PATCH 0/3] Add Reorder Completion Queue (RCQ) support Abhijit Gangurde
@ 2026-04-30 12:39 ` Abhijit Gangurde
  2026-04-30 12:39 ` [PATCH 2/3] RDMA/ionic: Expose QP transport mode and RCQ sign bit to userspace Abhijit Gangurde
  2026-04-30 12:39 ` [PATCH 3/3] RDMA/ionic: Support QP transport mode selection in create and modify Abhijit Gangurde
  2 siblings, 0 replies; 4+ messages in thread
From: Abhijit Gangurde @ 2026-04-30 12:39 UTC (permalink / raw)
  To: jgg, leon, brett.creeley, andrew+netdev, davem, edumazet, kuba,
	pabeni
  Cc: allen.hubbe, nikhil.agarwal, linux-rdma, netdev, linux-kernel,
	Abhijit Gangurde

Read the default_qp_transport_mode and rcq_sign_bit from the RDMA
LIF identity reported by firmware.

Signed-off-by: Abhijit Gangurde <abhijit.gangurde@amd.com>
---
 drivers/net/ethernet/pensando/ionic/ionic_if.h | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_if.h b/drivers/net/ethernet/pensando/ionic/ionic_if.h
index 23d6e2b4791e..f6c2ca335dfb 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_if.h
+++ b/drivers/net/ethernet/pensando/ionic/ionic_if.h
@@ -553,6 +553,11 @@ enum ionic_lif_rdma_cap_stats {
  *	@rdma.eq_qtype:        RDMA Event Qtype
  *	@rdma.stats_type:      Supported statistics type
  *	                       (enum ionic_lif_rdma_cap_stats)
+ *	@rdma.rsvd:            Reserved byte
+ *	@rdma.rcq_sign_bit:    RCQ sign bit
+ *	@rdma.srq_qtype:       RDMA Shared Receive Qtype
+ *	@rdma.rsvd2:           Reserved byte
+ *	@rdma.default_qp_transport_mode: Default QP transport mode
  *	@rdma.rsvd1:           Reserved byte(s)
  * @words:               word access to struct contents
  */
@@ -598,7 +603,12 @@ union ionic_lif_identity {
 			struct ionic_lif_logical_qtype cq_qtype;
 			struct ionic_lif_logical_qtype eq_qtype;
 			__le16 stats_type;
-			u8 rsvd1[162];
+			u8 rsvd;
+			u8 rcq_sign_bit;
+			struct ionic_lif_logical_qtype srq_qtype;
+			u8 rsvd2;
+			u8 default_qp_transport_mode;
+			u8 rsvd1[146];
 		} __packed rdma;
 	} __packed;
 	__le32 words[478];
-- 
2.43.0


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

* [PATCH 2/3] RDMA/ionic: Expose QP transport mode and RCQ sign bit to userspace
  2026-04-30 12:39 [PATCH 0/3] Add Reorder Completion Queue (RCQ) support Abhijit Gangurde
  2026-04-30 12:39 ` [PATCH 1/3] net: ionic: Fetch default QP transport mode and RCQ capabilities from firmware Abhijit Gangurde
@ 2026-04-30 12:39 ` Abhijit Gangurde
  2026-04-30 12:39 ` [PATCH 3/3] RDMA/ionic: Support QP transport mode selection in create and modify Abhijit Gangurde
  2 siblings, 0 replies; 4+ messages in thread
From: Abhijit Gangurde @ 2026-04-30 12:39 UTC (permalink / raw)
  To: jgg, leon, brett.creeley, andrew+netdev, davem, edumazet, kuba,
	pabeni
  Cc: allen.hubbe, nikhil.agarwal, linux-rdma, netdev, linux-kernel,
	Abhijit Gangurde

Read the default_qp_transport_mode and rcq_sign_bit fields from the
RDMA LIF identity reported by firmware, store them in the driver's
lif_cfg, and expose them to userspace via the ucontext response.

The default_qp_transport_mode indicates which QP transport type the device
uses. The rcq_sign_bit indicates the Reorder Completion Queue
(RCQ) sign bit capability.

Co-developed-by: Allen Hubbe <allen.hubbe@amd.com>
Signed-off-by: Allen Hubbe <allen.hubbe@amd.com>
Signed-off-by: Abhijit Gangurde <abhijit.gangurde@amd.com>
---
 drivers/infiniband/hw/ionic/ionic_controlpath.c | 4 +++-
 drivers/infiniband/hw/ionic/ionic_lif_cfg.c     | 2 ++
 drivers/infiniband/hw/ionic/ionic_lif_cfg.h     | 2 ++
 include/uapi/rdma/ionic-abi.h                   | 4 +++-
 4 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/ionic/ionic_controlpath.c b/drivers/infiniband/hw/ionic/ionic_controlpath.c
index 7051a81cca94..6bb645713d6b 100644
--- a/drivers/infiniband/hw/ionic/ionic_controlpath.c
+++ b/drivers/infiniband/hw/ionic/ionic_controlpath.c
@@ -408,13 +408,15 @@ int ionic_alloc_ucontext(struct ib_ucontext *ibctx, struct ib_udata *udata)
 
 	resp.udma_count = dev->lif_cfg.udma_count;
 	resp.expdb_mask = dev->lif_cfg.expdb_mask;
+	resp.rcq_sign_bit = dev->lif_cfg.rcq_sign_bit;
+	resp.default_qp_transport_mode = dev->lif_cfg.default_qp_transport_mode;
 
 	if (dev->lif_cfg.sq_expdb)
 		resp.expdb_qtypes |= IONIC_EXPDB_SQ;
 	if (dev->lif_cfg.rq_expdb)
 		resp.expdb_qtypes |= IONIC_EXPDB_RQ;
 
-	rc = ib_copy_to_udata(udata, &resp, sizeof(resp));
+	rc = ib_respond_udata(udata, resp);
 	if (rc)
 		goto err_resp;
 
diff --git a/drivers/infiniband/hw/ionic/ionic_lif_cfg.c b/drivers/infiniband/hw/ionic/ionic_lif_cfg.c
index f3cd281c3a2f..2a27dd22e4c4 100644
--- a/drivers/infiniband/hw/ionic/ionic_lif_cfg.c
+++ b/drivers/infiniband/hw/ionic/ionic_lif_cfg.c
@@ -84,6 +84,8 @@ void ionic_fill_lif_cfg(struct ionic_lif *lif, struct ionic_lif_cfg *cfg)
 	cfg->udma_count = 2;
 
 	cfg->max_stride = ident->rdma.max_stride;
+	cfg->rcq_sign_bit = ident->rdma.rcq_sign_bit;
+	cfg->default_qp_transport_mode = ident->rdma.default_qp_transport_mode;
 	cfg->expdb_mask = ionic_get_expdb(lif);
 
 	cfg->sq_expdb =
diff --git a/drivers/infiniband/hw/ionic/ionic_lif_cfg.h b/drivers/infiniband/hw/ionic/ionic_lif_cfg.h
index 20853429f623..abf169d2727a 100644
--- a/drivers/infiniband/hw/ionic/ionic_lif_cfg.h
+++ b/drivers/infiniband/hw/ionic/ionic_lif_cfg.h
@@ -56,6 +56,8 @@ struct ionic_lif_cfg {
 	bool sq_expdb;
 	bool rq_expdb;
 	u8 expdb_mask;
+	u8 rcq_sign_bit;
+	u8 default_qp_transport_mode;
 };
 
 void ionic_fill_lif_cfg(struct ionic_lif *lif, struct ionic_lif_cfg *cfg);
diff --git a/include/uapi/rdma/ionic-abi.h b/include/uapi/rdma/ionic-abi.h
index 7b589d3e9728..fb0d13094c12 100644
--- a/include/uapi/rdma/ionic-abi.h
+++ b/include/uapi/rdma/ionic-abi.h
@@ -46,8 +46,10 @@ struct ionic_ctx_resp {
 	__u8 udma_count;
 	__u8 expdb_mask;
 	__u8 expdb_qtypes;
+	__u8 rcq_sign_bit;
+	__u8 default_qp_transport_mode;
 
-	__u8 rsvd2[3];
+	__u8 rsvd2;
 };
 
 struct ionic_qdesc {
-- 
2.43.0


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

* [PATCH 3/3] RDMA/ionic: Support QP transport mode selection in create and modify
  2026-04-30 12:39 [PATCH 0/3] Add Reorder Completion Queue (RCQ) support Abhijit Gangurde
  2026-04-30 12:39 ` [PATCH 1/3] net: ionic: Fetch default QP transport mode and RCQ capabilities from firmware Abhijit Gangurde
  2026-04-30 12:39 ` [PATCH 2/3] RDMA/ionic: Expose QP transport mode and RCQ sign bit to userspace Abhijit Gangurde
@ 2026-04-30 12:39 ` Abhijit Gangurde
  2 siblings, 0 replies; 4+ messages in thread
From: Abhijit Gangurde @ 2026-04-30 12:39 UTC (permalink / raw)
  To: jgg, leon, brett.creeley, andrew+netdev, davem, edumazet, kuba,
	pabeni
  Cc: allen.hubbe, nikhil.agarwal, linux-rdma, netdev, linux-kernel,
	Abhijit Gangurde

Allow userspace to specify the QP transport mode and number of
reorder completion queue paths during QP creation and modification.

Extend ionic_qp_req with transport_mode, num_rcq_paths, and
ionic_flags fields. The transport mode selects the firmware QP type,
ionic_flags are forwarded in the upper bits of priv_flags during
QP creation, and num_rcq_paths is passed to firmware during QP
modify.

Co-developed-by: Allen Hubbe <allen.hubbe@amd.com>
Signed-off-by: Allen Hubbe <allen.hubbe@amd.com>
Signed-off-by: Abhijit Gangurde <abhijit.gangurde@amd.com>
---
 .../infiniband/hw/ionic/ionic_controlpath.c    | 16 +++++++++++-----
 drivers/infiniband/hw/ionic/ionic_fw.h         | 18 +++++++++++++++---
 drivers/infiniband/hw/ionic/ionic_ibdev.h      |  1 +
 include/uapi/rdma/ionic-abi.h                  |  5 ++++-
 4 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/drivers/infiniband/hw/ionic/ionic_controlpath.c b/drivers/infiniband/hw/ionic/ionic_controlpath.c
index 6bb645713d6b..5a6d4036ea98 100644
--- a/drivers/infiniband/hw/ionic/ionic_controlpath.c
+++ b/drivers/infiniband/hw/ionic/ionic_controlpath.c
@@ -1326,7 +1326,9 @@ static int ionic_create_qp_cmd(struct ionic_ibdev *dev,
 			       struct ionic_qp *qp,
 			       struct ionic_tbl_buf *sq_buf,
 			       struct ionic_tbl_buf *rq_buf,
-			       struct ib_qp_init_attr *attr)
+			       struct ib_qp_init_attr *attr,
+			       u32 ionic_flags,
+			       enum ionic_qp_transport_mode transport_mode)
 {
 	const u16 dbid = ionic_obj_dbid(dev, pd->ibpd.uobject);
 	const u32 flags = to_ionic_qp_flags(0, 0,
@@ -1342,8 +1344,9 @@ static int ionic_create_qp_cmd(struct ionic_ibdev *dev,
 			.len = cpu_to_le16(IONIC_ADMIN_CREATE_QP_IN_V1_LEN),
 			.cmd.create_qp = {
 				.pd_id = cpu_to_le32(pd->pdid),
-				.priv_flags = cpu_to_be32(flags),
-				.type_state = to_ionic_qp_type(attr->qp_type),
+				.priv_flags = cpu_to_be32(flags |
+						(ionic_flags & IONIC_QP_USER_FLAGS_MASK)),
+				.type_state = to_ionic_qp_type(attr->qp_type, transport_mode),
 				.dbid_flags = cpu_to_le16(dbid),
 				.id_ver = cpu_to_le32(qp->qpid),
 			}
@@ -1412,6 +1415,7 @@ static int ionic_modify_qp_cmd(struct ionic_ibdev *dev,
 					  (attr->rnr_retry << 4)),
 				.rnr_timer = attr->min_rnr_timer,
 				.retry_timeout = attr->timeout,
+				.mrc_num_paths = qp->num_rcq_paths,
 				.type_state = state,
 				.id_ver = cpu_to_le32(qp->qpid),
 			}
@@ -2156,7 +2160,7 @@ int ionic_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *attr,
 	int rc;
 
 	if (udata) {
-		rc = ib_copy_validate_udata_in(udata, req, rsvd);
+		rc = ib_copy_validate_udata_in(udata, req, ionic_flags);
 		if (rc)
 			return rc;
 	} else {
@@ -2203,6 +2207,7 @@ int ionic_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *attr,
 
 	qp->sig_all = attr->sq_sig_type == IB_SIGNAL_ALL_WR;
 	qp->has_ah = attr->qp_type == IB_QPT_RC;
+	qp->num_rcq_paths = req.num_rcq_paths;
 
 	if (qp->has_ah) {
 		qp->hdr = kzalloc_obj(*qp->hdr);
@@ -2239,7 +2244,8 @@ int ionic_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *attr,
 	rc = ionic_create_qp_cmd(dev, pd,
 				 to_ionic_vcq_cq(attr->send_cq, qp->udma_idx),
 				 to_ionic_vcq_cq(attr->recv_cq, qp->udma_idx),
-				 qp, &sq_buf, &rq_buf, attr);
+				 qp, &sq_buf, &rq_buf, attr, req.ionic_flags,
+				 req.transport_mode);
 	if (rc)
 		goto err_cmd;
 
diff --git a/drivers/infiniband/hw/ionic/ionic_fw.h b/drivers/infiniband/hw/ionic/ionic_fw.h
index adfbb89d856c..3a31cd9073ca 100644
--- a/drivers/infiniband/hw/ionic/ionic_fw.h
+++ b/drivers/infiniband/hw/ionic/ionic_fw.h
@@ -105,6 +105,8 @@ enum ionic_qp_flags {
 	IONIC_QPF_SQ_CMB		= BIT(13),
 	IONIC_QPF_RQ_CMB		= BIT(14),
 	IONIC_QPF_PRIVILEGED		= BIT(15),
+
+	IONIC_QP_USER_FLAGS_MASK	= GENMASK(31, 16),
 };
 
 static inline int from_ionic_qp_flags(int flags)
@@ -218,6 +220,11 @@ static inline int ionic_to_ib_status(int sts)
 	}
 }
 
+enum ionic_qp_transport_mode {
+	IONIC_QPT_TRANSPORT_ROCE_V2 = BIT(0),
+	IONIC_QPT_TRANSPORT_MRC = BIT(1),
+};
+
 /* admin queue qp type */
 enum ionic_qp_type {
 	IONIC_QPT_RC,
@@ -228,16 +235,21 @@ enum ionic_qp_type {
 	IONIC_QPT_XRC_INI,
 	IONIC_QPT_XRC_TGT,
 	IONIC_QPT_XRC_SRQ,
+	IONIC_QPT_MRC,
 };
 
-static inline int to_ionic_qp_type(enum ib_qp_type type)
+static inline int to_ionic_qp_type(enum ib_qp_type type,
+				   enum ionic_qp_transport_mode tm)
 {
 	switch (type) {
 	case IB_QPT_GSI:
 	case IB_QPT_UD:
 		return IONIC_QPT_UD;
 	case IB_QPT_RC:
-		return IONIC_QPT_RC;
+		if (tm == IONIC_QPT_TRANSPORT_MRC)
+			return IONIC_QPT_MRC;
+		else
+			return IONIC_QPT_RC;
 	case IB_QPT_UC:
 		return IONIC_QPT_UC;
 	case IB_QPT_XRC_INI:
@@ -808,7 +820,7 @@ struct ionic_admin_mod_qp {
 	__le32		ah_id_len;
 	__u8		en_pcp;
 	__u8		ip_dscp;
-	__u8		rsvd2;
+	__u8		mrc_num_paths;
 	__u8		type_state;
 	union {
 		struct {
diff --git a/drivers/infiniband/hw/ionic/ionic_ibdev.h b/drivers/infiniband/hw/ionic/ionic_ibdev.h
index 63828240d659..24a7f93e1f00 100644
--- a/drivers/infiniband/hw/ionic/ionic_ibdev.h
+++ b/drivers/infiniband/hw/ionic/ionic_ibdev.h
@@ -253,6 +253,7 @@ struct ionic_qp {
 	u8			has_sq:1;
 	u8			has_rq:1;
 	u8			sig_all:1;
+	u8			num_rcq_paths;
 
 	struct list_head	qp_list_counter;
 
diff --git a/include/uapi/rdma/ionic-abi.h b/include/uapi/rdma/ionic-abi.h
index fb0d13094c12..bd02e4541d85 100644
--- a/include/uapi/rdma/ionic-abi.h
+++ b/include/uapi/rdma/ionic-abi.h
@@ -85,7 +85,10 @@ struct ionic_qp_req {
 	__u8 sq_cmb;
 	__u8 rq_cmb;
 	__u8 udma_mask;
-	__u8 rsvd[3];
+	__u8 num_rcq_paths;
+	__u8 transport_mode;
+	__u8 rsvd;
+	__u32 ionic_flags;
 };
 
 struct ionic_qp_resp {
-- 
2.43.0


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

end of thread, other threads:[~2026-04-30 12:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-30 12:39 [PATCH 0/3] Add Reorder Completion Queue (RCQ) support Abhijit Gangurde
2026-04-30 12:39 ` [PATCH 1/3] net: ionic: Fetch default QP transport mode and RCQ capabilities from firmware Abhijit Gangurde
2026-04-30 12:39 ` [PATCH 2/3] RDMA/ionic: Expose QP transport mode and RCQ sign bit to userspace Abhijit Gangurde
2026-04-30 12:39 ` [PATCH 3/3] RDMA/ionic: Support QP transport mode selection in create and modify Abhijit Gangurde

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