linux/drivers/target/iscsi
Varun Prakash d96adb9b07 cxgbit: fix sg_nents calculation
The current logic of calculating sg_nents can fail
if data_offset % PAGE_SIZE is not zero.

For example -
PAGE_SIZE = 4096
data_len = 3072
data_offset = 3072

As per current logic
sg_nents = max(1UL, DIV_ROUND_UP(data_len, PAGE_SIZE));
sg_nents = max(1UL, DIV_ROUND_UP(3072, 4096));
sg_nents = 1

But as data_offset % PAGE_SIZE = 3072 we should skip 3072 bytes
skip = 3K
sg_nents = max(1UL, DIV_ROUND_UP(3K(skip) + 3K(data_len), 4K(PAGE_SIZE));
sg_nents = 2;

This patch fixes this issue by adding skip to data_len.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2017-07-30 15:35:34 -07:00
..
cxgbit cxgbit: fix sg_nents calculation 2017-07-30 15:35:34 -07:00
iscsi_target_auth.c iscsi: ensure RNG is seeded before use 2017-06-19 22:06:28 -04:00
iscsi_target_auth.h target: Minimize #include directives 2016-12-09 10:22:28 -08:00
iscsi_target_configfs.c iscsi-target: Add login_keys_workaround attribute for non RFC initiators 2017-07-11 10:56:39 -07:00
iscsi_target_datain_values.c target: Minimize #include directives 2016-12-09 10:22:28 -08:00
iscsi_target_datain_values.h target: Minimize #include directives 2016-12-09 10:22:28 -08:00
iscsi_target_device.c target: Fix max_cmd_sn increment w/o cmdsn mutex regressions 2015-09-11 00:32:28 -07:00
iscsi_target_device.h target: Minimize #include directives 2016-12-09 10:22:28 -08:00
iscsi_target_erl0.c iscsi-target: Always wait for kthread_should_stop() before kthread exit 2017-05-31 15:12:57 -07:00
iscsi_target_erl0.h iscsi-target: Always wait for kthread_should_stop() before kthread exit 2017-05-31 15:12:57 -07:00
iscsi_target_erl1.c target: Minimize #include directives 2016-12-09 10:22:28 -08:00
iscsi_target_erl1.h target: Minimize #include directives 2016-12-09 10:22:28 -08:00
iscsi_target_erl2.c target/iscsi: Fix spelling of "reallegiance" 2017-02-09 00:39:08 -08:00
iscsi_target_erl2.h target/iscsi: Fix spelling of "reallegiance" 2017-02-09 00:39:08 -08:00
iscsi_target_login.c Add wait_for_random_bytes() and get_random_*_wait() functions so that 2017-07-15 12:44:02 -07:00
iscsi_target_login.h target: Minimize #include directives 2016-12-09 10:22:28 -08:00
iscsi_target_nego.c iscsi-target: Add login_keys_workaround attribute for non RFC initiators 2017-07-11 10:56:39 -07:00
iscsi_target_nego.h target: Minimize #include directives 2016-12-09 10:22:28 -08:00
iscsi_target_nodeattrib.c iscsi-target: Move iscsi_target_[core,stat].h under linux include 2015-01-30 13:06:21 -08:00
iscsi_target_nodeattrib.h target: Minimize #include directives 2016-12-09 10:22:28 -08:00
iscsi_target_parameters.c iscsi-target: Add login_keys_workaround attribute for non RFC initiators 2017-07-11 10:56:39 -07:00
iscsi_target_parameters.h iscsi-target: Add login_keys_workaround attribute for non RFC initiators 2017-07-11 10:56:39 -07:00
iscsi_target_seq_pdu_list.c iscsi-target: Move iscsi_target_[core,stat].h under linux include 2015-01-30 13:06:21 -08:00
iscsi_target_seq_pdu_list.h target: Minimize #include directives 2016-12-09 10:22:28 -08:00
iscsi_target_stat.c target: use per-attribute show and store methods 2015-10-13 22:17:49 -07:00
iscsi_target_tmr.c target/iscsi: Fix spelling of "reallegiance" 2017-02-09 00:39:08 -08:00
iscsi_target_tmr.h target: Minimize #include directives 2016-12-09 10:22:28 -08:00
iscsi_target_tpg.c iscsi-target: Add login_keys_workaround attribute for non RFC initiators 2017-07-11 10:56:39 -07:00
iscsi_target_tpg.h iscsi-target: Add login_keys_workaround attribute for non RFC initiators 2017-07-11 10:56:39 -07:00
iscsi_target_transport.c target: Minimize #include directives 2016-12-09 10:22:28 -08:00
iscsi_target_util.c target/iscsi: Simplify iscsit_free_cmd() 2017-07-06 23:11:27 -07:00
iscsi_target_util.h target/iscsi: Remove second argument of __iscsit_free_cmd() 2017-07-06 23:11:26 -07:00
iscsi_target.c iscsi-target: fix invalid flags in text response 2017-07-30 15:32:48 -07:00
iscsi_target.h target: Minimize #include directives 2016-12-09 10:22:28 -08:00
Kconfig cxgbit: add files for cxgbit.ko 2016-05-09 23:12:54 -07:00
Makefile cxgbit: add files for cxgbit.ko 2016-05-09 23:12:54 -07:00