FreeBSD Bugzilla – Attachment 183787 Details for
Bug 220267
[patch] NVMe kernel driver should use 32-bit NSID
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to convert all instances of nsid to uint32_t
v3-0003-Convert-NVMe-nsid-values-to-be-32-bits.patch (text/plain), 4.47 KB, created by
chuck
on 2017-06-25 18:50:55 UTC
(
hide
)
Description:
patch to convert all instances of nsid to uint32_t
Filename:
MIME Type:
Creator:
chuck
Created:
2017-06-25 18:50:55 UTC
Size:
4.47 KB
patch
obsolete
>From fede098be3d2f2bbd6f750bb5c16e55bee4bcc56 Mon Sep 17 00:00:00 2001 >Message-Id: <fede098be3d2f2bbd6f750bb5c16e55bee4bcc56.1498415898.git-series.chuck@tuffli.net> >In-Reply-To: <ea5a391f8f9486b033931757ab5518d3baa84d10.1498415898.git-series.chuck@tuffli.net> >References: <ea5a391f8f9486b033931757ab5518d3baa84d10.1498415898.git-series.chuck@tuffli.net> >From: Chuck Tuffli <chuck@tuffli.net> >Date: Fri, 16 Jun 2017 13:16:17 -0700 >Subject: [PATCH v3 3/3] Convert NVMe nsid values to be 32-bits > >Several places passed in the NVMe Namespace ID (nsid) as a >16 bit value, but the specification defines this as a 32-bit >value. Note other places in the driver correctly specify the >nsid as 32 bits. > >Signed-off-by: Chuck Tuffli <chuck@tuffli.net> >--- > sys/cam/cam_ccb.h | 2 +- > sys/cam/nvme/nvme_da.c | 2 +- > sys/dev/nvme/nvme.h | 10 +++++----- > sys/dev/nvme/nvme_ctrlr_cmd.c | 2 +- > sys/dev/nvme/nvme_private.h | 2 +- > 5 files changed, 9 insertions(+), 9 deletions(-) > >diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h >index be6301f..b103705 100644 >--- a/sys/cam/cam_ccb.h >+++ b/sys/cam/cam_ccb.h >@@ -627,7 +627,7 @@ struct ccb_pathinq_settings_sas { > }; > > struct ccb_pathinq_settings_nvme { >- uint16_t nsid; /* Namespace ID for this path */ >+ uint32_t nsid; /* Namespace ID for this path */ > }; > > #define PATHINQ_SETTINGS_SIZE 128 >diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c >index 37f7775..0ee2879 100644 >--- a/sys/cam/nvme/nvme_da.c >+++ b/sys/cam/nvme/nvme_da.c >@@ -743,7 +743,7 @@ ndaregister(struct cam_periph *periph, void *arg) > /* > * The name space ID is the lun, save it for later I/O > */ >- softc->nsid = (uint16_t)xpt_path_lun_id(periph->path); >+ softc->nsid = (uint32_t)xpt_path_lun_id(periph->path); > > /* > * Register this media as a disk >diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h >index ff64cb0..b48b0dc 100644 >--- a/sys/dev/nvme/nvme.h >+++ b/sys/dev/nvme/nvme.h >@@ -942,7 +942,7 @@ int nvme_ns_bio_process(struct nvme_namespace *ns, struct bio *bp, > > /* Command building helper functions -- shared with CAM */ > static inline >-void nvme_ns_flush_cmd(struct nvme_command *cmd, uint16_t nsid) >+void nvme_ns_flush_cmd(struct nvme_command *cmd, uint32_t nsid) > { > > cmd->opc = NVME_OPC_FLUSH; >@@ -950,7 +950,7 @@ void nvme_ns_flush_cmd(struct nvme_command *cmd, uint16_t nsid) > } > > static inline >-void nvme_ns_rw_cmd(struct nvme_command *cmd, uint32_t rwcmd, uint16_t nsid, >+void nvme_ns_rw_cmd(struct nvme_command *cmd, uint32_t rwcmd, uint32_t nsid, > uint64_t lba, uint32_t count) > { > cmd->opc = rwcmd; >@@ -964,21 +964,21 @@ void nvme_ns_rw_cmd(struct nvme_command *cmd, uint32_t rwcmd, uint16_t nsid, > } > > static inline >-void nvme_ns_write_cmd(struct nvme_command *cmd, uint16_t nsid, >+void nvme_ns_write_cmd(struct nvme_command *cmd, uint32_t nsid, > uint64_t lba, uint32_t count) > { > nvme_ns_rw_cmd(cmd, NVME_OPC_WRITE, nsid, lba, count); > } > > static inline >-void nvme_ns_read_cmd(struct nvme_command *cmd, uint16_t nsid, >+void nvme_ns_read_cmd(struct nvme_command *cmd, uint32_t nsid, > uint64_t lba, uint32_t count) > { > nvme_ns_rw_cmd(cmd, NVME_OPC_READ, nsid, lba, count); > } > > static inline >-void nvme_ns_trim_cmd(struct nvme_command *cmd, uint16_t nsid, >+void nvme_ns_trim_cmd(struct nvme_command *cmd, uint32_t nsid, > uint32_t num_ranges) > { > cmd->opc = NVME_OPC_DATASET_MANAGEMENT; >diff --git a/sys/dev/nvme/nvme_ctrlr_cmd.c b/sys/dev/nvme/nvme_ctrlr_cmd.c >index e2abf0e..7f125b2 100644 >--- a/sys/dev/nvme/nvme_ctrlr_cmd.c >+++ b/sys/dev/nvme/nvme_ctrlr_cmd.c >@@ -52,7 +52,7 @@ nvme_ctrlr_cmd_identify_controller(struct nvme_controller *ctrlr, void *payload, > } > > void >-nvme_ctrlr_cmd_identify_namespace(struct nvme_controller *ctrlr, uint16_t nsid, >+nvme_ctrlr_cmd_identify_namespace(struct nvme_controller *ctrlr, uint32_t nsid, > void *payload, nvme_cb_fn_t cb_fn, void *cb_arg) > { > struct nvme_request *req; >diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h >index 7307339..3f4abd6 100644 >--- a/sys/dev/nvme/nvme_private.h >+++ b/sys/dev/nvme/nvme_private.h >@@ -357,7 +357,7 @@ void nvme_ctrlr_cmd_identify_controller(struct nvme_controller *ctrlr, > void *payload, > nvme_cb_fn_t cb_fn, void *cb_arg); > void nvme_ctrlr_cmd_identify_namespace(struct nvme_controller *ctrlr, >- uint16_t nsid, void *payload, >+ uint32_t nsid, void *payload, > nvme_cb_fn_t cb_fn, void *cb_arg); > void nvme_ctrlr_cmd_set_interrupt_coalescing(struct nvme_controller *ctrlr, > uint32_t microseconds, >-- >git-series 0.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 220267
: 183787