[PATCH] lsi53c895a: Fix breakage v0.12.5 merge for SGL passthrough qemu-kvm.git tree

2010-08-22 Thread Nicholas A. Bellinger
because we need it for TEST_UNIT_READY and other non DATA I/O descriptors in lsi_do_msgin(). Tested with Linux x86_64 v2.6.26 KVM guest with hw/scsi-generic.c with TCM_Loop FILEIO backstores on a v2.6.35 KVM / TCM v4 host. Signed-off-by: Nicholas A. Bellinger --- hw/lsi5

Re: [PATCH] tcm_vhost: Use llist for cmd completion list

2013-01-17 Thread Nicholas A. Bellinger
Hi Asias! On Sun, 2013-01-06 at 14:36 +0800, Asias He wrote: > This drops the cmd completion list spin lock and makes the cmd > completion queue lock-less. > > Signed-off-by: Asias He > --- Apologies for the long delay to get back to this patch. After some initial testing, I'm seeing about abo

Re: [PATCH 0/5] vhost-scsi: Add support for host virtualized target

2013-01-17 Thread Nicholas A. Bellinger
Hi MST & Co, On Thu, 2013-01-17 at 18:43 +0200, Michael S. Tsirkin wrote: > On Fri, Sep 07, 2012 at 06:48:14AM +, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > Hello Anthony & Co, > > > > This is the fourth installment to add ho

vhost-scsi support for ANY_LAYOUT

2015-01-26 Thread Nicholas A. Bellinger
Hi MST & Paolo, So I'm currently working on vhost-scsi support for ANY_LAYOUT, and wanted to verify some assumptions based upon your earlier emails.. *) When ANY_LAYOUT is negotiated by vhost-scsi, it's expected that virtio-scsi request + response headers will (always..?) be within a single iovec

[PATCH 8/8] vhost/scsi: Set VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 feature bits

2015-01-30 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Signal support of VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 feature bits required for virtio-scsi 1.0 spec layout requirements. Cc: Michael S. Tsirkin Cc: Paolo Bonzini Signed-off-by: Nicholas Bellinger --- drivers/vhost/scsi.c | 9 +++-- 1 file changed, 7 inserti

[PATCH 2/8] vhost/scsi: Convert completion path to use memcpy_toiovecend

2015-01-30 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Required for ANY_LAYOUT support when the incoming virtio-scsi response header + fixed size sense buffer payload may span more than a single iovec entry. This changes existing code to save cmd->tvc_resp_iod instead of the first single iovec base pointer from &vq->iov[out]

[PATCH 6/8] vhost/scsi: Add ANY_LAYOUT prerequisites

2015-01-30 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds ANY_LAYOUT prerequisites logic for accepting a set of protection + data payloads via iovec + offset. Also includes helpers for calcuating SGLs + invoking vhost_scsi_map_to_sgl() with a known number of iovecs. Required by ANY_LAYOUT processing when struct

[PATCH 0/8] vhost/scsi: Add ANY_LAYOUT support

2015-01-30 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Hi MST & Paolo, The series adds initial vhost/scsi ANY_LAYOUT layout support. It assumes request/CDB and response/sense_buffer headers may span more than a single iovec using lib/iovec.c logic, along with a new addition of memcpy_fromiovec_out() to return the current re

[PATCH 1/8] lib/iovec: Add memcpy_fromiovec_out library function

2015-01-30 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds a new memcpy_fromiovec_out() library function which modifies the passed *iov following memcpy_fromiovec(), but also returns the next current iovec pointer via **iov_out. This is useful for vhost ANY_LAYOUT support when guests are allowed to generate incom

[PATCH 4/8] vhost/scsi: Change vhost_scsi_map_to_sgl to accept iov ptr + len

2015-01-30 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch changes vhost_scsi_map_to_sgl() parameters to accept virtio iovec ptr + len when determing pages_nr. This is currently done with iov_num_pages() -> PAGE_ALIGN, so allow the same parameters as well. Cc: Michael S. Tsirkin Cc: Paolo Bonzini Signed-off-by: Nic

