From nobody Thu Sep 03 14:45:55 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 4hbMpr3B1jz6rMyV for ; Thu, 03 Sep 2026 14:45:56 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hbMpr0dNmz40fy for ; Thu, 03 Sep 2026 14:45:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788446756; 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=BjzcmC2ahtw3753Yii4gbapEnG0Yl1E14/w+8uvx8R4=; b=eoNAqVSad+XiDc9WoJlv40Af2UrapWb1mcl30xBcQJg1tYTr5OjsVxkklnxbKRL36a/Wyq cOhroN/+nCehVnyUYLnQ6kmLkzlUbmvc3lzp29XqrQhf3tZc0koHiMEOh4LwpsmIjdYo+4 RFMdkBgvnirs/l6aTFQuckDrx5y0k0lFPQ+ybecYG2f7YpG62Bn2akDYyPGY863SSf6bTJ jFr/9WLbAuhzKV4WBYj40bEw5haJPn/PplZGyU18aKLXkkAXTyJwvjESoN3lGCnZoVmyoi k2l3zt0B7QXdakjXNBcGLLstZ0UcMA0AfleG5wfnSh/Az8FSRMshdbcjqoPRyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788446756; a=rsa-sha256; cv=none; b=IZdrlKPVyu1VeJBXh+6o9sXb8fBzv5H8u50WuXVg8DD8Wpx6s0A4i9Vn0CzIt03VSVyH7L DrCmIKRmCZyVTvN7IfXc9Pu4uDnsSeQWkolTXOA8lRKx0ikpNNLcQrMw0c2YXnctcTmS3R 09A5JB2mkzTjisl9Fxa+LWDKYldILKFONWCQAVRQYGFiDRXYyFK8HwLPqy+1lvzzCDylMQ zMugC7V2mdyPJoW5YZikBvrVvNUclJomIyat4VKFaulbZCYiCG/142w4NktFZj7kuy1n1M lAOcFkej0sE0KwnZjawrorvr2asFVf0kXgZOAAx6rxA676np+YdF68RW3CU//A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788446756; 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=BjzcmC2ahtw3753Yii4gbapEnG0Yl1E14/w+8uvx8R4=; b=Qa/bLELFl9rIU1PFC22qIpRZ8DlltbE1WyxXhu4zugd8gX3yBuGdSerL/riY5cpBOvDO3t jFz6QKgE1YQB07DxD9D1d0w2sAdF0ZGmVX2mM5bZyCwiwl3433uFnCCLFCb5Ud1zA+jKTz xeHWUgXQmDdze/3tVD3hwo0e+frvftd7EBaarHg9/B+SK5AF3hr+UW5GG9GPXtNlwxyuPG Ete3ZVdvcKxVWQ1qXoRtqBO/nlmOI651X+zbs9bW1zWAflpFqlNnC4AxpCZQG2gwfM3swx Tzhwdfyg67eDNkxnWJuHoCprTY+F6ULHLLd1PeTKlcoeTs0cLdRyl8V6t/8gvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hbMpq6lGQz30k for ; Thu, 03 Sep 2026 14:45:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25d09 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 03 Sep 2026 14:45:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: a5bb0fde6722 - main - iflib: update rs_pending based on descriptors consumed by isc_txd_encap 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: 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: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a5bb0fde672271f7a4c5a460ed0cd0282a18ca66 Auto-Submitted: auto-generated Date: Thu, 03 Sep 2026 14:45:55 +0000 Message-Id: <6a998823.25d09.2ce78a6b@gitrepo.freebsd.org> The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=a5bb0fde672271f7a4c5a460ed0cd0282a18ca66 commit a5bb0fde672271f7a4c5a460ed0cd0282a18ca66 Author: Andrew Gallatin AuthorDate: 2026-09-02 17:41:32 +0000 Commit: Andrew Gallatin CommitDate: 2026-09-03 14:23:55 +0000 iflib: update rs_pending based on descriptors consumed by isc_txd_encap The new watchdog code triggers spurious watchdog resets on NICs doing KTLS offload. Fix this by using the actual segments consumed by the NIC driver's isc_txd_encap. The issue is that rs_pending is updated using an estimate of the descriptors that will be used for the current packet, based on what bus_dma produced. However, NICs which support ktls offload may do extra DMAs (and consume extra descriptors) to derive crypto state when re-transmitting TLS segments. This is the reason for allowing drivers to control ift_pad. When this happens, the estimated rs_pending may undercount. This may also happen if NIC drivers consume extra descriptors for other reasons. (eg, hw errata handling on e1000) Reviewed by: kbowling Differential Revision: https://reviews.freebsd.org/D59321 Sponsored-by: Netflix --- sys/net/iflib.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 7a6e817f6073..0c2b03c0b5f3 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -2462,8 +2462,7 @@ iflib_timer(void *arg) * (ift_processed) nor reclaimed (ift_cleaned accounts * the difference to ift_in_use). The tail whose * report-status request is still deferred is never - * reported and must not count (ift_rs_pending - * over-counts it by one per packet). + * reported and must not count. */ in_use = txq->ift_in_use; outstanding = in_use - @@ -3756,11 +3755,9 @@ defrag: * However, this also means that the driver will need to keep track * of the descriptors that RS was set on to check them for the DD bit. */ - txq->ift_rs_pending += nsegs + 1; - if (txq->ift_rs_pending > TXQ_MAX_RS_DEFERRED(txq) || + if (txq->ift_rs_pending + nsegs + 1 > TXQ_MAX_RS_DEFERRED(txq) || iflib_no_tx_batch || (TXQ_AVAIL(txq) - nsegs) <= MAX_TX_DESC(ctx)) { pi.ipi_flags |= IPI_TX_INTR; - txq->ift_rs_pending = 0; } pi.ipi_segs = segs; @@ -3780,6 +3777,11 @@ defrag: ndesc += txq->ift_size; txq->ift_gen = 1; } + + if (pi.ipi_flags & IPI_TX_INTR) + txq->ift_rs_pending = 0; + else + txq->ift_rs_pending += ndesc; /* * drivers can need up to ift_pad sentinels */