Skip to content

Commit d50b0e0

Browse files
Revert various related big-endian PI commits
This reverts a series of related changes that mapped storage and reference tags into the shared region over multiple CDWords in big-endian ordering. Keith confirmed the CDWords are always in little-endian ordering, and that the MSB-LSB representation in the spec is for the metadata payload itself. Signed-off-by: Brandon Paupore <[email protected]>
1 parent 555d4c1 commit d50b0e0

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/nvme/ioctl.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,9 +1920,9 @@ static int nvme_set_var_size_tags(__u32 *cmd_dw2, __u32 *cmd_dw3, __u32 *cmd_dw1
19201920
return -1;
19211921
}
19221922

1923-
*cmd_dw2 = cpu_to_be32(cdw2);
1924-
*cmd_dw3 = cpu_to_be32(cdw3);
1925-
*cmd_dw14 = cpu_to_be32(cdw14);
1923+
*cmd_dw2 = cpu_to_le32(cdw2);
1924+
*cmd_dw3 = cpu_to_le32(cdw3);
1925+
*cmd_dw14 = cpu_to_le32(cdw14);
19261926
return 0;
19271927
}
19281928

@@ -1944,9 +1944,9 @@ int nvme_io(struct nvme_io_args *args, __u8 opcode)
19441944
cdw15 = args->apptag | (args->appmask << 16);
19451945

19461946
if (args->args_size == size_v1) {
1947-
cdw2 = (args->storage_tag >> 32) & 0xffff;
1948-
cdw3 = args->storage_tag & 0xffffffff;
1949-
cdw14 = args->reftag;
1947+
cdw2 = cpu_to_le32((args->storage_tag >> 32) & 0xffff);
1948+
cdw3 = cpu_to_le32(args->storage_tag & 0xffffffff);
1949+
cdw14 = cpu_to_le32(args->reftag);
19501950
} else {
19511951
if (nvme_set_var_size_tags(&cdw2, &cdw3, &cdw14,
19521952
args->pif,

src/nvme/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ static inline void nvme_init_copy_range_elbt(__u8 *elbt, __u64 eilbrt)
416416
int i;
417417

418418
for (i = 0; i < 8; i++)
419-
elbt[9 - i] = (eilbrt >> (8 * i)) & 0xff;
419+
elbt[i + 2] = (eilbrt >> (8 * i)) & 0xff;
420420
elbt[1] = 0;
421421
elbt[0] = 0;
422422
}

0 commit comments

Comments
 (0)