numam-spdk/lib/iscsi
Shuhei Matsumoto ce43ae2123 lib/iscsi: Merge multiple Data-OUT PDUs up to 64KB in a sequence
Some iSCSI initiators send a Data-OUT PDU sequence whose PDUs do
not have block size multiples data.

SPDK iSCSI target had replied SCSI write error to such initiators
because previously we had sent a write subtask per Data-OUT PDU.
SPDK SCSI library had rejected the write subtask because its data
was not block size multiples.

This patch fixes the issue.

The idea is to aggregate multiple Data-OUT PDUs into a single write
subtask up to 64KB or until F bit is set. MaxRecvDataSegmentLength
is 64KB but MaxBurstLength is 1MB. Hence one Data-OUT PDU data may
be split into multiple data buffers, but the maximum number of split
is two.

When processing the data segment of the Data-OUT PDU, save the data
buffer of the current PDU to the current task if the data buffer is
not full and F bit is not set. In this case, write subtask is not
submitted.

When processing the header of the Data-OUT PDU, if the current task
saves the data buffer from the last Data-OUT PDU, it passes the data
buffer to the Data-OUT PDU.

When reading the data segment of the current PDU, attach the second
data buffer to the current PDU if the first data buffer becomes full.

These are enabled only if DIF is disabled.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ib9cfb53fe8c0807a63e58c61bed3bb52f60f4830
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6439
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-04-19 12:47:40 +00:00
..
conn.c lib/iscsi: Rename current_datain_offset of task by current_data_offset 2021-04-12 09:49:31 +00:00
conn.h iscsi: Add the support for long text response. 2020-11-11 00:53:52 +00:00
init_grp.c subsystem/iscsi: remove legacy config support 2020-10-20 08:53:53 +00:00
init_grp.h subsystem/iscsi: remove legacy config support 2020-10-20 08:53:53 +00:00
iscsi_rpc.c lib/iscsi: Add wait parameter to iscsi_create_portal_group RPC 2020-11-24 08:20:37 +00:00
iscsi_subsystem.c lib/iscsi: Merge multiple Data-OUT PDUs up to 64KB in a sequence 2021-04-19 12:47:40 +00:00
iscsi.c lib/iscsi: Merge multiple Data-OUT PDUs up to 64KB in a sequence 2021-04-19 12:47:40 +00:00
iscsi.h lib/iscsi: Merge multiple Data-OUT PDUs up to 64KB in a sequence 2021-04-19 12:47:40 +00:00
Makefile so_ver: increase all major versions 2021-02-05 14:43:47 +00:00
md5.c lib/iscsi: Remove the "spdk_" prefix from internal APIs declared in md5.h 2020-04-20 07:38:29 +00:00
md5.h lib/iscsi: Remove the "spdk_" prefix from internal APIs declared in md5.h 2020-04-20 07:38:29 +00:00
param.c lib/iscsi: add a comment for iscsi_parse_params() 2021-03-26 21:06:15 +00:00
param.h lib/iscsi: Remove the "spdk_" prefix from internal APIs declared in param.h 2020-04-20 07:38:29 +00:00
portal_grp.c lib/iscsi: Add portal_group_resume() and add pause parameter to portal_group_open() 2020-11-24 08:20:37 +00:00
portal_grp.h lib/iscsi: Add portal_group_resume() and add pause parameter to portal_group_open() 2020-11-24 08:20:37 +00:00
spdk_iscsi.map subsystem/iscsi: remove legacy config support 2020-10-20 08:53:53 +00:00
task.c lib/iscsi: Merge multiple Data-OUT PDUs up to 64KB in a sequence 2021-04-19 12:47:40 +00:00
task.h lib/iscsi: Merge multiple Data-OUT PDUs up to 64KB in a sequence 2021-04-19 12:47:40 +00:00
tgt_node.c iscsi: get the member after the NULL check 2020-12-01 10:21:50 +00:00
tgt_node.h subsystem/iscsi: remove legacy config support 2020-10-20 08:53:53 +00:00