* [RESEND PATCH stable only] nvmet: set loop queue's segment boundary mask as PAGE_SIZE - 1
@ 2019-04-02 1:56 Ming Lei
2019-04-03 14:04 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Ming Lei @ 2019-04-02 1:56 UTC (permalink / raw)
To: linux-nvme, Christoph Hellwig
Cc: Ming Lei, Yi Zhang, Sagi Grimberg, Chaitanya Kulkarni, stable
NVMe target only accepts single-page sg list, either file or block
device backed target code follows this assumption.
However, loop target is one exception, given the sg list is from
the host queue directly.
This patch sets loop queue's segment boundary mask as PAGE_SIZE - 1
for following NVMe target assumption.
Multi-page bvec has been merged to v5.1-rc1, so commit 02db99548d36
("nvmet: fix building bvec from sg list") can fix the current issue
simply without needing to limit the segment size for nvme-loop.
Reported-by: Yi Zhang <yi.zhang@redhat.com>
Fixes: 3a85a5de29ea ("nvme-loop: add a NVMe loopback host driver")
Cc: Yi Zhang <yi.zhang@redhat.com>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
drivers/nvme/target/loop.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c
index b9f623ab01f3..7194f86b9dac 100644
--- a/drivers/nvme/target/loop.c
+++ b/drivers/nvme/target/loop.c
@@ -549,6 +549,9 @@ static int nvme_loop_create_io_queues(struct nvme_loop_ctrl *ctrl)
if (ret)
goto out_cleanup_connect_q;
+ /* target only accepts single-page sg list */
+ blk_queue_segment_boundary(ctrl->ctrl.connect_q, PAGE_SIZE - 1);
+
return 0;
out_cleanup_connect_q:
--
2.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [RESEND PATCH stable only] nvmet: set loop queue's segment boundary mask as PAGE_SIZE - 1 2019-04-02 1:56 [RESEND PATCH stable only] nvmet: set loop queue's segment boundary mask as PAGE_SIZE - 1 Ming Lei @ 2019-04-03 14:04 ` Greg KH 2019-04-03 16:22 ` Ming Lei 0 siblings, 1 reply; 4+ messages in thread From: Greg KH @ 2019-04-03 14:04 UTC (permalink / raw) To: Ming Lei Cc: linux-nvme, Christoph Hellwig, Yi Zhang, Sagi Grimberg, Chaitanya Kulkarni, stable On Tue, Apr 02, 2019 at 09:56:10AM +0800, Ming Lei wrote: > NVMe target only accepts single-page sg list, either file or block > device backed target code follows this assumption. > > However, loop target is one exception, given the sg list is from > the host queue directly. > > This patch sets loop queue's segment boundary mask as PAGE_SIZE - 1 > for following NVMe target assumption. > > Multi-page bvec has been merged to v5.1-rc1, so commit 02db99548d36 > ("nvmet: fix building bvec from sg list") can fix the current issue > simply without needing to limit the segment size for nvme-loop. I don't understand, 02db99548d36 does not work for older kernels, so because of that, you need/want this patch to be applied? If so, what specific kernel versions do you want this to go to? thanks, greg k-h ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RESEND PATCH stable only] nvmet: set loop queue's segment boundary mask as PAGE_SIZE - 1 2019-04-03 14:04 ` Greg KH @ 2019-04-03 16:22 ` Ming Lei 2019-04-24 16:48 ` Greg KH 0 siblings, 1 reply; 4+ messages in thread From: Ming Lei @ 2019-04-03 16:22 UTC (permalink / raw) To: Greg KH Cc: Yi Zhang, Sagi Grimberg, Chaitanya Kulkarni, stable, linux-nvme, Christoph Hellwig On Wed, Apr 03, 2019 at 04:04:27PM +0200, Greg KH wrote: > On Tue, Apr 02, 2019 at 09:56:10AM +0800, Ming Lei wrote: > > NVMe target only accepts single-page sg list, either file or block > > device backed target code follows this assumption. > > > > However, loop target is one exception, given the sg list is from > > the host queue directly. > > > > This patch sets loop queue's segment boundary mask as PAGE_SIZE - 1 > > for following NVMe target assumption. > > > > Multi-page bvec has been merged to v5.1-rc1, so commit 02db99548d36 > > ("nvmet: fix building bvec from sg list") can fix the current issue > > simply without needing to limit the segment size for nvme-loop. > > I don't understand, 02db99548d36 does not work for older kernels, so > because of that, you need/want this patch to be applied? If so, what > specific kernel versions do you want this to go to? Old kernel needs both this patch and 02db99548d36, and you should see the description in 02db99548d36 commit log too. This patch should be needed since nvme-loop is introduced. Thanks, Ming ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RESEND PATCH stable only] nvmet: set loop queue's segment boundary mask as PAGE_SIZE - 1 2019-04-03 16:22 ` Ming Lei @ 2019-04-24 16:48 ` Greg KH 0 siblings, 0 replies; 4+ messages in thread From: Greg KH @ 2019-04-24 16:48 UTC (permalink / raw) To: Ming Lei Cc: Yi Zhang, Sagi Grimberg, Chaitanya Kulkarni, stable, linux-nvme, Christoph Hellwig On Thu, Apr 04, 2019 at 12:22:27AM +0800, Ming Lei wrote: > On Wed, Apr 03, 2019 at 04:04:27PM +0200, Greg KH wrote: > > On Tue, Apr 02, 2019 at 09:56:10AM +0800, Ming Lei wrote: > > > NVMe target only accepts single-page sg list, either file or block > > > device backed target code follows this assumption. > > > > > > However, loop target is one exception, given the sg list is from > > > the host queue directly. > > > > > > This patch sets loop queue's segment boundary mask as PAGE_SIZE - 1 > > > for following NVMe target assumption. > > > > > > Multi-page bvec has been merged to v5.1-rc1, so commit 02db99548d36 > > > ("nvmet: fix building bvec from sg list") can fix the current issue > > > simply without needing to limit the segment size for nvme-loop. > > > > I don't understand, 02db99548d36 does not work for older kernels, so > > because of that, you need/want this patch to be applied? If so, what > > specific kernel versions do you want this to go to? > > Old kernel needs both this patch and 02db99548d36, and you should see > the description in 02db99548d36 commit log too. > > This patch should be needed since nvme-loop is introduced. I'm sorry, I still do not understand. Please resend the patches that you wish to have applied, with the proper git commit ids, and let us know what trees they should be applied to. I can not parse the above text, sorry. greg k-h ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-04-24 16:48 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-04-02 1:56 [RESEND PATCH stable only] nvmet: set loop queue's segment boundary mask as PAGE_SIZE - 1 Ming Lei 2019-04-03 14:04 ` Greg KH 2019-04-03 16:22 ` Ming Lei 2019-04-24 16:48 ` Greg KH
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).