Re: iscsi_trx going into D state

2016-10-17 Thread Zhu Lingshan
in my environment I see there is another call stack not listed in your mail Thanks, BR Zhu Lingshan On 10/18/2016 03:11 AM, Robert LeBlanc wrote: Sorry hit send too soon. In addition, on the client we see: # ps -aux | grep D | grep kworker root 5583 0.0 0.0 0 0 ?D

Re: Need some pointers to debug a target hang

2016-10-31 Thread Zhu Lingshan
I find anything new. Thanks, BR Zhu Lingshan On 10/30/2016 07:03 AM, Johannes Thumshirn wrote: On Sat, Oct 29, 2016 at 03:53:25PM -0700, Nicholas A. Bellinger wrote: Hi Johannes & Zhu, On Tue, 2016-10-18 at 23:29 -0700, Nicholas A. Bellinger wrote: On Tue, 2016-10-18 at 19:35 +

Re: Need some pointers to debug a target hang

2016-11-08 Thread Zhu Lingshan
On 11/04/2016 02:52 PM, Nicholas A. Bellinger wrote: Hi Zhu & Co, Thanks for the detailed logs. Comments below. On Mon, 2016-10-31 at 16:51 +0800, Zhu Lingshan wrote: Hi Nicholas, (sorry it would be a long mail) Sorry for the delay, I spent some test and debug work. I find the patch

Re: [PATCHv3 0/2] target: make location of /var/targets configurable

2016-05-25 Thread Zhu Lingshan
Hi experts, I think these patches are great, and I am ready to help in user space. Thanks, BR Zhu Lingshan On 05/09/2016 09:17 AM, Lee Duncan wrote: On 04/14/2016 06:18 PM, Lee Duncan wrote: These patches make the location of "/var/target" configurable, though it still defaul

Re: how to test pscsi with vhost

2016-07-04 Thread Zhu Lingshan
Hi Zhangfei, I am also interested in pscsi, you can try kvm, seems you can create a virtualized pscsi device in kvm / virt-manager. I haven't tried that yet, hope this can help. Thanks, BR Zhu Lingshan 在 2016/7/4 15:32, Zhangfei Gao 写道: I am testing with pscsi, but fail to find any

Re: iscsi_trx going into D state

2016-10-07 Thread Zhu Lingshan
other call statck with D status. Thanks, BR Zhu Lingshan 在 2016/10/1 1:14, Robert LeBlanc 写道: We are having a reoccurring problem where iscsi_trx is going into D state. It seems like it is waiting for a session tear down to happen or something, but keeps waiting. We have to reboot these targets on

[RESEND V2 2/6] tcmu: refactor add_device cmd with new nl helpers

2018-05-01 Thread Zhu Lingshan
use new netlink events helpers tcmu_netlink_init() and tcmu_netlink_send() to refactor netlink event TCMU_CMD_ADDED_DEVICE Signed-off-by: Zhu Lingshan --- Changes in V2: - return tcmu_netlink_event_send() directly, instead of a ret value. drivers/target/target_core_user.c | 17

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

2018-05-01 Thread Zhu Lingshan
itple attributes for different commands. Signed-off-by: Zhu Lingshan --- Changes in V2: - Add new blank lines for better code style, easier to scan the chunks drivers/target/target_core_user.c | 59 +++ 1 file changed, 59 insertions(+) diff --git a/drivers/t

[RESEND V2 5/6] tcmu: refactor nl dev_size attr with new helpers

2018-05-01 Thread Zhu Lingshan
use new netlink events helpers tcmu_netlink_init() and tcmu_netlink_send() to refactor netlink event attribute TCMU_ATTR_DEV_SIZE(belongs to TCMU_CMD_RECONFIG_DEVICE) which is also dev_size in configFS. Signed-off-by: Zhu Lingshan --- Changes in V2: - return tcmu_netlink_event_send() directly

[RESEND V2 6/6] tcmu: refactor nl wr_cache attr with new helpers

2018-05-01 Thread Zhu Lingshan
. Signed-off-by: Zhu Lingshan --- Changes in V2: - return tcmu_netlink_event_send() directly, instead of a ret value. drivers/target/target_core_user.c | 89 +-- 1 file changed, 20 insertions(+), 69 deletions(-) diff --git a/drivers/target/target_core_user.c b