[PATCH 7/8] vhost/scsi: Add ANY_LAYOUT support

2015-01-30 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds initial ANY_LAYOUT support with a new vhost_virtqueue callback in vhost_scsi_handle_vqal(). It calculates data_direction + exp_data_len for the new tcm_vhost_cmd descriptor by walking both outgoing + incoming iovecs, assuming the layout of outgoing reques

[PATCH 3/8] vhost/scsi: Fix incorrect early vhost_scsi_handle_vq failures

2015-01-30 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch fixes vhost_scsi_handle_vq() failure cases that result in BUG_ON() getting triggered when vhost_scsi_free_cmd() is called, and ->tvc_se_cmd has not been initialized by target_submit_cmd_map_sgls(). It changes tcm_vhost_release_cmd() to use tcm_vhost_cmd->tvc_n

[PATCH 5/8] vhost/scsi: Add common vhost_scsi_queue_desc code

2015-01-30 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Move logic for typical vhost_scsi_handle_vq() -> tcm_vhost_workqueue -> tcm_vhost_submission_work() dispatch into vhost_scsi_queue_desc(). Can be shared by vhost_scsi_handle_vqal() code. Cc: Michael S. Tsirkin Cc: Paolo Bonzini Signed-off-by: Nicholas Bellinger ---

[PATCH 2/3] vhost/scsi: Add VIRTIO_SCSI_F_T10_PI host_feature bit

2015-01-30 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Signed-off-by: Nicholas Bellinger --- hw/scsi/vhost-scsi.c| 1 + hw/scsi/virtio-scsi.c | 3 +++ hw/virtio/virtio-pci.c | 2 ++ include/hw/i386/pc.h| 13 - include/hw/virtio/virtio-scsi.h | 5 - 5 files chang

[PATCH 0/3] vhost/scsi: Enable virtio 1.0 host_feature bits

2015-01-30 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Hi MST & Paolo, Here are the associated QEMU vhost/scsi changes to enable KVM host for expose F_HOTPLUG, F_T10_PI, and ANY_LAYOUT feature bits into virtio 1.0 compatible guests. Note this does not include VIRTIO_SCSI_F_CHANGE, which is currently not supported by vhost/s

[PATCH 3/3] vhost/scsi: Add VIRTIO_F_ANY_LAYOUT host_feature bit

2015-01-30 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Signed-off-by: Nicholas Bellinger --- hw/scsi/vhost-scsi.c | 1 + hw/virtio/virtio-pci.c | 2 ++ include/hw/i386/pc.h | 5 + 3 files changed, 8 insertions(+) diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index 95f7b99..bfb7005 100644 --- a/hw/scsi/vh

[PATCH 1/3] vhost/scsi: Add VIRTIO_SCSI_F_HOTPLUG host_feature bit

2015-01-30 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Cc: Michael S. Tsirkin Cc: Paolo Bonzini Signed-off-by: Nicholas Bellinger --- hw/virtio/virtio-pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index dde1d73..5127efb 100644 --- a/hw/virtio/virtio-pci.c +++ b

Re: [PATCH 1/8] lib/iovec: Add memcpy_fromiovec_out library function

2015-01-31 Thread Nicholas A. Bellinger
On Fri, 2015-01-30 at 10:33 +0100, Paolo Bonzini wrote: > > On 30/01/2015 09:12, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > This patch adds a new memcpy_fromiovec_out() library function which modifies > > the passed *iov following memcpy_fro

Re: [PATCH 4/8] vhost/scsi: Change vhost_scsi_map_to_sgl to accept iov ptr + len

2015-01-31 Thread Nicholas A. Bellinger
On Fri, 2015-01-30 at 12:51 +0200, Michael S. Tsirkin wrote: > On Fri, Jan 30, 2015 at 08:12:28AM +0000, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > This patch changes vhost_scsi_map_to_sgl() parameters to accept virtio > > iovec ptr +

[PATCH-v2 05/11] vhost/scsi: Add ANY_LAYOUT iov -> sgl mapping prerequisites

