Skip to content

Commit 6f65947

Browse files
committed
Merge tag 'nvme-6.16-2025-06-05' of git://git.infradead.org/nvme into block-6.16
Pull NVMe updates and fixes from Christoph: "nvme updates for Linux 6.16 - TCP error handling fix (Shin'ichiro Kawasaki) - TCP I/O stall handling fixes (Hannes Reinecke) - fix command limits status code (Keith Busch) - support vectored buffers also for passthrough (Pavel Begunkov) - spelling fixes (Yi Zhang)" * tag 'nvme-6.16-2025-06-05' of git://git.infradead.org/nvme: nvme: spelling fixes nvme-tcp: fix I/O stalls on congested sockets nvme-tcp: sanitize request list handling nvme-tcp: remove tag set when second admin queue config fails nvme: enable vectored registered bufs for passthrough cmds nvme: fix implicit bool to flags conversion nvme: fix command limits status code
2 parents a2f4c1a + 44e479d commit 6f65947

File tree

20 files changed

+57
-54
lines changed

20 files changed

+57
-54
lines changed

drivers/nvme/common/auth.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ EXPORT_SYMBOL_GPL(nvme_auth_generate_key);
471471
* @c1: Value of challenge C1
472472
* @c2: Value of challenge C2
473473
* @hash_len: Hash length of the hash algorithm
474-
* @ret_psk: Pointer too the resulting generated PSK
474+
* @ret_psk: Pointer to the resulting generated PSK
475475
* @ret_len: length of @ret_psk
476476
*
477477
* Generate a PSK for TLS as specified in NVMe base specification, section
@@ -759,8 +759,8 @@ int nvme_auth_derive_tls_psk(int hmac_id, u8 *psk, size_t psk_len,
759759
goto out_free_prk;
760760

761761
/*
762-
* 2 addtional bytes for the length field from HDKF-Expand-Label,
763-
* 2 addtional bytes for the HMAC ID, and one byte for the space
762+
* 2 additional bytes for the length field from HDKF-Expand-Label,
763+
* 2 additional bytes for the HMAC ID, and one byte for the space
764764
* separator.
765765
*/
766766
info_len = strlen(psk_digest) + strlen(psk_prefix) + 5;

drivers/nvme/host/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ config NVME_TCP_TLS
106106
help
107107
Enables TLS encryption for NVMe TCP using the netlink handshake API.
108108

109-
The TLS handshake daemon is availble at
109+
The TLS handshake daemon is available at
110110
https://github.com/oracle/ktls-utils.
111111

112112
If unsure, say N.

drivers/nvme/host/constants.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static const char * const nvme_statuses[] = {
145145
[NVME_SC_BAD_ATTRIBUTES] = "Conflicting Attributes",
146146
[NVME_SC_INVALID_PI] = "Invalid Protection Information",
147147
[NVME_SC_READ_ONLY] = "Attempted Write to Read Only Range",
148-
[NVME_SC_ONCS_NOT_SUPPORTED] = "ONCS Not Supported",
148+
[NVME_SC_CMD_SIZE_LIM_EXCEEDED ] = "Command Size Limits Exceeded",
149149
[NVME_SC_ZONE_BOUNDARY_ERROR] = "Zoned Boundary Error",
150150
[NVME_SC_ZONE_FULL] = "Zone Is Full",
151151
[NVME_SC_ZONE_READ_ONLY] = "Zone Is Read Only",

drivers/nvme/host/core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ static blk_status_t nvme_error_status(u16 status)
290290
case NVME_SC_NS_NOT_READY:
291291
return BLK_STS_TARGET;
292292
case NVME_SC_BAD_ATTRIBUTES:
293-
case NVME_SC_ONCS_NOT_SUPPORTED:
294293
case NVME_SC_INVALID_OPCODE:
295294
case NVME_SC_INVALID_FIELD:
296295
case NVME_SC_INVALID_NS:
@@ -1027,7 +1026,7 @@ static inline blk_status_t nvme_setup_rw(struct nvme_ns *ns,
10271026

10281027
if (ns->head->ms) {
10291028
/*
1030-
* If formated with metadata, the block layer always provides a
1029+
* If formatted with metadata, the block layer always provides a
10311030
* metadata buffer if CONFIG_BLK_DEV_INTEGRITY is enabled. Else
10321031
* we enable the PRACT bit for protection information or set the
10331032
* namespace capacity to zero to prevent any I/O.

drivers/nvme/host/fabrics.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ EXPORT_SYMBOL_GPL(nvmf_connect_io_queue);
582582
* Do not retry when:
583583
*
584584
* - the DNR bit is set and the specification states no further connect
585-
* attempts with the same set of paramenters should be attempted.
585+
* attempts with the same set of parameters should be attempted.
586586
*
587587
* - when the authentication attempt fails, because the key was invalid.
588588
* This error code is set on the host side.

drivers/nvme/host/fabrics.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ enum {
8080
* @transport: Holds the fabric transport "technology name" (for a lack of
8181
* better description) that will be used by an NVMe controller
8282
* being added.
83-
* @subsysnqn: Hold the fully qualified NQN subystem name (format defined
83+
* @subsysnqn: Hold the fully qualified NQN subsystem name (format defined
8484
* in the NVMe specification, "NVMe Qualified Names").
8585
* @traddr: The transport-specific TRADDR field for a port on the
8686
* subsystem which is adding a controller.
@@ -156,7 +156,7 @@ struct nvmf_ctrl_options {
156156
* @create_ctrl(): function pointer that points to a non-NVMe
157157
* implementation-specific fabric technology
158158
* that would go into starting up that fabric
159-
* for the purpose of conneciton to an NVMe controller
159+
* for the purpose of connection to an NVMe controller
160160
* using that fabric technology.
161161
*
162162
* Notes:
@@ -165,7 +165,7 @@ struct nvmf_ctrl_options {
165165
* 2. create_ctrl() must be defined (even if it does nothing)
166166
* 3. struct nvmf_transport_ops must be statically allocated in the
167167
* modules .bss section so that a pure module_get on @module
168-
* prevents the memory from beeing freed.
168+
* prevents the memory from being freed.
169169
*/
170170
struct nvmf_transport_ops {
171171
struct list_head entry;

drivers/nvme/host/fc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1955,7 +1955,7 @@ nvme_fc_fcpio_done(struct nvmefc_fcp_req *req)
19551955
}
19561956

19571957
/*
1958-
* For the linux implementation, if we have an unsuccesful
1958+
* For the linux implementation, if we have an unsucceesful
19591959
* status, they blk-mq layer can typically be called with the
19601960
* non-zero status and the content of the cqe isn't important.
19611961
*/
@@ -2479,7 +2479,7 @@ __nvme_fc_abort_outstanding_ios(struct nvme_fc_ctrl *ctrl, bool start_queues)
24792479
* writing the registers for shutdown and polling (call
24802480
* nvme_disable_ctrl()). Given a bunch of i/o was potentially
24812481
* just aborted and we will wait on those contexts, and given
2482-
* there was no indication of how live the controlelr is on the
2482+
* there was no indication of how live the controller is on the
24832483
* link, don't send more io to create more contexts for the
24842484
* shutdown. Let the controller fail via keepalive failure if
24852485
* its still present.

drivers/nvme/host/ioctl.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -493,13 +493,15 @@ static int nvme_uring_cmd_io(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
493493
d.timeout_ms = READ_ONCE(cmd->timeout_ms);
494494

495495
if (d.data_len && (ioucmd->flags & IORING_URING_CMD_FIXED)) {
496-
/* fixedbufs is only for non-vectored io */
497-
if (vec)
498-
return -EINVAL;
496+
int ddir = nvme_is_write(&c) ? WRITE : READ;
499497

500-
ret = io_uring_cmd_import_fixed(d.addr, d.data_len,
501-
nvme_is_write(&c) ? WRITE : READ, &iter, ioucmd,
502-
issue_flags);
498+
if (vec)
499+
ret = io_uring_cmd_import_fixed_vec(ioucmd,
500+
u64_to_user_ptr(d.addr), d.data_len,
501+
ddir, &iter, issue_flags);
502+
else
503+
ret = io_uring_cmd_import_fixed(d.addr, d.data_len,
504+
ddir, &iter, ioucmd, issue_flags);
503505
if (ret < 0)
504506
return ret;
505507

@@ -521,7 +523,7 @@ static int nvme_uring_cmd_io(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
521523
if (d.data_len) {
522524
ret = nvme_map_user_request(req, d.addr, d.data_len,
523525
nvme_to_user_ptr(d.metadata), d.metadata_len,
524-
map_iter, vec);
526+
map_iter, vec ? NVME_IOCTL_VEC : 0);
525527
if (ret)
526528
goto out_free_req;
527529
}
@@ -727,7 +729,7 @@ int nvme_ns_head_ioctl(struct block_device *bdev, blk_mode_t mode,
727729

728730
/*
729731
* Handle ioctls that apply to the controller instead of the namespace
730-
* seperately and drop the ns SRCU reference early. This avoids a
732+
* separately and drop the ns SRCU reference early. This avoids a
731733
* deadlock when deleting namespaces using the passthrough interface.
732734
*/
733735
if (is_ctrl_ioctl(cmd))

drivers/nvme/host/multipath.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl, struct nvme_ns_head *head)
760760
* controller's scan_work context. If a path error occurs here, the IO
761761
* will wait until a path becomes available or all paths are torn down,
762762
* but that action also occurs within scan_work, so it would deadlock.
763-
* Defer the partion scan to a different context that does not block
763+
* Defer the partition scan to a different context that does not block
764764
* scan_work.
765765
*/
766766
set_bit(GD_SUPPRESS_PART_SCAN, &head->disk->state);

drivers/nvme/host/nvme.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ static inline bool nvme_ns_head_multipath(struct nvme_ns_head *head)
523523
enum nvme_ns_features {
524524
NVME_NS_EXT_LBAS = 1 << 0, /* support extended LBA format */
525525
NVME_NS_METADATA_SUPPORTED = 1 << 1, /* support getting generated md */
526-
NVME_NS_DEAC = 1 << 2, /* DEAC bit in Write Zeores supported */
526+
NVME_NS_DEAC = 1 << 2, /* DEAC bit in Write Zeroes supported */
527527
};
528528

529529
struct nvme_ns {

drivers/nvme/host/pci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3015,7 +3015,7 @@ static void nvme_reset_work(struct work_struct *work)
30153015
goto out;
30163016

30173017
/*
3018-
* Freeze and update the number of I/O queues as thos might have
3018+
* Freeze and update the number of I/O queues as those might have
30193019
* changed. If there are no I/O queues left after this reset, keep the
30203020
* controller around but remove all namespaces.
30213021
*/
@@ -3186,7 +3186,7 @@ static unsigned long check_vendor_combination_bug(struct pci_dev *pdev)
31863186
/*
31873187
* Exclude some Kingston NV1 and A2000 devices from
31883188
* NVME_QUIRK_SIMPLE_SUSPEND. Do a full suspend to save a
3189-
* lot fo energy with s2idle sleep on some TUXEDO platforms.
3189+
* lot of energy with s2idle sleep on some TUXEDO platforms.
31903190
*/
31913191
if (dmi_match(DMI_BOARD_NAME, "NS5X_NS7XAU") ||
31923192
dmi_match(DMI_BOARD_NAME, "NS5x_7xAU") ||

drivers/nvme/host/pr.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ static int nvme_status_to_pr_err(int status)
8282
return PR_STS_SUCCESS;
8383
case NVME_SC_RESERVATION_CONFLICT:
8484
return PR_STS_RESERVATION_CONFLICT;
85-
case NVME_SC_ONCS_NOT_SUPPORTED:
86-
return -EOPNOTSUPP;
8785
case NVME_SC_BAD_ATTRIBUTES:
8886
case NVME_SC_INVALID_OPCODE:
8987
case NVME_SC_INVALID_FIELD:

drivers/nvme/host/rdma.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static struct nvme_rdma_qe *nvme_rdma_alloc_ring(struct ib_device *ibdev,
221221

222222
/*
223223
* Bind the CQEs (post recv buffers) DMA mapping to the RDMA queue
224-
* lifetime. It's safe, since any chage in the underlying RDMA device
224+
* lifetime. It's safe, since any change in the underlying RDMA device
225225
* will issue error recovery and queue re-creation.
226226
*/
227227
for (i = 0; i < ib_queue_size; i++) {
@@ -800,7 +800,7 @@ static int nvme_rdma_configure_admin_queue(struct nvme_rdma_ctrl *ctrl,
800800

801801
/*
802802
* Bind the async event SQE DMA mapping to the admin queue lifetime.
803-
* It's safe, since any chage in the underlying RDMA device will issue
803+
* It's safe, since any change in the underlying RDMA device will issue
804804
* error recovery and queue re-creation.
805805
*/
806806
error = nvme_rdma_alloc_qe(ctrl->device->dev, &ctrl->async_event_sqe,

drivers/nvme/host/tcp.c

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,8 @@ nvme_tcp_fetch_request(struct nvme_tcp_queue *queue)
452452
return NULL;
453453
}
454454

455-
list_del(&req->entry);
455+
list_del_init(&req->entry);
456+
init_llist_node(&req->lentry);
456457
return req;
457458
}
458459

@@ -560,6 +561,8 @@ static int nvme_tcp_init_request(struct blk_mq_tag_set *set,
560561
req->queue = queue;
561562
nvme_req(rq)->ctrl = &ctrl->ctrl;
562563
nvme_req(rq)->cmd = &pdu->cmd;
564+
init_llist_node(&req->lentry);
565+
INIT_LIST_HEAD(&req->entry);
563566

564567
return 0;
565568
}
@@ -764,6 +767,14 @@ static int nvme_tcp_handle_r2t(struct nvme_tcp_queue *queue,
764767
return -EPROTO;
765768
}
766769

770+
if (llist_on_list(&req->lentry) ||
771+
!list_empty(&req->entry)) {
772+
dev_err(queue->ctrl->ctrl.device,
773+
"req %d unexpected r2t while processing request\n",
774+
rq->tag);
775+
return -EPROTO;
776+
}
777+
767778
req->pdu_len = 0;
768779
req->h2cdata_left = r2t_length;
769780
req->h2cdata_offset = r2t_offset;
@@ -1350,7 +1361,7 @@ static int nvme_tcp_try_recv(struct nvme_tcp_queue *queue)
13501361
queue->nr_cqe = 0;
13511362
consumed = sock->ops->read_sock(sk, &rd_desc, nvme_tcp_recv_skb);
13521363
release_sock(sk);
1353-
return consumed;
1364+
return consumed == -EAGAIN ? 0 : consumed;
13541365
}
13551366

13561367
static void nvme_tcp_io_work(struct work_struct *w)
@@ -1378,6 +1389,11 @@ static void nvme_tcp_io_work(struct work_struct *w)
13781389
else if (unlikely(result < 0))
13791390
return;
13801391

1392+
/* did we get some space after spending time in recv? */
1393+
if (nvme_tcp_queue_has_pending(queue) &&
1394+
sk_stream_is_writeable(queue->sock->sk))
1395+
pending = true;
1396+
13811397
if (!pending || !queue->rd_enabled)
13821398
return;
13831399

@@ -2394,7 +2410,7 @@ static int nvme_tcp_setup_ctrl(struct nvme_ctrl *ctrl, bool new)
23942410
nvme_tcp_teardown_admin_queue(ctrl, false);
23952411
ret = nvme_tcp_configure_admin_queue(ctrl, false);
23962412
if (ret)
2397-
return ret;
2413+
goto destroy_admin;
23982414
}
23992415

24002416
if (ctrl->icdoff) {
@@ -2638,6 +2654,8 @@ static void nvme_tcp_submit_async_event(struct nvme_ctrl *arg)
26382654
ctrl->async_req.offset = 0;
26392655
ctrl->async_req.curr_bio = NULL;
26402656
ctrl->async_req.data_len = 0;
2657+
init_llist_node(&ctrl->async_req.lentry);
2658+
INIT_LIST_HEAD(&ctrl->async_req.entry);
26412659

26422660
nvme_tcp_queue_request(&ctrl->async_req, true);
26432661
}

drivers/nvme/target/admin-cmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ static void nvmet_execute_identify(struct nvmet_req *req)
11651165
* A "minimum viable" abort implementation: the command is mandatory in the
11661166
* spec, but we are not required to do any useful work. We couldn't really
11671167
* do a useful abort, so don't bother even with waiting for the command
1168-
* to be exectuted and return immediately telling the command to abort
1168+
* to be executed and return immediately telling the command to abort
11691169
* wasn't found.
11701170
*/
11711171
static void nvmet_execute_abort(struct nvmet_req *req)

drivers/nvme/target/core.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,7 @@ inline u16 errno_to_nvme_status(struct nvmet_req *req, int errno)
6262
return NVME_SC_LBA_RANGE | NVME_STATUS_DNR;
6363
case -EOPNOTSUPP:
6464
req->error_loc = offsetof(struct nvme_common_command, opcode);
65-
switch (req->cmd->common.opcode) {
66-
case nvme_cmd_dsm:
67-
case nvme_cmd_write_zeroes:
68-
return NVME_SC_ONCS_NOT_SUPPORTED | NVME_STATUS_DNR;
69-
default:
70-
return NVME_SC_INVALID_OPCODE | NVME_STATUS_DNR;
71-
}
72-
break;
65+
return NVME_SC_INVALID_OPCODE | NVME_STATUS_DNR;
7366
case -ENODATA:
7467
req->error_loc = offsetof(struct nvme_rw_command, nsid);
7568
return NVME_SC_ACCESS_DENIED;
@@ -651,7 +644,7 @@ void nvmet_ns_disable(struct nvmet_ns *ns)
651644
* Now that we removed the namespaces from the lookup list, we
652645
* can kill the per_cpu ref and wait for any remaining references
653646
* to be dropped, as well as a RCU grace period for anyone only
654-
* using the namepace under rcu_read_lock(). Note that we can't
647+
* using the namespace under rcu_read_lock(). Note that we can't
655648
* use call_rcu here as we need to ensure the namespaces have
656649
* been fully destroyed before unloading the module.
657650
*/

drivers/nvme/target/fc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ nvmet_fc_portentry_rebind_tgt(struct nvmet_fc_tgtport *tgtport)
13391339
/**
13401340
* nvmet_fc_register_targetport - transport entry point called by an
13411341
* LLDD to register the existence of a local
1342-
* NVME subystem FC port.
1342+
* NVME subsystem FC port.
13431343
* @pinfo: pointer to information about the port to be registered
13441344
* @template: LLDD entrypoints and operational parameters for the port
13451345
* @dev: physical hardware device node port corresponds to. Will be

drivers/nvme/target/io-cmd-bdev.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ u16 blk_to_nvme_status(struct nvmet_req *req, blk_status_t blk_sts)
133133
* Right now there exists M : 1 mapping between block layer error
134134
* to the NVMe status code (see nvme_error_status()). For consistency,
135135
* when we reverse map we use most appropriate NVMe Status code from
136-
* the group of the NVMe staus codes used in the nvme_error_status().
136+
* the group of the NVMe status codes used in the nvme_error_status().
137137
*/
138138
switch (blk_sts) {
139139
case BLK_STS_NOSPC:
@@ -145,15 +145,8 @@ u16 blk_to_nvme_status(struct nvmet_req *req, blk_status_t blk_sts)
145145
req->error_loc = offsetof(struct nvme_rw_command, slba);
146146
break;
147147
case BLK_STS_NOTSUPP:
148+
status = NVME_SC_INVALID_OPCODE | NVME_STATUS_DNR;
148149
req->error_loc = offsetof(struct nvme_common_command, opcode);
149-
switch (req->cmd->common.opcode) {
150-
case nvme_cmd_dsm:
151-
case nvme_cmd_write_zeroes:
152-
status = NVME_SC_ONCS_NOT_SUPPORTED | NVME_STATUS_DNR;
153-
break;
154-
default:
155-
status = NVME_SC_INVALID_OPCODE | NVME_STATUS_DNR;
156-
}
157150
break;
158151
case BLK_STS_MEDIUM:
159152
status = NVME_SC_ACCESS_DENIED;

drivers/nvme/target/passthru.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static u16 nvmet_passthru_override_id_ctrl(struct nvmet_req *req)
9999

100100
/*
101101
* The passthru NVMe driver may have a limit on the number of segments
102-
* which depends on the host's memory fragementation. To solve this,
102+
* which depends on the host's memory fragmentation. To solve this,
103103
* ensure mdts is limited to the pages equal to the number of segments.
104104
*/
105105
max_hw_sectors = min_not_zero(pctrl->max_segments << PAGE_SECTORS_SHIFT,

include/linux/nvme.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2171,7 +2171,7 @@ enum {
21712171
NVME_SC_BAD_ATTRIBUTES = 0x180,
21722172
NVME_SC_INVALID_PI = 0x181,
21732173
NVME_SC_READ_ONLY = 0x182,
2174-
NVME_SC_ONCS_NOT_SUPPORTED = 0x183,
2174+
NVME_SC_CMD_SIZE_LIM_EXCEEDED = 0x183,
21752175

21762176
/*
21772177
* I/O Command Set Specific - Fabrics commands:

0 commit comments

Comments
 (0)