From nobody Mon Aug 31 16:23:27 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 4hYZ6m4M8Fz6r26Q for ; Mon, 31 Aug 2026 16:23:28 +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 4hYZ6m0xn2z44NZ for ; Mon, 31 Aug 2026 16:23:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788193408; 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=eP3Pb7GH51NlX1WbdZ+zZfZpM2T6cpYBffvGjoIhKsg=; b=U8ldJVyyPw/QNNlZPjwWXpKCqT/T54masyaNfLIuV5X9WmxxzDmRvGH//P3+XKrH6MW0a/ 8725qdyLJ2HXcwHxm670ie8Os/1XWJCUKkyq1mqfQuvCmELFJBOYBpR6GKPcxJQ412H3SS mK/PA/3MWFj2XiCHgUiYwsEhq7a7rILgjZ4uH2wlppvYTu4eWnIBf+A3J7iL6RY9EA0HVI PekZpobTPrmIHE/awGwEf38CWNFGwprfb6AzjSsEADPKQlPaJqHFhHrkbevzqflzmOml1u pGs3JLznZNYHNuE2Df+ms4fk8O7U7WoHiIHPokgshzWnygaeV17MfZZFgl0Vzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788193408; a=rsa-sha256; cv=none; b=Z4FIZBDjDBw0iKOOpGk9GTBxbEw90nRtdG6k11aO6CZOG+h8PQODV0xmtSv/B89RFBTFHn iZIN9zedmI4ro94I88PGsqrvs9q5eYGHPvQQFKzu/MZFta48tCc0mP8QbBTseGU+VMBSrI Dt73oFC9vfM+TKiRj2zw8rEoHkBbywAP6xAOlzkeoVHWLd4O23Z79rnOS0QZmgqSG9LG8y sfl4UFL7hfoQwe4PDjY/IZfk7zopy57pl6koME4KFB2GdDl4kcsZHXymNoa/wW2TbeQoHi oFt7PKjSFqE9Oc7kadlDvvK2NZ0AEPVVWhr2Gp/cxLy6n4xP3nnC0S7hnLVN5w== 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=1788193408; 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=eP3Pb7GH51NlX1WbdZ+zZfZpM2T6cpYBffvGjoIhKsg=; b=m007/+eWoj3lb9o9mNuegkXOZ84+/ve6AzdU4Tvj01UUyIvznfmbeUIoweMtcL93+6QpC0 gdRGNXuDpediPbvk5lTHdlvWFUoChpxwiW9FZiDzSGLe/SxWu4cTpXXzvLb0FX4La0mqN3 lfGrEhufrLqeDT6oImJk8CWFEb762LLd3nHZ4ZqrHgOpQdHhisaxnIj0b3P9KI+dZJdZpL 1iW1p4zsX3yg1ejSiwbMIqzKlugH5BzCKgnqRgJ2xLD2rdCl85sJfjGEi8rTJWAavvz1nA i+/wz3xl4ToswpHDvh9RwXEvo5LbdI0AUUjhQ55jxtvwA+FLN1s1KW1/ajh14w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hYZ6l6rj8z44m for ; Mon, 31 Aug 2026 16:23:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3188c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 31 Aug 2026 16:23:27 +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: 2cb719337fb7 - stable/15 - aq(4): enable jumbo frames, software LRO, and suspend/resume 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: 2cb719337fb79c5903873b164c55abcc940da91c Auto-Submitted: auto-generated Date: Mon, 31 Aug 2026 16:23:27 +0000 Message-Id: <6a95aa7f.3188c.5d45db08@gitrepo.freebsd.org> The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2cb719337fb79c5903873b164c55abcc940da91c commit 2cb719337fb79c5903873b164c55abcc940da91c Author: Nick Price AuthorDate: 2026-06-20 19:03:00 +0000 Commit: Ed Maste CommitDate: 2026-08-31 16:17:57 +0000 aq(4): enable jumbo frames, software LRO, and suspend/resume - Configure the RX buffer size from the interface MTU and enable jumbo frames up to 9000 bytes, replacing the fixed standard-frame setup. - Advertise IFCAP_LRO so iflib coalesces received TCP segments with its software tcp_lro(9), like every other in-tree iflib driver (ix/igc/em/vmxnet3); aq does no hardware LRO. iflib builds the per-RX-queue LRO context unconditionally, so the capability bit is all that is required; enabled by default via isc_capenable, toggle at runtime with ifconfig. - Add suspend/shutdown/resume handlers, replacing the unimplemented- function placeholders. aq_if_shutdown/aq_if_suspend stop the interface and deinitialize the hardware; aq_if_resume re-resets the F/W, re-reads the mailbox address and re-selects fw_ops via aq_hw_mpi_create() before iflib re-inits, because the runtime init path (aq_hw_init) reuses the cached mailbox/fw_ops and a D3 power cycle can clear them. iflib calls IFDI_RESUME unconditionally, so this also covers resuming while the interface was administratively down. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57437 (cherry picked from commit b64408358d7f27a69b84d9fd1e23e239e8bd00fc) --- sys/dev/aq/aq_main.c | 49 ++++++++++++++++++++++++++++++------------------- sys/dev/aq/aq_ring.c | 2 +- 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/sys/dev/aq/aq_main.c b/sys/dev/aq/aq_main.c index c7701cc4f6d8..e159ce7e72ff 100644 --- a/sys/dev/aq/aq_main.c +++ b/sys/dev/aq/aq_main.c @@ -392,8 +392,8 @@ aq_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_csum_flags = CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_TSO; #if __FreeBSD__ >= 12 scctx->isc_capabilities = IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_HWCSUM | - IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_VLAN_HWFILTER | IFCAP_VLAN_MTU | - IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM; + IFCAP_TSO | IFCAP_LRO | IFCAP_JUMBO_MTU | IFCAP_VLAN_HWFILTER | + IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM; scctx->isc_capenable = scctx->isc_capabilities; #else if_t ifp; @@ -408,6 +408,8 @@ aq_if_attach_pre(if_ctx_t ctx) HW_ATL_B0_TSO_SIZE - sizeof(struct ether_vlan_header); scctx->isc_tx_tso_segsize_max = HW_ATL_B0_MTU_JUMBO; scctx->isc_min_frame_size = 52; + scctx->isc_max_frame_size = ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN + + ETHER_VLAN_ENCAP_LEN; scctx->isc_txrx = &aq_txrx; scctx->isc_txqsizes[0] = sizeof(aq_tx_desc_t) * scctx->isc_ntxd[0]; @@ -512,21 +514,18 @@ aq_if_detach(if_ctx_t ctx) static int aq_if_shutdown(if_ctx_t ctx) { - - AQ_DBG_ENTER(); - - AQ_XXX_UNIMPLEMENTED_FUNCTION; - - AQ_DBG_EXIT(0); - return (0); + return (aq_if_suspend(ctx)); } static int aq_if_suspend(if_ctx_t ctx) { + struct aq_dev *softc = iflib_get_softc(ctx); + AQ_DBG_ENTER(); - AQ_XXX_UNIMPLEMENTED_FUNCTION; + aq_if_stop(ctx); + aq_hw_deinit(&softc->hw); AQ_DBG_EXIT(0); return (0); @@ -535,12 +534,13 @@ aq_if_suspend(if_ctx_t ctx) static int aq_if_resume(if_ctx_t ctx) { - AQ_DBG_ENTER(); - - AQ_XXX_UNIMPLEMENTED_FUNCTION; + struct aq_dev *softc = iflib_get_softc(ctx); + int err; - AQ_DBG_EXIT(0); - return (0); + AQ_DBG_ENTER(); + err = aq_hw_mpi_create(&softc->hw); + AQ_DBG_EXIT(err); + return (err); } _Static_assert(sizeof(struct aq_ring_stats) % sizeof(counter_u64_t) == 0, @@ -755,6 +755,7 @@ aq_if_init(if_ctx_t ctx) } for (i = 0; i < softc->rx_rings_count; i++) { struct aq_ring *ring = softc->rx_rings[i]; + ring->rx_max_frame_size = iflib_get_rx_mbuf_sz(ctx); err = aq_ring_rx_init(&softc->hw, ring); if (err) { device_printf(softc->dev, @@ -901,11 +902,21 @@ aq_if_multi_set(if_ctx_t ctx) static int aq_if_mtu_set(if_ctx_t ctx, uint32_t mtu) { - int err = 0; - AQ_DBG_ENTER(); + if_softc_ctx_t scctx = iflib_get_softc_ctx(ctx); + uint32_t max_frame; - AQ_DBG_EXIT(err); - return (err); + AQ_DBG_ENTERA("mtu %u", mtu); + + max_frame = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN; + if (max_frame > HW_ATL_B0_MTU_JUMBO) { + AQ_DBG_EXIT(EINVAL); + return (EINVAL); + } + + scctx->isc_max_frame_size = max_frame; + + AQ_DBG_EXIT(0); + return (0); } static void diff --git a/sys/dev/aq/aq_ring.c b/sys/dev/aq/aq_ring.c index 900061437ddb..9b7f6ae2bf0e 100644 --- a/sys/dev/aq/aq_ring.c +++ b/sys/dev/aq/aq_ring.c @@ -371,7 +371,7 @@ aq_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) len = ring->rx_max_frame_size; } else { total_len = le32toh(rx_desc->wb.pkt_len); - len = total_len & (ring->rx_max_frame_size - 1); + len = total_len - (size_t)i * ring->rx_max_frame_size; } ri->iri_frags[i].irf_flid = 0; ri->iri_frags[i].irf_idx = cidx;