[RESEND V2 4/6] tcmu: refactor nl dev_cfg attr with new nl helpers

2018-05-01 Thread Zhu Lingshan
use new netlink events helpers tcmu_netlink_init() and tcmu_netlink_send() to refactor netlink event attribute TCMU_ATTR_DEV_CFG(belongs to TCMU_CMD_RECONFIG_DEVICE) which is also dev_config in configFS. Signed-off-by: Zhu Lingshan --- Changes in V2: - return tcmu_netlink_event_send() directly

[RESEND V2 3/6] tcmu: refactor rm_device cmd with new nl helpers

2018-05-01 Thread Zhu Lingshan
use new netlink events helpers tcmu_netlink_init() and tcmu_netlink_send() to refactor netlink event TCMU_CMD_REMOVED_DEVICE Signed-off-by: Zhu Lingshan --- Changes in V2: - return tcmu_netlink_event_send() directly, instead of a ret value. drivers/target/target_core_user.c | 16

[PATCH 02/33] TCMU PR: add tcmu_dev_pr_info to store PR buffer

2018-06-15 Thread Zhu Lingshan
This patch added a struct tcmu_dev_pr_info, which can help store the string buffer we got from a TCMU device record (for example, for RBD devices, the records should be stored in their metadata). So that we can decode / encode them. Signed-off-by: Zhu Lingshan --- drivers/target

[PATCH 03/33] TCMU PR: add functions can get PR info from a dev

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_send_get_pr_info_event() to get Persistent Reservation info from a TCMU device, added it's wrapper function tcmu_get_dev_pr_info() as well. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 31 +++ 1 file ch

[PATCH 08/33] TCMU PR: add functions to handle PR generation

2018-06-15 Thread Zhu Lingshan
This patch added two functions: tcmu_pr_info_gen_encode() and tcmu_pr_info_gen_decode() to encode/decode the generations of Persistent Reservations Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 34 +++ 1 file changed, 34 insertions(+) diff

[PATCH 07/33] TCMU PR: add functions to handle SCSI2 Reservation

2018-06-15 Thread Zhu Lingshan
This patch added two functions: tcmu_pr_info_scsi2_rsv_encode() and tcmu_pr_info_scsi2_rsv_decode() to encode and decode SCSI2 Reservations. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 65 +++ 1 file changed, 65 insertions(+) diff --git a

[PATCH 06/33] TCMU PR: add decode/encode func for PR seq and ver

2018-06-15 Thread Zhu Lingshan
This patch added three functions, tcmu_pr_info_vers_seq_encode() to encode PR sequence and version into a string, tcmu_pr_info_vers_decode() and tcmu_pr_info_seq_decode() used to decode them. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 62

[PATCH 18/33] TCMU PR: add a function to register a new IT Nexus

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_execute_pr_register_new() which can help to register an unregistered I_T Nexus. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 34 +++ 1 file changed, 34 insertions(+) diff --git a/drivers/target

[PATCH 17/33] TCMU PR: add a function to append a new PR reg

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_pr_info_append_reg() which can help to append a new Persistent Reservation registration to struct tcmu_pr_info. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 20 1 file changed, 20 insertions(+) diff --git a/drivers

[PATCH 12/33] TCMU PR: add a function to free tcmu_pr_info

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_pr_info_free() which can help free struct tcmu_pr_info. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c

[PATCH 10/33] TCMU PR: add funcs to handle PR registrations num

2018-06-15 Thread Zhu Lingshan
This patch added two functions: tcmu_pr_info_num_regs_decode() and tcmu_pr_info_num_regs_encode() to handle the number of Persistent Reservation registrations. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 34 +++ 1 file changed, 34 insertions

[PATCH 19/33] TCMU PR: add functions to unregister a reg

2018-06-15 Thread Zhu Lingshan
the functions above to unregister the registration. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 75 +++ 1 file changed, 75 insertions(+) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 5d0da54072cd

[PATCH 11/33] TCMU PR: add funcs to handle TCMU PR registrations

2018-06-15 Thread Zhu Lingshan
This patch added a struct tcmu_pr_reg which contain Persistent Reservation registrations information, also added two functions tcmu_pr_info_reg_decode() and tcmu_pr_info_reg_encode() to handle it. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 51

