Skip to content

Commit cd17613

Browse files
committed
Merge tag 'block-6.10-20240628' of git://git.kernel.dk/linux
Pull block fixes from Jens Axboe: "NVMe fixes via Keith: - Fabrics fixes (Hannes) - Missing module description (Jeff) - Clang warning fix (Nathan)" * tag 'block-6.10-20240628' of git://git.kernel.dk/linux: nvmet-fc: Remove __counted_by from nvmet_fc_tgt_queue.fod[] nvmet: make 'tsas' attribute idempotent for RDMA nvme: fixup comment for nvme RDMA Provider Type nvme-apple: add missing MODULE_DESCRIPTION() nvmet: do not return 'reserved' for empty TSAS values nvme: fix NVME_NS_DEAC may incorrectly identifying the disk as EXT_LBA.
2 parents a2316dd + cab598b commit cd17613

File tree

5 files changed

+38
-14
lines changed

5 files changed

+38
-14
lines changed

drivers/nvme/host/apple.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,4 +1602,5 @@ static struct platform_driver apple_nvme_driver = {
16021602
module_platform_driver(apple_nvme_driver);
16031603

16041604
MODULE_AUTHOR("Sven Peter <[email protected]>");
1605+
MODULE_DESCRIPTION("Apple ANS NVM Express device driver");
16051606
MODULE_LICENSE("GPL");

drivers/nvme/host/nvme.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ static inline bool nvme_ns_head_multipath(struct nvme_ns_head *head)
502502
enum nvme_ns_features {
503503
NVME_NS_EXT_LBAS = 1 << 0, /* support extended LBA format */
504504
NVME_NS_METADATA_SUPPORTED = 1 << 1, /* support getting generated md */
505-
NVME_NS_DEAC, /* DEAC bit in Write Zeores supported */
505+
NVME_NS_DEAC = 1 << 2, /* DEAC bit in Write Zeores supported */
506506
};
507507

508508
struct nvme_ns {

drivers/nvme/target/configfs.c

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -410,28 +410,49 @@ static ssize_t nvmet_addr_tsas_show(struct config_item *item,
410410
return sprintf(page, "%s\n", nvmet_addr_tsas_rdma[i].name);
411411
}
412412
}
413-
return sprintf(page, "reserved\n");
413+
return sprintf(page, "\n");
414+
}
415+
416+
static u8 nvmet_addr_tsas_rdma_store(const char *page)
417+
{
418+
int i;
419+
420+
for (i = 0; i < ARRAY_SIZE(nvmet_addr_tsas_rdma); i++) {
421+
if (sysfs_streq(page, nvmet_addr_tsas_rdma[i].name))
422+
return nvmet_addr_tsas_rdma[i].type;
423+
}
424+
return NVMF_RDMA_QPTYPE_INVALID;
425+
}
426+
427+
static u8 nvmet_addr_tsas_tcp_store(const char *page)
428+
{
429+
int i;
430+
431+
for (i = 0; i < ARRAY_SIZE(nvmet_addr_tsas_tcp); i++) {
432+
if (sysfs_streq(page, nvmet_addr_tsas_tcp[i].name))
433+
return nvmet_addr_tsas_tcp[i].type;
434+
}
435+
return NVMF_TCP_SECTYPE_INVALID;
414436
}
415437

416438
static ssize_t nvmet_addr_tsas_store(struct config_item *item,
417439
const char *page, size_t count)
418440
{
419441
struct nvmet_port *port = to_nvmet_port(item);
420442
u8 treq = nvmet_port_disc_addr_treq_mask(port);
421-
u8 sectype;
422-
int i;
443+
u8 sectype, qptype;
423444

424445
if (nvmet_is_port_enabled(port, __func__))
425446
return -EACCES;
426447

427-
if (port->disc_addr.trtype != NVMF_TRTYPE_TCP)
428-
return -EINVAL;
429-
430-
for (i = 0; i < ARRAY_SIZE(nvmet_addr_tsas_tcp); i++) {
431-
if (sysfs_streq(page, nvmet_addr_tsas_tcp[i].name)) {
432-
sectype = nvmet_addr_tsas_tcp[i].type;
448+
if (port->disc_addr.trtype == NVMF_TRTYPE_RDMA) {
449+
qptype = nvmet_addr_tsas_rdma_store(page);
450+
if (qptype == port->disc_addr.tsas.rdma.qptype)
451+
return count;
452+
} else if (port->disc_addr.trtype == NVMF_TRTYPE_TCP) {
453+
sectype = nvmet_addr_tsas_tcp_store(page);
454+
if (sectype != NVMF_TCP_SECTYPE_INVALID)
433455
goto found;
434-
}
435456
}
436457

437458
pr_err("Invalid value '%s' for tsas\n", page);

drivers/nvme/target/fc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ struct nvmet_fc_tgt_queue {
148148
struct workqueue_struct *work_q;
149149
struct kref ref;
150150
/* array of fcp_iods */
151-
struct nvmet_fc_fcp_iod fod[] __counted_by(sqsize);
151+
struct nvmet_fc_fcp_iod fod[] /* __counted_by(sqsize) */;
152152
} __aligned(sizeof(unsigned long long));
153153

154154
struct nvmet_fc_hostport {

include/linux/nvme.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,11 @@ enum {
8585
enum {
8686
NVMF_RDMA_QPTYPE_CONNECTED = 1, /* Reliable Connected */
8787
NVMF_RDMA_QPTYPE_DATAGRAM = 2, /* Reliable Datagram */
88+
NVMF_RDMA_QPTYPE_INVALID = 0xff,
8889
};
8990

90-
/* RDMA QP Service Type codes for Discovery Log Page entry TSAS
91-
* RDMA_QPTYPE field
91+
/* RDMA Provider Type codes for Discovery Log Page entry TSAS
92+
* RDMA_PRTYPE field
9293
*/
9394
enum {
9495
NVMF_RDMA_PRTYPE_NOT_SPECIFIED = 1, /* No Provider Specified */
@@ -110,6 +111,7 @@ enum {
110111
NVMF_TCP_SECTYPE_NONE = 0, /* No Security */
111112
NVMF_TCP_SECTYPE_TLS12 = 1, /* TLSv1.2, NVMe-oF 1.1 and NVMe-TCP 3.6.1.1 */
112113
NVMF_TCP_SECTYPE_TLS13 = 2, /* TLSv1.3, NVMe-oF 1.1 and NVMe-TCP 3.6.1.1 */
114+
NVMF_TCP_SECTYPE_INVALID = 0xff,
113115
};
114116

115117
#define NVME_AQ_DEPTH 32

0 commit comments

Comments
 (0)