From: Jason Gunthorpe <jgg@ziepe.ca>
To: Thorsten Blum <thorsten.blum@linux.dev>
Cc: Abhijit Gangurde <abhijit.gangurde@amd.com>,
Allen Hubbe <allen.hubbe@amd.com>,
Leon Romanovsky <leon@kernel.org>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RDMA/ionic: Replace cpu_to_be64 + le64_to_cpu with swab64
Date: Fri, 12 Dec 2025 02:49:56 -0400 [thread overview]
Message-ID: <aTu7FFofH/ot1A74@ziepe.ca> (raw)
In-Reply-To: <20251210131428.569187-2-thorsten.blum@linux.dev>
On Wed, Dec 10, 2025 at 02:14:29PM +0100, Thorsten Blum wrote:
> Replace cpu_to_be64(le64_to_cpu()) with swab64() to simplify
> ionic_prep_reg(). No functional changes.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> drivers/infiniband/hw/ionic/ionic_datapath.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/ionic/ionic_datapath.c b/drivers/infiniband/hw/ionic/ionic_datapath.c
> index aa2944887f23..1a1cf82d1745 100644
> --- a/drivers/infiniband/hw/ionic/ionic_datapath.c
> +++ b/drivers/infiniband/hw/ionic/ionic_datapath.c
> @@ -1105,7 +1105,7 @@ static int ionic_prep_reg(struct ionic_qp *qp,
> wqe->reg_mr.length = cpu_to_be64(mr->ibmr.length);
> wqe->reg_mr.offset = ionic_pgtbl_off(&mr->buf, mr->ibmr.iova);
> dma_addr = ionic_pgtbl_dma(&mr->buf, mr->ibmr.iova);
> - wqe->reg_mr.dma_addr = cpu_to_be64(le64_to_cpu(dma_addr));
> + wqe->reg_mr.dma_addr = swab64(dma_addr);
This doesn't make any sense to me. The original code looks wrong and
would fail sparse, switching to swab just highlights how nonsense it
is, there is no way that is right on BE and LE.
Pensando guys what is the right thing to do here??
Jason
next prev parent reply other threads:[~2025-12-12 6:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-10 13:14 [PATCH] RDMA/ionic: Replace cpu_to_be64 + le64_to_cpu with swab64 Thorsten Blum
2025-12-12 6:49 ` Jason Gunthorpe [this message]
2025-12-12 8:24 ` Abhijit Gangurde
2025-12-16 0:51 ` Jason Gunthorpe
2025-12-16 12:35 ` Thorsten Blum
2025-12-18 16:09 ` Leon Romanovsky
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=aTu7FFofH/ot1A74@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=abhijit.gangurde@amd.com \
--cc=allen.hubbe@amd.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=thorsten.blum@linux.dev \
/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