From nobody Thu Oct 29 06:03:05 2026 X-Original-To: dev-commits-src-branches@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 4jFYYk1WTrz6xrYr for ; Thu, 29 Oct 2026 06:03:06 +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 4jFYYj6r9Yz4sP6 for ; Thu, 29 Oct 2026 06:03:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793253786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hMgNb0C9r3uk/nvWyKEdQyXviADnOWXXFkElbzjN+D0=; b=cyrI9rYmIfz5gwfmFs8C+oYumsImDeCMqMoBaZ5RMgofoZ1ghtIQwLH5owK0SKd2dAe3BL MHw6/v13luQU1JgEYAOzuAyRn8BxufodkyV3PdKUfwtWtSE09ivVVcx0MT049KUJeyx9uh 6GKRQeh0bmlJQYHNNUL6/lVL8qWu+9xXfQHfToYF9WbmRq8o3ntfZZZwCoNPPKD2Bd5Cfx obhzN938FL7x0I0a6LhoQF41oWhgQxt9VsiPieMzWY053yq0gI0m4rp1Vrj+1UBWnHAv1l m1ZsJ7Y1H0KDvLjWzRgFXUTSzabUdOyZl8Z0xC/CQBs6sIuvvN6Oc5wndDvrIQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793253786; b=vn++BVjg9S0ocsI/RbjQlBsY/yLx2bEW2zpQXvBcXtBNySPyMFc1WORXRvajrA6jQdil+o eEkIqiuasohByZhHPDAX4ieiaO/0qnWuynjKrcRL90QpzsxaluCR9fbojGJUkncqWS+Q5f gyiKUSCKQMjmPOukRoVtymnHCU/iz2wDSu/m77SWjr6Urek+JthnsvHqv2MFCj/zVhU5gp BxnkY+A2X9+uVIuUg0QSLiVHjVtcAKoJTG/lX6Y3GYKt5MdR5nA98QFAPeE3fuolUn4NIY z0HnwFtOdXJ7Q3w9P2P50ENBPypYsOAx/EVX1fefXQz6TjaqvrXQqccvvk53iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793253786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hMgNb0C9r3uk/nvWyKEdQyXviADnOWXXFkElbzjN+D0=; b=wOGmLvT7eT5ZWtpsfT/r5UPac4U894Ba1eJnd9GASHyICQCfNX/awFs6fpIbZmM9S3taOv 9zTlRNgxPQhMv1vLt5qrHw78aWTM1a9OrFse90AgeW6wvovkVufGYpeceT1P5dVCKb2oUI FV8FQ+yNvOURTB+CtX6bWIh3s3ENda5RJDa9CID9cR+czIe7xjzrk8OuQISU1voIi2v9m8 Tc9nhzquIqQZdkVuyrXiaGMF2Oe9hEv6laEMe+esh74/763WXWECNaOVyAhW9Ltjpus59C Bt866Umx0hIAaVhfo4wnvxUdelv9dlYecqBWLkq1sZzGJJ0jnhnqvuze7whSvQ== 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 4jFYYj6Vr0zR5m for ; Thu, 29 Oct 2026 06:03:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 396cf by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Oct 2026 06:03:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Andrew Gallatin From: Kevin Bowling Subject: git: 57e7572fcbe8 - stable/15 - iflib: handle transient errors from isc_txd_encap() List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: Commits to the stable branches of the FreeBSD 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: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 57e7572fcbe84d45de5eddfba4b9c387c47c325f Auto-Submitted: auto-generated Date: Thu, 29 Oct 2026 06:03:05 +0000 Message-Id: <6ae2e199.396cf.78179964@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=57e7572fcbe84d45de5eddfba4b9c387c47c325f commit 57e7572fcbe84d45de5eddfba4b9c387c47c325f Author: Andrew Gallatin AuthorDate: 2026-06-15 14:20:41 +0000 Commit: Kevin Bowling CommitDate: 2026-10-29 05:28:16 +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 (cherry picked from commit 074ff8746388b3ed8581a84a7eea7b4b3e1bfe23) --- 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 3f7b1b84b514..f8403ff7c1a4 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -3824,8 +3824,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 @@ -3834,13 +3835,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