From nobody Tue Nov 23 23:12:50 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9083718A1676; Tue, 23 Nov 2021 23:12:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKg72d5wz3vW3; Tue, 23 Nov 2021 23:12:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F04D71F59D; Tue, 23 Nov 2021 23:12:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNCoON037615; Tue, 23 Nov 2021 23:12:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNColL037614; Tue, 23 Nov 2021 23:12:50 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:50 GMT Message-Id: <202111232312.1ANNColL037614@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b3d02f0be3ec - stable/13 - ctld: Always declare MaxRecvDataSegmentLength. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b3d02f0be3ecd4a08fcd4b9ca366f9cf56418356 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TJAqs6mYDTsoTlJeB7cw3Pb8fl07l0/6ZWj30iyfGoE=; b=OaS9MeU48/xNJjtX/lxeAtT/abW2ZN+dibkHZVhOrg2GoYZZ9RFr2SmB+wM0i11yxbPY+/ NCtYJG1SuDdtXC4gicOI+FBLveXBcSE++i8GNBPp9UgWcDrln7d2npT1SBsUTsDH0xwsRo mF7a/wbBmQCcQkF8dd4EZZZ+KKylAphJMmMjwaCdojhq6ohN51Wo3cFSqPE8lZvcUnOhff w/EPQCwAiuHi7hEALC5LmAiM0m0oQbcXiB5TGMiyj+jncf2Adnj7kynSuYb7gmK632IMqs dy1aXgLvc/pMv5OJws7QuRL+/1WV4l9V4HNz9Q276m5PMbKKSjuqTnR63ZXSrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709171; a=rsa-sha256; cv=none; b=TT2b/nrHkRYGYtJRhgh25LQapiMbwoRG/2wI696a2DtI97kzSEKVc1gOd/rzhoh7bbrtl0 s/z+6Jla6lECj3IgXZkMWyv+zIB/J9yB/y/alq0CzUM2Pf7CG+OqjiAeKnxni3a7VL/dZC 8NwGxM+fPgsYLfI6doc86R4Ad2Qb8aJJKpGaHF45gOhBfHGC4n55KGAvJJciuAJGQGu+Kb SZg06SofX5/1th/6WUchYYHDd1YgF5gSO6vN8n7R5BakFc3Ib9vSHS3vZAsOyaQexyGG7t T5K8GQsCXus3UqWbsaYMs7wxWx0CsoF4nnCbUX0wzPx2PaqIeguLSYoNID8V1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b3d02f0be3ecd4a08fcd4b9ca366f9cf56418356 commit b3d02f0be3ecd4a08fcd4b9ca366f9cf56418356 Author: John Baldwin AuthorDate: 2021-10-26 21:52:40 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:44 +0000 ctld: Always declare MaxRecvDataSegmentLength. This key is Declarative and should always be sent even if the initiator did not send it's own limit. This is similar to the fix in fc79cf4fea72 but for the target side. However, unlike that fix, failure to send the key simply results in reduced performance. PR: 259439 Reviewed by: mav, emaste Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32651 (cherry picked from commit 7ef7b252adc0152e5f726d00640124c5de0909a9) --- usr.sbin/ctld/login.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/usr.sbin/ctld/login.c b/usr.sbin/ctld/login.c index f219a3044586..63b2cfd51d92 100644 --- a/usr.sbin/ctld/login.c +++ b/usr.sbin/ctld/login.c @@ -565,10 +565,6 @@ login_negotiate_key(struct pdu *request, const char *name, tmp = conn->conn_max_send_data_segment_limit; } conn->conn_max_send_data_segment_length = tmp; - conn->conn_max_recv_data_segment_length = - conn->conn_max_recv_data_segment_limit; - keys_add_int(response_keys, name, - conn->conn_max_recv_data_segment_length); } else if (strcmp(name, "MaxBurstLength") == 0) { tmp = strtoul(value, NULL, 10); if (tmp <= 0) { @@ -796,6 +792,11 @@ login_negotiate(struct connection *conn, struct pdu *request) log_errx(1, "initiator sent FirstBurstLength > MaxBurstLength"); } + conn->conn_max_recv_data_segment_length = + conn->conn_max_recv_data_segment_limit; + keys_add_int(response_keys, "MaxRecvDataSegmentLength", + conn->conn_max_recv_data_segment_length); + log_debugx("operational parameter negotiation done; " "transitioning to Full Feature Phase");