Skip to content

Commit 9e20ae3

Browse files
author
Nicholas Bellinger
committed
iscsi-target; Allow an extra tag_num / 2 number of percpu_ida tags
This patch bumps the default number of tags allocated per session by iscsi-target via transport_alloc_session_tags() -> percpu_ida_init() by another (tag_num / 2). This is done to take into account the tags waiting to be acknowledged and released in iscsit_ack_from_expstatsn(), but who's number are not directly limited by the CmdSN Window queue_depth being enforced by the target. Using a larger value here is also useful to prevent percpu_ida_alloc() from having to steal tags from other CPUs when no tags are available on the local CPU, while waiting for unacknowledged tags to be released. Signed-off-by: Nicholas Bellinger <[email protected]>
1 parent f56cbbb commit 9e20ae3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/target/iscsi/iscsi_target_nego.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ int iscsi_target_locate_portal(
11921192
*/
11931193
alloc_tags:
11941194
tag_num = max_t(u32, ISCSIT_MIN_TAGS, queue_depth);
1195-
tag_num += ISCSIT_EXTRA_TAGS;
1195+
tag_num += (tag_num / 2) + ISCSIT_EXTRA_TAGS;
11961196
tag_size = sizeof(struct iscsi_cmd) + conn->conn_transport->priv_size;
11971197

11981198
ret = transport_alloc_session_tags(sess->se_sess, tag_num, tag_size);

0 commit comments

Comments
 (0)