From nobody Thu Aug 25 17:31:32 2022 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 4MD94N3BGsz4b313; Thu, 25 Aug 2022 17:31:32 +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 4MD94N2SMSz3KHk; Thu, 25 Aug 2022 17:31:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661448692; 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=kgUaMrr0ePC6b6g1zxIT/mubnIaQH/GZiTn+f7nWGqM=; b=V23k8ZhWs9CL4HtUKY0fqHz2AgicelEWrVTE7EsP4qkLXkfY2Cn11TOvCM9vc68yRrElXT jmPbeFJAx/i/hyKziSdpeb9KZqy3RYJ9GW9nNu9l5idXM8cRMbOhrQjdjhpT3DzYXB/bX8 hEFiVRHp1BTdpPHQMXa6UjevS09kRtmdON174DIkCO31QxeeXBbbv2i8Ib3A50YCb7vPKk phabqpKe/i4dS8nePGK0ZylpcHUXXzxs8vuoMW9p5qLh0AGc6qKKcMs+zWbzf5QWCTD+TP e3fLIir5mNjZ/hXYTgWb6qSr7BHk2RuBfPgFsdazuGl9NGae+o4oPBvTooTIQQ== 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 4MD94N16djzwxW; Thu, 25 Aug 2022 17:31:32 +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 27PHVWLk041470; Thu, 25 Aug 2022 17:31:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27PHVWNg041469; Thu, 25 Aug 2022 17:31:32 GMT (envelope-from git) Date: Thu, 25 Aug 2022 17:31:32 GMT Message-Id: <202208251731.27PHVWNg041469@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: cb85a1815fbe - stable/13 - cxgbei: Adjust the calculation for the maximum ISO payload. 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: cb85a1815fbe3cc9d67d51ad3fefa536b2e3c163 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661448692; 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=kgUaMrr0ePC6b6g1zxIT/mubnIaQH/GZiTn+f7nWGqM=; b=JiTAOzd88GR/CjrEblfJguTC5JKgpEoVjDv1iYgnlXJa5p7V96OmrSLQ4KHJ1kWGXKI+ZN BNKpx0zFKQKCcNOVeV+zK8/FHXwNb24jRXdF8Dkht+WMSzqmr/Now4WaI9cRpT5Dlhi8pU Hn75xeEOFEuZENoj6VQuezzDl8/EYhNMO7cklttbSa6GWDkrPk6FTmoP8UI0mAnqLXUl2k +b3MtZr+pw2QPdrAAxGIhpkdJ0VS9F2lZN4x4ZIwTQZznNIr26UqZ0k4A/K78Mnoue68Uh neYPFb/A/THRVe5u/vd+BwFForfoFahDWhop6rYFFXAqwVBaTw7bCHAmPPF5WA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661448692; a=rsa-sha256; cv=none; b=UA6MtyS27TWE9IG9JFfxbSZsxBO5FI6g0MOx2AVgWBhLIVrWFkVNOMOfxfDY3DWi2Lax1W CWLneBF2iEhw0E9UaSMLm1Op4n0S+H2/QnM7BAXABc6VMIliNXTlmeeVIcc8S2uHHQ2d2b WZJSxAu3g3ddSn6SxBNjV6MR/S1ncvHZX3wptdlFV3sVC8Hhr+6NpHAXC5ahUMjY73X86P xH5Pntgp+D/IwGgIVNGcAXq4/CtGj3XBXJqjsgU3ma1DMX3K5k/etDKOsAoaZoQdUAN81T m7BAsoiPK8ZjPofwC4xl0jJ70YJzmGuSiuprQtEf1O0UNus9eUrudX7SXeNzdw== 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=cb85a1815fbe3cc9d67d51ad3fefa536b2e3c163 commit cb85a1815fbe3cc9d67d51ad3fefa536b2e3c163 Author: John Baldwin AuthorDate: 2022-05-26 20:38:20 +0000 Commit: John Baldwin CommitDate: 2022-08-25 16:30:09 +0000 cxgbei: Adjust the calculation for the maximum ISO payload. Round down the maximim ISO payload by the current MSS. Otherwise the round up by MSS when calculating the 16-bit maximum payload len passed along in the FLOWC work request can overflow. Discussed with: np Sponsored by: Chelsio Communications (cherry picked from commit 8020c05683f266c5513cfe8ad3e58e7e06f85ffa) --- sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index 7d58e11b7835..735d1fe19996 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -1103,7 +1103,7 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) struct tcpcb *tp; struct toepcb *toep; cap_rights_t rights; - u_int max_rx_pdu_len, max_tx_pdu_len; + u_int max_iso_payload, max_rx_pdu_len, max_tx_pdu_len; int error, max_iso_pdus; MPASS(icc->icc_signature == CXGBEI_CONN_SIGNATURE); @@ -1195,7 +1195,9 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) if (icc->sc->tt.iso && chip_id(icc->sc) >= CHELSIO_T5 && !is_memfree(icc->sc)) { - max_iso_pdus = CXGBEI_MAX_ISO_PAYLOAD / max_tx_pdu_len; + max_iso_payload = rounddown(CXGBEI_MAX_ISO_PAYLOAD, + tp->t_maxseg); + max_iso_pdus = max_iso_payload / max_tx_pdu_len; ic->ic_hw_isomax = max_iso_pdus * ic->ic_max_send_data_segment_length; } else