All of lore.kernel.org
 help / color / mirror / Atom feed
From: willy@linux.intel.com (Matthew Wilcox)
Subject: [PATCHv2] NVMe: write_long SCSI to NVMe translation implementation
Date: Tue, 17 Mar 2015 08:59:14 -0400	[thread overview]
Message-ID: <20150317125914.GB4003@linux.intel.com> (raw)
In-Reply-To: <004301d060aa$99924070$ccb6c150$@samsung.com>

On Tue, Mar 17, 2015@05:34:40PM +0530, Sunad Bhandary wrote:
> Hi Keith,
> 
> Any comments/updates on this ?
> 
>  	id_ctrl = mem;
>  	v_sup = id_ctrl->vwc;
> +	(id_ctrl->oncs & NVME_CTRL_ONCS_WRITE_UNCORRECTABLE) ?
> +				(wrt_uncor = 0x01) : (wrt_uncor = 0);

This is a weird way of writing it.  Either do it like this:

	if (id_ctrl->oncs & NVME_CTRL_ONCS_WRITE_UNCORRECTABLE)
		wrt_uncor = 0x01;
	else
		wrt_uncor = 0;

Or this:

	wrt_uncor = (id_ctrl->oncs & NVME_CTRL_ONCS_WRITE_UNCORRECTABLE) ? 1 : 0;

(and what's with the 'hex for one, decimal for the other' decision you
made there?)

> @@ -3001,6 +3059,10 @@ static int nvme_scsi_translate(struct nvme_ns *ns,
> struct sg_io_hdr *hdr)
>  	case UNMAP:
>  		retcode = nvme_trans_unmap(ns, hdr, cmd);
>  		break;
> +	case WRITE_LONG:
> +	case SERVICE_ACTION_OUT_16:
> +		retcode = nvme_trans_write_long(ns, hdr, cmd);
> +		break;

Umm ... SAO16 can be used for more commands than just Write Long 16.  You need
to check the Service Action in addition to the opcode.

  reply	other threads:[~2015-03-17 12:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03 11:30 [PATCHv2] NVMe: write_long SCSI to NVMe translation implementation Sunad Bhandary S
2015-03-17 12:04 ` Sunad Bhandary
2015-03-17 12:59   ` Matthew Wilcox [this message]
2015-03-18 15:13     ` Sunad Bhandary
2015-03-18 15:24       ` Busch, Keith
2015-03-19 11:57         ` Sunad Bhandary
     [not found]     ` <5540471F.5030606@huawei.com>
2015-04-29 13:22       ` some questions about create I/O queues Keith Busch
2015-04-30  1:26         ` dingxiang

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=20150317125914.GB4003@linux.intel.com \
    --to=willy@linux.intel.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.