[PATCH 02/15] target: fix isid copying and comparision

2018-07-15 Thread Mike Christie
s use hex2bin to when converting from the hex sting to the bin value. Signed-off-by: Mike Christie --- drivers/target/target_core_pr.c| 20 drivers/target/target_core_transport.c | 3 ++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/drivers/t

[PATCH 08/15] target: add session removal function

2018-07-15 Thread Mike Christie
tup/remove session functions and we let it to continue to go wild with it calling the lower level functions directly. Signed-off-by: Mike Christie --- drivers/infiniband/ulp/srpt/ib_srpt.c| 3 +-- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 3 +-- drivers/scsi/qla2xxx/tcm_qla2xxx.c

[PATCH 01/15] configfs: fix registered group removal

2018-07-15 Thread Mike Christie
unregistration. Sorry if you are getting this multiple times. I thouhgt I sent this to some of you and lkml, but I do not see it. Signed-off-by: Mike Christie Cc: Christoph Hellwig Cc: Joel Becker --- fs/configfs/dir.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/fs/configfs/dir.c b/fs

[PATCH 07/15] target: rename target_alloc_session

2018-07-15 Thread Mike Christie
then add a remove function to match the setup in this one, so it should make sense for all drivers, except iscsi, to just call those 2 functions to setup and remove a session. iscsi will continue to be the odd driver. Signed-off-by: Mike Christie --- drivers/infiniband/ulp/srpt/ib_srpt.c| 6

[RFC PATCH 00/15] target: export session info

2018-07-15 Thread Mike Christie
Currently, session info is in 3 places: 1. iscsi has the info file under initiator acls. 2. In the tpg dir iscsi and qla have the dynamic sessions. 3. Some lun stat files return some initiator info. The problem with these is for: 1 and 3 - They only display 1 session's info per target port. In

[PATCH 04/15] target/iscsi: move session_index to common se_session

2018-07-15 Thread Mike Christie
The next patches will make session$SID dir for each session so move the iscsi session session_index to the se_session. This differs from the previous code in that it now uses idr_alloc_cyclic to help prevent apps from confusing a reused sid with a previous session. Signed-off-by: Mike Christie

[PATCH 03/15] target: fix __transport_register_session locking

2018-07-15 Thread Mike Christie
save/restore call. Signed-off-by: Mike Christie --- drivers/target/target_core_transport.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 6324743..75ddbbb 100644 --- a/drivers/target

[PATCH 1/1] tcmu: Don't pass KERN_ERR to pr_err

2018-06-26 Thread Mike Christie
Fix warning: smatch warnings: drivers/target/target_core_user.c:301 tcmu_genl_cmd_done() warn: KERN_* level not at start of string Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/target

[PATCH 4/6] tcmu: misc nl code cleanup

2018-06-22 Thread Mike Christie
Some misc cleanup of the nl rework patches. 1. Fix space instead of tabs use and extra newline. 2. Drop initializing variables to 0 when not needed 3. Just pass the skb_buff and msg_header pointers to tcmu_netlink_event_send. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c

[PATCH 5/6] tcmu: add module wide block/reset_netlink support

2018-06-22 Thread Mike Christie
the kernel and then reopen the netlink socket and unblock it to allow new requests. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 100 -- 1 file changed, 97 insertions(+), 3 deletions(-) diff --git a/drivers/target/target_core_user.c

tcmu: fix hung netlink requests and nl related cleanup V2

2018-06-22 Thread Mike Christie
The following patches fix the issues where the userspace daemon has crashed and left netlink requests dangling. The daemon can now block the interface, kill outstanding requests, reopen the netlink socket and then unblock and execute new requests. The patches were made over Martin's for-next branc

[PATCH 3/6] tcmu: simplify nl interface

2018-06-22 Thread Mike Christie
/remove is still executing does not make sense. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 73a5768

[PATCH 6/6] target: remove target_find_device

2018-06-22 Thread Mike Christie
target_find_device is no longer used, so remove it. Signed-off-by: Mike Christie --- drivers/target/target_core_device.c | 24 include/target/target_core_backend.h | 2 -- 2 files changed, 26 deletions(-) diff --git a/drivers/target/target_core_device.c b/drivers

[PATCH 2/6] tcmu: track nl commands

2018-06-22 Thread Mike Christie
The next patch is going to fix the hung nl command issue so this adds a list of outstanding nl commands that we can later abort when the daemon is restarted. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 68 ++- 1 file changed, 39

[PATCH 1/6] tcmu: delete unused __wait

2018-06-22 Thread Mike Christie
When this code change this was never cleaned up. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index e4a76f9..898a561 100644 --- a/drivers/target

Re: [PATCH 3/3] tcmu: add module wide block/reset_netlink support

