Skip to contentSkip to conversation

NVMe: use namespace id for nvme_get_features

PATCH New Keith Busch 2 participants 2 messages Jul 25, 2012 – Jul 26, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NVMe: use namespace id for nvme_get_features

The specification does not provide a use for command dword11 in the NVMe Get Features command, but does use the NSID for some features.

Signed-off-by Keith Busch <keith.busch at intel.com>
---
 drivers/block/nvme.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/block/nvme.c +2 -2
index 38b9c73..c4ba0f7 100644
@@ -840,15 +840,15 @@ static int nvme_identify(struct nvme_dev *dev, unsigned nsid, unsigned cns,
 }
 
 static int nvme_get_features(struct nvme_dev *dev, unsigned fid,
-				unsigned dword11, dma_addr_t dma_addr)
+				unsigned nsid, dma_addr_t dma_addr)
 {
 	struct nvme_command c;
 
 	memset(&c, 0, sizeof(c));
 	c.features.opcode = nvme_admin_get_features;
+	c.features.nsid = cpu_to_le32(nsid);
 	c.features.prp1 = cpu_to_le64(dma_addr);
 	c.features.fid = cpu_to_le32(fid);
-	c.features.dword11 = cpu_to_le32(dword11);
 
 	return nvme_submit_admin_cmd(dev, &c, NULL);
 }
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 1/1 NVMe: use namespace id for nvme_get_features

Quoted 2 lines · Keith Busch

The specification does not provide a use for command dword11 in the NVMe Get Features command, but does use the NSID for some features.

... proof that one shouldn't write both sides of a protocol.

Thanks, applied.

Quoted 35 lines
Signed-off-by Keith Busch <keith.busch at intel.com>
---
 drivers/block/nvme.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/block/nvme.c +2 -2
index 38b9c73..c4ba0f7 100644
@@ -840,15 +840,15 @@ static int nvme_identify(struct nvme_dev *dev, unsigned nsid, unsigned cns,
 }
 
 static int nvme_get_features(struct nvme_dev *dev, unsigned fid,
-				unsigned dword11, dma_addr_t dma_addr)
+				unsigned nsid, dma_addr_t dma_addr)
 {
 	struct nvme_command c;
 
 	memset(&c, 0, sizeof(c));
 	c.features.opcode = nvme_admin_get_features;
+	c.features.nsid = cpu_to_le32(nsid);
 	c.features.prp1 = cpu_to_le64(dma_addr);
 	c.features.fid = cpu_to_le32(fid);
-	c.features.dword11 = cpu_to_le32(dword11);
 
 	return nvme_submit_admin_cmd(dev, &c, NULL);
 }
Signature · 7 lines
1.7.0.4


_______________________________________________
Linux-nvme mailing list
Linux-nvme at lists.infradead.org
http://merlin.infradead.org/mailman/listinfo/linux-nvme