linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Write with Stream ID Support
@ 2015-04-21  1:47 kwan.huen
  2015-04-21  1:47 ` [PATCH 1/2] added stream id write support kwan.huen
  2015-04-21  1:47 ` [PATCH 2/2] added two nvme commands for open/close streams and garbage collection kwan.huen
  0 siblings, 2 replies; 5+ messages in thread
From: kwan.huen @ 2015-04-21  1:47 UTC (permalink / raw)
  To: Matthew Wilcox, Keith Busch, Jens Axboe, kwan.huen, Dimitri John Ledkov
  Cc: linux-nvme, linux-kernel, linux-api


The attached patch set enables basic write with stream ID support. 
First patch reads the stream id embedded in the bio and passes to the 
device along with the write command.
Second patch adds two new nvme commands to be used with ioctl 
such that application can do open/close stream and host
initiated garbage collection.

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

* [PATCH 1/2] added stream id write support
  2015-04-21  1:47 Write with Stream ID Support kwan.huen
@ 2015-04-21  1:47 ` kwan.huen
  2015-04-21 13:44   ` Jeff Moyer
  2015-04-21  1:47 ` [PATCH 2/2] added two nvme commands for open/close streams and garbage collection kwan.huen
  1 sibling, 1 reply; 5+ messages in thread
From: kwan.huen @ 2015-04-21  1:47 UTC (permalink / raw)
  To: Matthew Wilcox, Keith Busch, Jens Axboe, kwan.huen, Dimitri John Ledkov
  Cc: linux-nvme, linux-kernel, linux-api

---
 drivers/block/nvme-core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index 85b8036..332341a 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -769,6 +769,9 @@ static int nvme_submit_iod(struct nvme_queue *nvmeq, struct nvme_iod *iod,
 	if (req->cmd_flags & REQ_RAHEAD)
 		dsmgmt |= NVME_RW_DSM_FREQ_PREFETCH;
 
+	if (rq_data_dir(req))
+		dsmgmt |= bio_get_streamid(req->bio) << 8;
+
 	cmnd = &nvmeq->sq_cmds[nvmeq->sq_tail];
 	memset(cmnd, 0, sizeof(*cmnd));
 
-- 
1.9.1


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

* [PATCH 2/2] added two nvme commands for open/close streams and garbage collection
  2015-04-21  1:47 Write with Stream ID Support kwan.huen
  2015-04-21  1:47 ` [PATCH 1/2] added stream id write support kwan.huen
@ 2015-04-21  1:47 ` kwan.huen
  1 sibling, 0 replies; 5+ messages in thread
From: kwan.huen @ 2015-04-21  1:47 UTC (permalink / raw)
  To: Matthew Wilcox, Keith Busch, Jens Axboe, kwan.huen, Dimitri John Ledkov
  Cc: linux-nvme, linux-kernel, linux-api

---
 include/uapi/linux/nvme.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/uapi/linux/nvme.h b/include/uapi/linux/nvme.h
index aef9a81..5025610 100644
--- a/include/uapi/linux/nvme.h
+++ b/include/uapi/linux/nvme.h
@@ -229,6 +229,8 @@ enum nvme_opcode {
 	nvme_cmd_resv_report	= 0x0e,
 	nvme_cmd_resv_acquire	= 0x11,
 	nvme_cmd_resv_release	= 0x15,
+	nvme_cmd_stream_ctrl	= 0x18,
+	nvme_cmd_gc_ctrl	= 0x1c,
 };
 
 struct nvme_common_command {
-- 
1.9.1


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

* Re: [PATCH 1/2] added stream id write support
  2015-04-21  1:47 ` [PATCH 1/2] added stream id write support kwan.huen
@ 2015-04-21 13:44   ` Jeff Moyer
  2015-04-21 19:03     ` Hingkwan Huen
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Moyer @ 2015-04-21 13:44 UTC (permalink / raw)
  To: kwan.huen
  Cc: Matthew Wilcox, Keith Busch, Jens Axboe, Dimitri John Ledkov,
	linux-nvme, linux-kernel, linux-api

"kwan.huen" <kwan.huen@samsung.com> writes:

> ---
>  drivers/block/nvme-core.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
> index 85b8036..332341a 100644
> --- a/drivers/block/nvme-core.c
> +++ b/drivers/block/nvme-core.c
> @@ -769,6 +769,9 @@ static int nvme_submit_iod(struct nvme_queue *nvmeq, struct nvme_iod *iod,
>  	if (req->cmd_flags & REQ_RAHEAD)
>  		dsmgmt |= NVME_RW_DSM_FREQ_PREFETCH;
>  
> +	if (rq_data_dir(req))
> +		dsmgmt |= bio_get_streamid(req->bio) << 8;
> +

There's no public specification for this, yet.  How many bits are set
aside for the stream id?  Do you need to do bounds checking/input
validation?  What happens on adapters with older firmware when these
bits are set?

Cheers,
Jeff

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

* RE: [PATCH 1/2] added stream id write support
  2015-04-21 13:44   ` Jeff Moyer
@ 2015-04-21 19:03     ` Hingkwan Huen
  0 siblings, 0 replies; 5+ messages in thread
From: Hingkwan Huen @ 2015-04-21 19:03 UTC (permalink / raw)
  To: 'Jeff Moyer'
  Cc: 'Matthew Wilcox', 'Keith Busch',
	'Jens Axboe', 'Dimitri John Ledkov',
	linux-nvme, linux-kernel, linux-api



> -----Original Message-----
> From: Jeff Moyer [mailto:jmoyer@redhat.com]
> Sent: Tuesday, April 21, 2015 6:45 AM
> To: kwan.huen
> Cc: Matthew Wilcox; Keith Busch; Jens Axboe; Dimitri John Ledkov; linux-
> nvme@lists.infradead.org; linux-kernel@vger.kernel.org; linux-
> api@vger.kernel.org
> Subject: Re: [PATCH 1/2] added stream id write support
> 
> "kwan.huen" <kwan.huen@samsung.com> writes:
> 
> > ---
> >  drivers/block/nvme-core.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
> > index 85b8036..332341a 100644
> > --- a/drivers/block/nvme-core.c
> > +++ b/drivers/block/nvme-core.c
> > @@ -769,6 +769,9 @@ static int nvme_submit_iod(struct nvme_queue
> *nvmeq, struct nvme_iod *iod,
> >  	if (req->cmd_flags & REQ_RAHEAD)
> >  		dsmgmt |= NVME_RW_DSM_FREQ_PREFETCH;
> >
> > +	if (rq_data_dir(req))
> > +		dsmgmt |= bio_get_streamid(req->bio) << 8;
> > +
> 
> There's no public specification for this, yet.  How many bits are set
aside for
> the stream id?  Do you need to do bounds checking/input validation?  What
> happens on adapters with older firmware when these bits are set?
> 
> Cheers,
> Jeff

Thanks Jeff for the review! 
The patch depends on Jens' recent io-streamid patch set, and the new NVMe
spec we are trying to get approved.
The patch is probably still too early and we'll push this again when Jens'
patches are released and the new spec goes public.
Thanks,
kwan


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

end of thread, other threads:[~2015-04-21 19:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-21  1:47 Write with Stream ID Support kwan.huen
2015-04-21  1:47 ` [PATCH 1/2] added stream id write support kwan.huen
2015-04-21 13:44   ` Jeff Moyer
2015-04-21 19:03     ` Hingkwan Huen
2015-04-21  1:47 ` [PATCH 2/2] added two nvme commands for open/close streams and garbage collection kwan.huen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).