From 67562faa5d67e80e67e34c226a068f9c8c8caf99 Mon Sep 17 00:00:00 2001 From: Tokunori Ikegami Date: Tue, 24 Mar 2026 00:38:47 +0900 Subject: [PATCH 1/2] libnvme: rename copy_range and add new fields Rename to copy_range_f0 and follow NVMe command set spec revision 1.2. Signed-off-by: Tokunori Ikegami --- libnvme/src/nvme/cmds.h | 12 +++++------ libnvme/src/nvme/types.h | 44 ++++++++++++++++++++++++++++----------- libnvme/test/ioctl/misc.c | 11 +++++----- nvme.c | 6 +++--- 4 files changed, 47 insertions(+), 26 deletions(-) diff --git a/libnvme/src/nvme/cmds.h b/libnvme/src/nvme/cmds.h index 6396703d9b..268b103805 100644 --- a/libnvme/src/nvme/cmds.h +++ b/libnvme/src/nvme/cmds.h @@ -4383,7 +4383,7 @@ nvme_init_copy(struct nvme_passthru_cmd *cmd, __u32 nsid, __u64 sdlba, data_len = nr * sizeof(struct nvme_copy_range_f3); break; default: - data_len = nr * sizeof(struct nvme_copy_range); + data_len = nr * sizeof(struct nvme_copy_range_f0); break; } @@ -5252,18 +5252,18 @@ nvme_init_copy_range_elbt(__u8 *elbt, __u64 eilbrt) } /** - * nvme_init_copy_range() - Constructs a copy range structure + * nvme_init_copy_range_f0() - Constructs a copy range structure * @copy: Copy range array * @nlbs: Number of logical blocks * @slbas: Starting LBA - * @eilbrts: Expected initial logical block reference tag + * @elbts: Expected initial logical block reference tag * @elbatms: Expected logical block application tag mask * @elbats: Expected logical block application tag * @nr: Number of descriptors to construct */ static inline void -nvme_init_copy_range(struct nvme_copy_range *copy, __u16 *nlbs, - __u64 *slbas, __u32 *eilbrts, __u32 *elbatms, +nvme_init_copy_range_f0(struct nvme_copy_range_f0 *copy, __u16 *nlbs, + __u64 *slbas, __u32 *elbts, __u32 *elbatms, __u32 *elbats, __u16 nr) { int i; @@ -5271,7 +5271,7 @@ nvme_init_copy_range(struct nvme_copy_range *copy, __u16 *nlbs, for (i = 0; i < nr; i++) { copy[i].nlb = htole16(nlbs[i]); copy[i].slba = htole64(slbas[i]); - copy[i].eilbrt = htole32(eilbrts[i]); + copy[i].elbt = htole32(elbts[i]); copy[i].elbatm = htole16(elbatms[i]); copy[i].elbat = htole16(elbats[i]); } diff --git a/libnvme/src/nvme/types.h b/libnvme/src/nvme/types.h index ff478d0f71..de583c062d 100644 --- a/libnvme/src/nvme/types.h +++ b/libnvme/src/nvme/types.h @@ -6436,22 +6436,28 @@ struct nvme_dsm_range { }; /** - * struct nvme_copy_range - Copy - Source Range Entries Descriptor Format + * struct nvme_copy_range_f0 - Copy - Source Range Entries Descriptor Format 0h * @rsvd0: Reserved * @slba: Starting LBA * @nlb: Number of Logical Blocks - * @rsvd18: Reserved - * @eilbrt: Expected Initial Logical Block Reference Tag / + * @cetype: Bits 3-0: Command Extension Type + * @rsvd19: Reserved + * @cev: Command Extension Value + * @rsvd22: Reserved + * @elbt: Expected Initial Logical Block Reference Tag / * Expected Logical Block Storage Tag * @elbatm: Expected Logical Block Application Tag Mask * @elbat: Expected Logical Block Application Tag */ -struct nvme_copy_range { +struct nvme_copy_range_f0 { __u8 rsvd0[8]; __le64 slba; __le16 nlb; - __u8 rsvd18[6]; - __le32 eilbrt; + __u8 cetype; + __u8 rsvd19; + __le16 cev; + __u8 rsvd22[2]; + __le32 elbt; __le16 elbat; __le16 elbatm; }; @@ -6461,7 +6467,10 @@ struct nvme_copy_range { * @rsvd0: Reserved * @slba: Starting LBA * @nlb: Number of Logical Blocks - * @rsvd18: Reserved + * @cetype: Bits 3-0: Command Extension Type + * @rsvd19: Reserved + * @cev: Command Extension Value + * @rsvd22: Reserved * @elbt: Expected Initial Logical Block Reference Tag / * Expected Logical Block Storage Tag * @elbatm: Expected Logical Block Application Tag Mask @@ -6471,7 +6480,10 @@ struct nvme_copy_range_f1 { __u8 rsvd0[8]; __le64 slba; __le16 nlb; - __u8 rsvd18[8]; + __u8 cetype; + __u8 rsvd19; + __le16 cev; + __u8 rsvd22[4]; __u8 elbt[10]; __le16 elbat; __le16 elbatm; @@ -6491,7 +6503,9 @@ enum nvme_copy_range_sopt { * @rsvd4: Reserved * @slba: Starting LBA * @nlb: Number of Logical Blocks - * @rsvd18: Reserved + * @cetype: Bits 3-0: Command Extension Type + * @rsvd19: Reserved + * @cev: Command Extension Value * @sopt: Source Options * @eilbrt: Expected Initial Logical Block Reference Tag / * Expected Logical Block Storage Tag @@ -6503,7 +6517,9 @@ struct nvme_copy_range_f2 { __u8 rsvd4[4]; __le64 slba; __le16 nlb; - __u8 rsvd18[4]; + __u8 cetype; + __u8 rsvd19; + __le16 cev; __le16 sopt; __le32 eilbrt; __le16 elbat; @@ -6516,8 +6532,10 @@ struct nvme_copy_range_f2 { * @rsvd4: Reserved * @slba: Starting LBA * @nlb: Number of Logical Blocks - * @rsvd18: Reserved + * @cetype: Bits 3-0: Command Extension Type + * @rsvd19: Reserved * @sopt: Source Options + * @cev: Command Extension Value * @rsvd24: Reserved * @elbt: Expected Initial Logical Block Reference Tag / * Expected Logical Block Storage Tag @@ -6529,7 +6547,9 @@ struct nvme_copy_range_f3 { __u8 rsvd4[4]; __le64 slba; __le16 nlb; - __u8 rsvd18[4]; + __u8 cetype; + __u8 rsvd19; + __le16 cev; __le16 sopt; __u8 rsvd24[2]; __u8 elbt[10]; diff --git a/libnvme/test/ioctl/misc.c b/libnvme/test/ioctl/misc.c index b6dc618dd3..b2b5ad7afd 100644 --- a/libnvme/test/ioctl/misc.c +++ b/libnvme/test/ioctl/misc.c @@ -983,7 +983,7 @@ static void test_dsm(void) static void test_copy(void) { __u16 nr = TEST_COPY_NR, cev = 0, dspec = 0; - int copy_size = sizeof(struct nvme_copy_range) * nr, err; + int copy_size = sizeof(struct nvme_copy_range_f0) * nr, err; bool prinfor = false, prinfow = false, stcw = false, stcr = false, fua = false, lr = false; __u8 cetype = 0, dtype = 0, desfmt = 0xf; @@ -993,7 +993,7 @@ static void test_copy(void) __u32 short_pi[TEST_COPY_NR] = { 0x1000, 0x20000000, 0x40000000 }; __u32 elbatms[TEST_COPY_NR] = { 0x1ff, 0x3ff, 0x3ff }; __u32 elbats[TEST_COPY_NR] = { 0x111, 0x222, 0x333 }; - __u8 expected_data[sizeof(struct nvme_copy_range) * TEST_COPY_NR] = { + __u8 expected_data[sizeof(struct nvme_copy_range_f0) * TEST_COPY_NR] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10, 0, 0, 0, 0, 0, 0, 0xa, 0, 0, 0, 0, 0, 0, 0, 0, 0x10, 0, 0, 0x11, 1, 0xff, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x20, 0, 0, 0, 0, @@ -1002,7 +1002,7 @@ static void test_copy(void) 0xc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x40, 0x33, 3, 0xff, 3 }; - _cleanup_free_ struct nvme_copy_range *copy = NULL; + _cleanup_free_ struct nvme_copy_range_f0 *copy = NULL; copy = calloc(1, copy_size); check(copy, "copy: ENOMEM"); @@ -1017,13 +1017,14 @@ static void test_copy(void) ((dtype & 0xf) << 20) | ((prinfow & 0xf) << 26) | ((fua & 0x1) << 30) | ((lr & 0x1) << 31), - .data_len = nr * sizeof(struct nvme_copy_range), + .data_len = nr * sizeof(struct nvme_copy_range_f0), .in_data = expected_data, }; struct nvme_passthru_cmd cmd; set_mock_io_cmds(&mock_io_cmd, 1); - nvme_init_copy_range(copy, nlbs, slbas, short_pi, elbatms, elbats, nr); + nvme_init_copy_range_f0(copy, nlbs, slbas, short_pi, elbatms, elbats, + nr); nvme_init_copy(&cmd, TEST_NSID, sdlba, nr, desfmt, prinfor, prinfow, cetype, dtype, stcw, stcr, fua, lr, cev, dspec, (void *)copy); diff --git a/nvme.c b/nvme.c index 08fb9f8363..b198f3fbed 100644 --- a/nvme.c +++ b/nvme.c @@ -7770,7 +7770,7 @@ static int copy_cmd(int argc, char **argv, struct command *acmd, struct plugin * __u32 elbats[256] = { 0 }; _cleanup_free_ union { - struct nvme_copy_range f0[256]; + struct nvme_copy_range_f0 f0[256]; struct nvme_copy_range_f1 f1[256]; struct nvme_copy_range_f2 f2[256]; struct nvme_copy_range_f3 f3[256]; @@ -7922,8 +7922,8 @@ static int copy_cmd(int argc, char **argv, struct command *acmd, struct plugin * eilbrts.long_pi, elbatms, elbats, nr); break; default: - nvme_init_copy_range(copy->f0, nlbs, slbas, eilbrts.short_pi, - elbatms, elbats, nr); + nvme_init_copy_range_f0(copy->f0, nlbs, slbas, eilbrts.short_pi, + elbatms, elbats, nr); break; } From 8b6577c88ea9477b72ca8007915ae95a5566802d Mon Sep 17 00:00:00 2001 From: Tokunori Ikegami Date: Tue, 24 Mar 2026 00:41:14 +0900 Subject: [PATCH 2/2] libnvme/cmds: change copy desc format tags to big-endian Change the elbt, elbat and albatm tag fields byte ordering. Signed-off-by: Tokunori Ikegami --- libnvme/src/nvme/cmds.h | 58 +++++++++++++-------------------- libnvme/src/nvme/types.h | 22 ++++++------- libnvme/test/ioctl/misc.c | 68 ++++++++++++++++++++++++++++++++++++--- nvme.c | 8 ++--- 4 files changed, 101 insertions(+), 55 deletions(-) diff --git a/libnvme/src/nvme/cmds.h b/libnvme/src/nvme/cmds.h index 268b103805..25dea786ae 100644 --- a/libnvme/src/nvme/cmds.h +++ b/libnvme/src/nvme/cmds.h @@ -5235,22 +5235,6 @@ nvme_init_dsm_range(struct nvme_dsm_range *dsm, __u32 *ctx_attrs, } } -/** - * nvme_init_copy_range_elbt() - Constructs a copy range elbt structure - * @elbt: - * @eilbrts: Expected initial logical block reference tag - */ -static inline void -nvme_init_copy_range_elbt(__u8 *elbt, __u64 eilbrt) -{ - int i; - - for (i = 0; i < 8; i++) - elbt[9 - i] = (eilbrt >> (8 * i)) & 0xff; - elbt[1] = 0; - elbt[0] = 0; -} - /** * nvme_init_copy_range_f0() - Constructs a copy range structure * @copy: Copy range array @@ -5263,17 +5247,17 @@ nvme_init_copy_range_elbt(__u8 *elbt, __u64 eilbrt) */ static inline void nvme_init_copy_range_f0(struct nvme_copy_range_f0 *copy, __u16 *nlbs, - __u64 *slbas, __u32 *elbts, __u32 *elbatms, - __u32 *elbats, __u16 nr) + __u64 *slbas, __u32 *elbts, __u16 *elbatms, + __u16 *elbats, __u16 nr) { int i; for (i = 0; i < nr; i++) { copy[i].nlb = htole16(nlbs[i]); copy[i].slba = htole64(slbas[i]); - copy[i].elbt = htole32(elbts[i]); - copy[i].elbatm = htole16(elbatms[i]); - copy[i].elbat = htole16(elbats[i]); + copy[i].elbt = htobe32(elbts[i]); + copy[i].elbatm = htobe16(elbatms[i]); + copy[i].elbat = htobe16(elbats[i]); } } @@ -5289,17 +5273,19 @@ nvme_init_copy_range_f0(struct nvme_copy_range_f0 *copy, __u16 *nlbs, */ static inline void nvme_init_copy_range_f1(struct nvme_copy_range_f1 *copy, __u16 *nlbs, - __u64 *slbas, __u64 *eilbrts, __u32 *elbatms, - __u32 *elbats, __u16 nr) + __u64 *slbas, __u64 *eilbrts, __u16 *elbatms, + __u16 *elbats, __u16 nr) { int i; + memset(copy, 0, sizeof(*copy) * nr); + for (i = 0; i < nr; i++) { copy[i].nlb = htole16(nlbs[i]); copy[i].slba = htole64(slbas[i]); - copy[i].elbatm = htole16(elbatms[i]); - copy[i].elbat = htole16(elbats[i]); - nvme_init_copy_range_elbt(copy[i].elbt, eilbrts[i]); + *(__be64 *)©[i].elbt[2] = htobe64(eilbrts[i]); + copy[i].elbatm = htobe16(elbatms[i]); + copy[i].elbat = htobe16(elbats[i]); } } @@ -5310,7 +5296,7 @@ nvme_init_copy_range_f1(struct nvme_copy_range_f1 *copy, __u16 *nlbs, * @nlbs: Number of logical blocks * @slbas: Starting LBA * @sopts: Source options - * @eilbrts: Expected initial logical block reference tag + * @elbts: Expected initial logical block reference tag * @elbatms: Expected logical block application tag mask * @elbats: Expected logical block application tag * @nr: Number of descriptors to construct @@ -5318,7 +5304,7 @@ nvme_init_copy_range_f1(struct nvme_copy_range_f1 *copy, __u16 *nlbs, static inline void nvme_init_copy_range_f2(struct nvme_copy_range_f2 *copy, __u32 *snsids, __u16 *nlbs, __u64 *slbas, __u16 *sopts, - __u32 *eilbrts, __u32 *elbatms, __u32 *elbats, + __u32 *elbts, __u16 *elbatms, __u16 *elbats, __u16 nr) { int i; @@ -5328,9 +5314,9 @@ nvme_init_copy_range_f2(struct nvme_copy_range_f2 *copy, copy[i].nlb = htole16(nlbs[i]); copy[i].slba = htole64(slbas[i]); copy[i].sopt = htole16(sopts[i]); - copy[i].eilbrt = htole32(eilbrts[i]); - copy[i].elbatm = htole16(elbatms[i]); - copy[i].elbat = htole16(elbats[i]); + copy[i].elbt = htobe32(elbts[i]); + copy[i].elbatm = htobe16(elbatms[i]); + copy[i].elbat = htobe16(elbats[i]); } } @@ -5349,19 +5335,21 @@ nvme_init_copy_range_f2(struct nvme_copy_range_f2 *copy, static inline void nvme_init_copy_range_f3(struct nvme_copy_range_f3 *copy, __u32 *snsids, __u16 *nlbs, __u64 *slbas, __u16 *sopts, - __u64 *eilbrts, __u32 *elbatms, __u32 *elbats, + __u64 *eilbrts, __u16 *elbatms, __u16 *elbats, __u16 nr) { int i; + memset(copy, 0, sizeof(*copy) * nr); + for (i = 0; i < nr; i++) { copy[i].snsid = htole32(snsids[i]); copy[i].nlb = htole16(nlbs[i]); copy[i].slba = htole64(slbas[i]); copy[i].sopt = htole16(sopts[i]); - copy[i].elbatm = htole16(elbatms[i]); - copy[i].elbat = htole16(elbats[i]); - nvme_init_copy_range_elbt(copy[i].elbt, eilbrts[i]); + *(__be64 *)©[i].elbt[2] = htobe64(eilbrts[i]); + copy[i].elbatm = htobe16(elbatms[i]); + copy[i].elbat = htobe16(elbats[i]); } } diff --git a/libnvme/src/nvme/types.h b/libnvme/src/nvme/types.h index de583c062d..90697733dc 100644 --- a/libnvme/src/nvme/types.h +++ b/libnvme/src/nvme/types.h @@ -6457,9 +6457,9 @@ struct nvme_copy_range_f0 { __u8 rsvd19; __le16 cev; __u8 rsvd22[2]; - __le32 elbt; - __le16 elbat; - __le16 elbatm; + __be32 elbt; + __be16 elbat; + __be16 elbatm; }; /** @@ -6485,8 +6485,8 @@ struct nvme_copy_range_f1 { __le16 cev; __u8 rsvd22[4]; __u8 elbt[10]; - __le16 elbat; - __le16 elbatm; + __be16 elbat; + __be16 elbatm; }; /** @@ -6507,7 +6507,7 @@ enum nvme_copy_range_sopt { * @rsvd19: Reserved * @cev: Command Extension Value * @sopt: Source Options - * @eilbrt: Expected Initial Logical Block Reference Tag / + * @elbt: Expected Initial Logical Block Reference Tag / * Expected Logical Block Storage Tag * @elbatm: Expected Logical Block Application Tag Mask * @elbat: Expected Logical Block Application Tag @@ -6521,9 +6521,9 @@ struct nvme_copy_range_f2 { __u8 rsvd19; __le16 cev; __le16 sopt; - __le32 eilbrt; - __le16 elbat; - __le16 elbatm; + __be32 elbt; + __be16 elbat; + __be16 elbatm; }; /** @@ -6553,8 +6553,8 @@ struct nvme_copy_range_f3 { __le16 sopt; __u8 rsvd24[2]; __u8 elbt[10]; - __le16 elbat; - __le16 elbatm; + __be16 elbat; + __be16 elbatm; }; /** diff --git a/libnvme/test/ioctl/misc.c b/libnvme/test/ioctl/misc.c index b2b5ad7afd..d02cf98002 100644 --- a/libnvme/test/ioctl/misc.c +++ b/libnvme/test/ioctl/misc.c @@ -991,15 +991,15 @@ static void test_copy(void) __u16 nlbs[TEST_COPY_NR] = { 0xa, 0xb, 0xc }; __u64 slbas[TEST_COPY_NR] = { 0x1000, 0x20000000, 0x300040000000 }; __u32 short_pi[TEST_COPY_NR] = { 0x1000, 0x20000000, 0x40000000 }; - __u32 elbatms[TEST_COPY_NR] = { 0x1ff, 0x3ff, 0x3ff }; - __u32 elbats[TEST_COPY_NR] = { 0x111, 0x222, 0x333 }; + __u16 elbatms[TEST_COPY_NR] = { 0x1ff, 0x3ff, 0x3ff }; + __u16 elbats[TEST_COPY_NR] = { 0x111, 0x222, 0x333 }; __u8 expected_data[sizeof(struct nvme_copy_range_f0) * TEST_COPY_NR] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10, 0, 0, 0, 0, 0, 0, - 0xa, 0, 0, 0, 0, 0, 0, 0, 0, 0x10, 0, 0, 0x11, 1, 0xff, 1, + 0xa, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10, 0, 1, 0x11, 1, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x20, 0, 0, 0, 0, - 0xb, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x20, 0x22, 2, 0xff, 3, + 0xb, 0, 0, 0, 0, 0, 0, 0, 0x20, 0, 0, 0, 2, 0x22, 3, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x40, 0, 0x30, 0, 0, - 0xc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x40, 0x33, 3, 0xff, 3 + 0xc, 0, 0, 0, 0, 0, 0, 0, 0x40, 0, 0, 0, 3, 0x33, 3, 0xff }; _cleanup_free_ struct nvme_copy_range_f0 *copy = NULL; @@ -1034,6 +1034,63 @@ static void test_copy(void) check(cmd.result == 0, "returned result %" PRIu64, (uint64_t)cmd.result); } +static void test_copy_range_f1(void) +{ + __u16 nr = TEST_COPY_NR, cev = 0, dspec = 0; + int copy_size = sizeof(struct nvme_copy_range_f1) * nr, err; + bool prinfor = false, prinfow = false, stcw = false, + stcr = false, fua = false, lr = false; + __u8 cetype = 0, dtype = 0, desfmt = 0x1; + __u64 sdlba = 0xfffff; + __u16 nlbs[TEST_COPY_NR] = { 0xa, 0xb, 0xc }; + __u64 slbas[TEST_COPY_NR] = { 0x1000, 0x20000000, 0x300040000000 }; + __u64 long_pi[TEST_COPY_NR] = { 0x1000, 0x20000000, 0x40000000 }; + __u16 elbatms[TEST_COPY_NR] = { 0x1ff, 0x3ff, 0x3ff }; + __u16 elbats[TEST_COPY_NR] = { 0x111, 0x222, 0x333 }; + __u8 expected_data[sizeof(struct nvme_copy_range_f1) * TEST_COPY_NR] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10, 0, 0, 0, 0, 0, 0, + 0xa, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0x10, 0, 1, 0x11, 1, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0x20, 0, 0, 0, 0, 0xb, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0x20, 0, 0, 0, 2, 0x22, 3, 0xff, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x40, 0, 0x30, 0, 0, + 0xc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0x40, 0, 0, 0, 3, 0x33, 3, 0xff + }; + + _cleanup_free_ struct nvme_copy_range_f1 *copy = NULL; + + copy = calloc(1, copy_size); + check(copy, "copy: ENOMEM"); + + struct mock_cmd mock_io_cmd = { + .opcode = nvme_cmd_copy, + .nsid = TEST_NSID, + .cdw10 = sdlba & 0xffffffff, + .cdw11 = sdlba >> 32, + .cdw12 = ((nr - 1) & 0xff) | ((desfmt & 0xf) << 8) | + ((prinfor & 0xf) << 12) | + ((dtype & 0xf) << 20) | + ((prinfow & 0xf) << 26) | + ((fua & 0x1) << 30) | ((lr & 0x1) << 31), + .data_len = nr * sizeof(struct nvme_copy_range_f1), + .in_data = expected_data, + }; + struct nvme_passthru_cmd cmd; + + set_mock_io_cmds(&mock_io_cmd, 1); + nvme_init_copy_range_f1(copy, nlbs, slbas, long_pi, elbatms, elbats, + nr); + nvme_init_copy(&cmd, TEST_NSID, sdlba, nr, desfmt, + prinfor, prinfow, cetype, dtype, stcw, stcr, + fua, lr, cev, dspec, (void *)copy); + err = nvme_submit_io_passthru(test_hdl, &cmd); + end_mock_cmds(); + check(err == 0, "returned error %d", err); + check(cmd.result == 0, "returned result %" PRIu64, + (uint64_t)cmd.result); +} + static void test_resv_acquire(void) { enum nvme_resv_rtype rtype = NVME_RESERVATION_RTYPE_EAAR; @@ -1448,6 +1505,7 @@ int main(void) RUN_TEST(verify); RUN_TEST(dsm); RUN_TEST(copy); + RUN_TEST(copy_range_f1); RUN_TEST(resv_acquire); RUN_TEST(resv_register); RUN_TEST(resv_release); diff --git a/nvme.c b/nvme.c index b198f3fbed..040ad6d171 100644 --- a/nvme.c +++ b/nvme.c @@ -7766,8 +7766,8 @@ static int copy_cmd(int argc, char **argv, struct command *acmd, struct plugin * __u64 long_pi[256]; } eilbrts; - __u32 elbatms[256] = { 0 }; - __u32 elbats[256] = { 0 }; + __u16 elbatms[256] = { 0 }; + __u16 elbats[256] = { 0 }; _cleanup_free_ union { struct nvme_copy_range_f0 f0[256]; @@ -7876,9 +7876,9 @@ static int copy_cmd(int argc, char **argv, struct command *acmd, struct plugin * return -EINVAL; } - natms = argconfig_parse_comma_sep_array_u32(cfg.elbatms, elbatms, + natms = argconfig_parse_comma_sep_array_u16(cfg.elbatms, elbatms, ARRAY_SIZE(elbatms)); - nats = argconfig_parse_comma_sep_array_u32(cfg.elbats, elbats, + nats = argconfig_parse_comma_sep_array_u16(cfg.elbats, elbats, ARRAY_SIZE(elbats)); nr = max(nb, max(ns, max(nrts, max(natms, nats))));