Skip to contentSkip to conversation

RDMA/mana_ib: advertise pow2 RC SQ support to user space

PATCH Applied Snehal Sanghvi 2 participants 2 messages Sep 2 – Sep 6

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/mana_ib: advertise pow2 RC SQ support to user space

From: Snehal Sanghvi <[email protected]>

The send queue of an RC QP normally needs an extra rollback area in shared memory. With fixed-size WQEs the rollback can be derived from the WQE size alone, so an adapter supporting it can accept a plain power-of-two send queue and the rollback area becomes unnecessary.

Report the adapter capability to user space with a new comp_mask bit in the alloc ucontext response, so that user space can request a power-of-two RC send queue when the adapter supports it.

---
 drivers/infiniband/hw/mana/main.c    | 2 ++
 drivers/infiniband/hw/mana/mana_ib.h | 1 +
 include/uapi/rdma/mana-abi.h         | 1 +
 3 files changed, 4 insertions(+)
drivers/infiniband/hw/mana/main.c +2 -0
index 83a97f1c5c..672bd3f650 100644
@@ -248,6 +248,8 @@ int mana_ib_alloc_ucontext(struct ib_ucontext *ibcontext,
 	ucontext->doorbell = doorbell_page;
 	ucmd_resp.comp_mask = MANA_IB_UCNTX_ALLOC_PDN_SUPPORT;
 	ucmd_resp.comp_mask |= MANA_IB_UCNTX_RC_EXT_SUPPORT;
+	if (mdev->adapter_caps.feature_flags & MANA_IB_FEATURE_RC_QP_SQ_POW2_SUPPORT)
+		ucmd_resp.comp_mask |= MANA_IB_UCNTX_RC_SQ_POW2_SUPPORT;
 	ret = ib_respond_udata(udata, ucmd_resp);
 	if (ret)
 		return ret;
drivers/infiniband/hw/mana/mana_ib.h +1 -0
index 1be33ed8bd..4da110b302 100644
@@ -268,6 +268,7 @@ enum mana_ib_adapter_features {
 	MANA_IB_FEATURE_DEV_COUNTERS_SUPPORT = BIT(5),
 	MANA_IB_FEATURE_MULTI_PORTS_SUPPORT = BIT(6),
 	MANA_IB_FEATURE_MSN_IN_WQE_SUPPORT = BIT(7),
+	MANA_IB_FEATURE_RC_QP_SQ_POW2_SUPPORT = BIT(14),
 	MANA_IB_FEATURE_MULTI_PORT_GSI_SUPPORT = BIT(15),
 };
 
include/uapi/rdma/mana-abi.h +1 -0
index c9a2417666..ebc9a655b8 100644
@@ -111,6 +111,7 @@ struct mana_ib_create_qp_rss_resp {
 enum mana_ib_ucontext_support {
 	MANA_IB_UCNTX_ALLOC_PDN_SUPPORT = 1 << 0,
 	MANA_IB_UCNTX_RC_EXT_SUPPORT = 1 << 1,
+	MANA_IB_UCNTX_RC_SQ_POW2_SUPPORT = 1 << 2,
 };
 
 struct mana_ib_alloc_ucontext_resp {
Signature · 1 line
2.43.0
#1 lore raw
Quoted 10 lines · Snehal Sanghvi

The send queue of an RC QP normally needs an extra rollback area in shared memory. With fixed-size WQEs the rollback can be derived from the WQE size alone, so an adapter supporting it can accept a plain power-of-two send queue and the rollback area becomes unnecessary.

Report the adapter capability to user space with a new comp_mask bit in the alloc ucontext response, so that user space can request a power-of-two RC send queue when the adapter supports it.

[...]

Applied, thanks!

[1/1] RDMA/mana_ib: advertise pow2 RC SQ support to user space

      https://git.kernel.org/rdma/rdma/c/89b48ad5671fa0

Best regards,

Signature · 1 line
Leon Romanovsky <[email protected]>