From nobody Sun Jul 19 16:49:11 2026 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 4h38kJ4xFXz6fpBF for ; Sun, 19 Jul 2026 16:49:12 +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 4h38kH6CnSz43b8 for ; Sun, 19 Jul 2026 16:49:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784479751; 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=U90apVR3Ch+RfYo3sw4IE52LPPM8yy8yOTmsAMIYBHM=; b=WpkRR7fkftJPuslcjkcWrOXoybaDmQdXLGD59fPPZF3YNiufa2J0N61pBOkhXI81G7geUp gJmSVU6D+RS5/tkXT2GNys8WDYyRNB9MrFmXe7j3tPAQNxCyjD9DqxtuN7pXhcCae1d4j9 tFQNi5Ev+amRnbUAxfv3fUdr+dsSO+s8EYUzFJ9hbmyWKNQVvMkz3JXMRamBaZ6LQmTrjY dlVnbDjNDVUtzn6YHNHpHk3TmwJt8G0ujJaZihSKDiQrm33UkVmcysFH4ExXWQ/KNFTvpf RSX9EhCmBNl9VQDf/Hc6bxqconR1knnXCsqrCG8DYgHyizPiDtGGspoPs4UExw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1784479751; a=rsa-sha256; cv=none; b=wpDNaeLF/bItq3NLNLJmxISH4Jwzthy4qvM60AK/0hepHTpGFy+VHGPMh0wRRzkDkn94h7 fKJQ9vJPvVEEoWQuMcPHHhIZAmmqMLJG7XP+NlLtByyO6/56ichKy11QeWfXVuQjP4T2rd Ru14KOo2RluRs/2+iM0FXud3Iw8U2gv2HSGuXtHeKh5GyN/Cv4ExXQ9IDAWDL+/CPUaYcN Gbh8J30y4ZiPRKf0rU1+uOxBjv0jro06rcR5PPiGoANWosOoLhGeCx46dh4WiL6JqZrcNV o8xuFCt4uHYsi/0zS++BLr5SMVkQw4AHx3CteMCwmvweVjQ6ZGnIvWmZmMDsjQ== 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=1784479751; 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=U90apVR3Ch+RfYo3sw4IE52LPPM8yy8yOTmsAMIYBHM=; b=ISPAfXTKF7w8U4v4QntO8FZPY5YTo3HZo8K7+d0XsLlu9LNflqIFFZZj/+MQZ4/65qLdw5 9TqiIupfEOkplYUDIw+rLOGO92nukCqcSxMe58QegNPv7ILlBy+/9jENp6r5h+amG4zhjV o3tiz/ZtSuqkRWBMoenVMff4af/Ly70AzPoT87zeakjVWHNAKhYXUTqU0QcBzqNIcPo/xG ZG0J7StxP35cblvczZwRPc98e/MmRDzj6s6hIKtV1Coph0h2DPbdnDpeI6MbDno3RA1ZMg 9OjmtSciaSIevdwYmqdJ52oqHlsCg/euYJJ9eoVMwVfl43DbwUnjcwKuwpj/cQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h38kH4c3Jz7LV for ; Sun, 19 Jul 2026 16:49:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31895 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Jul 2026 16:49:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Nick Price From: Adrian Chadd Subject: git: 73cd4048807d - main - aq(4): drop errored RX frames instead of resetting the interface 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 73cd4048807dc0b3a5329bfc9a80ea4bf2d975fd Auto-Submitted: auto-generated Date: Sun, 19 Jul 2026 16:49:11 +0000 Message-Id: <6a5d0007.31895.7826cc7b@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=73cd4048807dc0b3a5329bfc9a80ea4bf2d975fd commit 73cd4048807dc0b3a5329bfc9a80ea4bf2d975fd Author: Nick Price AuthorDate: 2026-07-19 16:40:46 +0000 Commit: Adrian Chadd CommitDate: 2026-07-19 16:40:46 +0000 aq(4): drop errored RX frames instead of resetting the interface aq_isc_rxd_pkt_get() returned EBADMSG when a receive descriptor's MAC/receive-error bit (rx_stat bit 0) was set. iflib treats any error from isc_rxd_pkt_get() as a fatal ring fault and answers with IFC_DO_RESET -- a full interface reinitialization. A per-frame receive error is not a ring fault: on a marginal link or cable the Atlantic delivers errored frames continuously, so each one triggered another reset and the interface reset-stormed itself into carrying no traffic instead of merely dropping the bad frames. The Atlantic delivers errored frames to the host by design (Linux drops them in software via buff->is_error), and iflib offers no per-frame error return that isn't a reset. Follow the vmxnet3 model: on a receive error zero the fragment lengths and return success. iflib then discards the packet (assemble_segments() excludes zero-length fragments) while still recycling the descriptors through the refill path -- no reset. Also drop frames flagged with an RX-DMA fault (rdm_err), not just the MAC-error bit; and keep iri_len non-zero on that drop path, since iflib asserts iri_len != 0. The genuinely structural errors -- more segments than isc_rx_nsegments, or a pkt_len inconsistent with the descriptor count -- still return EBADMSG, since those indicate a confused ring where a reset is the right recovery. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D58136 --- sys/dev/aq/aq_ring.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/sys/dev/aq/aq_ring.c b/sys/dev/aq/aq_ring.c index 8307fb0b3474..6afec86c63bc 100644 --- a/sys/dev/aq/aq_ring.c +++ b/sys/dev/aq/aq_ring.c @@ -333,11 +333,13 @@ aq_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) if_t ifp; int cidx, rc = 0, i; size_t len, total_len; + bool is_error = false; AQ_DBG_ENTERA("[%d] start=%d", ring->index, ri->iri_cidx); cidx = ri->iri_cidx; ifp = iflib_get_ifp(aq_dev->ctx); i = 0; + total_len = 0; do { if (i >= aq_dev->sctx->isc_rx_nsegments) @@ -348,11 +350,15 @@ aq_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) trace_aq_rx_descr(ring->index, cidx, (volatile uint64_t *)rx_desc); - if ((rx_desc->wb.rx_stat & BIT(0)) != 0) - goto rx_err; + /* MAC error (rx_stat) or RX-DMA fault (rdm_err) -> drop. */ + if ((rx_desc->wb.rx_stat & BIT(0)) != 0 || rx_desc->wb.rdm_err) + is_error = true; if (!rx_desc->wb.eop) { len = ring->rx_buf_size; + } else if (is_error) { + total_len = le32toh(rx_desc->wb.pkt_len); + len = 0; } else { total_len = le32toh(rx_desc->wb.pkt_len); if (total_len < (size_t)i * ring->rx_buf_size) @@ -375,6 +381,19 @@ aq_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) cidx = aq_next(cidx, ring->rx_size - 1); } while (!rx_desc->wb.eop); + ri->iri_nfrags = i; + ri->iri_len = total_len; + + /* Per-frame RX error: drop (zero-length frags), don't reset. */ + if (is_error) { + counter_u64_add(ring->stats.rx_err, 1); + for (i = 0; i < ri->iri_nfrags; i++) + ri->iri_frags[i].irf_len = 0; + if (ri->iri_len == 0) + ri->iri_len = 1; /* iflib asserts iri_len != 0 */ + goto exit; + } + if ((if_getcapenable(ifp) & IFCAP_RXCSUM) != 0) { aq_rx_set_cso_flags(rx_desc, ri); } @@ -383,9 +402,6 @@ aq_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) ri->iri_flowid = le32toh(rx_desc->wb.rss_hash); } - ri->iri_len = total_len; - ri->iri_nfrags = i; - counter_u64_add(ring->stats.rx_bytes, total_len); counter_u64_add(ring->stats.rx_pkts, 1); goto exit;