From nobody Thu May 26 21:33:25 2022 X-Original-To: dev-commits-src-main@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 B1A4A1B57139; Thu, 26 May 2022 21:33:25 +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 4L8LlT4dvmz3h31; Thu, 26 May 2022 21:33:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653600805; 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=qkcN/7Lb6brny1YWJqy0wEgGh4u2kfJN+5wkAoV40h8=; b=DNAI2fZ33C59UTKkZTE/ykOW5d7nxOZlzEQUqolpp/SJa63NQrcnugBdoZmfdW59mOg8Ep 6+fK8ELCi7yxouAwccVL0NiGgfHfyW4IcM22lPQI9FZBDJgTiTti28rj7yP4qaBIZ+5ek3 lz1xbZ9sEtILGy4gTDmkn4f7EEoeZOViN5BQfwUeqb6Jzf5XrgtomxFeiETkDvgLT7qpSI k1OVj6s91FOH9qh12RjtlPLLi1KevYX4VqD4CaI5mYAglHMpPC4UHxFgdLIxz91c3Vo1At YdsOyrv4c+o2nJM9o+wiwHY4KHZy3LgLrnSM31ZQ1PawbGi0t2Y+cUhkpLNoag== 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 7F4AB15EE8; Thu, 26 May 2022 21:33:25 +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 24QLXPW6073066; Thu, 26 May 2022 21:33:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24QLXPcB073065; Thu, 26 May 2022 21:33:25 GMT (envelope-from git) Date: Thu, 26 May 2022 21:33:25 GMT Message-Id: <202205262133.24QLXPcB073065@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 8020c05683f2 - main - cxgbei: Adjust the calculation for the maximum ISO payload. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 8020c05683f266c5513cfe8ad3e58e7e06f85ffa Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653600805; 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=qkcN/7Lb6brny1YWJqy0wEgGh4u2kfJN+5wkAoV40h8=; b=P/3DqFPrfzpI0ys08FNTyqAhup3Wm2IJBKO2erh7g3y25pnSJULsyY+Ec38RtlK3pko6lI 8Zd68OX93TgndVokLL1gWUBlbsLDrg8mYVynUoM0+1XNwWPy7Ykw5O2JWGp1l6fRIIQ5/g DTBQJhUXFl3TVDNMwyFHPNVTp4LStoo+wb+vHlzEFAFV2ZFVZ5FhSZJNMQ/OGegRBz2948 jU+ZZdPWhSRtg2OZZQPFQ8P7xhzQ9R1ND9lhhRO2/5A/0oW26KBdotbzmAwT8kw3UUCWEW lhkgxz6OtGX29JgnUxnVvFSnEHKZNaUwO9ZqRx6Cw23HlaXuf39maydiNcSp4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653600805; a=rsa-sha256; cv=none; b=lB5nQpQBnceQBGJk6WOOLCAl9WOENaBSGLhzHTVOggmxzHXf7QUvac+uGAH0OudjbNGGrY HkbCbozpHjqUTHl3S2EgsgpMonjCscUiSE70lwJP5zYUlwyiXdoskg+Wf7QaD9El4eTaXN YCYrGt/1vdQmgu2cy//PpB7dV3IZJweNpVPViN3yxLWn99A3I2+5KnHzpm7mWrdO23Idaq zEKXn3UxU+oqrlofU2GqS/DyEgwtZjyLZvlGJz/xyQmeRbIFVUi4oDtKI8lJoMzfd9gopm UEN0FX5yEvmFk4jjE3KV6WqD1p29dX7iuGZP/2iNNnMsMFbfoY+h24DJ1REz4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8020c05683f266c5513cfe8ad3e58e7e06f85ffa commit 8020c05683f266c5513cfe8ad3e58e7e06f85ffa Author: John Baldwin AuthorDate: 2022-05-26 20:38:20 +0000 Commit: John Baldwin CommitDate: 2022-05-26 21:32:54 +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 --- 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 f7b06a472200..1b896516d546 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