Spdk/lib/iscsi
Ziye Yang 476b1b0fc9 lib/iscsi: fix the queued_datain_task hanlding issue.
Due to the network issue, spdk_iscsi_conn_free_pdu in
spdk_iscsi_conn_flush_pdus_internal will not be executed.
So consider the pdu free, we should call spdk_iscsi_conn_free_pdu
in spdk_iscsi_conn_free_tasks.

Actually, for the task which in queued_datain_task, we have
the following case:

1 The task is not sent to the scsi layer: it means that
the task is not freed, so we should call spdk_iscsi_task_put
here.
2 The task is sent to the scsi layer, but no subtasks
are sent to the scsi layer: It means that the call
back function (spdk_iscsi_task_cpl) will be called,
but since it will have the subtask, so spdk_iscsi_task_put
will not be called, thus, we should call spdk_iscsi_task_put
here.
3 The task is sent to the scsi layer, and some subtasks
are also sent to the scsi layer: It also mean that the
spdk_iscsi_task_put will not be called in spdk_iscsi_task_cpl,
and not all the subtasks will be finished, so the father task
will not be freed, so we should still call spdk_iscsi_task_put
here.

4 The task is sent to the scsi layer, and all the subtasks
are also sent to the scsi layer,
thus this task is not in the queued_data_in_task.

So according to 1-4, we should call spdk_iscsi_task_put here,
and also decrease the data_in_cnt;

Change-Id: Icb13df1ae07f6eea0247d45f4a0397edc4aa2500
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/420875
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-08-15 00:44:49 +00:00
..
acceptor.c thread: Replace #include of io_channel.h with thread.h 2018-06-12 15:24:07 +00:00
acceptor.h iscsi: login poller per portal and portal cache 2017-10-06 17:00:45 -04:00
conn.c lib/iscsi: fix the queued_datain_task hanlding issue. 2018-08-15 00:44:49 +00:00
conn.h iscsi: Support hot removal of LUN based on LUN open/close 2018-07-17 17:43:28 +00:00
init_grp.c iscsi: Add JSON config/info dump for initiator group. 2018-05-10 19:38:26 +00:00
init_grp.h iscsi: Add JSON config/info dump for initiator group. 2018-05-10 19:38:26 +00:00
iscsi_rpc.c subsystem/iscsi: Add iSCSI options to JSON config file 2018-06-01 20:15:59 +00:00
iscsi_subsystem.c iscsi: Fix the issue that mutual CHAP auth for discovery session don't work 2018-08-13 16:38:49 +00:00
iscsi.c iscsi: Support hot removal of LUN based on LUN open/close 2018-07-17 17:43:28 +00:00
iscsi.h iscsi/rpc: fix several bugs of set_iscsi_options 2018-07-25 19:22:08 +00:00
Makefile build: remove $(ENV_CFLAGS) where not necessary 2018-01-03 12:05:59 -05:00
md5.c astyle: enforce braces around single-line statements 2017-12-11 11:19:32 -05:00
md5.h include: Move the remainder of the code base to stdinc.h 2017-05-08 13:20:36 -07:00
param.c iscsi: Use braces for the body of an if, for, or while and remove blank lines 2018-06-14 03:35:28 +00:00
param.h include: Move the remainder of the code base to stdinc.h 2017-05-08 13:20:36 -07:00
portal_grp.c iscsi: Fix two bugs of JSON config dump 2018-05-17 23:06:11 +00:00
portal_grp.h iscsi: Add JSON config/info dump for portal group. 2018-05-10 19:38:26 +00:00
task.c scsi, iscsi: move task->parent to iSCSI task 2018-01-05 00:01:37 -05:00
task.h Use SPDK_CONTAINEROF in a few more places 2018-07-06 22:47:04 +00:00
tgt_node.c iscsi: Fix two bugs of JSON config dump 2018-05-17 23:06:11 +00:00
tgt_node.h iscsi: Add JSON config/info dump for target node. 2018-05-04 17:45:48 +00:00