All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] nvme: Add symbolic constants for CC identifiers
@ 2017-08-13 16:21 Max Gurtovoy
  2017-08-13 16:21 ` [PATCH 2/2] nvme: Rename AMS symbolic constants to fit specification Max Gurtovoy
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Max Gurtovoy @ 2017-08-13 16:21 UTC (permalink / raw)


Signed-off-by: Max Gurtovoy <maxg at mellanox.com>
---
 drivers/nvme/target/core.c |   14 +++++++-------
 include/linux/nvme.h       |   24 +++++++++++++++---------
 2 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index f4b02bb..9955c2d 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -538,37 +538,37 @@ void nvmet_req_uninit(struct nvmet_req *req)
 
 static inline bool nvmet_cc_en(u32 cc)
 {
-	return cc & 0x1;
+	return (cc >> NVME_CC_EN_SHIFT) & 0x1;
 }
 
 static inline u8 nvmet_cc_css(u32 cc)
 {
-	return (cc >> 4) & 0x7;
+	return (cc >> NVME_CC_CSS_SHIFT) & 0x7;
 }
 
 static inline u8 nvmet_cc_mps(u32 cc)
 {
-	return (cc >> 7) & 0xf;
+	return (cc >> NVME_CC_MPS_SHIFT) & 0xf;
 }
 
 static inline u8 nvmet_cc_ams(u32 cc)
 {
-	return (cc >> 11) & 0x7;
+	return (cc >> NVME_CC_AMS_SHIFT) & 0x7;
 }
 
 static inline u8 nvmet_cc_shn(u32 cc)
 {
-	return (cc >> 14) & 0x3;
+	return (cc >> NVME_CC_SHN_SHIFT) & 0x3;
 }
 
 static inline u8 nvmet_cc_iosqes(u32 cc)
 {
-	return (cc >> 16) & 0xf;
+	return (cc >> NVME_CC_IOSQES_SHIFT) & 0xf;
 }
 
 static inline u8 nvmet_cc_iocqes(u32 cc)
 {
-	return (cc >> 20) & 0xf;
+	return (cc >> NVME_CC_IOCQES_SHIFT) & 0xf;
 }
 
 static void nvmet_start_ctrl(struct nvmet_ctrl *ctrl)
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index 25d8225..ebbe6e8 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -133,16 +133,22 @@ enum {
 enum {
 	NVME_CC_ENABLE		= 1 << 0,
 	NVME_CC_CSS_NVM		= 0 << 4,
+	NVME_CC_EN_SHIFT	= 0,
+	NVME_CC_CSS_SHIFT	= 4,
 	NVME_CC_MPS_SHIFT	= 7,
-	NVME_CC_ARB_RR		= 0 << 11,
-	NVME_CC_ARB_WRRU	= 1 << 11,
-	NVME_CC_ARB_VS		= 7 << 11,
-	NVME_CC_SHN_NONE	= 0 << 14,
-	NVME_CC_SHN_NORMAL	= 1 << 14,
-	NVME_CC_SHN_ABRUPT	= 2 << 14,
-	NVME_CC_SHN_MASK	= 3 << 14,
-	NVME_CC_IOSQES		= NVME_NVM_IOSQES << 16,
-	NVME_CC_IOCQES		= NVME_NVM_IOCQES << 20,
+	NVME_CC_AMS_SHIFT	= 11,
+	NVME_CC_SHN_SHIFT	= 14,
+	NVME_CC_IOSQES_SHIFT	= 16,
+	NVME_CC_IOCQES_SHIFT	= 20,
+	NVME_CC_ARB_RR		= 0 << NVME_CC_AMS_SHIFT,
+	NVME_CC_ARB_WRRU	= 1 << NVME_CC_AMS_SHIFT,
+	NVME_CC_ARB_VS		= 7 << NVME_CC_AMS_SHIFT,
+	NVME_CC_SHN_NONE	= 0 << NVME_CC_SHN_SHIFT,
+	NVME_CC_SHN_NORMAL	= 1 << NVME_CC_SHN_SHIFT,
+	NVME_CC_SHN_ABRUPT	= 2 << NVME_CC_SHN_SHIFT,
+	NVME_CC_SHN_MASK	= 3 << NVME_CC_SHN_SHIFT,
+	NVME_CC_IOSQES		= NVME_NVM_IOSQES << NVME_CC_IOSQES_SHIFT,
+	NVME_CC_IOCQES		= NVME_NVM_IOCQES << NVME_CC_IOCQES_SHIFT,
 	NVME_CSTS_RDY		= 1 << 0,
 	NVME_CSTS_CFS		= 1 << 1,
 	NVME_CSTS_NSSRO		= 1 << 4,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] nvme: Rename AMS symbolic constants to fit specification
  2017-08-13 16:21 [PATCH 1/2] nvme: Add symbolic constants for CC identifiers Max Gurtovoy
@ 2017-08-13 16:21 ` Max Gurtovoy
  2017-08-15  9:07   ` Sagi Grimberg
  2017-08-15  9:07 ` [PATCH 1/2] nvme: Add symbolic constants for CC identifiers Sagi Grimberg
  2017-08-16  8:10 ` Christoph Hellwig
  2 siblings, 1 reply; 5+ messages in thread
From: Max Gurtovoy @ 2017-08-13 16:21 UTC (permalink / raw)


Signed-off-by: Max Gurtovoy <maxg at mellanox.com>
---
 drivers/nvme/host/core.c |    2 +-
 include/linux/nvme.h     |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 37046ac..8bfb8cd 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1447,7 +1447,7 @@ int nvme_enable_ctrl(struct nvme_ctrl *ctrl, u64 cap)
 
 	ctrl->ctrl_config = NVME_CC_CSS_NVM;
 	ctrl->ctrl_config |= (page_shift - 12) << NVME_CC_MPS_SHIFT;
-	ctrl->ctrl_config |= NVME_CC_ARB_RR | NVME_CC_SHN_NONE;
+	ctrl->ctrl_config |= NVME_CC_AMS_RR | NVME_CC_SHN_NONE;
 	ctrl->ctrl_config |= NVME_CC_IOSQES | NVME_CC_IOCQES;
 	ctrl->ctrl_config |= NVME_CC_ENABLE;
 
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index ebbe6e8..8dd8b3f 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -140,9 +140,9 @@ enum {
 	NVME_CC_SHN_SHIFT	= 14,
 	NVME_CC_IOSQES_SHIFT	= 16,
 	NVME_CC_IOCQES_SHIFT	= 20,
-	NVME_CC_ARB_RR		= 0 << NVME_CC_AMS_SHIFT,
-	NVME_CC_ARB_WRRU	= 1 << NVME_CC_AMS_SHIFT,
-	NVME_CC_ARB_VS		= 7 << NVME_CC_AMS_SHIFT,
+	NVME_CC_AMS_RR		= 0 << NVME_CC_AMS_SHIFT,
+	NVME_CC_AMS_WRRU	= 1 << NVME_CC_AMS_SHIFT,
+	NVME_CC_AMS_VS		= 7 << NVME_CC_AMS_SHIFT,
 	NVME_CC_SHN_NONE	= 0 << NVME_CC_SHN_SHIFT,
 	NVME_CC_SHN_NORMAL	= 1 << NVME_CC_SHN_SHIFT,
 	NVME_CC_SHN_ABRUPT	= 2 << NVME_CC_SHN_SHIFT,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 1/2] nvme: Add symbolic constants for CC identifiers
  2017-08-13 16:21 [PATCH 1/2] nvme: Add symbolic constants for CC identifiers Max Gurtovoy
  2017-08-13 16:21 ` [PATCH 2/2] nvme: Rename AMS symbolic constants to fit specification Max Gurtovoy