[PATCH 05/33] TCMU PR: add a function to get IT_Nexus

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_gen_it_nexus() which can help generate a string contain IT_Nexus information from a session. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 44 +++ 1 file changed, 44 insertions(+) diff --git a/drivers/target

[PATCH 04/33] TCMU PR: add functions can store PR info into devs

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_send_set_pr_info_event() to store Persistent Reservation information into a TCMU device (for example, if we use a RBD device, the information will be stored in it's metadata), added it's wrapper function tcmu_set_dev_pr_info() as well. Signed-off-by: Zh

[PATCH 13/33] TCMU PR: add a PR info decoder function

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_pr_info_decode() which can decode Persistent Reservation info, from the string to a struct tcmu_pr_info. This function will call the pervious added decoder like tcmu_pr_info_reg_decode() to do it's work. Signed-off-by: Zhu Lingshan --- drivers/t

[PATCH 09/33] TCMU PR: add func to handle PR type, key, IT nexus

2018-06-15 Thread Zhu Lingshan
This patch add two functions: tcmu_pr_info_rsv_decode() and tcmu_pr_info_rsv_encode() to handle Persistent Reservations type, key and IT_Nexus. This patch added a struct tcmu_pr_rsv to store such information as well. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 72

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

2018-06-15 Thread Zhu Lingshan
more than one initiators sending multiple PR requests via multiple targets. Signed-off-by: Zhu Lingshan --- include/uapi/linux/target_core_user.h | 19 +++ 1 file changed, 19 insertions(+) diff --git a/include/uapi/linux/target_core_user.h b/include/uapi/linux/target_core_us

[PATCH 14/33] TCMU PR: add a function can get PR info from a dev

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_pr_info_get() which can help get Persistent Reservation information from a TCMU device. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 51 +++ 1 file changed, 51 insertions(+) diff --git a/drivers/target

[PATCH 16/33] TCMU PR: init PR info when empty for TCMU dev

2018-06-15 Thread Zhu Lingshan
patch added a function tcmu_pr_info_init() to initialize Persistent Reservation struct tcmu_pr_info, encode it to a string, and store this string in the TCMU device records. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 48 +++ 1 file changed, 48

[PATCH 15/33] TCMU PR: add a PR info encoder function

2018-06-15 Thread Zhu Lingshan
d-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 133 ++ 1 file changed, 133 insertions(+) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 0f8eeed61c60..957e444d853b 100644 --- a/drivers/target/target_core_user.c

[PATCH 25/33] TCMU PR: netlink support for passthrough PR info

2018-06-15 Thread Zhu Lingshan
This patch added netlink support for passthrough Persistent Reservation information. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 35 +++ 1 file changed, 35 insertions(+) diff --git a/drivers/target/target_core_user.c b/drivers/target

[PATCH 29/33] TCMU PR: enable PRO Reserve for TCMU devices

2018-06-15 Thread Zhu Lingshan
gt;pr_ops->pr_reserve to passthrough data to user space. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_pr.c | 11 ++- drivers/target/target_core_user.c | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/target/target_core_pr.c b/drivers/ta

[PATCH 32/33] TCMU PR: implementation of PR clear for TCMU

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_execute_pr_clear() which can help perform Persistent Reservation clear operation, this means clear reservations and registrations. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 108 ++ 1 file changed, 108

[PATCH 31/33] TCMU PR: enable PRO Release for TCMU devices

2018-06-15 Thread Zhu Lingshan
gt;pr_ops->pr_release to passthrough PR release request to user space Signed-off-by: Zhu Lingshan --- drivers/target/target_core_pr.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c index d47ccbf05679..c668dfb84bf1

[PATCH 24/33] TCMU PR: handle PR read keys for TCMU devs

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_execute_pr_read_keys() which can help handle Persistent Reservation Read Keys. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 74 +++ 1 file changed, 74 insertions(+) diff --git a/drivers/target

[PATCH 26/33] TCMU PR: add PR ops function pointers

2018-06-15 Thread Zhu Lingshan
This patch added a struct target_pr_ops contains TCMU Persistent Reservation operation functions. Added a "struct target_pr_ops" type pointer in target_backend_ops, so that we can call TCMU PR functions from struct target_backend_ops. Signed-off-by: Zhu Lingshan --- driv

[PATCH 27/33] TCMU PR: enable PR register and ReadKeys for TCMU

2018-06-15 Thread Zhu Lingshan
_ops and dev->transport->pr_ops->pr_register are not NULL, core_scsi3_emulate_pro_register() will call dev->transport->pr_ops->pr_register, this means call tcmu_execute_pr_register(). It is the same way how core_scsi3_pri_read_keys() can call tcmu_execute_pr_read_keys. Signed-off-by: Zhu

[PATCH 33/33] TCMU PR: enable PRO Clear for TCMU devices

2018-06-15 Thread Zhu Lingshan
->pr_ops->pr_clear to passthrough PR clear request to user space Signed-off-by: Zhu Lingshan --- drivers/target/target_core_pr.c | 5 + drivers/target/target_core_user.c | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c index

[PATCH 28/33] TCMU PR: implementation of PR Reserve for TCMU

2018-06-15 Thread Zhu Lingshan
This patch added functions to handle Persistent Reservation Reserve against TCMU devices. Function tcm_rbd_pr_info_rsv_set() will help set PR information in struct tcmu_pr_info, function tcmu_execute_pr_reserve() will help handle PR reserve requests against TCMU devices. Signed-off-by: Zhu

[PATCH 23/33] TCMU PR: func to handle PR read keys but no regs

2018-06-15 Thread Zhu Lingshan
from tcmu_pr_info_init(). Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 17 + 1 file changed, 17 insertions(+) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index c3adff826163..2fcdfc97ca75 100644 --- a/drivers/t

[PATCH 30/33] TCMU PR: implementation of PR release for TCMU

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_execute_pr_release() to handle SCSI3 Persistent Reservation Release for TCMU devices. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 119 ++ 1 file changed, 119 insertions(+) diff --git a/drivers/target

[PATCH 22/33] TCMU PR: add a function to handle TCMU PR register

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_execute_pr_register() which can help to handle Persistent Reservation register operation for TCMU devices. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 138 ++ 1 file changed, 138 insertions(+) diff --git a

[PATCH 20/33] TCMU PR: add a func to register an existing reg

2018-06-15 Thread Zhu Lingshan
This patch added a function tcmu_execute_pr_register_existing() which will handle Persistent Reservation registration for a currently registered IT_Nexus. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 34 +++ 1 file changed, 34 insertions

[PATCH 21/33] TCMU PR: add a func to update PR info on TCMU dev

2018-06-15 Thread Zhu Lingshan
to RBD meatada. Signed-off-by: Zhu Lingshan --- drivers/target/target_core_user.c | 43 +++ 1 file changed, 43 insertions(+) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 4b426a9061b1..559e0d40d63b 100644 --- a/drivers

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

2018-06-15 Thread Zhu Lingshan
, we can implement it after kernel side stabilized. Thanks, BR Zhu Lingshan On 2018/6/16 2:23, Zhu Lingshan wrote: These commits and the following intend to implement Persistent Reservation operations for TCMU devices. This series of commits would implement such PR operations: PR_Out_Register

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

2018-06-16 Thread Zhu Lingshan
ingle point that can help response to PR requests. Yes, the code is a bit complex, but the logic is easy, just exchange information with tcmu-runner via netlink, then tcmu-runner handles read / write the metadata. Thanks a lot for your help! Thanks, BR Zhu Lingshan On 2018/6/16 13:22, Chr

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

2018-06-16 Thread Zhu Lingshan
Hello Maged, Thanks for your comment and help, please give me some time to process this. Thanks, BR Zhu Lingshan On 2018/6/16 19:04, Maged Mokhtar wrote: Hi Zhu, These are my comments for the patch set: 1) patches 18-24, 28, 30,32 (+ the yet to be implemented pr functions) : instead of

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

2018-06-16 Thread Zhu Lingshan
On 2018/6/17 3:20, 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 following intend to implement Persistent Reservation operations

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

2018-06-18 Thread Zhu Lingshan
On 2018/6/18 19:12, Christoph Hellwig wrote: On Sun, Jun 17, 2018 at 12:40:56PM +0800, Zhu Lingshan wrote: Hello Mike and Christoph, Thanks Mike's comment inspired me, if I understand this correctly, it is suggested to implement this whole solution in kernel, avoid  splitting PRG han