2015-02-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds ANY_LAYOUT prerequisites logic for accepting a set of protection + data payloads via iovec + offset. Also includes helpers for calcuating SGLs + invoking vhost_scsi_map_to_sgl() with a known number of iovecs. Required by ANY_LAYOUT processing when struct

[PATCH-v2 02/11] vhost/scsi: Convert completion path to use memcpy_toiovecend

2015-02-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Required for ANY_LAYOUT support when the incoming virtio-scsi response header + fixed size sense buffer payload may span more than a single iovec entry. This changes existing code to save cmd->tvc_resp_iod instead of the first single iovec base pointer from &vq->iov[out]

[PATCH-v2 09/11] vhost/scsi: Drop legacy pre virtio v1.0 !ANY_LAYOUT logic

2015-02-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger With the new ANY_LAYOUT logic in place for vhost_scsi_handle_vqal(), there is no longer a reason to keep around the legacy code with !ANY_LAYOUT assumptions. Go ahead and drop the pre virtio 1.0 logic in vhost_scsi_handle_vq() and associated helpers. Cc: Michael S. Tsir

[PATCH-v2 03/11] vhost/scsi: Fix incorrect early vhost_scsi_handle_vq failures

2015-02-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch fixes vhost_scsi_handle_vq() failure cases that result in BUG_ON() getting triggered when vhost_scsi_free_cmd() is called, and ->tvc_se_cmd has not been initialized by target_submit_cmd_map_sgls(). It changes tcm_vhost_release_cmd() to use tcm_vhost_cmd->tvc_n

[PATCH-v2 00/11] vhost/scsi: Add ANY_LAYOUT + VERSION_1 support

2015-02-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Hi MST, Paolo, & Co, This -v2 series adds vhost/scsi ANY_LAYOUT + VERSION_1 host feature bit support. It adds a new vhost_virtqueue ->handle_kick() callback to determine the start of protection and data payloads iovecs past starting virtio-scsi request and response head

[PATCH-v2 01/11] lib/iovec: Add memcpy_fromiovec_out library function

2015-02-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds a new memcpy_fromiovec_out() library function which modifies the passed *iov following memcpy_fromiovec(), but also returns the next current iovec pointer via **iov_out. This is useful for vhost ANY_LAYOUT support when guests are allowed to generate incom

[PATCH-v2 10/11] vhost/scsi: Drop left-over scsi_tcq.h include

2015-02-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger With the recent removal of MSG_*_TAG defines in commit 68d81f40, vhost-scsi is now using TCM_*_TAG and doesn't depend upon host side scsi_tcq.h definitions anymore. Cc: Michael S. Tsirkin Cc: Paolo Bonzini Signed-off-by: Nicholas Bellinger --- drivers/vhost/scsi.c |

[PATCH-v2 06/11] vhost/scsi: Add ANY_LAYOUT vhost_skip_iovec_bytes helper

2015-02-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds a vhost_skip_iovec_bytes() helper for skipping ahead a number of bytes into the passed *iov_in + off_in, saving the current **iov_out + off_out so it may be used by the caller. This is useful for virtio-scsi READs when needing to skip ahead of the startin

[PATCH-v2 11/11] vhost/scsi: Global tcm_vhost -> vhost_scsi rename

2015-02-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger There is a large amount of code that still references the original 'tcm_vhost' naming conventions, instead of modern 'vhost_scsi'. Go ahead and do a global rename to make the usage consistent. Cc: Michael S. Tsirkin Cc: Paolo Bonzini Signed-off-by: Nicholas Bellinger

[PATCH-v2 08/11] vhost/scsi: Set VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 feature bits

2015-02-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Signal support of VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 feature bits required for virtio-scsi 1.0 spec layout requirements. Cc: Michael S. Tsirkin Cc: Paolo Bonzini Signed-off-by: Nicholas Bellinger --- drivers/vhost/scsi.c | 9 +++-- 1 file changed, 7 inserti

