Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@meta.com>
To: <linux-nvme@lists.infradead.org>, <wagi@kernel.org>
Cc: <dwagner@suse.de>, Keith Busch <kbusch@kernel.org>
Subject: [PATCH] libnvme: do not byte swap command dwords
Date: Thu, 3 Apr 2025 07:43:15 -0700	[thread overview]
Message-ID: <20250403144315.2576523-1-kbusch@meta.com> (raw)

From: Keith Busch <kbusch@kernel.org>

The dwords always need to be set in the cpu native format. The driver
will handle setting up the SQE in the nvme little-endian order, and big
endian is never used, so this byte swapping was wrong.

Link: https://github.com/linux-nvme/nvme-cli/issues/2761
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 src/nvme/ioctl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/nvme/ioctl.c b/src/nvme/ioctl.c
index 18b228d9..86c2b702 100644
--- a/src/nvme/ioctl.c
+++ b/src/nvme/ioctl.c
@@ -1920,9 +1920,9 @@ static int nvme_set_var_size_tags(__u32 *cmd_dw2, __u32 *cmd_dw3, __u32 *cmd_dw1
 		return -1;
 	}
 
-	*cmd_dw2 = cpu_to_be32(cdw2);
-	*cmd_dw3 = cpu_to_be32(cdw3);
-	*cmd_dw14 = cpu_to_be32(cdw14);
+	*cmd_dw2 = cdw2;
+	*cmd_dw3 = cdw3;
+	*cmd_dw14 = cdw14;
 	return 0;
 }
 
-- 
2.47.1



             reply	other threads:[~2025-04-03 14:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-03 14:43 Keith Busch [this message]
2025-04-03 17:25 ` [PATCH] libnvme: do not byte swap command dwords Daniel Wagner
2025-04-03 17:35   ` Keith Busch
2025-04-03 17:38   ` Daniel Wagner
2025-04-03 18:25 ` Daniel Wagner

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=20250403144315.2576523-1-kbusch@meta.com \
    --to=kbusch@meta.com \
    --cc=dwagner@suse.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=wagi@kernel.org \
    /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