Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Apr 2026 17:56:02 +0000
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 45c8b3b908f3 - stable/15 - nvmf: Limit the default I/O queue size to 128 entries
Message-ID:  <69ebaeb2.1e3de.79429f08@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/15 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=45c8b3b908f3a5e9002db1dd4de74f413e52ef93

commit 45c8b3b908f3a5e9002db1dd4de74f413e52ef93
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2026-02-20 19:21:18 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-04-24 15:42:35 +0000

    nvmf: Limit the default I/O queue size to 128 entries
    
    Previously the size defaulted to the maximum supported size reported
    by the remote host.  The value of 128 matches the default on Linux and
    avoids excessive resource usage for I/O queues.
    
    Sponsored by:   Chelsio Communications
    
    (cherry picked from commit 1602f0013bddc7b59b0b8de94c0e6cd742ffc9be)
---
 sbin/nvmecontrol/fabrics.c       | 2 +-
 sbin/nvmecontrol/nvmecontrol.8   | 6 +++---
 sys/dev/nvmf/nvmf.h              | 3 ++-
 tools/tools/nvmf/nvmfdd/nvmfdd.c | 3 ++-
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/sbin/nvmecontrol/fabrics.c b/sbin/nvmecontrol/fabrics.c
index 5fdbf68127d4..b120118cf022 100644
--- a/sbin/nvmecontrol/fabrics.c
+++ b/sbin/nvmecontrol/fabrics.c
@@ -485,7 +485,7 @@ connect_nvm_queues(const struct nvmf_association_params *aparams,
 	/* Validate I/O queue size. */
 	memset(io, 0, sizeof(*io) * num_io_queues);
 	if (queue_size == 0)
-		queue_size = (u_int)mqes + 1;
+		queue_size = MIN(NVMF_DEFAULT_IO_ENTRIES, (u_int)mqes + 1);
 	else if (queue_size > (u_int)mqes + 1) {
 		warnx("I/O queue size exceeds controller maximum (%u)",
 		    mqes + 1);
diff --git a/sbin/nvmecontrol/nvmecontrol.8 b/sbin/nvmecontrol/nvmecontrol.8
index dc757bcf90c3..55373f428ddf 100644
--- a/sbin/nvmecontrol/nvmecontrol.8
+++ b/sbin/nvmecontrol/nvmecontrol.8
@@ -33,7 +33,7 @@
 .\"
 .\" Author: Jim Harris <jimharris@FreeBSD.org>
 .\"
-.Dd July 9, 2025
+.Dd February 20, 2026
 .Dt NVMECONTROL 8
 .Os
 .Sh NAME
@@ -827,8 +827,8 @@ NVMe Qualified Name to use for this host.
 By default an NQN is auto-generated from the current host's UUID.
 .It Fl Q Ar entries
 Number of entries in each I/O queue.
-By default the maximum queue size reported by the MQES field
-of the remote host's CAP property is used.
+The default is the minimum of 128 or the maximum queue size reported
+by the MQES field of the remote host's CAP property.
 .El
 .Ss connect-all
 Query the Discovery Controller at
diff --git a/sys/dev/nvmf/nvmf.h b/sys/dev/nvmf/nvmf.h
index 9b2b4c1dea40..e53eecca156e 100644
--- a/sys/dev/nvmf/nvmf.h
+++ b/sys/dev/nvmf/nvmf.h
@@ -27,11 +27,12 @@
 #define	NVMF_NN			(1024)
 
 /*
- * Default timeouts for Fabrics hosts.  These match values used by
+ * Default settings for Fabrics hosts.  These match values used by
  * Linux.
  */
 #define	NVMF_DEFAULT_RECONNECT_DELAY	10
 #define	NVMF_DEFAULT_CONTROLLER_LOSS	600
+#define	NVMF_DEFAULT_IO_ENTRIES		128
 
 /*
  * (data, size) is the userspace buffer for a packed nvlist.
diff --git a/tools/tools/nvmf/nvmfdd/nvmfdd.c b/tools/tools/nvmf/nvmfdd/nvmfdd.c
index 0f181682aac2..9cc426c3ede9 100644
--- a/tools/tools/nvmf/nvmfdd/nvmfdd.c
+++ b/tools/tools/nvmf/nvmfdd/nvmfdd.c
@@ -474,7 +474,8 @@ main(int ac, char **av)
 	memset(&qparams, 0, sizeof(qparams));
 	tcp_qpair_params(&qparams, false, address, port);
 
-	io = nvmf_connect(na, &qparams, 1, info.mqes + 1, hostid,
+	io = nvmf_connect(na, &qparams, 1,
+	    MIN(NVMF_DEFAULT_IO_ENTRIES, info.mqes + 1), hostid,
 	    nvmf_cntlid(admin), av[2], hostnqn, 0);
 	if (io == NULL) {
 		warn("Failed to create I/O queue: %s",


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69ebaeb2.1e3de.79429f08>