Re: [PATCHv2 2/5] target/user: Add global data block pool support

2017-03-17 Thread Andy Grover
On 03/17/2017 01:04 AM, Xiubo Li wrote: [...] These days what I have gotten is that the unmap_mapping_range() could be used. At the same time I have deep into the mm code and fixed the double usage of the data blocks and possible page fault call trace bugs mentioned above. Following is the V3 p

Re: [PATCHv2 2/5] target/user: Add global data block pool support

2017-03-08 Thread Andy Grover
On 03/08/2017 12:45 AM, lixi...@cmss.chinamobile.com wrote: From: Xiubo Li For each target there will be one ring, when the target number grows larger and larger, it could eventually runs out of the system memories. In this patch for each target ring, the cmd area size will be limited to 8M an

Re: [PATCH] target/user: Fix possible overwrite of t_data_sg's lastiov[]

2017-03-06 Thread Andy Grover
On 03/05/2017 09:48 PM, Xiubo Li wrote: Maybe fix this by exiting aasda() with iov pointing at the next unused iov in the array? May it shouldn't be the aasda()'s duty to increment the iov ptr. Sure, your call. [snip text where we agree current solution allows data block sharing, and new appr

Re: [PATCH] target/user: Fix possible overwrite of t_data_sg's last iov[]

2017-03-03 Thread Andy Grover
On 02/27/2017 09:47 PM, lixi...@cmss.chinamobile.com wrote: From: Xiubo Li If there has BIDI data, its first iov[] will overwrite the last iov[] for se_cmd->t_data_sg. (+CCing orig BIDI and data block code authors) Yeah. It looks like because alloc_and_scatter_data_area() (hereafter "aasda"

how to unmap pages in an anonymous mmap?

2017-02-27 Thread Andy Grover
On 02/26/2017 09:59 PM, Xiubo Li wrote: >> But, We likely don't want to release memory from the data area anyways >> while active, in any case. How about if we set a timer when active >> commands go to zero, and then reduce data area to some minimum if no new >> cmds come in before timer expires? >

Re: [PATCH] target/user: Add daynmic growing data area featuresupport

2017-02-24 Thread Andy Grover
On 02/23/2017 06:07 PM, Xiubo Li wrote: >> Cool. This is a good approach for an initial patch but this raises >> concerns about efficiently managing kernel memory usage -- the data area >> grows but never shrinks, and total possible usage increases per >> backstore. (What if there are 1000?) Any id

Re: [PATCH] target/user: Add daynmic growing data area feature support

2017-02-22 Thread Andy Grover
On 02/17/2017 01:24 AM, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li > > Currently for the TCMU, the ring buffer size is fixed to 64K cmd > area + 1M data area, and this will be bottlenecks for high iops. Hi Xiubo, thanks for your work. daynmic -> dynamic Have you benchmarked this patc

Re: [PATCH RFC] target/user: Add double ring buffers support.

2017-02-14 Thread Andy Grover
On 02/13/2017 09:50 PM, Xiubo Li wrote: > The struct tcmu_cmd_entry {} size is fixed 44 bytes without iovec[], and > the size of struct iovec[N] is about 16 bytes * N. > > The cmd entry size will be [44B, N *16 + 44B], and the data size will be > [0, N * 4096], so the ratio of sizeof(cmd entry): s

Re: [PATCH RFC] target/user: Add double ring buffers support.

2017-02-13 Thread Andy Grover
On 02/13/2017 01:50 AM, Xiubo Li wrote: There is one new scheme in my mind: Yes I think it's now clear we need more buffer space to avoid bottlenecks for high iops. The initial design kept it simple with the 1MB vmalloc'd space but anticipated greater would be needed. It should not be necessar

Re: [PATCH RFC] target/user: Add double ring buffers support.

2017-02-13 Thread Andy Grover
On 02/12/2017 05:38 PM, Xiubo Li wrote: On 2017年02月11日 02:02, Andy Grover wrote: 1. increase the region mmap()ed by userspace, TCMU_RING_SIZE, from 1MB to 1GB or larger 2. Don't vmalloc() the whole thing, instead vmalloc for the cmd ring portion, and dynamically alloc pages for the data ar

Re: [PATCH RFC] target/user: Add double ring buffers support.

2017-02-10 Thread Andy Grover
On 02/09/2017 10:48 PM, lixi...@cmss.chinamobile.com wrote: For now the tcmu is based on UIO framework and only using the map0 with fixed ring buffer size. This will work fine mostly, but when we are using the 10GBASE NIC, the ring buffer is too small to deal with the incoming iscsi cmds. We can

Should queue_max_hw_sectors() always be <= max_dev_sectors?

2016-08-30 Thread Andy Grover
Hi Martin, (you're the last person to touch this? :) If I create a local SCSI device using LIO's loopback fabric, and backed by a file, /sys/block/sda/queue/max_hw_sectors_kb reports 32767. This reflects the loopback scsi_host_template reporting 65536 max_sectors, but that's the "controller" -

Re: [PATCH v3 03/13] iscsi-target: add void (*iscsit_get_rx_pdu)()

2016-08-08 Thread Andy Grover
Hi Varun, On 04/19/2016 11:30 AM, Varun Prakash wrote: Add void (*iscsit_get_rx_pdu)() to struct iscsit_transport, iscsi-target uses this callback to receive and process Rx iSCSI PDUs. cxgbit.ko needs this callback to reuse iscsi-target Rx thread. Signed-off-by: Varun Prakash Acked-by: Sagi G

Re: NVMe over Fabrics target implementation

2016-06-07 Thread Andy Grover
On 06/06/2016 11:23 PM, Nicholas A. Bellinger wrote: Hi HCH & Co, On Mon, 2016-06-06 at 23:22 +0200, Christoph Hellwig wrote: This patch set adds a generic NVMe over Fabrics target. The implementation conforms to the NVMe 1.2b specification (which includes Fabrics) and provides the NVMe over Fa

Re: [PATCH 2/2] target: use new "dbroot" target attribute

2016-04-01 Thread Andy Grover
On 04/01/2016 11:01 AM, Lee Duncan wrote: On 04/01/2016 12:58 AM, Johannes Thumshirn wrote: On 2016-03-31 20:05, Lee Duncan wrote: This commit updates the target core ALUA and PR modules to use the new "dbroot" attribute instead of assuming the target database is in "/var/target". Same goes f

Re: [PATCH 0/2] target: 64-bit LUN support

2015-06-10 Thread Andy Grover
On 06/09/2015 11:41 PM, Hannes Reinecke wrote: Hi Nic, here's now the patchset for making LIO-target support 64-bit LUNs. Pretty straightforward, plus an additional patch to remove the now obsolete limitation on 256 LUNs per TPG. There had been a comment in the header that REPORT LUN emulation w

Re: [RFC PATCH 0/4] Make iSCSI network namespace aware

2015-05-20 Thread Andy Grover
On 05/13/2015 03:12 PM, Chris Leech wrote: This is only about the structures and functionality involved in maintaining the iSCSI session, the SCSI host along with it's discovered targets and devices has no association with network namespaces. These patches are functional, but not complete. Ther

Re: [PATCH 01/12] target: Convert se_node_acl->device_list[] to RCU hlist

2015-05-12 Thread Andy Grover
On 05/12/2015 02:25 AM, Nicholas A. Bellinger wrote: From: Nicholas Bellinger This patch converts se_node_acl->device_list[] table for mappedluns to modern RCU hlist_head usage in order to support an arbitrary number of node_acl lun mappings. This includes changes to core_[enable,disable]_devi

Re: [RFC PATCH 2/2] lpfc: add target hooks

2015-04-14 Thread Andy Grover
On 04/12/2015 07:17 AM, Sebastian Herbszt wrote: Add target hooks. Signed-off-by: Sebastian Herbszt +#ifdef LPFC_TARGET_MODE +#include "lpfc_target_api.h" +#include "lpfc_target_api_base.h" +#endif Hi, great to see new fabrics posted. There are a great many ifdefs like this. Are they stri

Re: [RFC 00/22] target: se_node_acl LUN list RCU conversion

2015-03-30 Thread Andy Grover
On 03/30/2015 12:21 PM, Christoph Hellwig wrote: On Mon, Mar 30, 2015 at 12:16:04PM -0700, Andy Grover wrote: I dug my patches up and rebased on top of target-pending/for-next. Pushed here: git://git.kernel.org/pub/scm/linux/kernel/git/grover/linux.git mar30-dynalloc-deve https

Re: [RFC 00/22] target: se_node_acl LUN list RCU conversion

2015-03-30 Thread Andy Grover
On 03/30/2015 05:08 AM, Christoph Hellwig wrote: Fortunately there is the old patch from Andy to make the se_dev_entry dynamically allocated, which comes in useful here. With that we might only change the rdonly flag on a live dev entry, or assign an ACL when it previously was NULL, something th

Re: [Lsf-pc] [LSF/MM TOPIC] Unifying the LIO and SCST target drivers

2015-03-09 Thread Andy Grover
On 03/06/2015 10:25 PM, Nicholas A. Bellinger wrote: That's what I was getting at above: configfs works great for exactly what we're using it for, but there are other things sysfs does better so we may want to use both. Just posted a small series for allowing fabric drivers to expose this u

Re: [Lsf-pc] [LSF/MM TOPIC] Unifying the LIO and SCST target drivers

2015-03-06 Thread Andy Grover
On 03/05/2015 11:25 PM, Bart Van Assche wrote: On 03/05/15 19:39, Andy Grover wrote: On 03/05/2015 08:06 AM, Bart Van Assche wrote: If we would do what Nic proposed - modify SCST such that it uses configfs instead of sysfs - then that would result in the removal of at least one SCST feature

Re: [Lsf-pc] [LSF/MM TOPIC] Unifying the LIO and SCST target drivers

2015-03-05 Thread Andy Grover
On 03/05/2015 08:06 AM, Bart Van Assche wrote: If we would do what Nic proposed - modify SCST such that it uses configfs instead of sysfs - then that would result in the removal of at least one SCST feature that is important to its users, namely automatic population of the configuration filesyst

Re: [PATCHv2 5/5] scsi: move scsi/sg.h to uapi/linux/sg.h

2015-01-30 Thread Andy Grover
On 01/30/2015 09:28 AM, Douglas Gilbert wrote: At the moment many user space programs in Linux access the SG_IO ioctl related declarations with: #include I suspect that file is maintained by the glib folks (because it does not match the kernel file but is logically equivalent). Now if this

[PATCHv2 1/5] scsi: add WRITE_VERIFY_16 to scsi.h

2015-01-29 Thread Andy Grover
Signed-off-by: Andy Grover --- include/scsi/scsi.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index d0a66aa..cf778fe 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h @@ -150,6 +150,7 @@ enum scsi_timeouts { #define WRITE_16

[PATCHv2 4/5] scsi: Move scsi/scsi_ioctl.h to uapi/linux/scsi_ioctl.h

2015-01-29 Thread Andy Grover
Make all scsi ioctl-related definitions available via a uapi header. Change files referencing scsi/scsi_ioctl.h to refer to uapi/linux/scsi_ioctl.h. Signed-off-by: Andy Grover --- block/bsg.c| 2 +- block/scsi_ioctl.c | 2 +- drivers/block/cciss.c

[PATCHv2 0/5] Move headers to uapi/linux

2015-01-29 Thread Andy Grover
tch adds a missing opcode. Builds with allmodconfig. Thanks for taking a look, and any suggestions for further improvement. Regards -- Andy Andy Grover (5): scsi: add WRITE_VERIFY_16 to scsi.h scsi: Move ioctl defs from scsi/scsi.h to scsi/scsi_ioctl.h scsi: Move user-shareable stuff in scsi

[PATCHv2 3/5] scsi: Move user-shareable stuff in scsi/scsi.h to uapi/linux/scsi.h

2015-01-29 Thread Andy Grover
also includes uapi/scsi/scsi.h so kernel code need not update includes. Signed-off-by: Andy Grover --- include/scsi/scsi.h | 497 + include/uapi/linux/Kbuild | 1 + include/uapi/linux/scsi.h | 506 ++ 3

[PATCHv2 5/5] scsi: move scsi/sg.h to uapi/linux/sg.h

2015-01-29 Thread Andy Grover
This will enable user programs to have access to the most current definitions. Modify include sites for new path. Signed-off-by: Andy Grover --- block/bio.c| 2 +- block/blk-map.c| 2 +- block/bsg.c| 2 +- block/scsi_ioctl.c

[PATCHv2 2/5] scsi: Move ioctl defs from scsi/scsi.h to scsi/scsi_ioctl.h

2015-01-29 Thread Andy Grover
These can be consolidated into scsi_ioctl.h with the other ones. Signed-off-by: Andy Grover --- include/scsi/scsi.h | 21 - include/scsi/scsi_ioctl.h | 20 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/include/scsi/scsi.h b

Re: old linux scsi headers

2015-01-27 Thread Andy Grover
On 01/10/2015 02:10 AM, Christoph Hellwig wrote: On Fri, Jan 09, 2015 at 09:38:50AM -0800, Andy Grover wrote: Hello glibc people, This concerns sysdeps/unix/sysv/linux/scsi/{scsi, scsi_ioctl, sg}.h They define common SCSI values, as well as Linux's SCSI-related ioctls. Apparently they

Re: tcmu-runner (target userspace passthrough daemon) development

2015-01-21 Thread Andy Grover
On 01/20/2015 04:35 PM, Nicholas A. Bellinger wrote: As a proof-of-concept, I've implemented a Gluster backend handler. I'm looking for code review and collaborators, as well as suggestions on what other userspace handlers we might want to work on. Tape or optical jukebox emulation? VMDK files??

tcmu-runner (target userspace passthrough daemon) development

2015-01-20 Thread Andy Grover
Hi all, tcmu-runner is a userspace daemon that simplifies the configuration and processing of SCSI commands from LIO to userspace handlers, via the new TCMU userspace passthrough backstore. https://github.com/agrover/tcmu-runner As a proof-of-concept, I've implemented a Gluster backend handl

old linux scsi headers

2015-01-09 Thread Andy Grover
Hello glibc people, This concerns sysdeps/unix/sysv/linux/scsi/{scsi, scsi_ioctl, sg}.h They define common SCSI values, as well as Linux's SCSI-related ioctls. Apparently they were copied from the Linux kernel tree back in 1999, so they're pretty stale. I'm wondering if I should submit a pat

Re: [LSF/MM ATTEND] iSCSI/iSER MQ + EXTENDED_COPY host support

2015-01-08 Thread Andy Grover
On 01/08/2015 03:11 PM, Douglas Gilbert wrote: Andy, XCOPY is huge and keeps getting bigger (apart from the recent trimming of the "LID1" generation mentioned above). Most SCSI commands are sent to the LU involved, but for EXTENDED COPY command itself, should it be sent to the source or destinati

Re: [PATCH 3/3] scsi: Remove scsi_ioctl.h

2015-01-08 Thread Andy Grover
On 01/08/2015 12:35 PM, James Bottomley wrote: On Thu, 2015-01-08 at 11:47 -0800, Andy Grover wrote: Now that we have uapi/scsi/scsi.h, that is the logical place for SCSI ioctl definitions to go. The kernel-specific stuff that remains is so little that it can be folded into scsi/scsi.h, and

[PATCH 0/3] Add uapi/scsi/scsi.h

2015-01-08 Thread Andy Grover
ing opcode. Builds with allmodconfig. Thanks -- Andy Andy Grover (3): scsi: add WRITE_VERIFY_16 to scsi.h scsi: Move user-shareable stuff in scsi/scsi.h to uapi/scsi/scsi.h scsi: Remove scsi_ioctl.h block/bsg.c| 1 - block/scsi_ioctl.c | 1 - dri

[PATCH 3/3] scsi: Remove scsi_ioctl.h

2015-01-08 Thread Andy Grover
for ide-floppy_ioctl.c where we just replace it with including scsi/scsi.h. Signed-off-by: Andy Grover --- block/bsg.c| 1 - block/scsi_ioctl.c | 1 - drivers/block/cciss.c | 1 - drivers/block/pktcdvd.c| 1 - drivers/ide/ide

[PATCH 1/3] scsi: add WRITE_VERIFY_16 to scsi.h

2015-01-08 Thread Andy Grover
Signed-off-by: Andy Grover --- include/scsi/scsi.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 8a7f8ad..faf2118 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h @@ -150,6 +150,7 @@ enum scsi_timeouts { #define WRITE_16

[PATCH 2/3] scsi: Move user-shareable stuff in scsi/scsi.h to uapi/scsi/scsi.h

2015-01-08 Thread Andy Grover
A great many SCSI codes and ioctl values can be made available to userspace in a uapi header, while the kernel-only definitions stay in scsi/scsi.h. scsi/scsi.h also includes uapi/scsi/scsi.h so kernel code need not update includes. Signed-off-by: Andy Grover --- include/scsi/scsi.h | 522

Re: [LSF/MM ATTEND] iSCSI/iSER MQ + EXTENDED_COPY host support

2015-01-08 Thread Andy Grover
On 01/07/2015 02:11 PM, Douglas Gilbert wrote: T10 have now dropped the LID1 and LID4 stuff (its the length of the LIST IDENTIFIER field: 1 byte or 4 bytes) by obsoleting all LID1 variants in SPC-5 revision 01. So the LID1 variants are now gone and the LID4 appendage is dropped from the remaining

Re: [PATCH 3/3] target: Change some fabric functions to return bool

2014-11-17 Thread Andy Grover
On 11/13/2014 11:06 PM, Christoph Hellwig wrote: On Thu, Nov 13, 2014 at 12:50:58PM -0800, Andy Grover wrote: The tpg_check_* functions in the fabric_ops struct return 1 or 0, so we can make their return type bool. Change fabrics to match. All these true/false stub sounds like some of them

[PATCH 2/3] target: Remove TRANSPORT_LUNFLAGS_NO_ACCESS

2014-11-13 Thread Andy Grover
Only used as a param to core_disable_device_list_for_node(), but that function doesn't use it. Change function signature to remove that param, and change all callsites to not pass LUNFLAGS_NO_ACCESS. Signed-off-by: Andy Grover --- drivers/target/target_core_device.c | 8 +++- dr

[PATCH 3/3] target: Change some fabric functions to return bool

2014-11-13 Thread Andy Grover
The tpg_check_* functions in the fabric_ops struct return 1 or 0, so we can make their return type bool. Change fabrics to match. Signed-off-by: Andy Grover --- drivers/infiniband/ulp/srpt/ib_srpt.c| 8 drivers/scsi/qla2xxx/tcm_qla2xxx.c | 10 +- drivers

[PATCH 1/3] target: Remove TRANSPORT_LUNFLAGS_READ_WRITE

2014-11-13 Thread Andy Grover
LUNFLAGS_READ_WRITE is always the inverse of LUNFLAGS_READ_ONLY. Removing this enum value resulted in some spots where a parameter's value can be just true or false, which we can represent with a bool instead of u32. Change to a bool named "lun_access_ro". Signed-off-

Re: [PATCH v4 10/25] virtio: add API to enable VQs early

2014-11-10 Thread Andy Grover
On 10/13/2014 12:50 AM, Michael S. Tsirkin wrote: virtio spec 0.9.X requires DRIVER_OK to be set before VQs are used, but some drivers use VQs before probe function returns. Since DRIVER_OK is set after probe, this violates the spec. Even though under virtio 1.0 transitional devices support this

[PATCHv2 4/4] target: Add a user-passthrough backstore

2014-10-01 Thread Andy Grover
* The use of idrs may be overkill -- we maybe can replace them with a simple counter to generate cmd_ids, and a hash table to get a cmd_id's associated pointer. * Use of a free-running counter for cmd ring instead of explicit modulo math. This would require power-of-2 cmd ring siz

[PATCHv2 1/4] target: Remove unneeded check in sbc_parse_cdb

2014-10-01 Thread Andy Grover
The check of SCF_SCSI_DATA_CDB seems to be a remnant from before hch's refactoring of this function. There are no places where that flag is set that cmd->execute_cmd isn't also set. Signed-off-by: Andy Grover --- drivers/target/target_core_sbc.c | 2 +- 1 file changed, 1 in

[PATCHv2 3/4] target: Add documentation on the target userspace pass-through driver

2014-10-01 Thread Andy Grover
Describes the driver and its interface to make it possible for user programs to back a LIO-exported LUN. Thanks to Richard W. M. Jones for review, and supplementing this doc with the first two paragraphs. Signed-off-by: Andy Grover --- Documentation/target/tcmu-design.txt | 378

[PATCHv2 2/4] uio: Export definition of struct uio_device

2014-10-01 Thread Andy Grover
In order to prevent a O(n) search of the filesystem to link up its uio node with its target configuration, TCMU needs to know the minor number that UIO assigned. Expose the definition of this struct so TCMU can access this field. Signed-off-by: Andy Grover --- drivers/uio/uio.c | 12

[PATCHv2 0/4] Userspace Passthrough backstore for LIO

2014-10-01 Thread Andy Grover
le if device is unconfigured in tcmu_free_device Thanks -- Andy Andy Grover (4): target: Remove unneeded check in sbc_parse_cdb uio: Export definition of struct uio_device target: Add documentation on the target userspace pass-through driver target: Add a user-passthrough backstore Docum

Re: targetcli do not show iscsi

2014-09-30 Thread Andy Grover
On 09/30/2014 02:45 AM, Jerome Martin wrote: On 09/30/2014 11:41 AM, Luigi Tarenga wrote: On 09/30/2014 11:28 AM, Jerome Martin wrote: Luigi, Out of curiosity, does it work as expected with the stock fedora packaged kernel ? Best, -- Jerome didn't test that configuration and since I can

Re: [PATCHv3 0/8] target: Save memory on unused se_dev_entrys and se_luns

2014-09-23 Thread Andy Grover
On 09/18/2014 04:17 PM, Nicholas A. Bellinger wrote: I'm currently reviewing #2, #4, #5 and #7 and will consider merging these. These cleanups account for most of the LOC reduction, and avoid most of the larger concerns. Also for patches like this, they really need testing on your end before I

Re: [PATCH 4/4] target: Add a user-passthrough backstore

2014-09-22 Thread Andy Grover
On 09/22/2014 01:58 PM, Nicholas A. Bellinger wrote: So I'd still like to start for an initial merge with the two different modes mentioned earlier. The pure-passthrough mode where everything is handled by user-space, and an I/O passthrough mode where only SCF_SCSI_DATA_CDB is passed along to us

Re: [PATCH 4/4] target: Add a user-passthrough backstore

2014-09-19 Thread Andy Grover
On 09/19/2014 04:51 PM, Alex Elsayed wrote: Not sure I follow.. How does the proposed passthrough mode prevent someone from emulating OSDs, media changers, optical disks or anything else in userspace with TCMU..? The main thing that the above comments highlight is why attempting to combine the

Re: [PATCHv3 0/8] target: Save memory on unused se_dev_entrys and se_luns

2014-09-18 Thread Andy Grover
On 09/18/2014 12:38 AM, Nicholas A. Bellinger wrote: On Sat, 2014-09-13 at 21:55 +0200, Christoph Hellwig wrote: ping again. We're getting closer to the end of the 3.18 merge window and there still hasn't been a response. Should Andy just send the patches directly to Linus once 3.18 opens give

[PATCH 0/4] Userspace Passthrough backstore for LIO

2014-09-15 Thread Andy Grover
lly is hindered until the kernel code is accepted :) Changes since version 2: * Incorporate doc improvements from Richard W. M. Jones * Correct off-by-1 error in tcmu_get_blocks * execute_rw must be set in the sbc_ops passed to sbc_parse_cdb Thanks -- Andy Andy Grover (4): target: Remove un

[PATCH 3/4] target: Add documentation on the target userspace pass-through driver

2014-09-15 Thread Andy Grover
Describes the driver and its interface to make it possible for user programs to back a LIO-exported LUN. Thanks to Richard W. M. Jones for review, and supplementing this doc with the first two paragraphs. Signed-off-by: Andy Grover --- Documentation/target/tcmu-design.txt | 239

[PATCH 2/4] uio: Export definition of struct uio_device

2014-09-15 Thread Andy Grover
In order to prevent a O(n) search of the filesystem to link up its uio node with its target configuration, TCMU needs to know the minor number that UIO assigned. Expose the definition of this struct so TCMU can access this field. Signed-off-by: Andy Grover --- drivers/uio/uio.c | 12

[PATCH 1/4] target: Remove unneeded check in sbc_parse_cdb

2014-09-15 Thread Andy Grover
The check of SCF_SCSI_DATA_CDB seems to be a remnant from before hch's refactoring of this function. There are no places where that flag is set that cmd->execute_cmd isn't also set. Signed-off-by: Andy Grover --- drivers/target/target_core_sbc.c | 2 +- 1 file changed, 1 in

[PATCH 4/4] target: Add a user-passthrough backstore

2014-09-15 Thread Andy Grover
* The use of idrs may be overkill -- we maybe can replace them with a simple counter to generate cmd_ids, and a hash table to get a cmd_id's associated pointer. * Use of a free-running counter for cmd ring instead of explicit modulo math. This would require power-of-2 cmd ring siz

Re: [RFC 1/2] target: Add documentation on the target userspace pass-through driver

2014-09-02 Thread Andy Grover
On 08/31/2014 02:22 PM, Richard W.M. Jones wrote: Reading this several times, I now think I get what it's trying to say, but I think it needs to introduces the terms (as the Economist style does). Something like this: "TCM is the new name for LIO, an in-kernel iSCSI target (server). Exist

Re: [RFC 1/2] target: Add documentation on the target userspace pass-through driver

2014-08-31 Thread Andy Grover
On 08/30/2014 10:35 AM, Richard W.M. Jones wrote: On Tue, Jul 01, 2014 at 12:11:14PM -0700, Andy Grover wrote: Describes the driver and its interface to make it possible for user programs to back a LIO-exported LUN. Signed-off-by: Andy Grover --- Documentation/target/tcmu-design.txt | 210

Re: [PATCHv3 0/8] target: Save memory on unused se_dev_entrys and se_luns

2014-08-22 Thread Andy Grover
On 07/29/2014 06:15 AM, Christoph Hellwig wrote: Nic, any progress on looking over these? Seems like there's actually nothing at all queued up for 3.17 in the target tree, or am І missing something? ping? -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of

[RFCv2 3/4] target: Add a user-passthrough backstore

2014-08-20 Thread Andy Grover
rintks in code, still. Signed-off-by: Andy Grover --- drivers/target/Kconfig |5 + drivers/target/Makefile|1 + drivers/target/target_core_transport.c |4 + drivers/target/target_core_user.c | 1158 include/uapi/li

[RFCv2 4/4] target: Add documentation on the target userspace pass-through driver

2014-08-20 Thread Andy Grover
Describes the driver and its interface to make it possible for user programs to back a LIO-exported LUN. Signed-off-by: Andy Grover --- Documentation/target/tcmu-design.txt | 229 +++ 1 file changed, 229 insertions(+) create mode 100644 Documentation/target/tcmu

[RFCv2 0/4] Userspace pass-through storage engine (backend)

2014-08-20 Thread Andy Grover
s/userback, create a user storage object and give it a size, and 'file/foo.img' as config parameter * Start tcmu-runner (manually for now) * Create a loopback fabric and link the above storage object to it Andy Grover (4): target: Remove unneeded check in sbc_parse_cdb uio: Export d

[RFCv2 2/4] uio: Export definition of struct uio_device

2014-08-20 Thread Andy Grover
In order to prevent a O(n) search of the filesystem to link up its uio node with its target configuration, TCMU needs to know the minor number that UIO assigned. Expose the definition of this struct so TCMU can access this field. Signed-off-by: Andy Grover --- drivers/uio/uio.c | 12

[RFCv2 1/4] target: Remove unneeded check in sbc_parse_cdb

2014-08-20 Thread Andy Grover
The check of SCF_SCSI_DATA_CDB seems to be a remnant from before hch's refactoring of this function. There are no places where that flag is set that cmd->execute_cmd isn't also set. Signed-off-by: Andy Grover --- drivers/target/target_core_sbc.c | 2 +- 1 file changed, 1 in

Re: [RFC 1/2] target: Add documentation on the target userspace pass-through driver

2014-07-08 Thread Andy Grover
[re-adding individual CCs that were dropped] On 07/05/2014 04:29 AM, Alex Elsayed wrote: +Device Discovery: + +Other devices may be using UIO besides TCMU. Unrelated user processes +may also be handling different sets of TCMU devices. TCMU userspace +processes must find their devices by scanning

Re: [RFC 0/2] target: userspace pass-through backend

2014-07-07 Thread Andy Grover
Hi, here's some additional beginning bits for the configuration and use of this code: Changes to targetcli-fb and rtslib-fb: https://github.com/agrover/targetcli-fb/tree/userback https://github.com/agrover/rtslib-fb/tree/userback An incredibly-crappy stand-in for the user process that will han

[RFC 2/2] target: Add a user-passthrough backstore

2014-07-01 Thread Andy Grover
rintks in code, still. Signed-off-by: Andy Grover --- drivers/target/Kconfig |5 + drivers/target/Makefile|1 + drivers/target/target_core_transport.c |4 + drivers/target/target_core_user.c | 1078 drivers/target/

[RFC 1/2] target: Add documentation on the target userspace pass-through driver

2014-07-01 Thread Andy Grover
Describes the driver and its interface to make it possible for user programs to back a LIO-exported LUN. Signed-off-by: Andy Grover --- Documentation/target/tcmu-design.txt | 210 +++ 1 file changed, 210 insertions(+) create mode 100644 Documentation/target/tcmu

[RFC 0/2] target: userspace pass-through backend

2014-07-01 Thread Andy Grover
is the actual code, along with implementation rationale. Thanks -- Andy [1] http://thread.gmane.org/gmane.linux.scsi.target.devel/5044 Andy Grover (2): target: Add documentation on the target userspace pass-through driver target: Add a user-passthrough backstore Documentation/target/tcmu

[PATCHv3 9/8] target: Fix return with spinlock held in scsi3_ua_check()

2014-07-01 Thread Andy Grover
Reported-by: Maurizio Lombardi Signed-off-by: Andy Grover --- Hi Maurizio, yup, thanks! Here's a patch that fixes the issue - it can be applied as 9/8 or alternatively squashed into 1/8. Thanks again -- Regards -- Andy drivers/target/target_core_ua.c | 4 +++- 1 file changed, 3 inser

[PATCHv3 3/8] target: Allocate se_dev_entrys in device list only when used

2014-06-30 Thread Andy Grover
ons referencing deve inside the spinlock, since it's not safe to access deve outside it. Skip reinitializing, since the deve is actually being freed. Do not allocate device_list array separately, but include it in se_node_acl. Signed-off-by: Andy Grover --- drivers/target/target_core_

[PATCHv3 2/8] target: Don't unlock/relock tpg_lun_lock in loop in add_node_to_devs

2014-06-30 Thread Andy Grover
hange the other place enable_device_list_for_node is called, add_initiator_node_lun_acl. Hold tpg_lun_lock across all uses of lun. Change error handling to release lock from error paths. Remove core_dev_get_lun. Signed-off-by: Andy Grover --- drivers/target/target_core_devi

[PATCHv3 4/8] target: core_tpg_post_dellun can return void

2014-06-30 Thread Andy Grover
Nothing in it can raise an error. Reviewed-by: Christoph Hellwig Signed-off-by: Andy Grover --- drivers/target/target_core_internal.h | 2 +- drivers/target/target_core_tpg.c | 5 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/target/target_core_internal.h b

[PATCHv3 0/8] target: Save memory on unused se_dev_entrys and se_luns

2014-06-30 Thread Andy Grover
hanks -- Regards -- Andy Andy Grover (8): target: Add locking to some accesses to nacl.device_list target: Don't unlock/relock tpg_lun_lock in loop in add_node_to_devs target: Allocate se_dev_entrys in device list only when used target: core_tpg_post_dellun can return void targ

[PATCHv3 5/8] target: Change core_dev_del_lun to take a se_lun instead of unpacked_lun

2014-06-30 Thread Andy Grover
igned-off-by: Andy Grover --- drivers/target/target_core_device.c | 18 -- drivers/target/target_core_fabric_configfs.c | 2 +- drivers/target/target_core_internal.h| 5 ++-- drivers/target/target_core_tpg.c | 36 +++- 4 files ch

[PATCHv3 1/8] target: Add locking to some accesses to nacl.device_list

2014-06-30 Thread Andy Grover
Make sure all accesses of deve elements in device_list are protected. This will become critically important once device_list entries are potentially NULL. Reported-by: Christoph Hellwig Signed-off-by: Andy Grover --- drivers/target/target_core_device.c | 7 ++--- drivers/target

[PATCHv3 7/8] target: Remove core_tpg_release_virtual_lun0 function

2014-06-30 Thread Andy Grover
Simple and just called from one place. Reviewed-by: Christoph Hellwig Signed-off-by: Andy Grover --- drivers/target/target_core_tpg.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index a63a3d7

[PATCHv3 6/8] target: Allocate se_luns only when used

2014-06-30 Thread Andy Grover
_list, put it directly in se_portal_group. Reviewed-by: Christoph Hellwig Signed-off-by: Andy Grover --- drivers/target/sbp/sbp_target.c | 6 +- drivers/target/target_core_device.c | 43 ++-- drivers/target/target_core_fabric_configfs.c | 21 +++--- drivers/t

[PATCHv3 8/8] target: Refactor core_enable_device_list_for_node

2014-06-30 Thread Andy Grover
Create helper functions to alloc a deve and to transition it from demo mode to explicit. Signed-off-by: Andy Grover --- drivers/target/target_core_device.c | 121 ++-- 1 file changed, 74 insertions(+), 47 deletions(-) diff --git a/drivers/target

[PATCH RESEND] target: Fix a comment in emulate_evpd_86

2014-06-23 Thread Andy Grover
Fix comment to make it clear that check_dev_wce can return true if emulation is in use, but also if it's *not* emulated but the underlying device supports it. Reviewed-by: Chris Leech Signed-off-by: Andy Grover --- drivers/target/target_core_spc.c | 2 +- 1 file changed, 1 insertion(

[PATCHv2 RESENDv2 8/9] target: Remove core_tpg_release_virtual_lun0 function

2014-06-23 Thread Andy Grover
Simple and just called from one place. Signed-off-by: Andy Grover --- drivers/target/target_core_tpg.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index a63a3d7..bc0299a 100644 --- a/drivers

[PATCHv2 RESENDv2 0/9] target: Save memory on unused se_dev_entrys and se_luns

2014-06-23 Thread Andy Grover
Hi nab, hch, and all, This patchset reduces the amount of memory for se_dev_entry and se_lun arrays by waiting to allocate array members until they are created. This patch saves up to 261KB per TPG, and up to 65KB per ACL. It also fixes a number of locking bugs around these data structures. Andy

[PATCHv2 RESENDv2 2/9] target: Don't unlock/relock tpg_lun_lock in loop in add_node_to_devs

2014-06-23 Thread Andy Grover
hange the other place enable_device_list_for_node is called, add_initiator_node_lun_acl. Hold tpg_lun_lock across all uses of lun. Change error handling to release lock from error paths. Remove core_dev_get_lun. Signed-off-by: Andy Grover --- drivers/target/target_core_devi

[PATCHv2 RESENDv2 7/9] target: Allocate se_luns only when used

2014-06-23 Thread Andy Grover
_list, put it directly in se_portal_group. Signed-off-by: Andy Grover --- drivers/target/sbp/sbp_target.c | 6 +- drivers/target/target_core_device.c | 43 ++-- drivers/target/target_core_fabric_configfs.c | 21 +++--- drivers/target/target_core_internal.h

[PATCHv2 RESENDv2 9/9] target: Refactor core_enable_device_list_for_node

2014-06-23 Thread Andy Grover
Create helper functions to alloc a deve and to transition it from demo mode to explicit. Signed-off-by: Andy Grover --- drivers/target/target_core_device.c | 121 ++-- 1 file changed, 74 insertions(+), 47 deletions(-) diff --git a/drivers/target

[PATCHv2 RESENDv2 1/9] target: Add locking to some accesses to nacl.device_list

2014-06-23 Thread Andy Grover
Make sure all accesses of deve elements in device_list are protected. This will become critically important once device_list entries are potentially NULL. Reported-by: Christoph Hellwig Signed-off-by: Andy Grover --- drivers/target/target_core_device.c | 7 ++--- drivers/target

[PATCHv2 RESENDv2 4/9] target: core_tpg_post_dellun can return void

2014-06-23 Thread Andy Grover
Nothing in it can raise an error. Signed-off-by: Andy Grover --- drivers/target/target_core_internal.h | 2 +- drivers/target/target_core_tpg.c | 5 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/target/target_core_internal.h b/drivers/target

[PATCHv2 RESENDv2 5/9] target: Change core_dev_del_lun to take a se_lun instead of unpacked_lun

2014-06-23 Thread Andy Grover
Remove core_tpg_pre_dellun entirely, since we don't need to get/check a pointer we already have. Nothing else can return an error, so core_dev_del_lun can return void. Signed-off-by: Andy Grover --- drivers/target/target_core_device.c | 18 +--- drivers/t

[PATCHv2 RESENDv2 3/9] target: Allocate se_dev_entrys in device list only when used

2014-06-23 Thread Andy Grover
ons referencing deve inside the spinlock, since it's not safe to access deve outside it. Skip reinitializing, since the deve is actually being freed. Do not allocate device_list array separately, but include it in se_node_acl. Signed-off-by: Andy Grover --- drivers/target/target_core_

[PATCHv2 RESENDv2 6/9] target: Rename core_tpg_post_dellun to remove_lun

2014-06-23 Thread Andy Grover
A clearer name, now that pre_dellun is gone. Signed-off-by: Andy Grover --- drivers/target/target_core_device.c | 2 +- drivers/target/target_core_internal.h | 2 +- drivers/target/target_core_tpg.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/target

Re: [PATCH 1/2] target: Don't allow setting WC emulation if device doesn't support

2014-05-14 Thread Andy Grover
On 05/14/2014 05:57 PM, Nicholas A. Bellinger wrote: On Wed, 2014-05-14 at 17:22 -0700, Andy Grover wrote: On 05/14/2014 05:07 PM, Nicholas A. Bellinger wrote: On Wed, 2014-05-14 at 15:48 -0700, Andy Grover wrote: Just like for pSCSI, if the transport sets get_write_cache, then it is not

Re: [PATCH] block: Export REQ_FLUSH status via sysfs

2014-05-14 Thread Andy Grover
On 05/14/2014 05:11 PM, Nicholas A. Bellinger wrote: On Wed, 2014-05-14 at 15:51 -0700, Andy Grover wrote: Whether this is set or not is important for whether good performance is possible, when using the block device as a backstore for the kernel target. Exposing this will let kernel target

Re: [PATCH 1/2] target: Don't allow setting WC emulation if device doesn't support

2014-05-14 Thread Andy Grover
On 05/14/2014 05:07 PM, Nicholas A. Bellinger wrote: On Wed, 2014-05-14 at 15:48 -0700, Andy Grover wrote: Just like for pSCSI, if the transport sets get_write_cache, then it is not valid to enable write cache emulation for it. Return an error. see https://bugzilla.redhat.com/show_bug.cgi?id

[PATCH] block: Export REQ_FLUSH status via sysfs

2014-05-14 Thread Andy Grover
Signed-off-by: Andy Grover --- block/genhd.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/block/genhd.c b/block/genhd.c index 791f419..258fadc 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -958,6 +958,14 @@ static ssize_t disk_capability_show(struct device *dev

  1   2   3   >