Date: Thu, 9 Jun 2016 07:49:20 +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: r301721 - head/usr.sbin/iscsid Message-ID: <201606090749.u597nKer049801@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Thu Jun 9 07:49:20 2016 New Revision: 301721 URL: https://svnweb.freebsd.org/changeset/base/301721 Log: Decouple MaxBurstLength and FirstBurstLength from MaxRecvDataSegmentLength reported by the ICL module in iscsid(8). This harmed performance and was just wrong. MFC after: 1 month Modified: head/usr.sbin/iscsid/iscsid.h head/usr.sbin/iscsid/login.c Modified: head/usr.sbin/iscsid/iscsid.h ============================================================================== --- head/usr.sbin/iscsid/iscsid.h Thu Jun 9 07:19:02 2016 (r301720) +++ head/usr.sbin/iscsid/iscsid.h Thu Jun 9 07:49:20 2016 (r301721) @@ -42,8 +42,10 @@ #define CONN_DIGEST_NONE 0 #define CONN_DIGEST_CRC32C 1 -#define CONN_MUTUAL_CHALLENGE_LEN 1024 +#define CONN_MUTUAL_CHALLENGE_LEN 1024 #define SOCKBUF_SIZE 1048576 +#define MAX_BURST_LENGTH (256 * 1024) +#define FIRST_BURST_LENGTH (128 * 1024) struct connection { int conn_iscsi_fd; Modified: head/usr.sbin/iscsid/login.c ============================================================================== --- head/usr.sbin/iscsid/login.c Thu Jun 9 07:19:02 2016 (r301720) +++ head/usr.sbin/iscsid/login.c Thu Jun 9 07:49:20 2016 (r301721) @@ -395,16 +395,24 @@ login_negotiate_key(struct connection *c } conn->conn_max_data_segment_length = tmp; } else if (strcmp(name, "MaxBurstLength") == 0) { - if (conn->conn_immediate_data) { - tmp = strtoul(value, NULL, 10); - if (tmp <= 0) - log_errx(1, "received invalid MaxBurstLength"); - conn->conn_max_burst_length = tmp; + tmp = strtoul(value, NULL, 10); + if (tmp <= 0) + log_errx(1, "received invalid MaxBurstLength"); + if (tmp > MAX_BURST_LENGTH) { + log_debugx("capping MaxBurstLength " + "from %d to %d", tmp, MAX_BURST_LENGTH); + tmp = MAX_BURST_LENGTH; } + conn->conn_max_burst_length = tmp; } else if (strcmp(name, "FirstBurstLength") == 0) { tmp = strtoul(value, NULL, 10); if (tmp <= 0) log_errx(1, "received invalid FirstBurstLength"); + if (tmp > FIRST_BURST_LENGTH) { + log_debugx("capping FirstBurstLength " + "from %d to %d", tmp, FIRST_BURST_LENGTH); + tmp = FIRST_BURST_LENGTH; + } conn->conn_first_burst_length = tmp; } else if (strcmp(name, "DefaultTime2Wait") == 0) { /* Ignore */ @@ -489,10 +497,8 @@ login_negotiate(struct connection *conn) keys_add(request_keys, "DataDigest", "None"); keys_add(request_keys, "ImmediateData", "Yes"); - keys_add_int(request_keys, "MaxBurstLength", - 2 * conn->conn_limits.isl_max_data_segment_length); - keys_add_int(request_keys, "FirstBurstLength", - conn->conn_limits.isl_max_data_segment_length); + keys_add_int(request_keys, "MaxBurstLength", MAX_BURST_LENGTH); + keys_add_int(request_keys, "FirstBurstLength", FIRST_BURST_LENGTH); keys_add(request_keys, "InitialR2T", "Yes"); keys_add(request_keys, "MaxOutstandingR2T", "1"); if (conn->conn_conf.isc_iser == 1) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606090749.u597nKer049801>