All of lore.kernel.org
 help / color / mirror / Atom feed
From: logang@deltatee.com (Logan Gunthorpe)
Subject: [RFC PATCH 4/8] nvmet: use const values for id-ctrl
Date: Fri, 30 Mar 2018 12:50:45 -0600	[thread overview]
Message-ID: <06ee48f5-822c-4fe1-78ca-f8fd22af5d87@deltatee.com> (raw)
In-Reply-To: <20180330065747.20962-5-chaitanya.kulkarni@wdc.com>



On 30/03/18 12:57 AM, Chaitanya Kulkarni wrote:
> This patch adds constant values which are used in
> target identify ctrl.
> 
> These values will be used in implementing
> target passthru identify ctrl to mask the passthru
> ctrl values with the default target ctrl values.
> 
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
> ---
>  drivers/nvme/target/admin-cmd.c | 6 +++---
>  drivers/nvme/target/nvmet.h     | 4 ++++
>  2 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
> index 90dcdc40ac71..6b3d20b32187 100644
> --- a/drivers/nvme/target/admin-cmd.c
> +++ b/drivers/nvme/target/admin-cmd.c
> @@ -210,7 +210,7 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req)
>  	 * comands.  But we don't do anything useful for abort either, so
>  	 * no point in allowing more abort commands than the spec requires.
>  	 */
> -	id->acl = 3;
> +	id->acl = NVMET_ID_CTRL_ACL;
>  
>  	id->aerl = NVMET_ASYNC_EVENTS - 1;
>  
> @@ -223,8 +223,8 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req)
>  	/* We support keep-alive timeout in granularity of seconds */
>  	id->kas = cpu_to_le16(NVMET_KAS);
>  
> -	id->sqes = (0x6 << 4) | 0x6;
> -	id->cqes = (0x4 << 4) | 0x4;
> +	id->sqes = NVMET_ID_CTRL_SQES;
> +	id->cqes = NVMET_ID_CTRL_CQES;

Hmm, I don't know... maybe see what others think but this doesn't feel
right to me. Perhaps a helper function to set the common elements wtih
nvmet_id_ctrl_init_fabircs_fields() of the id struct would be more
appropriate.

Logan

  reply	other threads:[~2018-03-30 18:50 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-30  6:57 [RFC PATCH 0/8] nvmet: implement target passthru commands support Chaitanya Kulkarni
2018-03-30  6:57 ` [RFC PATCH 1/8] nvme-core: add new interfaces Chaitanya Kulkarni
2018-03-30 17:48   ` Logan Gunthorpe
2018-04-02 23:25     ` Chaitanya Kulkarni
2018-04-04 11:52   ` Sagi Grimberg
2018-04-13 17:27     ` Christoph Hellwig
2018-03-30  6:57 ` [RFC PATCH 2/8] nvme-core: export existing ctrl and ns interfaces Chaitanya Kulkarni
2018-04-04 11:59   ` Sagi Grimberg
2018-03-30  6:57 ` [RFC PATCH 3/8] nvmet: add passthru members in target subsys Chaitanya Kulkarni
2018-03-30  6:57 ` [RFC PATCH 4/8] nvmet: use const values for id-ctrl Chaitanya Kulkarni
2018-03-30 18:50   ` Logan Gunthorpe [this message]
2018-04-02 23:27     ` Chaitanya Kulkarni
2018-04-13 17:28     ` Christoph Hellwig
2018-03-30  6:57 ` [RFC PATCH 5/8] nvmet: export nvmet_add_async_event api Chaitanya Kulkarni
2018-03-30  6:57 ` [RFC PATCH 6/8] nvmet: add target passthru command support Chaitanya Kulkarni
2018-03-30  6:57 ` [RFC PATCH 7/8] nvmet: integrate passthru code with target core Chaitanya Kulkarni
2018-03-30  6:57 ` [RFC PATCH 8/8] nvmet: add configfs interface for target passthru Chaitanya Kulkarni
2018-03-30 18:13   ` Logan Gunthorpe
2018-04-03  0:13     ` Chaitanya Kulkarni
2018-04-03  3:21       ` Logan Gunthorpe
2018-04-13 17:30     ` Christoph Hellwig
2018-04-13 17:37       ` Logan Gunthorpe
2018-04-13 21:50         ` Stephen  Bates
2018-03-30 17:46 ` [RFC PATCH 0/8] nvmet: implement target passthru commands support Logan Gunthorpe
2018-04-02 23:23   ` Chaitanya Kulkarni
2018-04-04 11:44 ` Sagi Grimberg
2018-04-13 17:35   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=06ee48f5-822c-4fe1-78ca-f8fd22af5d87@deltatee.com \
    --to=logang@deltatee.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.