summaryrefslogtreecommitdiffstats
path: root/sys/dev/iscsi
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2014-02-11 11:58:54 +0000
committertrasz <trasz@FreeBSD.org>2014-02-11 11:58:54 +0000
commita92d8da5ad7b149e8fd60a5161b84b2df861825d (patch)
treed0199f715d9ff5bebbf9fb9da29f4506f7a0f135 /sys/dev/iscsi
parent1c069ec47aefedb8787cfd2c4239abef53586447 (diff)
downloadFreeBSD-src-a92d8da5ad7b149e8fd60a5161b84b2df861825d.zip
FreeBSD-src-a92d8da5ad7b149e8fd60a5161b84b2df861825d.tar.gz
MFC r260083:
Fix extremely slow operation with data digests enabled. This was caused by receive code waiting for data digest even when the data segment was empty. It didn't actually read it, but it waited until those four bytes become available in the socket buffer, i.e. until any other PDU (e.g. NOP) came in. Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/dev/iscsi')
-rw-r--r--sys/dev/iscsi/icl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/iscsi/icl.c b/sys/dev/iscsi/icl.c
index f29f0d2..e0e1179 100644
--- a/sys/dev/iscsi/icl.c
+++ b/sys/dev/iscsi/icl.c
@@ -239,7 +239,7 @@ icl_pdu_size(const struct icl_pdu *response)
icl_pdu_padding(response);
if (response->ip_conn->ic_header_crc32c)
len += ISCSI_HEADER_DIGEST_SIZE;
- if (response->ip_conn->ic_data_crc32c)
+ if (response->ip_data_len != 0 && response->ip_conn->ic_data_crc32c)
len += ISCSI_DATA_DIGEST_SIZE;
return (len);
@@ -615,7 +615,7 @@ icl_conn_receive_pdu(struct icl_conn *ic, size_t *availablep)
break;
ic->ic_receive_state = ICL_CONN_STATE_DATA_DIGEST;
- if (ic->ic_data_crc32c == false)
+ if (request->ip_data_len == 0 || ic->ic_data_crc32c == false)
ic->ic_receive_len = 0;
else
ic->ic_receive_len = ISCSI_DATA_DIGEST_SIZE;
OpenPOWER on IntegriCloud