@ 2017-08-15  9:07 ` Sagi Grimberg
  2017-08-16  8:10 ` Christoph Hellwig
  2 siblings, 0 replies; 5+ messages in thread
From: Sagi Grimberg @ 2017-08-15  9:07 UTC (permalink / raw)


Looks fine,

Reviewed-by: Sagi Grimberg <sagi at grimberg.me>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] nvme: Rename AMS symbolic constants to fit specification
  2017-08-13 16:21 ` [PATCH 2/2] nvme: Rename AMS symbolic constants to fit specification Max Gurtovoy
@ 2017-08-15  9:07   ` Sagi Grimberg
  0 siblings, 0 replies; 5+ messages in thread
From: Sagi Grimberg @ 2017-08-15  9:07 UTC (permalink / raw)


Looks fine,

Reviewed-by: Sagi Grimberg <sagi at grimberg.me>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] nvme: Add symbolic constants for CC identifiers
  2017-08-13 16:21 [PATCH 1/2] nvme: Add symbolic constants for CC identifiers Max Gurtovoy
  2017-08-13 16:21 ` [PATCH 2/2] nvme: Rename AMS symbolic constants to fit specification Max Gurtovoy
  2017-08-15  9:07 ` [PATCH 1/2] nvme: Add symbolic constants for CC identifiers Sagi Grimberg
@ 2017-08-16  8:10 ` Christoph Hellwig
  2 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2017-08-16  8:10 UTC (permalink / raw)


Thanks,

applied both patches to nvme-4.14.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-08-16  8:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-13 16:21 [PATCH 1/2] nvme: Add symbolic constants for CC identifiers Max Gurtovoy
2017-08-13 16:21 ` [PATCH 2/2] nvme: Rename AMS symbolic constants to fit specification Max Gurtovoy
2017-08-15  9:07   ` Sagi Grimberg
2017-08-15  9:07 ` [PATCH 1/2] nvme: Add symbolic constants for CC identifiers Sagi Grimberg
2017-08-16  8:10 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.