From nobody Sun Aug 16 22:19:51 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 4hNVkv3G7Kz6phHK for ; Sun, 16 Aug 2026 22:19:51 +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 4hNVkv2kcNz3PlT for ; Sun, 16 Aug 2026 22:19:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786918791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RFFsEfd2jD9uezvf8Y0T++LMJyIkebBVYmZeyyJhcjk=; b=IkmMpslhmOpDA7NwM2INN8N30G3ol3gM2+RLUKhIKSrbdsC4y0GF0nvARRsJuQP4bdR84+ YRHSXWd72knruq4/Dr9FHK56kTgHpCVSmLHQ7gX5SbwgsqOXX87j2O7j9DbYTojYmJ5728 /advRpgEjPSpZdGv2ke9mFSK2/zw1/+WQlHlZvQZfADQ+ZM/wA3geWbeeN1Ek16BFWttSb tczBxPejsLWnyxT06zH+Qo0ErV7fi+zCXTLvpLxXhOQsax42bKgibzeCs/Iau8N7Q1TTt6 U2CmrQg2B/0y0aDakRojHLAH9tvvZNLXSc/mEseUoHDq8PemXh5DLSaQgMjN3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786918791; a=rsa-sha256; cv=none; b=REsFb8jY0ljkfvrsL4bkdsndip3CzjosxYV6SWbZRaZsIdwoUEV8Uni57h2+PXGsn6sEdg ttdNpc6n0aVZJyBVEQR+XlZjTC7Xwlj5kU7om2lYm1hLobRSsMYE4IB7+U0afr0ag64cT/ zgRdf5Cyk8tOBoCH2e0TftHoiACdtrbg56QkEr1otlY/IMqye1+rx3eKggA7ZGiyG0SPgv i20Po/IxcKtmiG3FLt6G+Zff4oA+09ww6m+nJTgJIHy7s64exFYS5nQj9GSncFiNeW9dot wZLG7bqVjBbsWOiq0ZlsvJj3h0rejpGeJDVbXLvT9uSBPObXDgx9Mbw272lw6g== 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=1786918791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RFFsEfd2jD9uezvf8Y0T++LMJyIkebBVYmZeyyJhcjk=; b=Stx/x+DgipYXmAtfZIJsEnPBWWimiO4k4/VrqTZ9Bxp7UYkNuwW2xdlj6f7c0U8GSFiGVr lEx5qSkmFjz18Hj/R9/Scw5S19uXu1qkKx9+YD0QNCAil39S7m0XCpgjYCoY84KDUzCc/b cBn1YMJH040CZbEEbEj5FJeoYok/cqXCe+hk5htV9MGZ7Sf4mhco5l3JZNcK8k66FMXGdy LvfCGYm1lSSmUhpIb0Bk6YA0Z1ZZHiSG03m07z7WA1NPjAVW/AlWyz4yOQfUDh7CyBEpFS Ik6iW28oe6d5X1W8SIgSQN+HWjnIyA/yN5zyTOEiPjCVQETdtazZC+ADPNjPTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hNVkv1JBdzmgW for ; Sun, 16 Aug 2026 22:19:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22333 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 16 Aug 2026 22:19:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 8c81b3bdd6b0 - stable/15 - iflib: Add restart transactions for IOV reconfiguration List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 8c81b3bdd6b0fb0e6dc1c3fa3432151d5f26dfaf Auto-Submitted: auto-generated Date: Sun, 16 Aug 2026 22:19:51 +0000 Message-Id: <6a823787.22333.7ae9751@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=8c81b3bdd6b0fb0e6dc1c3fa3432151d5f26dfaf commit 8c81b3bdd6b0fb0e6dc1c3fa3432151d5f26dfaf Author: Kevin Bowling AuthorDate: 2026-07-28 21:53:18 +0000 Commit: Kevin Bowling CommitDate: 2026-08-16 22:18:47 +0000 iflib: Add restart transactions for IOV reconfiguration Some devices remap the PF queues when entering or leaving SR-IOV. Add opt-in PCI IOV helpers that hold the iflib context lock across the complete stop, driver callback, and restart transaction. Existing drivers continue to use the non-restarting helpers. Sponsored by: BBOX.io (cherry picked from commit f8fa2d77bc305bec519f9f02afe211e903c57573) --- sys/net/iflib.c | 22 ++++++++++++++++++++++ sys/net/iflib.h | 2 ++ 2 files changed, 24 insertions(+) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 711c27f62939..3ea5296fd2ae 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -5486,6 +5486,28 @@ iflib_device_iov_uninit(device_t dev) CTX_UNLOCK(ctx); } +void +iflib_device_iov_uninit_restart(device_t dev) +{ + if_ctx_t ctx; + bool restart; + + ctx = device_get_softc(dev); + + CTX_LOCK(ctx); + /* + * RUNNING can be clear while a watchdog reset is pending but the + * hardware is still live. Always stop before the driver changes its + * queue layout, and use IFF_UP only to preserve administrative state. + */ + restart = (if_getflags(ctx->ifc_ifp) & IFF_UP) != 0; + iflib_stop(ctx); + IFDI_IOV_UNINIT(ctx); + if (restart) + iflib_init_locked(ctx); + CTX_UNLOCK(ctx); +} + int iflib_device_iov_add_vf(device_t dev, uint16_t vfnum, const nvlist_t *params) { diff --git a/sys/net/iflib.h b/sys/net/iflib.h index 47b461311b09..ed97796b550c 100644 --- a/sys/net/iflib.h +++ b/sys/net/iflib.h @@ -447,7 +447,9 @@ int iflib_device_shutdown(device_t); int iflib_device_probe_vendor(device_t); int iflib_device_iov_init(device_t, uint16_t, const nvlist_t *); +int iflib_device_iov_init_restart(device_t, uint16_t, const nvlist_t *); void iflib_device_iov_uninit(device_t); +void iflib_device_iov_uninit_restart(device_t); int iflib_device_iov_add_vf(device_t, uint16_t, const nvlist_t *); /*