From nobody Sun Jul 19 16:49:11 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 4h38kJ3l9hz6fpRb 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 4h38kJ16Jvz43jn for ; Sun, 19 Jul 2026 16:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784479752; 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=RW07gJZoM8HV38iToYUujCFkgRx692sr2uAhhqOsTpXTu8Q/GSqen7Ys7YgKi7YOiyNNbo 0jN6H3NqYCRisuMv+SmGWNBaggsL2vzwhwEdpNI+NJBugXK+YiOvgneQIRBNHEauo40GBo 1hM5Zs3YgfE31jr1cbYPHQQhrz915bFudKxQl+XIz9haO8LYQe9OTYSUff5Exj22Oif8Mg PnldWLHFGvnK1/sadzAiczz8cgATgBOmYZDIJUuiiYJaRavityjBpCMlV+WjoBSatpmoGw svGT9BnxDhdYAytsO2oYG94WHpCtrZ2JRSGMsrp3MnhLS3aDeLzz1wiziBvlkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1784479752; a=rsa-sha256; cv=none; b=hQgBMNDPtZx2GHFnmY+ylbIDKD9UCldrHAWH8lQvwgjPF42L1hZSSNwyjXfLIFWNTb0Kmp y797BChRG7poytDj5PHf0uaAStvgkvqys4+nqnPqSEeRGNJu8aSq/HL6uGDH1gyWg9W6K+ h/a+a4UbIekezYSe9oWUVO1T4GpnlPPdIIwK3Nsc71/3yofPLVoqvHuFVPPhDborGXJ7De 223KtZfAm6ge994ua5dQWf/K2WCOxVil46HAmsOT3NXF8jLAQeGgtVceX5NS0kX1S3KEUO 5oNlWNIYgx30OCP+Rj2CExP4b1VpqlM9GsxxsPb6GmslYSZhSXDsWObLu+O+fw== 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=1784479752; 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=kJKmdwae/GR8pE6myZXsgoh1XT/4v64YPluWcixdnOyiP036Qr0cljmqfYaSpRldh2RZ9C APfE1vyGXKDumwP/W0gwywolJNsF2o7q9zVutAu8hGV2ySp+B0pXDsTK1rowFs09+c6s2Q 9OBIF70KTQnWWttNCGHv9o/V3kBSk+DK6u3cO32OzlSB8D5XeIy4VwhZL/J5uwpXFRoSQq 5xuRNHUhtQPGwMG9+6WAfinJGC/xe1DuZ79CHTsmH0T0/x08QoH9obB4j2+w/UBLOMDieu fWwczLPbzpi/CXY+9DPJzgS7YTPKahzsylw3Xi4x4nRK/BodPmrhYwBoMu8tdQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h38kH4jzCz81S 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 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: 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;