mirror of
https://git.FreeBSD.org/src.git
synced 2026-06-02 11:24:32 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
.\"
|
||||
.\" Author: Jim Harris <jimharris@FreeBSD.org>
|
||||
.\"
|
||||
.Dd January 31, 2026
|
||||
.Dd February 20, 2026
|
||||
.Dt NVMECONTROL 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
@@ -828,8 +828,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
|
||||
|
||||
+2
-1
@@ -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.
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user