From owner-svn-src-head@freebsd.org Thu Jun 9 07:49:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1772BADC22F; Thu, 9 Jun 2016 07:49:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDA721D58; Thu, 9 Jun 2016 07:49:21 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u597nLX1049803; Thu, 9 Jun 2016 07:49:21 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u597nKer049801; Thu, 9 Jun 2016 07:49:20 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201606090749.u597nKer049801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 9 Jun 2016 07:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301721 - head/usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2016 07:49:22 -0000 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) {