Skip to content

Commit

Permalink
Merge tag 'nvme-6.10-2024-06-27' of git:https://git.infradead.org/nvme into…
Browse files Browse the repository at this point in the history
… block-6.10

Pull NVMe fixes from Keith:

"nvme fixes for Linux 6.10

 - Fabrics fixes (Hannes)
 - Missing module description (Jeff)
 - Clang warning fix (Nathan)"

* tag 'nvme-6.10-2024-06-27' of git:https://git.infradead.org/nvme:
  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.
  • Loading branch information
axboe committed Jun 27, 2024
2 parents 5f75e08 + 440e205 commit cab598b
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 14 deletions.
1 change: 1 addition & 0 deletions drivers/nvme/host/apple.c
Original file line number Diff line number Diff line change
Expand Up @@ -1602,4 +1602,5 @@ static struct platform_driver apple_nvme_driver = {
module_platform_driver(apple_nvme_driver);

MODULE_AUTHOR("Sven Peter <[email protected]>");
MODULE_DESCRIPTION("Apple ANS NVM Express device driver");
MODULE_LICENSE("GPL");
2 changes: 1 addition & 1 deletion drivers/nvme/host/nvme.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ static inline bool nvme_ns_head_multipath(struct nvme_ns_head *head)
enum nvme_ns_features {
NVME_NS_EXT_LBAS = 1 << 0, /* support extended LBA format */
NVME_NS_METADATA_SUPPORTED = 1 << 1, /* support getting generated md */
NVME_NS_DEAC, /* DEAC bit in Write Zeores supported */
NVME_NS_DEAC = 1 << 2, /* DEAC bit in Write Zeores supported */
};

struct nvme_ns {
Expand Down
41 changes: 31 additions & 10 deletions drivers/nvme/target/configfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,28 +410,49 @@ static ssize_t nvmet_addr_tsas_show(struct config_item *item,
return sprintf(page, "%s\n", nvmet_addr_tsas_rdma[i].name);
}
}
return sprintf(page, "reserved\n");
return sprintf(page, "\n");
}

static u8 nvmet_addr_tsas_rdma_store(const char *page)
{
int i;

for (i = 0; i < ARRAY_SIZE(nvmet_addr_tsas_rdma); i++) {
if (sysfs_streq(page, nvmet_addr_tsas_rdma[i].name))
return nvmet_addr_tsas_rdma[i].type;
}
return NVMF_RDMA_QPTYPE_INVALID;
}

static u8 nvmet_addr_tsas_tcp_store(const char *page)
{
int i;

for (i = 0; i < ARRAY_SIZE(nvmet_addr_tsas_tcp); i++) {
if (sysfs_streq(page, nvmet_addr_tsas_tcp[i].name))
return nvmet_addr_tsas_tcp[i].type;
}
return NVMF_TCP_SECTYPE_INVALID;
}

static ssize_t nvmet_addr_tsas_store(struct config_item *item,
const char *page, size_t count)
{
struct nvmet_port *port = to_nvmet_port(item);
u8 treq = nvmet_port_disc_addr_treq_mask(port);
u8 sectype;
int i;
u8 sectype, qptype;

if (nvmet_is_port_enabled(port, __func__))
return -EACCES;

if (port->disc_addr.trtype != NVMF_TRTYPE_TCP)
return -EINVAL;

for (i = 0; i < ARRAY_SIZE(nvmet_addr_tsas_tcp); i++) {
if (sysfs_streq(page, nvmet_addr_tsas_tcp[i].name)) {
sectype = nvmet_addr_tsas_tcp[i].type;
if (port->disc_addr.trtype == NVMF_TRTYPE_RDMA) {
qptype = nvmet_addr_tsas_rdma_store(page);
if (qptype == port->disc_addr.tsas.rdma.qptype)
return count;
} else if (port->disc_addr.trtype == NVMF_TRTYPE_TCP) {
sectype = nvmet_addr_tsas_tcp_store(page);
if (sectype != NVMF_TCP_SECTYPE_INVALID)
goto found;
}
}

pr_err("Invalid value '%s' for tsas\n", page);
Expand Down
2 changes: 1 addition & 1 deletion drivers/nvme/target/fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ struct nvmet_fc_tgt_queue {
struct workqueue_struct *work_q;
struct kref ref;
/* array of fcp_iods */
struct nvmet_fc_fcp_iod fod[] __counted_by(sqsize);
struct nvmet_fc_fcp_iod fod[] /* __counted_by(sqsize) */;
} __aligned(sizeof(unsigned long long));

struct nvmet_fc_hostport {
Expand Down
6 changes: 4 additions & 2 deletions include/linux/nvme.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ enum {
enum {
NVMF_RDMA_QPTYPE_CONNECTED = 1, /* Reliable Connected */
NVMF_RDMA_QPTYPE_DATAGRAM = 2, /* Reliable Datagram */
NVMF_RDMA_QPTYPE_INVALID = 0xff,
};

/* RDMA QP Service Type codes for Discovery Log Page entry TSAS
* RDMA_QPTYPE field
/* RDMA Provider Type codes for Discovery Log Page entry TSAS
* RDMA_PRTYPE field
*/
enum {
NVMF_RDMA_PRTYPE_NOT_SPECIFIED = 1, /* No Provider Specified */
Expand All @@ -110,6 +111,7 @@ enum {
NVMF_TCP_SECTYPE_NONE = 0, /* No Security */
NVMF_TCP_SECTYPE_TLS12 = 1, /* TLSv1.2, NVMe-oF 1.1 and NVMe-TCP 3.6.1.1 */
NVMF_TCP_SECTYPE_TLS13 = 2, /* TLSv1.3, NVMe-oF 1.1 and NVMe-TCP 3.6.1.1 */
NVMF_TCP_SECTYPE_INVALID = 0xff,
};

#define NVME_AQ_DEPTH 32
Expand Down

0 comments on commit cab598b

Please sign in to comment.