[PATCH-v2 07/11] vhost/scsi: Add ANY_LAYOUT vhost_virtqueue callback

2015-02-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds ANY_LAYOUT support with a new vqs[].vq.handle_kick() callback in vhost_scsi_handle_vqal(). It calculates data_direction + exp_data_len for the new tcm_vhost_cmd descriptor by walking both outgoing + incoming iovecs, assuming the layout of outgoing request

[PATCH-v2 04/11] vhost/scsi: Change vhost_scsi_map_to_sgl to accept iov ptr + len

2015-02-01 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch changes vhost_scsi_map_to_sgl() parameters to accept virtio iovec ptr + len when determing pages_nr. This is currently done with iov_num_pages() -> PAGE_ALIGN, so allow the same parameters as well. Cc: Michael S. Tsirkin Cc: Paolo Bonzini Signed-off-by: Nic

Re: [PATCH 0/8] vhost/scsi: Add ANY_LAYOUT support

2015-02-02 Thread Nicholas A. Bellinger
On Mon, 2015-02-02 at 00:15 -0800, Christoph Hellwig wrote: > Hi Nic, > > Al has been rewriting the vhost code to use iov_iter primitives, > can you please rebase it on top of that istead of using the obsolete > infrastructure? > Yep, already done with the copy_[from,to]_iter() conversion in vho

Re: [target:for-next 16/21] drivers/vhost/scsi.c:1081:5: sparse: symbol 'vhost_skip_iovec_bytes' was not declared. Should it be static?

2015-02-02 Thread Nicholas A. Bellinger
On Mon, 2015-02-02 at 14:25 +0800, kbuild test robot wrote: > tree: git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git > for-next > head: 2936f1d4f3e8247bd519feba7892371d5e4c6603 > commit: 105acf608f25d5e0d9fef669299a5438b7b114ee [16/21] vhost/scsi: Add > ANY_LAYOUT vhost_sk

Re: [PATCH v2 18/18] vhost: vhost_scsi_handle_vq() should just use copy_from_user()

2015-02-02 Thread Nicholas A. Bellinger
Hi Al, On Mon, 2015-02-02 at 07:59 +, Al Viro wrote: > From: Al Viro > > it has just verified that it asks no more than the length of the > first segment of iovec. > > And with that the last user of stuff in lib/iovec.c is gone. > RIP. > > Cc: Michael S

[PATCH-v3 0/9] vhost/scsi: Add ANY_LAYOUT + VERSION_1 support

2015-02-02 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Hi MST, Paolo, Al & Co, Here is -v3 for adding vhost/scsi ANY_LAYOUT + VERSION_1 host feature bit support. It adds a new vhost_virtqueue ->handle_kick() callback to determine the start of protection and data payloads iovecs past starting virtio-scsi request and response

[PATCH-v3 3/9] vhost/scsi: Change vhost_scsi_map_to_sgl to accept iov ptr + len

2015-02-02 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch changes vhost_scsi_map_to_sgl() parameters to accept virtio iovec ptr + len when determing pages_nr. This is currently done with iov_num_pages() -> PAGE_ALIGN, so allow the same parameters as well. Cc: Michael S. Tsirkin Cc: Paolo Bonzini Signed-off-by: Nic

[PATCH-v3 2/9] vhost/scsi: Fix incorrect early vhost_scsi_handle_vq failures

2015-02-02 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch fixes vhost_scsi_handle_vq() failure cases that result in BUG_ON() getting triggered when vhost_scsi_free_cmd() is called, and ->tvc_se_cmd has not been initialized by target_submit_cmd_map_sgls(). It changes tcm_vhost_release_cmd() to use tcm_vhost_cmd->tvc_n

[PATCH-v3 1/9] vhost/scsi: Convert completion path to use copy_to_iser

2015-02-02 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Required for ANY_LAYOUT support when the incoming virtio-scsi response header + fixed size sense buffer payload may span more than a single iovec entry. This changes existing code to save cmd->tvc_resp_iov instead of the first single iovec base pointer from &vq->iov[out]

