From nobody Tue Jun 23 17:01:35 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 4glBDh4f9Jz6hl47 for ; Tue, 23 Jun 2026 17:01:40 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4glBDh40zLz3ddN for ; Tue, 23 Jun 2026 17:01:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782234100; 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=h+z7qmXFa7xwg4G5bT2BCAaIpMIBICiPiCV/xY/q6b4=; b=eSPbcdKSOposVW5hPEey4eSODlaEeCnFBADKseBtw9/Rv6ymYSoM/hSuBHh8pGPLYbF5tF ihlQeakd+z29r/J8pHQWtNxrY+gOrjRuRhnky526ntZIBiX3AgU/B2G7jgYAuJ8m+i+aEJ e8LOGlxmaOk9KFO8ZXznOKDnhapB9qGuVaJvnMuA9JKeC6K/CU+EPnGJ98J5GWpQ0BZw+L BGIpKKYPLBUovw5FqA35GmZdxSzKSLL3J15VzVcqSDh5TWyw86GSjxvuxcbhQaXtPzdL2m OZAnrQqADyWOprqQuvIaCIoQgN6IWV4Ey5BTjbQc88Y/aRN9MYuA+fnRxTLnpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782234100; a=rsa-sha256; cv=none; b=VsaAJmH/2EV3yI4+eKJ0UyMdtigxAzNd23VYYu2kMvN/DnFhrFNnKH875M4gdjGI1NbQFL 6v1e1Q0Pe+3aIZUvFYweIlZ1hOhodHVEWnvR3O8ZWgagQ8szNZRmD6Xfps1u8yOCoEApr+ Nlktgb+G3CUhS8RnJ6XMM2d+8unMUc5C8QrhkK+ZWo9nda5XlhooSY+/aH0n6V1dvRVPie eKxeFyscw8rLxkJseQRqdMZz1C3RRC99dtEDBFNVgVy5hf3MV2j7OtUKxKjvI+QdLEXuo5 BWvpkb62hWX5y6GU1RWJmFDxsC9y2OC5U05zgjYtJgvgf5RSj4xIuvM14onUGw== 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=1782234100; 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=h+z7qmXFa7xwg4G5bT2BCAaIpMIBICiPiCV/xY/q6b4=; b=EZKq0Ra+zRSmas3GQPiJKXMd0razfuipBg/8ZK75Rmn7OCjy90Pgb3xGy+S4FNjmuM3ZTv HBQTWtmt/E7NbxNFC6xK8cCdH7sbFvjDpff/ZKqN3kF6ecVySs7FoB/dI5BrFYeBefmvDI cXfCNwXZrhFdRWoVLR35hcaHhfWxqVVe56tfu+DmBHde9TvqmxSLP9w3gY/sdVxeTBNPhz lebYMStNCKwWpsiudwIV5QPv+JeZIkSv++A8tmgnqrO7Axaxqz60zJtGWoKR5J0ofNyYFF b6FjTFjDkXbmpQdBLTW/MFer2FhJEuA/oeyOOF0Y5bKERTXi+o2s+Mb7zNz4SQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4glBDh2w5Tzjxb for ; Tue, 23 Jun 2026 17:01:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32f64 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 23 Jun 2026 17:01:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 074ff8746388 - main - iflib: handle transient errors from 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: 074ff8746388b3ed8581a84a7eea7b4b3e1bfe23 Auto-Submitted: auto-generated Date: Tue, 23 Jun 2026 17:01:35 +0000 Message-Id: <6a3abbef.32f64.64c7995@gitrepo.freebsd.org> The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=074ff8746388b3ed8581a84a7eea7b4b3e1bfe23 commit 074ff8746388b3ed8581a84a7eea7b4b3e1bfe23 Author: Andrew Gallatin AuthorDate: 2026-06-15 14:20:41 +0000 Commit: Andrew Gallatin CommitDate: 2026-06-23 17:00:55 +0000 iflib: handle transient errors from isc_txd_encap() Until we introduced support for nic ktls offload, all error returns from isc_txd_encap() indicated a permanent failure. Iflib remapped all those failures to ENOMEM, which was treated by the tcp stack as a permanent error and passed back to the caller. This was done to avoid creating "infinite loops" where a packet couldn't be mapped for transmit, and kept being sent over and over. Now that we have support for nic ktls offload, some ktls offload drivers may return ENOBUFS from their encap function to indicate that, for example, the ktls context may not yet be fully initialized. This needs to be treated as a transient error so that the TCP stack may re-try at a later time. To achieve this, pass the raw error back to the caller when the encap routine returns an error aside from EFBIG. Note that I audited all in-tree iflib drivers. Only ice and ixl ran return anything other than 0 from their encap, which is EFBIG. both of which are still treated as they were before. Testing with an out-of-tree ktls offload nic using iflib showed ENOMEM errors from sendmsg() before this change, and no more errors passed back to userspace after this change. Reviewed by: kp, sumit.saxena_broadcom.com Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D57550 --- sys/net/iflib.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 1af9d22db9a2..918dddc51a4f 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -3687,8 +3687,9 @@ defrag: remap = 1; goto defrag; } + goto defrag_failed; } - goto defrag_failed; + goto out_with_error; } /* * err can't possibly be non-zero here, so we don't neet to test it @@ -3697,13 +3698,15 @@ defrag: return (err); defrag_failed: + err = ENOMEM; txq->ift_mbuf_defrag_failed++; +out_with_error: txq->ift_map_failed++; m_freem(*m_headp); DBG_COUNTER_INC(tx_frees); *m_headp = NULL; DBG_COUNTER_INC(encap_txd_encap_fail); - return (ENOMEM); + return (err); } static void