* [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