* [for-next 0/4] RDMA/ionic: add DMA MR and v2 atomic WQE
@ 2026-11-07 15:02 Abhijit Gangurde
2026-11-07 15:02 ` [for-next 1/4] net: ionic: add an RDMA capability word to the LIF identity Abhijit Gangurde
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Abhijit Gangurde @ 2026-11-07 15:02 UTC (permalink / raw)
To: jgg, leon, brett.creeley, andrew+netdev, davem, edumazet, kuba, pabeni
Cc: allen.hubbe, eric.joyner, nikhil.agarwal, linux-rdma, netdev,
linux-kernel, Abhijit Gangurde
Add a generic RDMA capability word to the LIF identity and use it
to allocate a PD-scoped DMA memory region. Use the v2 atomic send
WQE on RDMA version 2. Also fix the v1 atomic WQE so the operands
are not overwritten by the common payload.
Net changes pull request:
The following changes since commit 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4:
Linux 7.4-rc1 (2026-11-01 13:26:31 -0800)
are available in the Git repository at:
https://github.com/abhijitG-xlnx/linux.git ionic-shared
for you to fetch changes up to e64b2ae81599ce9e17fab5e635b8fe22df09739b:
net: ionic: add an RDMA capability word to the LIF identity (2026-11-05 09:18:39 +0530)
Abhijit Gangurde (2):
net: ionic: add an RDMA capability word to the LIF identity
RDMA/ionic: preserve atomic operands in the send WQE
Gregor Dick (2):
RDMA/ionic: allocate a PD-scoped DMA MR
RDMA/ionic: use the v2 atomic send WQE layout
.../infiniband/hw/ionic/ionic_controlpath.c | 38 +++++++++++++++++--
drivers/infiniband/hw/ionic/ionic_datapath.c | 17 +++++++--
drivers/infiniband/hw/ionic/ionic_fw.h | 31 +++++++++++++++
drivers/infiniband/hw/ionic/ionic_ibdev.h | 1 -
drivers/infiniband/hw/ionic/ionic_lif_cfg.c | 1 +
drivers/infiniband/hw/ionic/ionic_lif_cfg.h | 1 +
.../net/ethernet/pensando/ionic/ionic_if.h | 4 +-
7 files changed, 83 insertions(+), 10 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [for-next 1/4] net: ionic: add an RDMA capability word to the LIF identity
2026-11-07 15:02 [for-next 0/4] RDMA/ionic: add DMA MR and v2 atomic WQE Abhijit Gangurde
@ 2026-11-07 15:02 ` Abhijit Gangurde
2026-11-07 15:02 ` [for-next 2/4] RDMA/ionic: preserve atomic operands in the send WQE Abhijit Gangurde
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Abhijit Gangurde @ 2026-11-07 15:02 UTC (permalink / raw)
To: jgg, leon, brett.creeley, andrew+netdev, davem, edumazet, kuba, pabeni
Cc: allen.hubbe, eric.joyner, nikhil.agarwal, linux-rdma, netdev,
linux-kernel, Abhijit Gangurde
Name the generic RDMA capability word in the LIF identity. The
field replaces eight reserved bytes. The ethernet driver does
not interpret it.
Signed-off-by: Abhijit Gangurde <abhijit.gangurde@amd.com>
---
drivers/net/ethernet/pensando/ionic/ionic_if.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_if.h b/drivers/net/ethernet/pensando/ionic/ionic_if.h
index e911fad545d6..851bb618cff4 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_if.h
+++ b/drivers/net/ethernet/pensando/ionic/ionic_if.h
@@ -579,6 +579,7 @@ enum ionic_lif_rdma_alloc_qid {
* @rdma.rsvd2: Reserved byte(s)
* @rdma.alloc_qid_cap: RDMA queue type QID allocation capability
* (bitmask of enum ionic_lif_rdma_alloc_qid)
+ * @rdma.cap: Generic capability bits
* @rdma.rsvd1: Reserved byte(s)
* @words: word access to struct contents
*/
@@ -629,7 +630,8 @@ union ionic_lif_identity {
struct ionic_lif_logical_qtype srq_qtype;
u8 rsvd2[5];
u8 alloc_qid_cap;
- u8 rsvd1[142];
+ __le64 cap;
+ u8 rsvd1[134];
} __packed rdma;
} __packed;
__le32 words[478];
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [for-next 2/4] RDMA/ionic: preserve atomic operands in the send WQE
2026-11-07 15:02 [for-next 0/4] RDMA/ionic: add DMA MR and v2 atomic WQE Abhijit Gangurde
2026-11-07 15:02 ` [for-next 1/4] net: ionic: add an RDMA capability word to the LIF identity Abhijit Gangurde
@ 2026-11-07 15:02 ` Abhijit Gangurde
2026-11-07 15:02 ` [for-next 3/4] RDMA/ionic: allocate a PD-scoped DMA MR Abhijit Gangurde
2026-11-07 15:02 ` [for-next 4/4] RDMA/ionic: use the v2 atomic send WQE layout Abhijit Gangurde
3 siblings, 0 replies; 5+ messages in thread
From: Abhijit Gangurde @ 2026-11-07 15:02 UTC (permalink / raw)
To: jgg, leon, brett.creeley, andrew+netdev, davem, edumazet, kuba, pabeni
Cc: allen.hubbe, eric.joyner, nikhil.agarwal, linux-rdma, netdev,
linux-kernel, Abhijit Gangurde
ionic_prep_common() writes the common length and scatter/gather element
into the same body bytes as the atomic operands. Finish the atomic WQE
with ionic_prep_base() instead.
Fixes: b83c62055b6f ("RDMA/ionic: Register device ops for datapath")
Signed-off-by: Abhijit Gangurde <abhijit.gangurde@amd.com>
---
drivers/infiniband/hw/ionic/ionic_datapath.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/ionic/ionic_datapath.c b/drivers/infiniband/hw/ionic/ionic_datapath.c
index f1354dae089c..5b6f10256b49 100644
--- a/drivers/infiniband/hw/ionic/ionic_datapath.c
+++ b/drivers/infiniband/hw/ionic/ionic_datapath.c
@@ -1054,7 +1054,10 @@ static int ionic_prep_atomic(struct ionic_qp *qp,
wqe->atomic.sge.len = cpu_to_be32(8);
wqe->atomic.sge.lkey = cpu_to_be32(wr->wr.sg_list[0].lkey);
- return ionic_prep_common(qp, &wr->wr, meta, wqe);
+ meta->len = 8;
+ ionic_prep_base(qp, &wr->wr, meta, wqe);
+
+ return 0;
}
static int ionic_prep_inv(struct ionic_qp *qp,
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [for-next 3/4] RDMA/ionic: allocate a PD-scoped DMA MR
2026-11-07 15:02 [for-next 0/4] RDMA/ionic: add DMA MR and v2 atomic WQE Abhijit Gangurde
2026-11-07 15:02 ` [for-next 1/4] net: ionic: add an RDMA capability word to the LIF identity Abhijit Gangurde
2026-11-07 15:02 ` [for-next 2/4] RDMA/ionic: preserve atomic operands in the send WQE Abhijit Gangurde
@ 2026-11-07 15:02 ` Abhijit Gangurde
2026-11-07 15:02 ` [for-next 4/4] RDMA/ionic: use the v2 atomic send WQE layout Abhijit Gangurde
3 siblings, 0 replies; 5+ messages in thread
From: Abhijit Gangurde @ 2026-11-07 15:02 UTC (permalink / raw)
To: jgg, leon, brett.creeley, andrew+netdev, davem, edumazet, kuba, pabeni
Cc: allen.hubbe, eric.joyner, nikhil.agarwal, linux-rdma, netdev,
linux-kernel, Gregor Dick, Abhijit Gangurde
From: Gregor Dick <gregor.dick@amd.com>
ib_get_dma_mr() returns an rkey for an identity mapping of the whole
address space, bound to the protection domain, with the requested
access. CREATE_MR carries IONIC_MRF_DMA_MR and leaves the VA, length,
and map_count at zero because firmware owns that mapping.
Signed-off-by: Gregor Dick <gregor.dick@amd.com>
Signed-off-by: Abhijit Gangurde <abhijit.gangurde@amd.com>
---
.../infiniband/hw/ionic/ionic_controlpath.c | 38 +++++++++++++++++--
drivers/infiniband/hw/ionic/ionic_fw.h | 16 ++++++++
drivers/infiniband/hw/ionic/ionic_ibdev.h | 1 -
drivers/infiniband/hw/ionic/ionic_lif_cfg.c | 1 +
drivers/infiniband/hw/ionic/ionic_lif_cfg.h | 1 +
5 files changed, 52 insertions(+), 5 deletions(-)
diff --git a/drivers/infiniband/hw/ionic/ionic_controlpath.c b/drivers/infiniband/hw/ionic/ionic_controlpath.c
index 8a0a1575a339..b7f878c79070 100644
--- a/drivers/infiniband/hw/ionic/ionic_controlpath.c
+++ b/drivers/infiniband/hw/ionic/ionic_controlpath.c
@@ -910,20 +910,50 @@ static int ionic_destroy_mr_cmd(struct ionic_ibdev *dev, u32 mrid)
struct ib_mr *ionic_get_dma_mr(struct ib_pd *ibpd, int access)
{
+ struct ionic_ibdev *dev = to_ionic_ibdev(ibpd->device);
struct ionic_pd *pd = to_ionic_pd(ibpd);
struct ionic_mr *mr;
+ int rc;
mr = kzalloc_obj(*mr);
if (!mr)
return ERR_PTR(-ENOMEM);
- mr->ibmr.lkey = IONIC_DMA_LKEY;
- mr->ibmr.rkey = IONIC_DMA_RKEY;
-
- if (pd)
+ if (!(dev->lif_cfg.cap & IONIC_GEN_CAP_DMA_MR)) {
+ mr->ibmr.lkey = IONIC_DMA_LKEY;
pd->flags |= IONIC_QPF_PRIVILEGED;
+ return &mr->ibmr;
+ }
+
+ rc = ionic_get_mrid(dev, &mr->mrid);
+ if (rc)
+ goto err_mrid;
+
+ mr->ibmr.lkey = mr->mrid;
+ mr->ibmr.rkey = mr->mrid;
+
+ /*
+ * Identity map of the whole address space, bound to this pd.
+ * Firmware owns that extent, so the VA, length, and map_count
+ * stay zero.
+ */
+ mr->flags = IONIC_MRF_DMA_MR | to_ionic_mr_flags(access);
+
+ rc = ionic_create_mr_cmd(dev, pd, mr, 0, 0);
+ if (rc)
+ goto err_cmd;
+
+ pd->flags |= IONIC_QPF_PRIVILEGED;
+
return &mr->ibmr;
+
+err_cmd:
+ ionic_put_mrid(dev, mr->mrid);
+err_mrid:
+ kfree(mr);
+
+ return ERR_PTR(rc);
}
struct ib_mr *ionic_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 length,
diff --git a/drivers/infiniband/hw/ionic/ionic_fw.h b/drivers/infiniband/hw/ionic/ionic_fw.h
index b8e996d4b8b9..100138e4cae7 100644
--- a/drivers/infiniband/hw/ionic/ionic_fw.h
+++ b/drivers/infiniband/hw/ionic/ionic_fw.h
@@ -11,6 +11,11 @@
#define IONIC_EXP_DBELL_SZ 8
+/* ionic_lif_identity.rdma.cap bits */
+enum ionic_gen_cap_flags {
+ IONIC_GEN_CAP_DMA_MR = BIT(0),
+};
+
enum ionic_mrid_bits {
IONIC_MRID_INDEX_SHIFT = 8,
};
@@ -47,6 +52,17 @@ enum ionic_mr_flags {
IONIC_MRF_PB = BIT(7),
IONIC_MRF_ACCESS_MASK = BIT(12) - 1,
+ /*
+ * DMA_MR is an MR type selector, not an access permission. It
+ * sits in an otherwise-unused bit inside the access-mask range
+ * to_ionic_mr_flags() does not derive this bit from IB access
+ * flags. Firmware tests it before decoding access bits and takes
+ * a dedicated path.
+ *
+ * DMA_MR: identity map of the full address space, bound to a pd.
+ */
+ IONIC_MRF_DMA_MR = BIT(8),
+
/* bits that determine mr type */
IONIC_MRF_UKEY_EN = BIT(13),
IONIC_MRF_IS_MW = BIT(14),
diff --git a/drivers/infiniband/hw/ionic/ionic_ibdev.h b/drivers/infiniband/hw/ionic/ionic_ibdev.h
index 127b79cdfc45..8e7e52c9f492 100644
--- a/drivers/infiniband/hw/ionic/ionic_ibdev.h
+++ b/drivers/infiniband/hw/ionic/ionic_ibdev.h
@@ -44,7 +44,6 @@
#define IONIC_ROCE_UDP_SPORT 28272
#define IONIC_DMA_LKEY 0
-#define IONIC_DMA_RKEY IONIC_DMA_LKEY
#define IONIC_CMB_SUPPORTED \
(IONIC_CMB_ENABLE | IONIC_CMB_REQUIRE | IONIC_CMB_EXPDB | \
diff --git a/drivers/infiniband/hw/ionic/ionic_lif_cfg.c b/drivers/infiniband/hw/ionic/ionic_lif_cfg.c
index 66cee57442e7..dcf54856603d 100644
--- a/drivers/infiniband/hw/ionic/ionic_lif_cfg.c
+++ b/drivers/infiniband/hw/ionic/ionic_lif_cfg.c
@@ -95,6 +95,7 @@ void ionic_fill_lif_cfg(struct ionic_lif *lif, struct ionic_lif_cfg *cfg)
cfg->rq_expdb =
!!(lif->qtype_info[IONIC_QTYPE_RXQ].features & IONIC_QIDENT_F_EXPDB);
cfg->alloc_qid_cap = ident->rdma.alloc_qid_cap;
+ cfg->cap = le64_to_cpu(ident->rdma.cap);
}
struct net_device *ionic_lif_netdev(struct ionic_lif *lif)
diff --git a/drivers/infiniband/hw/ionic/ionic_lif_cfg.h b/drivers/infiniband/hw/ionic/ionic_lif_cfg.h
index bc14fc0921da..998785fef2f1 100644
--- a/drivers/infiniband/hw/ionic/ionic_lif_cfg.h
+++ b/drivers/infiniband/hw/ionic/ionic_lif_cfg.h
@@ -26,6 +26,7 @@ struct ionic_lif_cfg {
void *phc_state;
u64 page_size_supported;
+ u64 cap;
u32 npts_per_lif;
u32 nmrs_per_lif;
u32 nahs_per_lif;
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [for-next 4/4] RDMA/ionic: use the v2 atomic send WQE layout
2026-11-07 15:02 [for-next 0/4] RDMA/ionic: add DMA MR and v2 atomic WQE Abhijit Gangurde
` (2 preceding siblings ...)
2026-11-07 15:02 ` [for-next 3/4] RDMA/ionic: allocate a PD-scoped DMA MR Abhijit Gangurde
@ 2026-11-07 15:02 ` Abhijit Gangurde
3 siblings, 0 replies; 5+ messages in thread
From: Abhijit Gangurde @ 2026-11-07 15:02 UTC (permalink / raw)
To: jgg, leon, brett.creeley, andrew+netdev, davem, edumazet, kuba, pabeni
Cc: allen.hubbe, eric.joyner, nikhil.agarwal, linux-rdma, netdev,
linux-kernel, Gregor Dick, Abhijit Gangurde
From: Gregor Dick <gregor.dick@amd.com>
Firmware with RDMA version 2 reads the atomic local operand from the v2
atomic body. The lkey follows compare_low, and the 8-byte local VA is at
offset 32. Version 1 keeps the SGE layout. Select the body with the same
RDMA version that already selects the atomic opcode.
Signed-off-by: Gregor Dick <gregor.dick@amd.com>
Signed-off-by: Abhijit Gangurde <abhijit.gangurde@amd.com>
---
drivers/infiniband/hw/ionic/ionic_datapath.c | 12 +++++++++---
drivers/infiniband/hw/ionic/ionic_fw.h | 15 +++++++++++++++
2 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/drivers/infiniband/hw/ionic/ionic_datapath.c b/drivers/infiniband/hw/ionic/ionic_datapath.c
index 5b6f10256b49..75f82c21cc03 100644
--- a/drivers/infiniband/hw/ionic/ionic_datapath.c
+++ b/drivers/infiniband/hw/ionic/ionic_datapath.c
@@ -1050,9 +1050,15 @@ static int ionic_prep_atomic(struct ionic_qp *qp,
wqe->atomic.remote_rkey = cpu_to_be32(wr->rkey);
wqe->base.num_sge_key = 1;
- wqe->atomic.sge.va = cpu_to_be64(wr->wr.sg_list[0].addr);
- wqe->atomic.sge.len = cpu_to_be32(8);
- wqe->atomic.sge.lkey = cpu_to_be32(wr->wr.sg_list[0].lkey);
+
+ if (dev->lif_cfg.rdma_version >= 2) {
+ wqe->atomic_v2.local_va = cpu_to_be64(wr->wr.sg_list[0].addr);
+ wqe->atomic_v2.lkey = cpu_to_be32(wr->wr.sg_list[0].lkey);
+ } else {
+ wqe->atomic.sge.va = cpu_to_be64(wr->wr.sg_list[0].addr);
+ wqe->atomic.sge.len = cpu_to_be32(8);
+ wqe->atomic.sge.lkey = cpu_to_be32(wr->wr.sg_list[0].lkey);
+ }
meta->len = 8;
ionic_prep_base(qp, &wr->wr, meta, wqe);
diff --git a/drivers/infiniband/hw/ionic/ionic_fw.h b/drivers/infiniband/hw/ionic/ionic_fw.h
index 100138e4cae7..3f8b69e114a7 100644
--- a/drivers/infiniband/hw/ionic/ionic_fw.h
+++ b/drivers/infiniband/hw/ionic/ionic_fw.h
@@ -495,6 +495,20 @@ struct ionic_v1_atomic_bdy {
struct ionic_sge sge;
};
+/* v2 atomic wqe body */
+struct ionic_v2_atomic_bdy {
+ __be32 remote_va_high;
+ __be32 remote_va_low;
+ __be32 remote_rkey;
+ __be32 swap_add_high;
+ __be32 swap_add_low;
+ __be32 compare_high;
+ __be32 compare_low;
+ __be32 lkey;
+ __be64 local_va;
+ __u8 rsvd_expdb[8];
+};
+
/* v1 reg mr wqe body */
struct ionic_v1_reg_mr_bdy {
__be64 va;
@@ -524,6 +538,7 @@ struct ionic_v1_wqe {
struct ionic_v1_recv_bdy recv;
struct ionic_v1_common_bdy common;
struct ionic_v1_atomic_bdy atomic;
+ struct ionic_v2_atomic_bdy atomic_v2;
struct ionic_v1_reg_mr_bdy reg_mr;
struct ionic_v1_bind_mw_bdy bind_mw;
};
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-07 15:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-07 15:02 [for-next 0/4] RDMA/ionic: add DMA MR and v2 atomic WQE Abhijit Gangurde
2026-11-07 15:02 ` [for-next 1/4] net: ionic: add an RDMA capability word to the LIF identity Abhijit Gangurde
2026-11-07 15:02 ` [for-next 2/4] RDMA/ionic: preserve atomic operands in the send WQE Abhijit Gangurde
2026-11-07 15:02 ` [for-next 3/4] RDMA/ionic: allocate a PD-scoped DMA MR Abhijit Gangurde
2026-11-07 15:02 ` [for-next 4/4] RDMA/ionic: use the v2 atomic send WQE layout Abhijit Gangurde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®