[PATCH-v3 7/9] vhost/scsi: Drop legacy pre virtio v1.0 !ANY_LAYOUT logic

2015-02-02 Thread Nicholas A. Bellinger
From: Nicholas Bellinger With the new ANY_LAYOUT logic in place for vhost_scsi_handle_vqal(), there is no longer a reason to keep around the legacy code with !ANY_LAYOUT assumptions. Go ahead and drop the pre virtio 1.0 logic in vhost_scsi_handle_vq() and associated helpers. Cc: Michael S. Tsir

[PATCH-v3 5/9] vhost/scsi: Add ANY_LAYOUT vhost_virtqueue callback

2015-02-02 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds ANY_LAYOUT support with a new vqs[].vq.handle_kick() callback in vhost_scsi_handle_vqal(). It calculates data_direction + exp_data_len for the new tcm_vhost_cmd descriptor by walking both outgoing + incoming iovecs using iov_iter, assuming the layout of o

[PATCH-v3 6/9] vhost/scsi: Set VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 feature bits

2015-02-02 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Signal support of VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 feature bits required for virtio-scsi 1.0 spec layout requirements. Cc: Michael S. Tsirkin Cc: Paolo Bonzini Signed-off-by: Nicholas Bellinger --- drivers/vhost/scsi.c | 9 +++-- 1 file changed, 7 inserti

[PATCH-v3 9/9] vhost/scsi: Global tcm_vhost -> vhost_scsi rename

2015-02-02 Thread Nicholas A. Bellinger
From: Nicholas Bellinger There is a large amount of code that still references the original 'tcm_vhost' naming conventions, instead of modern 'vhost_scsi'. Go ahead and do a global rename to make the usage consistent. Cc: Michael S. Tsirkin Cc: Paolo Bonzini Signed-off-by: Nicholas Bellinger

[PATCH-v3 8/9] vhost/scsi: Drop left-over scsi_tcq.h include

2015-02-02 Thread Nicholas A. Bellinger
From: Nicholas Bellinger With the recent removal of MSG_*_TAG defines in commit 68d81f40, vhost-scsi is now using TCM_*_TAG and doesn't depend upon host side scsi_tcq.h definitions anymore. Cc: Michael S. Tsirkin Cc: Paolo Bonzini Signed-off-by: Nicholas Bellinger --- drivers/vhost/scsi.c |

[PATCH-v3 4/9] vhost/scsi: Add ANY_LAYOUT iov -> sgl mapping prerequisites

2015-02-02 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds ANY_LAYOUT prerequisites logic for accepting a set of protection + data payloads via iov_iter. Also includes helpers for calcuating SGLs + invoking vhost_scsi_map_to_sgl() with a known number of iovecs. Required by ANY_LAYOUT processing when struct iovec

Re: [PATCH-v3 1/9] vhost/scsi: Convert completion path to use copy_to_iser

2015-02-04 Thread Nicholas A. Bellinger
On Tue, 2015-02-03 at 11:24 +0200, Michael S. Tsirkin wrote: > > On Tue, Feb 03, 2015 at 06:29:55AM +, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > Required for ANY_LAYOUT support when the incoming virtio-scsi response > > header + fixed

Re: [PATCH-v3 4/9] vhost/scsi: Add ANY_LAYOUT iov -> sgl mapping prerequisites

2015-02-04 Thread Nicholas A. Bellinger
On Tue, 2015-02-03 at 11:32 +0200, Michael S. Tsirkin wrote: > On Tue, Feb 03, 2015 at 06:29:58AM +0000, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > This patch adds ANY_LAYOUT prerequisites logic for accepting a set of > > protection + data p

Re: [PATCH-v3 0/9] vhost/scsi: Add ANY_LAYOUT + VERSION_1 support

2015-02-04 Thread Nicholas A. Bellinger
On Tue, 2015-02-03 at 11:35 +0200, Michael S. Tsirkin wrote: > On Tue, Feb 03, 2015 at 06:29:54AM +0000, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > Hi MST, Paolo, Al & Co, > > > > Here is -v3 for adding vhost/scsi ANY_LAYOUT + V