2018-06-21 Thread Mike Christie
On 06/21/2018 10:52 PM, Mike Christie wrote: > +static int tcmu_set_block_netlink(const char *str, > + const struct kernel_param *kp) > +{ > + int ret; > + u8 val; > + > + ret = kstrtou8(str, 0, &val); > + if (ret <

[PATCH 2/3] tcmu: track nl commands

2018-06-21 Thread Mike Christie
The next patch is going to fix the hung nl command issue so this adds a list of outstanding nl commands that we can later abort when the daemon is restarted. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 68 ++- 1 file changed, 39

[PATCH 1/3] tcmu: delete unused __wait

2018-06-21 Thread Mike Christie
When this code change this was never cleaned up. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index e4a76f9..898a561 100644 --- a/drivers/target

[PATCH 3/3] tcmu: add module wide block/reset_netlink support

2018-06-21 Thread Mike Christie
the kernel and then reopen the netlink socket and unblock it to allow new requests. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 115 +++--- 1 file changed, 107 insertions(+), 8 deletions(-) diff --git a/drivers/target/target_core_user.c

[PATCH 0/3] tcmu: fix hung netlink requests during restarts

2018-06-21 Thread Mike Christie
The following patches fix the issues where the userspace daemon has crashed and left netlink requests dangling. The daemon can block the interface, kill outstanding requests, reopen the netlink socket and then unblock and execute new requests. The patches were made over Martin's for-next branch.

Re: [PATCH 01/33] TCMU PR: first commit to implement TCMU PR

2018-06-16 Thread Mike Christie
On 06/16/2018 02:20 PM, Mike Christie wrote: > Adding Bodo who is working on a alternative approach. > > On 06/16/2018 12:22 AM, Christoph Hellwig wrote: >> > On Sat, Jun 16, 2018 at 02:23:10AM +0800, Zhu Lingshan wrote: >>> >> These commits and the followi

Re: [PATCH 01/33] TCMU PR: first commit to implement TCMU PR

2018-06-16 Thread Mike Christie
Adding Bodo who is working on a alternative approach. On 06/16/2018 12:22 AM, Christoph Hellwig wrote: > On Sat, Jun 16, 2018 at 02:23:10AM +0800, Zhu Lingshan wrote: >> These commits and the following intend to implement Persistent >> Reservation operations for TCMU devices. > > Err, hell no. >

Re: [PATCH] tcmu: remove useless code and clean up the code style.

2018-06-07 Thread Mike Christie
fo, int > completed_cmd) > > spin_unlock(&udev->nl_cmd_lock); > if (!is_removed) > - target_undepend_item(&dev->dev_group.cg_item); > + target_undepend_item(&dev->dev_group.cg_item); > if (!ret) > complete(&nl_cmd->complete); > return ret; > Acked-by: Mike Christie

Re: [PATCH v2] target: transport should allow st ILI reads

2018-05-10 Thread Mike Christie
On 05/10/2018 01:51 PM, Mike Christie wrote: > On 05/09/2018 03:59 PM, Lee Duncan wrote: >> When a tape drive is exported via LIO using the >> pscsi module, a read that requests more bytes per block >> than the tape can supply returns an empty buffer. This >> is bec

Re: [PATCH v2] target: transport should allow st ILI reads

2018-05-10 Thread Mike Christie
On 05/09/2018 03:59 PM, Lee Duncan wrote: > When a tape drive is exported via LIO using the > pscsi module, a read that requests more bytes per block > than the tape can supply returns an empty buffer. This > is because the pscsi pass-through target module sees > the "ILI" illegal length bit set an

Re: [RESEND] tcmu: fix error resetting qfull_time_out to default

2018-05-10 Thread Mike Christie
; config_item *item, > > if (val >= 0) { > udev->qfull_time_out = val * MSEC_PER_SEC; > + } else if (val == -1) { > + udev->qfull_time_out = val; > } else { > printk(KERN_ERR "Invalid qfull timeout value %d\n", val); > return -EINVAL; > Look ok. Acked-by: Mike Christie

Re: [PATCH v2] target/file: add support of direct and async I/O

2018-05-08 Thread Mike Christie
> > No problem queuing it up if I get an ACK from Christoph or Mike. > I think Christoph Ackd it here https://www.spinics.net/lists/target-devel/msg16575.html It also seems ok to me. Reviewed-by: Mike Christie

Re: [PATCHv4 1/3] target/configfs: add module wide action support

2018-05-03 Thread Mike Christie
On 05/02/2018 08:03 PM, Xiubo Li wrote: > On 2018/5/3 2:27, Mike Christie wrote: >> On 04/19/2018 02:46 AM, xiu...@redhat.com wrote: >>> From: Xiubo Li >>> >>> For some case we need some module wide configfs to contol some >>> attributes of the whole

Re: [PATCHv4 3/3] tcmu: add module wide action/reset_netlink support

2018-05-02 Thread Mike Christie
On 04/19/2018 02:46 AM, xiu...@redhat.com wrote: > @@ -1572,13 +1579,16 @@ static int tcmu_wait_genl_cmd_reply(struct tcmu_dev > *udev) > if (udev->nl_reply_supported <= 0) > return 0; > > + spin_lock(&udev->nl_cmd_lock); > + nl_cmd->waiter++; I think this will allow

Re: [PATCHv4 1/3] target/configfs: add module wide action support

2018-05-02 Thread Mike Christie
On 04/19/2018 02:46 AM, xiu...@redhat.com wrote: > From: Xiubo Li > > For some case we need some module wide configfs to contol some > attributes of the whole transport module. When I suggested to move it module wide I just meant to add another mod param like the global max data area param. I li

Re: [RESEND V2 1/6] tcmu: add new netlink events helpers

2018-05-02 Thread Mike Christie
Thanks. Patchset looks ok to me. Acked-by: Mike Christie On 05/01/2018 10:13 PM, Zhu Lingshan wrote: > Add new netlink events helpers tcmu_netlink_event_init() and > tcmu_netlink_event_send(). These new functions intend to replace > exsiting netlink events helper function tcmu_netl

Re: [PATCHv3] tcmu: allow userspace to reset netlink

2018-04-17 Thread Mike Christie
> [] system_call_fastpath+0x16/0x1b > == > > Signed-off-by: Xiubo Li > --- > Changes since v1(suggested by Mike Christie): > v2: - Makes the reset per device. > v3: - Remove nl_cmd->complete, use status instead >

Re: [PATCHv2] tcmu: allow userspace to reset netlink

2018-04-13 Thread Mike Christie
On 04/12/2018 10:08 PM, Xiubo Li wrote: > >>> + >>> +if (val != 1) { >>> +pr_err("Invalid block value %d\n", val); >> I think you wanted >> >> "Invalid reset value %d\n" > Yeah, just copied it from other place. >> >>> +return -EINVAL; >>> +} >>> + >>> +spin_unlock(&udev

Re: [PATCHv2] tcmu: allow userspace to reset netlink

2018-04-12 Thread Mike Christie
> > Be careful of using this, it could reset the normal netlink requesting > operations, so we should use this only when the user space daemon from > starting and just before the daemon could receive and handle the nl > requests. > > Changes since v1(suggested

Re: [PATCH] tcmu: fix error resetting qfull_time_out to default

2018-04-12 Thread Mike Christie
; config_item *item, > > if (val >= 0) { > udev->qfull_time_out = val * MSEC_PER_SEC; > + } else if (val == -1) { > + udev->qfull_time_out = val; > } else { > printk(KERN_ERR "Invalid qfull timeout value %d\n", val); > return -EINVAL; > Acked-by: Mike Christie

Re: [PATCH] tcmu: fix error resetting qfull_time_out to default

2018-04-12 Thread Mike Christie
On 04/10/2018 04:11 AM, Xiubo Li wrote: > > On 2018/4/9 19:44, Prasanna Kumar Kalever wrote: >> Problem: >> --- >> $ cat /sys/kernel/config/target/core/user_0/block/attrib/qfull_time_out >> -1 >> >> $ echo "-1" > >> /sys/kernel/config/target/core/user_0/block/attrib/qfull_time_out >> -bash: ec

Re: [PATCH] tcmu: allow userspace to reset netlink

2018-04-04 Thread Mike Christie
On 04/04/2018 09:38 PM, Xiubo Li wrote: > On 2018/4/5 8:47, Mike Christie wrote: >> On 04/02/2018 06:42 AM, xiu...@redhat.com wrote: >>> From: Xiubo Li >>> >>> This patch adds 1 tcmu attr to reset and complete all the blocked >>> netlink waiting thre

Re: [PATCH] tcmu: allow userspace to reset netlink

2018-04-04 Thread Mike Christie
On 04/02/2018 06:42 AM, xiu...@redhat.com wrote: > From: Xiubo Li > > This patch adds 1 tcmu attr to reset and complete all the blocked > netlink waiting threads. It's used when the userspace daemon like > tcmu-runner has crashed or forced to shutdown just before the > netlink requests be replied

Re: [PATCH] libiscsi: ensure session spin lock usage consistent

2018-02-07 Thread Mike Christie
On 02/07/2018 04:41 PM, Mike Christie wrote: > >> static int iscsi_exec_task_mgmt_fn(struct iscsi_conn *conn, >> @@ -1908,7 +1908,7 @@ static enum blk_eh_timer_return >> iscsi_eh_cmd_timed_out(struct scsi_cmnd *sc) >> >> ISCSI_DBG_EH(sess

Re: [PATCH] libiscsi: ensure session spin lock usage consistent

2018-02-07 Thread Mike Christie
On 02/05/2018 01:13 PM, Lee Duncan wrote: > diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c > index 82c3fd4bc938..055357b2fe9e 100644 > --- a/drivers/scsi/libiscsi.c > +++ b/drivers/scsi/libiscsi.c > @@ -1248,9 +1248,9 @@ int iscsi_complete_pdu(struct iscsi_conn *conn, struct > iscs

Re: [PATCH] libiscsi: ensure session spin lock usage consistent

2018-02-07 Thread Mike Christie
On 02/05/2018 01:13 PM, Lee Duncan wrote: > The libiscsi code was using both spin_lock()/spin_unlock() > and spin_lock_bh()/spin_unlock_bh() on its session lock. It does this because the lock was only taken between bottom halves and process contexts. If we are already in a bh then there is no need

Re: [PATCH -next] tcmu: fix error return code in tcmu_configure_device()

2018-01-11 Thread Mike Christie
P_KERNEL); > - if (!udev->data_bitmap) > + if (!udev->data_bitmap) { > + ret = -ENOMEM; > goto err_bitmap_alloc; > + } > > udev->mb_addr = vzalloc(CMDR_SIZE); > if (!udev->mb_addr) { > Thanks. Acked-by: Mike Christie

Re: [PATCH] tcmu: Allow reconfig to handle multiple attributes

2018-01-10 Thread Mike Christie
On 01/04/2018 10:11 AM, Bryant G. Ly wrote: > This patch allows for multiple attributes to be reconfigured > and handled all in one call as compared to multiple netlinks. > > Example: > set attribute dev_reconfig=dev_config=fbo//home/path:dev_size=2147483648 > I know I suggested this, but I thin

Re: [PATCH] tcmu: clean up the scatter helper

2017-11-08 Thread Mike Christie
On 11/08/2017 04:39 PM, Bryant G. Ly wrote: > On 7/30/17 5:19 PM, Nicholas A. Bellinger wrote: > >> On Thu, 2017-07-13 at 14:33 +0800, lixi...@cmss.chinamobile.com wrote: >>> From: Xiubo Li >>> >>> Add some comments to make the scatter code to be more readable. >>> >>> Signed-off-by: Xiubo Li >>

Re: [PATCHv2] tcmu: Add fifo type waiter list support to avoid starvation

2017-11-08 Thread Mike Christie
On 11/08/2017 04:35 PM, Bryant G. Ly wrote: > > On 7/30/17 5:10 PM, Nicholas A. Bellinger wrote: > >> Hi Xiubo, >> >> Apologies for the delayed response. Comments below. >> >> On Wed, 2017-07-12 at 15:16 +0800, lixi...@cmss.chinamobile.com wrote: >>> From: Xiubo Li >>> >>> The fifo type waiter

[PATCH 17/19] tcmu: make ring buffer timer configurable

2017-10-29 Thread Mike Christie
too long to wait when some OSs like ESX will timeout commands after as little as 8 - 15 seconds. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 131 +- 1 file changed, 101 insertions(+), 30 deletions(-) diff --git a/drivers/target

[PATCH 18/19] tcmu: allow max block and global max blocks to be settable

2017-10-29 Thread Mike Christie
Users might have a physical system to a target so they could have a lot more than 2 gigs of memory they want to devote to tcmu. OTOH, we could be running in a vm and so a 2 gig global and 1 gig per dev limit might be too high. This patch allows the user to specify the limits. Signed-off-by: Mike

[PATCH 15/19] tcmu: simplify dbi thresh handling

2017-10-29 Thread Mike Christie
We do not really save a lot by trying to increase thresh a multiple of the existing value. This just simplifies the code by increasing it to whatever is needed for the command being executed. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 22 +++--- 1 file

[PATCH 05/19] tcmu: merge common block release code

2017-10-29 Thread Mike Christie
Have unmap_thread_fn use tcmu_blocks_release. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 4f666a5

[PATCH 11/19] tcmu: simplify scatter_data_area error handling

2017-10-29 Thread Mike Christie
scatter_data_area always returns 0, so stop checking for errors. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 31 +++ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/drivers/target/target_core_user.c b/drivers/target

[PATCH 19/19] target: return SAM_STAT_TASK_SET_FULL for TCM_OUT_OF_RESOURCES

2017-10-29 Thread Mike Christie
TCM_OUT_OF_RESOURCES is getting translated to TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE which seems like a heavy error when we just cannot allocate a resource that may be allocatable later. This has us translate TCM_OUT_OF_RESOURCES to SAM_STAT_TASK_SET_FULL instead. Signed-off-by: Mike Christie

[PATCH 12/19] tcmu: fix free block calculation

2017-10-29 Thread Mike Christie
The blocks_left calculation does not account for free blocks between 0 and thresh, so we could be queueing/waiting when there are enough blocks free. This has us add in the blocks between 0 and thresh as well as at the end from thresh to DATA_BLOCK_BITS. Signed-off-by: Mike Christie

[PATCH 08/19] tcmu: move expired command completion to unmap thread

2017-10-29 Thread Mike Christie
(even though this is named irqcontrol it is not run in irq context)) and timer/bh context. In the timer/bh context bhs are disabled, so you need to use the _bh lock calls from the thread context callers. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c

[PATCH 06/19] tcmu: split unmap_thread_fn

2017-10-29 Thread Mike Christie
Separate unmap_thread_fn to make it easier to read. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 120 ++ 1 file changed, 70 insertions(+), 50 deletions(-) diff --git a/drivers/target/target_core_user.c b/drivers/target

[PATCH 04/19] tcmu: fix double se_cmd completion

2017-10-29 Thread Mike Christie
adding the cmd to the udev->commands idr until we have allocated ring space and are about to send the cmd to userspace. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 54 ++- 1 file changed, 31 insertions(+), 23 deletions(-) diff --gi

[PATCH 16/19] tcmu: don't block submitting context for block waits

2017-10-29 Thread Mike Christie
eping here. 2. Devices were not fairly scheduled to run when they hit the global limit so they could time out waiting for ring space while others got run. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 264 -- 1 file changed, 169 insertions(+

[PATCH 13/19] tcmu: clean up the scatter helper

2017-10-29 Thread Mike Christie
From: Xiubo Li Add some comments to make the scatter code to be more readable, and drop unused arg to new_iov. Signed-off-by: Xiubo Li Reviewed-by: Mike Christie Signed-off-by: Nicholas Bellinger Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 30

[PATCH 10/19] tcmu: release blocks for partially setup cmds

2017-10-29 Thread Mike Christie
S and TCMU_GLOBAL_MAX_BLOCKS will be settable so it might be lower and could happen. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 5226b82..61

[PATCH 09/19] tcmu: remove commands_lock

2017-10-29 Thread Mike Christie
tcmu_handle_completions could be interrupted by a timer softirq while the commands_lock is held. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/target/target_core_user.c b/drivers/target

[PATCH 14/19] tcmu: prep queue_cmd_ring to be used by unmap wq

2017-10-29 Thread Mike Christie
In the next patch we will call queue_cmd_ring from the submitting context and also the unmap wq when blocks free. This changes the queue_cmd_ring return code so in the next patch we can return a sense_reason_t and also tell the caller if the cmd was internally queued. Signed-off-by: Mike Christie

[PATCH 01/19] tcmu: fix crash when removing the tcmu device v4

2017-10-29 Thread Mike Christie
f-by: Zhang Zhuoyu Signed-off-by: Xiubo Li [ported to scsi branch] Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 92 --- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/drivers/target/target_core_user.c b/dri

[PATCH 00/19] target/target_core_user: changes for 4.16

2017-10-29 Thread Mike Christie
The following patches made over linus's tree, and also apply over Nicks target-pending master branch, and Martin and James's for-next branches, fix several bugs and add features to the target_core_user module for LIO. - Patches 1 -3 are target_core_user fixes/changes that have been sitting on the

[PATCH 03/19] tcmu: Use macro to call container_of in tcmu_cmd_time_out_show

2017-10-29 Thread Mike Christie
From: Kenjiro Nakayama This patch makes a tiny change that using TCMU_DEV in tcmu_cmd_time_out_show so it is consistent with other functions. Signed-off-by: Kenjiro Nakayama [added missing tcmu_cmd_time_out_store conversion] Signed-off-by: Mike Christie --- drivers/target/target_core_user.c

[PATCH 07/19] tcmu: fix unmap thread race

2017-10-29 Thread Mike Christie
type of case. Signed-off-by: Mike Christie --- drivers/target/target_core_user.c | 43 +-- 1 file changed, 10 insertions(+), 33 deletions(-) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 15b54fd..14d9b79 100644 -

[PATCH 02/19] tcmu: Add netlink command reply supported option for each device

2017-10-29 Thread Mike Christie
backward-compatibility and used by default, however once users set nl_reply_supported= via configfs for a particular device, the device disables the netlink command reply support. Signed-off-by: Kenjiro Nakayama [use kstrtoint] Signed-off-by: Mike Christie --- drivers/target/target_core_user.c

Re: [PATCH] tcmu: Oops in unmap_thread_fn()

2017-08-03 Thread Mike Christie
ry_safe(udev, tmp, &root_udev_waiter, waiter) { > mutex_lock(&udev->cmdr_lock); > if (udev->waiting_blocks < free_blocks) { > mutex_unlock(&udev->cmdr_lock); > Thanks. Reviewed-by: Mike Christie

Re: [PATCH] tcmu: clean up the scatter helper

2017-07-13 Thread Mike Christie
On 07/13/2017 01:33 AM, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li > > Add some comments to make the scatter code to be more readable. > > Signed-off-by: Xiubo Li > --- Reviewed-by: Mike Christie

Re: [PATCHv2] tcmu: Add fifo type waiter list support to avoid starvation

2017-07-12 Thread Mike Christie
s available are > not enough, it will stop traversing the list and abort waking up the > others. > > Signed-off-by: Xiubo Li > Looks ok to me. Reviewed-by: Mike Christie

Re: [PATCH] tcmu: Fix possible to/from address overflow when doing the memcpy

2017-07-12 Thread Mike Christie
nge(from, copy_bytes); > - memcpy(to + sg->length - sg_remaining, from, > + memcpy(to + sg->length - sg_remaining, from + offset, > copy_bytes); > > sg_remaining -= copy_bytes; > Nice. Reviewed-by: Mike Christie

Re: [PATCH] tcmu: clean up the code and with one small fix

2017-07-11 Thread Mike Christie
On 07/11/2017 05:06 AM, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li > > Remove useless blank line and code and at the same time add one error > path to catch the errors. > > Signed-off-by: Xiubo Li Thanks. Reviewed-by: Mike Christie

Re: [PATCHv2] tcmu: Fix possbile memory leak when recalculating the cmd base size

2017-07-11 Thread Mike Christie
; To fix this, just memset all the entry memory before using it, and > also to be more readable we adjust the bidi code. > > Fixed: fe25cc34795(tcmu: Recalculate the tcmu_cmd size to save cmd area > memories) > Reported-by: Bryant G. Ly > Tested-by: Damien Le Moal > Signed-off-by: Xiubo Li > --- Nice. Thanks. Reviewed-by: Mike Christie

Re: [PATCH 4/5] target: user: Fix sense data handling

2017-07-10 Thread Mike Christie
On 07/10/2017 12:36 AM, Damien Le Moal wrote: > Nicholas, Mike, > > On 7/7/17 15:05, Nicholas A. Bellinger wrote: >> Everything including MNC's #1-6 and your #1-2 be pushed to >> target-pending/for-next shortly. >> >> Please use this as your base for testing. :) > > I ran tests this morning with

Re: [PATCH 4/5] target: user: Fix sense data handling

2017-07-07 Thread Mike Christie
On 07/06/2017 11:50 PM, Nicholas A. Bellinger wrote: > Hey MNC & Co, > > On Wed, 2017-06-28 at 12:44 -0500, Mike Christie wrote: >> On 06/28/2017 12:58 AM, Damien Le Moal wrote: >>> If the user request handler completed the request with a CHECK CONDITION >&g

Re: [PATCH] target: make device_mutex and device_list static

2017-07-05 Thread Mike Christie
" > > -DEFINE_MUTEX(device_mutex); > -LIST_HEAD(device_list); > +static DEFINE_MUTEX(device_mutex); > +static LIST_HEAD(device_list); > static DEFINE_IDR(devices_idr); > > static struct se_hba *lun0_hba; > My fault. Thanks. Reviewed-by: Mike Christie

Re: [PATCH] tcmu: Fix flushing cmd entry dcache page

2017-07-01 Thread Mike Christie
ead; > - tcmu_flush_dcache_range(entry, sizeof(*entry)); > tcmu_hdr_set_op(&entry->hdr.len_op, TCMU_OP_CMD); > entry->hdr.cmd_id = tcmu_cmd->cmd_id; > entry->hdr.kflags = 0; > Looks ok to me. Reviewed-by: Mike Christie

Re: [PATCH] tcmu: Fix flushing cmd entry dcache page

2017-06-30 Thread Mike Christie
On 06/30/2017 03:14 AM, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li > > When feeding the tcmu's cmd ring, we need to flush the dcache page > for the cmd entry to make sure these kernel stores are visible to > user space mappings of that page. > > For the none PAD cmd entry, this will be

Re: [PATCH v4 0/5] tcmu: Add Type of reconfig into netlink

2017-06-30 Thread Mike Christie
On 06/30/2017 11:58 AM, Mike Christie wrote: > On 06/30/2017 02:31 AM, Nicholas A. Bellinger wrote: >> Hey MNC, >> >> On Mon, 2017-06-12 at 01:43 -0500, Mike Christie wrote: >>> On 06/11/2017 04:02 PM, Mike Christie wrote: >>>> On 06/09/2017 01:11 AM, Ni

Re: [PATCH v4 0/5] tcmu: Add Type of reconfig into netlink

2017-06-30 Thread Mike Christie
On 06/30/2017 02:31 AM, Nicholas A. Bellinger wrote: > Hey MNC, > > On Mon, 2017-06-12 at 01:43 -0500, Mike Christie wrote: >> On 06/11/2017 04:02 PM, Mike Christie wrote: >>> On 06/09/2017 01:11 AM, Nicholas A. Bellinger wrote: >>>> Hi Bryant & Co, >

Re: [PATCH 5/5] target: core: Fix failed command sense data handling

2017-06-28 Thread Mike Christie
e_cmd_flags & SCF_TRANSPORT_TASK_SENSE) > - success = 1; > } > > + if (cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) > + success = 1; > + > /* >* Check for case where an explicit ABORT_TASK has been received >* and transport_wait_for_tasks() will be waiting for completion.. > Reviewed-by: Mike Christie

Re: [PATCH 4/5] target: user: Fix sense data handling

2017-06-28 Thread Mike Christie
ata_area(udev, cmd, true); > I have a patch similar to this and 5/5 in my set: https://www.spinics.net/lists/target-devel/msg15430.html If yours gets merged first then I will build my set over them, so patch looks ok to me. Reviewed-by: Mike Christie

Re: [PATCH] tcmu: Fix module removal due to stuck unmap_thread thread again

2017-06-15 Thread Mike Christie
prepare_to_wait(&unmap_wait, &__wait, TASK_INTERRUPTIBLE); > Looks ok to me Reviewed-by: Mike Christie

Re: [PATCH v4 0/5] tcmu: Add Type of reconfig into netlink

2017-06-11 Thread Mike Christie
On 06/11/2017 04:02 PM, Mike Christie wrote: > On 06/09/2017 01:11 AM, Nicholas A. Bellinger wrote: >> Hi Bryant & Co, >> >> On Tue, 2017-06-06 at 09:28 -0500, Bryant G. Ly wrote: >>> From: "Bryant G. Ly" >>> >>> This patch consists of

Re: [PATCH v4 0/5] tcmu: Add Type of reconfig into netlink

2017-06-11 Thread Mike Christie
patches look ok. Thanks. Could you just merge the attached patch into "[PATCH v4 5/5] tcmu: Add Type of reconfig into netlink" or into the patchset after it? It just makes some of the names a little less generic and only returns the reconfig attr for reconfig commands. >From b51f9b228490

Re: [PATCH v2 5/5] tcmu: Add Type of reconfig into netlink

2017-06-05 Thread Mike Christie
On 05/30/2017 01:31 PM, Bryant G. Ly wrote: > This patch adds more info about the attribute being changed, > so that usersapce can easily figure out what is happening. > > Signed-off-by: Bryant G. Ly > --- > drivers/target/target_core_user.c | 27 +-- > include/uapi/l

Re: [PATCH v2 4/5] tcmu: Make dev_config configurable

2017-06-05 Thread Mike Christie
On 05/30/2017 01:31 PM, Bryant G. Ly wrote: > This allows for userspace to change the device path after > it has been created. Thus giving the user the ability to change > the path. The use case for this is to allow for virtual optical > to have media change. > > Signed-off-by: Bryant G. Ly > ---

Re: [PATCH] tcmu: Add fifo type waiter list support to avoid starvation

2017-06-03 Thread Mike Christie
On 05/04/2017 09:51 PM, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li > > The fifo type waiter list will hold the udevs who are waiting for the > blocks from the data global pool. The unmap thread will try to feed the > first udevs in waiter list, if the global free blocks available are >

Re: [PATCH] iscsi-target: Fix initial login PDU asynchronous socket close OOPs

2017-05-31 Thread Mike Christie
On 05/30/2017 11:58 PM, Nicholas A. Bellinger wrote: > Hey MNC, > > On Fri, 2017-05-26 at 22:14 -0500, Mike Christie wrote: >> Thanks for the patch. >> > > Btw, after running DATERA's internal longevity and scale tests across > ~20 racks on v4.1.y with this

Re: [PATCH v1 3/4] tcmu: Make dev_size configurable via userspace

2017-05-29 Thread Mike Christie
On 05/26/2017 09:27 AM, Bryant G. Ly wrote: > Allow tcmu backstores to be able to set the device size > after it has been configured via set attribute. > > Part of support in userspace to support certain backstores > changing device size. > > Signed-off-by: Bryant G. Ly > --- > drivers/target/t

Re: [PATCH v1 4/4] tcmu: Make dev_config configurable

2017-05-29 Thread Mike Christie
On 05/26/2017 09:27 AM, Bryant G. Ly wrote: > This allows for userspace to change the device path after > it has been created. Thus giving the user the ability to change > the path. The use case for this is to allow for virtual optical > to have media change. > > Signed-off-by: Bryant G. Ly > ---

Re: [PATCH] iscsi-target: Fix initial login PDU asynchronous socket close OOPs

2017-05-26 Thread Mike Christie
Thanks for the patch. On 05/26/2017 12:32 AM, Nicholas A. Bellinger wrote: > > - state = iscsi_target_sk_state_check(sk); > - write_unlock_bh(&sk->sk_callback_lock); > - > - pr_debug("iscsi_target_sk_state_change: state: %d\n", state); > + orig_state_change(sk); > > -

Re: [PATCH] tcmu: Recalculate the tcmu_cmd size to save cmd area memories

2017-05-02 Thread Mike Christie
t; how many iovs is needed before insert it to cmd area. > > Signed-off-by: Xiubo Li Looks ok to me. Thanks. Acked-by: Mike Christie

Re: [PATCH v6 2/2] tcmu: Add global data block pool support

2017-05-01 Thread Mike Christie
On 04/30/2017 06:29 AM, Xiubo Li wrote: > [...] >>> +static struct page *tcmu_try_get_block_page(struct tcmu_dev *udev, >>> uint32_t dbi) >>> +{ >>> +struct page *page; >>> +int ret; >>> + >>> +mutex_lock(&udev->cmdr_lock); >>> +page = tcmu_get_block_page(udev, dbi); >>> +if (li

Re: [PATCH v6 1/2] tcmu: Add dynamic growing data area featuresupport

2017-05-01 Thread Mike Christie
On 04/30/2017 05:22 AM, Xiubo Li wrote: > On 2017年04月30日 13:48, Mike Christie wrote: >> On 04/26/2017 01:25 AM, lixi...@cmss.chinamobile.com wrote: >>> for_each_sg(data_sg, sg, data_nents, i) { >>> @@ -275,22 +371,26 @@ static void alloc_and_scatter_data_are

Re: [PATCH v6 2/2] tcmu: Add global data block pool support

2017-04-30 Thread Mike Christie
On 04/26/2017 01:25 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, currently for the cmd area > t

Re: [PATCH v6 1/2] tcmu: Add dynamic growing data area feature support

2017-04-29 Thread Mike Christie
On 04/26/2017 01:25 AM, lixi...@cmss.chinamobile.com wrote: > for_each_sg(data_sg, sg, data_nents, i) { > @@ -275,22 +371,26 @@ static void alloc_and_scatter_data_area(struct tcmu_dev > *udev, > from = kmap_atomic(sg_page(sg)) + sg->offset; > while (sg_remaining >

Re: RFC: remove REQ_OP_WRITE_SAME

2017-04-11 Thread Mike Christie
On 04/10/2017 11:07 AM, Christoph Hellwig wrote: > Now that we are using REQ_OP_WRITE_ZEROES for all zeroing needs in the > kernel there is very little use left for REQ_OP_WRITE_SAME. We only > have two callers left, and both just export optional protocol features > to remote systems: DRBD and the

Re: [PATCH] target/user: PGR Support

2017-04-03 Thread Mike Christie
On 04/03/2017 12:20 AM, Shie-rei Huang wrote: > After a PGR command is processed in the kernel, is it possible for the > user mode to be notified with the command so that the user mode has a > chance to do its part of PGR processing. Below is one use case of it. > Suppose two TCMU servers are set u

Re: [PATCHv5 2/2] tcmu: Fix wrongly calculating of the base_command_size

2017-03-28 Thread Mike Christie
req.iov[tcmu_cmd_get_block_cnt(tcmu_cmd)]), > sizeof(struct tcmu_cmd_entry)); > command_size = base_command_size > + round_up(scsi_command_size(se_cmd->t_task_cdb), > TCMU_OP_ALIGN_SIZE); > Looks ok to me. Thanks. Reviewed-by: Mike Christie

Re: [PATCHv4 2/4] tcmu: Fix wrongly calculating of the base_command_size

2017-03-21 Thread Mike Christie
On 03/21/2017 04:36 AM, lixi...@cmss.chinamobile.com wrote: > From: Xiubo Li > > The t_data_nents and t_bidi_data_nents are the numbers of the > segments, but it couldn't be sure the block size equals to size > of the segment. > > For the worst case, all the blocks are discontiguous and there >

Re: [PATCHv4 1/4] tcmu: Fix possible overwrite of t_data_sg's last iov[]

2017-03-21 Thread Mike Christie
iov++; > + alloc_and_scatter_data_area(udev, se_cmd->t_bidi_data_sg, > + se_cmd->t_bidi_data_nents, &iov, &iov_cnt, > + false); > + entry->req.iov_bidi_cnt = iov_cnt; > + } > /* cmd's data_bitmap is what changed in process */ > bitmap_xor(tcmu_cmd->data_bitmap, old_bitmap, udev->data_bitmap, > DATA_BLOCK_BITS); > Patch looks ok to me. Reviewed-by: Mike Christie

<    1   2   3   4   5   6   7   >