* [PATCH 1/2] nvmet: use macro definition for setting nmic value
@ 2021-09-23 10:17 Max Gurtovoy
2021-09-23 10:17 ` [PATCH 2/2] nvmet: use macro definitions for setting cmic value Max Gurtovoy
` (4 more replies)
0 siblings, 5 replies; 12+ messages in thread
From: Max Gurtovoy @ 2021-09-23 10:17 UTC (permalink / raw)
To: linux-nvme, hch, kbusch, sagi, chaitanyak; +Cc: Max Gurtovoy
This makes the code more readable.
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
drivers/nvme/target/admin-cmd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
index aa6d84d8848e..4ee9fe134697 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -536,7 +536,7 @@ static void nvmet_execute_identify_ns(struct nvmet_req *req)
* Our namespace might always be shared. Not just with other
* controllers, but also with any other user of the block device.
*/
- id->nmic = (1 << 0);
+ id->nmic = NVME_NS_NMIC_SHARED;
id->anagrpid = cpu_to_le32(req->ns->anagrpid);
memcpy(&id->nguid, &req->ns->nguid, sizeof(id->nguid));
--
2.18.1
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/2] nvmet: use macro definitions for setting cmic value
2021-09-23 10:17 [PATCH 1/2] nvmet: use macro definition for setting nmic value Max Gurtovoy
@ 2021-09-23 10:17 ` Max Gurtovoy
2021-09-23 17:20 ` Chaitanya Kulkarni
2021-09-25 20:47 ` Sagi Grimberg
2021-09-23 20:06 ` [PATCH 1/2] nvmet: use macro definition for setting nmic value Keith Busch
` (3 subsequent siblings)
4 siblings, 2 replies; 12+ messages in thread
From: Max Gurtovoy @ 2021-09-23 10:17 UTC (permalink / raw)
To: linux-nvme, hch, kbusch, sagi, chaitanyak; +Cc: Max Gurtovoy
This makes the code more readable.
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
drivers/nvme/target/admin-cmd.c | 3 ++-
include/linux/nvme.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
index 4ee9fe134697..92d81dc5906b 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -380,7 +380,8 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req)
*/
/* we support multiple ports, multiples hosts and ANA: */
- id->cmic = (1 << 0) | (1 << 1) | (1 << 3);
+ id->cmic = NVME_CTRL_CMIC_MULTI_PORT | NVME_CTRL_CMIC_MULTI_CTRL |
+ NVME_CTRL_CMIC_ANA;
/* Limit MDTS according to transport capability */
if (ctrl->ops->get_mdts)
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index b7c4c4130b65..36662641fd7b 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -312,6 +312,7 @@ struct nvme_id_ctrl {
};
enum {
+ NVME_CTRL_CMIC_MULTI_PORT = 1 << 0,
NVME_CTRL_CMIC_MULTI_CTRL = 1 << 1,
NVME_CTRL_CMIC_ANA = 1 << 3,
NVME_CTRL_ONCS_COMPARE = 1 << 0,
--
2.18.1
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] nvmet: use macro definitions for setting cmic value
2021-09-23 10:17 ` [PATCH 2/2] nvmet: use macro definitions for setting cmic value Max Gurtovoy
@ 2021-09-23 17:20 ` Chaitanya Kulkarni
2021-09-23 19:46 ` Keith Busch
2021-09-23 19:46 ` Max Gurtovoy
2021-09-25 20:47 ` Sagi Grimberg
1 sibling, 2 replies; 12+ messages in thread
From: Chaitanya Kulkarni @ 2021-09-23 17:20 UTC (permalink / raw)
To: Max Gurtovoy, linux-nvme, hch, kbusch, sagi
On 9/23/21 3:17 AM, Max Gurtovoy wrote:
> This makes the code more readable.
>
> Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
> ---
> drivers/nvme/target/admin-cmd.c | 3 ++-
> include/linux/nvme.h | 1 +
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
> index 4ee9fe134697..92d81dc5906b 100644
> --- a/drivers/nvme/target/admin-cmd.c
> +++ b/drivers/nvme/target/admin-cmd.c
> @@ -380,7 +380,8 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req)
> */
>
> /* we support multiple ports, multiples hosts and ANA: */
> - id->cmic = (1 << 0) | (1 << 1) | (1 << 3);
> + id->cmic = NVME_CTRL_CMIC_MULTI_PORT | NVME_CTRL_CMIC_MULTI_CTRL |
> + NVME_CTRL_CMIC_ANA;
>
>
So we actually had this discussion before to keep it open coded.
If I remember Keith had already sent out patch for this one...
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] nvmet: use macro definitions for setting cmic value
2021-09-23 17:20 ` Chaitanya Kulkarni
@ 2021-09-23 19:46 ` Keith Busch
2021-09-27 19:16 ` Chaitanya Kulkarni
2021-09-23 19:46 ` Max Gurtovoy
1 sibling, 1 reply; 12+ messages in thread
From: Keith Busch @ 2021-09-23 19:46 UTC (permalink / raw)
To: Chaitanya Kulkarni; +Cc: Max Gurtovoy, linux-nvme, hch, sagi
On Thu, Sep 23, 2021 at 05:20:21PM +0000, Chaitanya Kulkarni wrote:
> On 9/23/21 3:17 AM, Max Gurtovoy wrote:
> > This makes the code more readable.
> >
> > Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
> > ---
> > drivers/nvme/target/admin-cmd.c | 3 ++-
> > include/linux/nvme.h | 1 +
> > 2 files changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
> > index 4ee9fe134697..92d81dc5906b 100644
> > --- a/drivers/nvme/target/admin-cmd.c
> > +++ b/drivers/nvme/target/admin-cmd.c
> > @@ -380,7 +380,8 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req)
> > */
> >
> > /* we support multiple ports, multiples hosts and ANA: */
> > - id->cmic = (1 << 0) | (1 << 1) | (1 << 3);
> > + id->cmic = NVME_CTRL_CMIC_MULTI_PORT | NVME_CTRL_CMIC_MULTI_CTRL |
> > + NVME_CTRL_CMIC_ANA;
> >
> >
>
> So we actually had this discussion before to keep it open coded.
>
> If I remember Keith had already sent out patch for this one...
The similiar patch I'd sent went in as 92decf118f1da. I argued symbolic
names helps browsing the code since we can tag/cscope them, so I think
this is a fine change.
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] nvmet: use macro definitions for setting cmic value
2021-09-23 17:20 ` Chaitanya Kulkarni
2021-09-23 19:46 ` Keith Busch
@ 2021-09-23 19:46 ` Max Gurtovoy
2021-09-27 19:19 ` Chaitanya Kulkarni
1 sibling, 1 reply; 12+ messages in thread
From: Max Gurtovoy @ 2021-09-23 19:46 UTC (permalink / raw)
To: Chaitanya Kulkarni, linux-nvme, hch, kbusch, sagi
On 9/23/2021 8:20 PM, Chaitanya Kulkarni wrote:
> On 9/23/21 3:17 AM, Max Gurtovoy wrote:
>> This makes the code more readable.
>>
>> Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
>> ---
>> drivers/nvme/target/admin-cmd.c | 3 ++-
>> include/linux/nvme.h | 1 +
>> 2 files changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
>> index 4ee9fe134697..92d81dc5906b 100644
>> --- a/drivers/nvme/target/admin-cmd.c
>> +++ b/drivers/nvme/target/admin-cmd.c
>> @@ -380,7 +380,8 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req)
>> */
>>
>> /* we support multiple ports, multiples hosts and ANA: */
>> - id->cmic = (1 << 0) | (1 << 1) | (1 << 3);
>> + id->cmic = NVME_CTRL_CMIC_MULTI_PORT | NVME_CTRL_CMIC_MULTI_CTRL |
>> + NVME_CTRL_CMIC_ANA;
>>
>>
> So we actually had this discussion before to keep it open coded.
>
> If I remember Keith had already sent out patch for this one...
I don't understand why our code should include constants and not macros.
And if so, let's do it for all macros we have for the spec. We need one
policy.
>
>
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] nvmet: use macro definition for setting nmic value
2021-09-23 10:17 [PATCH 1/2] nvmet: use macro definition for setting nmic value Max Gurtovoy
2021-09-23 10:17 ` [PATCH 2/2] nvmet: use macro definitions for setting cmic value Max Gurtovoy
@ 2021-09-23 20:06 ` Keith Busch
2021-09-25 20:47 ` Sagi Grimberg
` (2 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: Keith Busch @ 2021-09-23 20:06 UTC (permalink / raw)
To: Max Gurtovoy; +Cc: linux-nvme, hch, sagi, chaitanyak
Patches look good to me.
Reviewed-by: Keith Busch <kbusch@kernel.org>
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] nvmet: use macro definition for setting nmic value
2021-09-23 10:17 [PATCH 1/2] nvmet: use macro definition for setting nmic value Max Gurtovoy
2021-09-23 10:17 ` [PATCH 2/2] nvmet: use macro definitions for setting cmic value Max Gurtovoy
2021-09-23 20:06 ` [PATCH 1/2] nvmet: use macro definition for setting nmic value Keith Busch
@ 2021-09-25 20:47 ` Sagi Grimberg
2021-09-27 19:17 ` Chaitanya Kulkarni
2021-10-12 13:13 ` Christoph Hellwig
4 siblings, 0 replies; 12+ messages in thread
From: Sagi Grimberg @ 2021-09-25 20:47 UTC (permalink / raw)
To: Max Gurtovoy, linux-nvme, hch, kbusch, chaitanyak
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] nvmet: use macro definitions for setting cmic value
2021-09-23 10:17 ` [PATCH 2/2] nvmet: use macro definitions for setting cmic value Max Gurtovoy
2021-09-23 17:20 ` Chaitanya Kulkarni
@ 2021-09-25 20:47 ` Sagi Grimberg
1 sibling, 0 replies; 12+ messages in thread
From: Sagi Grimberg @ 2021-09-25 20:47 UTC (permalink / raw)
To: Max Gurtovoy, linux-nvme, hch, kbusch, chaitanyak
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] nvmet: use macro definitions for setting cmic value
2021-09-23 19:46 ` Keith Busch
@ 2021-09-27 19:16 ` Chaitanya Kulkarni
0 siblings, 0 replies; 12+ messages in thread
From: Chaitanya Kulkarni @ 2021-09-27 19:16 UTC (permalink / raw)
To: Keith Busch; +Cc: Max Gurtovoy, linux-nvme, hch, sagi
>>
>> So we actually had this discussion before to keep it open coded.
>>
>> If I remember Keith had already sent out patch for this one...
>
> The similiar patch I'd sent went in as 92decf118f1da. I argued symbolic
> names helps browsing the code since we can tag/cscope them, so I think
> this is a fine change.
>
thanks for the clarification, I think I've missed the final decision..
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] nvmet: use macro definition for setting nmic value
2021-09-23 10:17 [PATCH 1/2] nvmet: use macro definition for setting nmic value Max Gurtovoy
` (2 preceding siblings ...)
2021-09-25 20:47 ` Sagi Grimberg
@ 2021-09-27 19:17 ` Chaitanya Kulkarni
2021-10-12 13:13 ` Christoph Hellwig
4 siblings, 0 replies; 12+ messages in thread
From: Chaitanya Kulkarni @ 2021-09-27 19:17 UTC (permalink / raw)
To: Max Gurtovoy, linux-nvme, hch, kbusch, sagi
On 9/23/21 3:17 AM, Max Gurtovoy wrote:
> This makes the code more readable.
>
> Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
> ---
Looks good.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] nvmet: use macro definitions for setting cmic value
2021-09-23 19:46 ` Max Gurtovoy
@ 2021-09-27 19:19 ` Chaitanya Kulkarni
0 siblings, 0 replies; 12+ messages in thread
From: Chaitanya Kulkarni @ 2021-09-27 19:19 UTC (permalink / raw)
To: Max Gurtovoy, linux-nvme, hch, kbusch, sagi
>>> This makes the code more readable.
>>>
>>> Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
>>> ---
>>> drivers/nvme/target/admin-cmd.c | 3 ++-
>>> include/linux/nvme.h | 1 +
>>> 2 files changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/nvme/target/admin-cmd.c
>>> b/drivers/nvme/target/admin-cmd.c
>>> index 4ee9fe134697..92d81dc5906b 100644
>>> --- a/drivers/nvme/target/admin-cmd.c
>>> +++ b/drivers/nvme/target/admin-cmd.c
>>> @@ -380,7 +380,8 @@ static void nvmet_execute_identify_ctrl(struct
>>> nvmet_req *req)
>>> */
>>> /* we support multiple ports, multiples hosts and ANA: */
>>> - id->cmic = (1 << 0) | (1 << 1) | (1 << 3);
>>> + id->cmic = NVME_CTRL_CMIC_MULTI_PORT | NVME_CTRL_CMIC_MULTI_CTRL |
>>> + NVME_CTRL_CMIC_ANA;
>>>
>> So we actually had this discussion before to keep it open coded.
>>
>> If I remember Keith had already sent out patch for this one...
>
> I don't understand why our code should include constants and not macros.
>
> And if so, let's do it for all macros we have for the spec. We need one
> policy.
>
Agree, looks good.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] nvmet: use macro definition for setting nmic value
2021-09-23 10:17 [PATCH 1/2] nvmet: use macro definition for setting nmic value Max Gurtovoy
` (3 preceding siblings ...)
2021-09-27 19:17 ` Chaitanya Kulkarni
@ 2021-10-12 13:13 ` Christoph Hellwig
4 siblings, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2021-10-12 13:13 UTC (permalink / raw)
To: Max Gurtovoy; +Cc: linux-nvme, hch, kbusch, sagi, chaitanyak
Thanks,
applied to nvme-5.16.
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2021-10-12 13:13 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-23 10:17 [PATCH 1/2] nvmet: use macro definition for setting nmic value Max Gurtovoy
2021-09-23 10:17 ` [PATCH 2/2] nvmet: use macro definitions for setting cmic value Max Gurtovoy
2021-09-23 17:20 ` Chaitanya Kulkarni
2021-09-23 19:46 ` Keith Busch
2021-09-27 19:16 ` Chaitanya Kulkarni
2021-09-23 19:46 ` Max Gurtovoy
2021-09-27 19:19 ` Chaitanya Kulkarni
2021-09-25 20:47 ` Sagi Grimberg
2021-09-23 20:06 ` [PATCH 1/2] nvmet: use macro definition for setting nmic value Keith Busch
2021-09-25 20:47 ` Sagi Grimberg
2021-09-27 19:17 ` Chaitanya Kulkarni
2021-10-12 13:13 ` 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.