Re: [PATCH-v3 7/9] vhost/scsi: Drop legacy pre virtio v1.0 !ANY_LAYOUT logic

2015-02-04 Thread Nicholas A. Bellinger
On Tue, 2015-02-03 at 11:37 +0200, Michael S. Tsirkin wrote: > On Tue, Feb 03, 2015 at 06:30:01AM +0000, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > With the new ANY_LAYOUT logic in place for vhost_scsi_handle_vqal(), > > there is no longer

Re: [PATCH-v3 6/9] vhost/scsi: Set VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 feature bits

2015-02-04 Thread Nicholas A. Bellinger
On Tue, 2015-02-03 at 11:40 +0200, Michael S. Tsirkin wrote: > On Tue, Feb 03, 2015 at 06:30:00AM +0000, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > Signal support of VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 feature bits > > required for

Re: [PATCH-v3 5/9] vhost/scsi: Add ANY_LAYOUT vhost_virtqueue callback

2015-02-04 Thread Nicholas A. Bellinger
On Tue, 2015-02-03 at 12:14 +0200, Michael S. Tsirkin wrote: > On Tue, Feb 03, 2015 at 06:29:59AM +0000, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > This patch adds ANY_LAYOUT support with a new vqs[].vq.handle_kick() > > callback in vhost_scsi

Re: [PATCH-v3 5/9] vhost/scsi: Add ANY_LAYOUT vhost_virtqueue callback

2015-02-04 Thread Nicholas A. Bellinger
On Tue, 2015-02-03 at 23:56 +, Al Viro wrote: > On Tue, Feb 03, 2015 at 06:29:59AM +0000, Nicholas A. Bellinger wrote: > > +* Copy over the virtio-scsi request header, which when > > +* ANY_LAYOUT is enabled may span multiple iovecs, or a > > +

Re: [PATCH-v3 5/9] vhost/scsi: Add ANY_LAYOUT vhost_virtqueue callback

2015-02-04 Thread Nicholas A. Bellinger
On Wed, 2015-02-04 at 11:20 +0100, Michael S. Tsirkin wrote: > On Wed, Feb 04, 2015 at 02:11:20AM -0800, Nicholas A. Bellinger wrote: > > On Tue, 2015-02-03 at 23:56 +, Al Viro wrote: > > > On Tue, Feb 03, 2015 at 06:29:59AM +, Nicholas A. Bellinger wrote: > > >

Re: [PATCH-v3 5/9] vhost/scsi: Add ANY_LAYOUT vhost_virtqueue callback

