From nobody Thu Nov 19 15:42:36 2026 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 4jVjQh53xgz71GdR for ; Thu, 19 Nov 2026 15:42:36 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jVjQh1ynBz3C5r for ; Thu, 19 Nov 2026 15:42:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795102956; 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=2Qaat6oaMdBGf/RTGs5Q2txK+PVCluznDfxVc8xIGv0=; b=XY6jDDTt3Ci/X8jb+pwo8yKyfZxwbdWXXv0rc5fZyst4qi3QQ0S7QCwtqUEnD6XYiC31Hh d4dVTieiURsNKxYCfI/HAlikDfNKm3YbEo3EjEzMf2cThP/Ya5Z8UxtpkZpM5riyNzY07m JsRAZeOVtnF1GG2JH3AJ1QMLSb7mOB01QtqUWm1oV0zqlFTt0Q/L8Wi2zfYD4hUWc9ryGd /MU0Ai0nSuPnfj1Ez6s3vmza50UeupNf6JtlT0EdnIOHCP65l0BuIALwTc9gP34HKCE7C4 cH36dMuqWOVphcSNMmX59lzqU1IU/3OGdBK7hRn5h4htISrJ3R67nL/+o6Hr4A== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795102956; b=aExbFHLgis5bShaMI/4aGaKPBBKjhups+yMMgcDMovQKMdwezoAOXiRgbXirVvBMAUTtiK Vz0AyesGrn67/K9SNP7E8KeBPJGMqI2x5OEEted6updr7TqdEIH7uGX9MEHNRwBJlte753 YmbBtW2rDib14ef5g61+1ko3a9RfdqoGchf3EoDjrKoETqqoWAgPB3r514cRck/WcYuiIF 8xTGOM544pNcAKRjb4BEkhpV7OOAA+syAKdMOS5vklyjk+gopsQ1OyO2VFfMmuEuMWOIJD bFQ0Yj47qJDCV5uKpN3Qq+p2GonOqFOQuNCophbcSqPc/ivxgOwmgjvt1OolWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795102956; 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=2Qaat6oaMdBGf/RTGs5Q2txK+PVCluznDfxVc8xIGv0=; b=RR4+T9DE4uqPmdeXG1y0URmc0u6F31ybNClEUh1nu11OJA0+F/PXsev4CQGfoLW48hbWBu VphINzQxY5NimsCCi65tsGj4tNt2MG+yAfNlNBJlHDFYu296NB6QN0FHKyYOK3Ciq2boqN IPIF5BZ1T1h+7VvCFYB7dy5Mn52bwCs2v8uNvse2Jq3+Bnac31Qk94cGIHAikAohrXNf2Y T/FzSLFI/KadEFxuJnNZzMxJCD19qhBznC9+Qy9M0goyz4m+M6B8j+kVV2PhO6m74DDBGc WLakYHORCIJBnjJTKQC4OKC5OsPX//N7R9YQcQdIthsonzg1aKj66CfvihKajA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jVjQh1Yggz15N6 for ; Thu, 19 Nov 2026 15:42:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id ddc9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 19 Nov 2026 15:42:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 6c1a74d7b72a - stable/15 - cxgbe: Don't cache nsegs for KTLS requests List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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/15 X-Git-Reftype: branch X-Git-Commit: 6c1a74d7b72a2a9b2cc6c5c271405a8639597d91 Auto-Submitted: auto-generated Date: Thu, 19 Nov 2026 15:42:36 +0000 Message-Id: <6aff18ec.ddc9.1a37b386@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6c1a74d7b72a2a9b2cc6c5c271405a8639597d91 commit 6c1a74d7b72a2a9b2cc6c5c271405a8639597d91 Author: John Baldwin AuthorDate: 2026-09-30 19:19:11 +0000 Commit: John Baldwin CommitDate: 2026-11-19 15:42:20 +0000 cxgbe: Don't cache nsegs for KTLS requests KTLS mbufs are initially parsed when they are first enqueued to estimate the number of transmit descriptors needed so that the mbuf is queued until enough descriptors are available. As part of this estimate, the number of DSGL segments required by each KTLS mbuf is calculated. Originally, the count for the first TLS record in a chain was cached in the header mbuf to avoid having to recalculate it when writing out the actual work request for the first TLS record, but this requires duplicating fairly complex logic both when parsing and transmitting requests. Sponsored by: Chelsio Communications (cherry picked from commit 6d587ff04b71cb82a1e98fd84b5e0257dd65fec9) --- sys/dev/cxgbe/crypto/t7_kern_tls.c | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/sys/dev/cxgbe/crypto/t7_kern_tls.c b/sys/dev/cxgbe/crypto/t7_kern_tls.c index 8e54adacb368..cba02b6f676a 100644 --- a/sys/dev/cxgbe/crypto/t7_kern_tls.c +++ b/sys/dev/cxgbe/crypto/t7_kern_tls.c @@ -857,7 +857,6 @@ t7_ktls_parse_pkt(struct mbuf *m) MPASS(m->m_next->m_flags & M_EXTPG); tot_len = 0; - nsegs = -1; /* * Each of the remaining mbufs in the chain should reference a @@ -874,13 +873,6 @@ t7_ktls_parse_pkt(struct mbuf *m) if (wr_len > SGE_MAX_WR_LEN || nsegs > TX_SGL_SEGS) return (EFBIG); tot_len += roundup2(wr_len, EQ_ESIZE); - - /* - * Store 'nsegs' for the first TLS record in the - * header mbuf's metadata. - */ - if (m_tls == m->m_next) - set_mbuf_nsegs(m, nsegs); } MPASS(tot_len != 0); @@ -894,9 +886,9 @@ t7_ktls_parse_pkt(struct mbuf *m) if (error == 0) { #ifdef VERBOSE_TRACES CTR(KTR_CXGBE, - "%s: %p len16 %d nsegs %d TCP seq %u deferred", + "%s: %p len16 %d TCP seq %u deferred", __func__, tlsp, mbuf_len16(m), - nsegs, ntohl(tcp->th_seq)); + ntohl(tcp->th_seq)); #endif } TXQ_UNLOCK(tlsp->txq); @@ -907,8 +899,7 @@ t7_ktls_parse_pkt(struct mbuf *m) } #ifdef VERBOSE_TRACES - CTR(KTR_CXGBE, "%s: %p len16 %d nsegs %d", __func__, tlsp, - mbuf_len16(m), nsegs); + CTR(KTR_CXGBE, "%s: %p len16 %d", __func__, tlsp, mbuf_len16(m)); #endif items[0] = m; error = mp_ring_enqueue(tlsp->txq->r, items, 1, 256); @@ -1464,16 +1455,8 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq *txq, #endif } - /* - * Use cached value for first record in chain if not using - * partial GCM mode. ktls_parse_pkt() calculates nsegs based - * on send_partial_ghash being false. - */ - if (m->m_next == m_tls && !send_partial_ghash) - nsegs = mbuf_nsegs(m); - else - nsegs = sglist_count_mbuf_epg(m_tls, - m_tls->m_epg_hdrlen + offset, plen); + nsegs = sglist_count_mbuf_epg(m_tls, m_tls->m_epg_hdrlen + offset, + plen); /* Determine if we need an LSO header. */ need_lso = (m_tls->m_len > mss);