From nobody Mon Aug 31 17:18:37 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 4hYbLQ0Zkfz6r5qb for ; Mon, 31 Aug 2026 17:18:38 +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 4hYbLP509Tz3Hct for ; Mon, 31 Aug 2026 17:18:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788196717; 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=EdHatOQoehENctpqT2MQYSol//NsMCXuHggIOp0uC/c=; b=WxOcgJNSV5PHXxVdZeV/h61JwjgggetT5JYs1PxUNj748nZFSHIDeAbAuUqqYcfVOd3POC Tr0lGsJDCQKaH2n/fE7XjPvZIBCWi/JW6B6dcuglDFH+exSgBIvpOu8kZd7j9ZSwFDnSN7 rKBbKvWMYmo1RD6D3XBSF3jQCelSTe+OLpJeJpvWboPweiOfEBVsaRFbsH5p76BkrkJVq+ CFw+Ksr0SUqotNFDpQLpM19A17EqeH1VD4m45uiDv9xwYuNnGJB/7IatmKGZQq7PSWPgpR B38i235H4KJlX2sIVpkrLJXLD2bKptRO0f5lgrXmLnO+176lSLGVOFNCTO6+vw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788196717; a=rsa-sha256; cv=none; b=RWi8N4PCo5F80gc96imPSj0YXQ5nfgHgVO+C0QYnQlJnMiinDKCPLlNFAAEsl8cXd45LiP 46FEp1TiaPdx0xNoPyvxWYJDAPL0qe8/4y9LLoiQxiQM/F98S9B/7OZKm9Mq2+7wc0agYW 9iOg6q3jhl5nYjABo9+4G42yj8qSxlYLuO4g2WpJWoZ2OKUm/j6OILgQ6lt/hSH6Azr/n8 c6ywyKJcg0eIO3dJc+KNyBw98ch15ccCuj1PdUF1xGtgkwGDPFf09QeEuK5N3rkwCByQIT /CveTZsE6wrCg+bY96rGBW1cb8vec0bo/DZt0WkJ9R5/yamsgVgDZVHvDxmnSQ== 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=1788196717; 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=EdHatOQoehENctpqT2MQYSol//NsMCXuHggIOp0uC/c=; b=LDlKk91KxTep/YJlkD5Y0IwWGHkQqrgTFvbr38VKhymcWj00JyulWOSwzfSdZ1oS9CNBJS 3kEKWgWf0MNtgWFDwae8CNL64/xnfRSqebSnPex2/C9voqjpthJStb3XUNO8l/f68QSUlM cZ8BbljYx4EUjHG/HRrmrrFbMV93WbDePMBvBEV0pO3fCryVTn9IDnLe63qQ856RkX0vBx ee++OqnjYgwyyZbtzGxdqxnv/V1FKnBZQe21Yjz1rtGVV6FcX6TRelIFZK/zP46V64QBKO QtWWsyAsvHE+yzBpopqte1quXker4leGN6p2lLd4pN2Zt0MfJm/b+EcUvF9qUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hYbLP3ZVGz5Vk for ; Mon, 31 Aug 2026 17:18:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35fb7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 31 Aug 2026 17:18:37 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Nick Price From: Ed Maste Subject: git: dcfe983dd5fc - stable/15 - 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: dcfe983dd5fc0ebff5cd525cae49fedc0f524ebf Auto-Submitted: auto-generated Date: Mon, 31 Aug 2026 17:18:37 +0000 Message-Id: <6a95b76d.35fb7.1e7ee288@gitrepo.freebsd.org> The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=dcfe983dd5fc0ebff5cd525cae49fedc0f524ebf commit dcfe983dd5fc0ebff5cd525cae49fedc0f524ebf Author: Nick Price AuthorDate: 2026-07-19 16:40:46 +0000 Commit: Ed Maste CommitDate: 2026-08-31 17:17:12 +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 (cherry picked from commit 73cd4048807dc0b3a5329bfc9a80ea4bf2d975fd) --- 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;