Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message May 16, 2023

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit f6f80750f75810bdaf56dd9362982055de1d7232:

docs: expand description for interval-based bw and iops statistics (2023-05-10 20:28:49 -0400)

are available in the Git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to 83b2d4b78374055c3a2261136eedf03b5fbfc335:

ci: stop testing Linux 32-bit builds (2023-05-15 08:51:27 -0400)

----------------------------------------------------------------
Ankit Kumar (2):
engines/nvme: support for 64 LBA formats engines/io_uring_cmd: add extended LBA support

Vincent Fu (1):
ci: stop testing Linux 32-bit builds

 .github/workflows/ci.yml |  4 ---
 engines/io_uring.c       | 30 +++++++++++++++++++---
 engines/nvme.c           | 66 ++++++++++++++++++++++++++++++++++++++++--------
 engines/nvme.h           |  6 ++---
 4 files changed, 84 insertions(+), 22 deletions(-)

---

Diff of recent changes:

.github/workflows/ci.yml +0 -4
index dd2997f0..8325a3d9 100644
@@ -14,7 +14,6 @@ jobs:
         - linux-gcc
         - linux-clang
         - macos
-        - linux-i686-gcc
         - android
         - windows-cygwin-64
         - windows-cygwin-32
@@ -28,9 +27,6 @@ jobs:
           cc: clang
         - build: macos
           os: macos-12
-        - build: linux-i686-gcc
-          os: ubuntu-22.04
-          arch: i686
         - build: android
           os: ubuntu-22.04
           arch: aarch64-linux-android32
engines/io_uring.c +26 -4
index f5ffe9f4..90e5a856 100644
@@ -1177,22 +1177,40 @@ static int fio_ioring_cmd_open_file(struct thread_data *td, struct fio_file *f)
 	if (o->cmd_type == FIO_URING_CMD_NVME) {
 		struct nvme_data *data = NULL;
 		unsigned int nsid, lba_size = 0;
+		__u32 ms = 0;
 		__u64 nlba = 0;
 		int ret;
 
 		/* Store the namespace-id and lba size. */
 		data = FILE_ENG_DATA(f);
 		if (data == NULL) {
-			ret = fio_nvme_get_info(f, &nsid, &lba_size, &nlba);
+			ret = fio_nvme_get_info(f, &nsid, &lba_size, &ms, &nlba);
 			if (ret)
 				return ret;
 
 			data = calloc(1, sizeof(struct nvme_data));
 			data->nsid = nsid;
-			data->lba_shift = ilog2(lba_size);
+			if (ms)
+				data->lba_ext = lba_size + ms;
+			else
+				data->lba_shift = ilog2(lba_size);
 
 			FILE_SET_ENG_DATA(f, data);
 		}
+
+		lba_size = data->lba_ext ? data->lba_ext : (1 << data->lba_shift);
+
+		for_each_rw_ddir(ddir) {
+			if (td->o.min_bs[ddir] % lba_size ||
+				td->o.max_bs[ddir] % lba_size) {
+				if (data->lba_ext)
+					log_err("block size must be a multiple of "
+						"(LBA data size + Metadata size)\n");
+				else
+					log_err("block size must be a multiple of LBA data size\n");
+				return 1;
+			}
+                }
 	}
 	if (!ld || !o->registerfiles)
 		return generic_open_file(td, f);
@@ -1243,16 +1261,20 @@ static int fio_ioring_cmd_get_file_size(struct thread_data *td,
 	if (o->cmd_type == FIO_URING_CMD_NVME) {
 		struct nvme_data *data = NULL;
 		unsigned int nsid, lba_size = 0;
+		__u32 ms = 0;
 		__u64 nlba = 0;
 		int ret;
 
-		ret = fio_nvme_get_info(f, &nsid, &lba_size, &nlba);
+		ret = fio_nvme_get_info(f, &nsid, &lba_size, &ms, &nlba);
 		if (ret)
 			return ret;
 
 		data = calloc(1, sizeof(struct nvme_data));
 		data->nsid = nsid;
-		data->lba_shift = ilog2(lba_size);
+		if (ms)
+			data->lba_ext = lba_size + ms;
+		else
+			data->lba_shift = ilog2(lba_size);
 
 		f->real_file_size = lba_size * nlba;
 		fio_file_set_size_known(f);
engines/nvme.c +55 -11

108 lines not on this page · raw message

engines/nvme.h +3 -3
index 408594d5..f7cb820d 100644
@@ -88,6 +88,7 @@ enum nvme_zns_zs {
 struct nvme_data {
 	__u32 nsid;
 	__u32 lba_shift;
+	__u32 lba_ext;
 };
 
 struct nvme_lbaf {
@@ -134,8 +135,7 @@ struct nvme_id_ns {
 	__le16			endgid;
 	__u8			nguid[16];
 	__u8			eui64[8];
-	struct nvme_lbaf	lbaf[16];
-	__u8			rsvd192[192];
+	struct nvme_lbaf	lbaf[64];
 	__u8			vs[3712];
 };
 
@@ -223,7 +223,7 @@ int fio_nvme_iomgmt_ruhs(struct thread_data *td, struct fio_file *f,
 			 struct nvme_fdp_ruh_status *ruhs, __u32 bytes);
 
 int fio_nvme_get_info(struct fio_file *f, __u32 *nsid, __u32 *lba_sz,
-		      __u64 *nlba);
+		      __u32 *ms, __u64 *nlba);
 
 int fio_nvme_uring_cmd_prep(struct nvme_uring_cmd *cmd, struct io_u *io_u,
 			    struct iovec *iov);