numam-spdk/lib/iscsi
Shuhei Matsumoto 39bdb45ed8 lib/iscsi: Decrement conn->data_in_cnt of primary correctly for LUN hotplug
We had not decremented conn->data_in_cnt when the primary is removed
from conn->queued_datain_tasks after submitting it.

If we simply add decrement into iscsi_conn_free_tasks() and
_iscsi_conn_remove_lun(), it conflicts with iscsi_transfer_in().

By recent refinements, primary is freed in either spdk_iscsi_conn_free_pdu()
or iscsi_conn_free_tasks()/_iscsi_conn_remove_lun().

Hence let's make decrement of conn->data_in_cnt for primary follow
the management of primary.

In iscsi_conn_free_tasks()/_iscsi_conn_remove_lun(), if
primary->current_datain_offset, conn->data_in_cnt is incremented, and
hence decrement it.

In spdk_iscsi_conn_free_pdu(), if primary and all subtasks are
completed, decrement conn->data_in_cnt.

This patch will fix the issue that conn->data_in_cnt ls still
positive even after all tasks are freed when removing LUN dynamically.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I70cb431ab968387749ff7a5c77cd109904687797
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474436
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2019-11-18 12:51:38 +00:00
..
conn.c lib/iscsi: Decrement conn->data_in_cnt of primary correctly for LUN hotplug 2019-11-18 12:51:38 +00:00
conn.h lib/iscsi: Separate PDU header and payload handling for Login Request 2019-10-22 17:20:51 +00:00
init_grp.c rpc: Rename add_initiator_group to iscsi_create_initiator_group 2019-09-24 16:40:01 +00:00
init_grp.h iscsi: Use not malloc'ed but fixed size string for initiator address 2019-07-01 05:03:07 +00:00
iscsi_rpc.c rpc: Rename delete_target_node to iscsi_delete_target_node 2019-10-01 14:00:30 +00:00
iscsi_subsystem.c rpc: Rename add_iscsi_auth_group to iscsi_create_auth_group 2019-09-24 14:46:27 +00:00
iscsi.c lib/iscsi: Decrement conn->data_in_cnt of primary correctly for LUN hotplug 2019-11-18 12:51:38 +00:00
iscsi.h lib/iscsi: Clarify only logout with reason "close the session" is acceptable on discovery session 2019-11-12 05:31:59 +00:00
Makefile mk: add a lib deps file. 2019-08-23 17:48:35 +00: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: Remove the prefix spdk_ from names of private functions 2019-04-01 00:52:56 +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 lib/iscsi: Add iscsi_portal_group_set_auth for per portal group CHAP authentication 2019-09-27 15:24:14 +00:00
portal_grp.h lib/iscsi: Add iscsi_portal_group_set_auth for per portal group CHAP authentication 2019-09-27 15:24:14 +00:00
task.c iscsi: Remove the prefix spdk_ from names of private functions 2019-04-01 00:52:56 +00:00
task.h Revert "iscsi: change the field bhs to pointer type." 2019-09-19 05:04:00 +00:00
tgt_node.c lib/iscsi: Request logout to asynchronously to initiator 2019-10-09 02:45:17 +00:00
tgt_node.h rpc: Rename delete_pg_ig_maps to iscsi_target_node_remove_pg_ig_maps 2019-09-18 18:09:13 +00:00