Date: Mon, 30 Dec 2013 12:18:06 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260083 - head/sys/dev/iscsi Message-ID: <201312301218.rBUCI6bm012046@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Mon Dec 30 12:18:06 2013 New Revision: 260083 URL: http://svnweb.freebsd.org/changeset/base/260083 Log: 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 (such as NOP) came in. PR: kern/185240 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.c Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Mon Dec 30 09:04:06 2013 (r260082) +++ head/sys/dev/iscsi/icl.c Mon Dec 30 12:18:06 2013 (r260083) @@ -239,7 +239,7 @@ icl_pdu_size(const struct icl_pdu *respo 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 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312301218.rBUCI6bm012046>