mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Abhijit Gangurde <abhijit.gangurde@amd.com>
To: <jgg@ziepe.ca>, <leon@kernel.org>, <brett.creeley@amd.com>,
	<andrew+netdev@lunn.ch>, <davem@davemloft.net>,
	<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>
Cc: <allen.hubbe@amd.com>, <eric.joyner@amd.com>,
	<nikhil.agarwal@amd.com>, <linux-rdma@vger.kernel.org>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Gregor Dick <gregor.dick@amd.com>,
	"Abhijit Gangurde" <abhijit.gangurde@amd.com>
Subject: [for-next 4/4] RDMA/ionic: use the v2 atomic send WQE layout
Date: Sat, 7 Nov 2026 20:32:49 +0530	[thread overview]
Message-ID: <20261107150249.1576835-5-abhijit.gangurde@amd.com> (raw)
In-Reply-To: <20261107150249.1576835-1-abhijit.gangurde@amd.com>

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


      parent reply	other threads:[~2026-11-07 15:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Abhijit Gangurde [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261107150249.1576835-5-abhijit.gangurde@amd.com \
    --to=abhijit.gangurde@amd.com \
    --cc=allen.hubbe@amd.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=brett.creeley@amd.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.joyner@amd.com \
    --cc=gregor.dick@amd.com \
    --cc=jgg@ziepe.ca \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nikhil.agarwal@amd.com \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®