2015-02-04 Thread Nicholas A. Bellinger
On Wed, 2015-02-04 at 10:42 +0100, Michael S. Tsirkin wrote: > On Wed, Feb 04, 2015 at 01:40:25AM -0800, Nicholas A. Bellinger wrote: > > > > + /* > > > > +* Any associated T10_PI bytes for the outgoing / > > > > incoming

Re: [PATCH-v3 5/9] vhost/scsi: Add ANY_LAYOUT vhost_virtqueue callback

2015-02-04 Thread Nicholas A. Bellinger
On Wed, 2015-02-04 at 02:41 -0800, Nicholas A. Bellinger wrote: > On Wed, 2015-02-04 at 10:42 +0100, Michael S. Tsirkin wrote: > > On Wed, Feb 04, 2015 at 01:40:25AM -0800, Nicholas A. Bellinger wrote: > > > > > + /* > > > > > +

[PATCH-v4 0/8] vhost/scsi: Add ANY_LAYOUT + VERSION_1 support

2015-02-05 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Hi MST, Paolo, Al & Co, Here is v4 patch series for vhost/scsi ANY_LAYOUT + VERSION_1 support. It updates vhost_virtqueue->handle_kick() -> vhost_scsi_handle_vq() callback code to determine the start of protection + data payloads iovecs past the starting virtio-scsi req

[PATCH-v4 4/8] vhost/scsi: Add ANY_LAYOUT iov -> sgl mapping prerequisites

2015-02-05 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds ANY_LAYOUT prerequisites logic for accepting a set of protection + data payloads via iov_iter. Also includes helpers for calcuating SGLs + invoking vhost_scsi_map_to_sgl() with a known number of iovecs. Required by ANY_LAYOUT processing when struct iovec

[PATCH-v4 1/8] vhost/scsi: Convert completion path to use copy_to_iter

2015-02-05 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Required for ANY_LAYOUT support when the incoming virtio-scsi response header + fixed size sense buffer payload may span more than a single iovec entry. This changes existing code to save cmd->tvc_resp_iov instead of the first single iovec base pointer from &vq->iov[out]

[PATCH-v4 7/8] vhost/scsi: Drop left-over scsi_tcq.h include

2015-02-05 Thread Nicholas A. Bellinger
From: Nicholas Bellinger With the recent removal of MSG_*_TAG defines in commit 68d81f40, vhost-scsi is now using TCM_*_TAG and doesn't depend upon host side scsi_tcq.h definitions anymore. Cc: Michael S. Tsirkin Acked-by: Michael S. Tsirkin Cc: Paolo Bonzini Signed-off-by: Nicholas Bellinger

[PATCH-v4 6/8] vhost/scsi: Set VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 feature bits

2015-02-05 Thread Nicholas A. Bellinger
From: Nicholas Bellinger Signal support of VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 feature bits required for virtio-scsi 1.0 spec layout requirements. Cc: Michael S. Tsirkin Acked-by: Michael S. Tsirkin Cc: Paolo Bonzini Signed-off-by: Nicholas Bellinger --- drivers/vhost/scsi.c | 4 +++-

[PATCH-v4 2/8] vhost/scsi: Fix incorrect early vhost_scsi_handle_vq failures

2015-02-05 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch fixes vhost_scsi_handle_vq() failure cases that result in BUG_ON() getting triggered when vhost_scsi_free_cmd() is called, and ->tvc_se_cmd has not been initialized by target_submit_cmd_map_sgls(). It changes tcm_vhost_release_cmd() to use tcm_vhost_cmd->tvc_n

[PATCH-v4 5/8] vhost/scsi: Add ANY_LAYOUT support in vhost_scsi_handle_vq

2015-02-05 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch adds ANY_LAYOUT compatible support within the existing vhost_scsi_handle_vq() ->handle_kick() callback. It calculates data_direction + exp_data_len for the new tcm_vhost_cmd descriptor by walking both outgoing + incoming iovecs using iov_iter, assuming the lay

[PATCH-v4 3/8] vhost/scsi: Change vhost_scsi_map_to_sgl to accept iov ptr + len

2015-02-05 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch changes vhost_scsi_map_to_sgl() parameters to accept virtio iovec ptr + len when determing pages_nr. This is currently done with iov_num_pages() -> PAGE_ALIGN, so allow the same parameters as well. Cc: Michael S. Tsirkin Cc: Paolo Bonzini Signed-off-by: Nic

[PATCH-v4 8/8] vhost/scsi: Global tcm_vhost -> vhost_scsi rename

2015-02-05 Thread Nicholas A. Bellinger
From: Nicholas Bellinger There is a large amount of code that still references the original 'tcm_vhost' naming conventions, instead of modern 'vhost_scsi'. Go ahead and do a global rename to make the usage consistent. Cc: Michael S. Tsirkin Acked-by: Michael S. Tsirkin Cc: Paolo Bonzini Sign

Re: [patch] vhost/scsi: potential memory corruption

2015-02-06 Thread Nicholas A. Bellinger
On Thu, 2015-02-05 at 10:37 +0300, Dan Carpenter wrote: > This code in vhost_scsi_make_tpg() is confusing because we limit "tpgt" > to UINT_MAX but the data type of "tpg->tport_tpgt" and that is a u16. > > I looked at the context and it turns out that in > vhost_scsi_set_endpoint(), "tpg->tport_tp

<    1   2   3   4