From nobody Fri Aug 7 07:25:14 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 4hGbJv2fPCz6p4h4 for ; Fri, 07 Aug 2026 07:25:19 +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 4hGbJv1qNmz3W1y for ; Fri, 07 Aug 2026 07:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786087519; 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=22VfABh+R8qQbMN6UeOnJPvQaR/gfT4t44JlPLAKZ8g=; b=lx0sVdv6RfYjkNMu/kmhxzXyBALc0haf4WESOlzIa7xf0coUrgy13QleeO+wv4lPR/YcRZ MC6V0viw5UQg2njmEieAYNrH9gl/wHi2hevdTYvegwuDxfBn0tOXCEOxDI3TrjQSckwemj IgKxTWARTS4lf6QVSsYBT02RUQcP5GSsB47pecwaAhPcC8WXJCMgIlB6EbeIt6Mc6ZTBvP 9/tk2IQ2LFseiyxgeAoOTnCZvNEJ03ITKJC3zBKwMGLsfOaQkKzcv9eY8I9hTihbGzOUft 8Q3+Ed8/49JaTeQoXc18o2t7AfKdey18eXSzJ91L+tmZp+Sg9powKUgLqO+6qQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786087519; a=rsa-sha256; cv=none; b=c6z1DqpHa0WLu9aQO0jQDRGZkcnSiytFLnZbENi71zBfISUm2NnfCc8Sg7jaNpGDryhDyP HiTM8pM4CuYiHTGgIQnctSh5MiFAFpzBOLgOn2TWNgi45fFpL+YwnqfKCb+QEcfeNuQzGO Qxk63i9I1+4fLubOSPnf1I3j3fNB7N2MUnDji5a/cmPTGLQf1TPt3fLAOcE9VfZZXpCkxH PtHOjJ8uUZMfkre9Dno61wuOZhvcw2AOuxLuvmt6zca24O6C1xUl5FggH2NxCVpcpBMJI2 GcGpUVfxfkKolZQEipgqHJXbXLzf9NzHYgOInpTQmI6tumF+lzE46U7/No5GIA== 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=1786087519; 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=22VfABh+R8qQbMN6UeOnJPvQaR/gfT4t44JlPLAKZ8g=; b=bclEZG2oH9U4GrLUcKJq3OqW2pkdXq0qIhA3uUHZfjFpv/deI+xykoTDFzgrZ2XblTKKWT oBcV1hP6L1a4Md7Mw7e7wcnhmcHeRYo9WCNKnpwhYok4EsAZAxP8d3bhSxMvVJtfqnN8qf vTcOv7kTN7YmndVKKTkC6lK97beV5X3oaZIkyp7dmE07Yr4R4ul2+i4ZZEPkkZY4IFivGU aqhoGkB2TiqNdSQsKWAabs5Gc2gFauSGYRSpclF7tRGXzx1IGpyM9mHbfs4Rqgxgle7yrB R1wvYST0MbbQXznjm8pKTTZvQJX2xabw2BmL+iN1Ov1gqolEc7qsLEbNwSr8EA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hGbJv0rpGzxKg for ; Fri, 07 Aug 2026 07:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 41603 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 07 Aug 2026 07:25:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 2cf580c694f6 - main - iflib: Permit SR-IOV configuration on a down 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: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2cf580c694f6f392531a63f01c3fb89c0244f89a Auto-Submitted: auto-generated Date: Fri, 07 Aug 2026 07:25:14 +0000 Message-Id: <6a75885a.41603.79234098@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=2cf580c694f6f392531a63f01c3fb89c0244f89a commit 2cf580c694f6f392531a63f01c3fb89c0244f89a Author: Kevin Bowling AuthorDate: 2026-08-06 11:03:28 +0000 Commit: Kevin Bowling CommitDate: 2026-08-07 07:24:57 +0000 iflib: Permit SR-IOV configuration on a down interface Drivers which remap PF queues need a stop/mutate/restart transaction only when the interface has live queues. Permit their IOV initialization callback while the interface is administratively down and leave it down afterward. This restores the standard boot-time iovctl.conf workflow for igb and lets other opt-in drivers configure VFs before netif brings the PF up. MFC after: 1 week --- share/man/man4/em.4 | 8 +++++--- sys/dev/e1000/if_igb_iov.c | 4 ++++ sys/net/iflib.c | 22 +++++++++++----------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/share/man/man4/em.4 b/share/man/man4/em.4 index 328e1e77b18b..22898e894b00 100644 --- a/share/man/man4/em.4 +++ b/share/man/man4/em.4 @@ -32,7 +32,7 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd July 29, 2026 +.Dd August 7, 2026 .Dt EM 4 .Os .Sh NAME @@ -188,8 +188,10 @@ The supported SR-IOV configuration uses one PF transmit and receive queue and requires MSI-X. I350 requires this layout; 82576 hardware can combine VMDq with per-pool RSS, but that mode is not implemented by this driver. -The PF must be administratively up and running when VFs are created and must -remain up for VF mailbox and datapath service. +The PF may be administratively down when VFs are created and remains down +afterward. +VF mailbox and datapath service begin when the PF is brought up, and the PF +must remain up to provide those services. Creating or destroying VFs temporarily stops and restarts a running PF. Set the following per-device .Xr iflib 4 diff --git a/sys/dev/e1000/if_igb_iov.c b/sys/dev/e1000/if_igb_iov.c index 7b6c18690db5..dc4b23397431 100644 --- a/sys/dev/e1000/if_igb_iov.c +++ b/sys/dev/e1000/if_igb_iov.c @@ -2003,6 +2003,10 @@ igb_if_iov_init(if_ctx_t ctx, u16 num_vfs, const nvlist_t *config) sc = iflib_get_softc(ctx); (void)config; + /* + * This callback may run while the PF is down. Record the software + * layout here; igb_iov_initialize() programs it during interface init. + */ atomic_store_rel_32(&sc->iov_teardown, 0); error = igb_iov_validate(sc, num_vfs); if (error != 0) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 63455fb46d70..da26926c8b17 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -5621,6 +5621,7 @@ iflib_device_iov_init_restart(device_t dev, uint16_t num_vfs, { if_ctx_t ctx; if_t ifp; + bool restart, running; int error; ctx = device_get_softc(dev); @@ -5629,19 +5630,18 @@ iflib_device_iov_init_restart(device_t dev, uint16_t num_vfs, CTX_LOCK(ctx); /* * Drivers which change the PF queue layout need the complete iflib - * stop/init sequence around their IOV callback. Keep that transition - * within one context-lock critical section. + * stop/init sequence around their IOV callback when the interface is + * active. An administratively-down interface has no live queues to + * quiesce, and must remain down after the new layout is installed. + * Keep the transition within one context-lock critical section. */ - if ((if_getflags(ifp) & IFF_UP) == 0 || - (if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) { - error = ENETDOWN; - goto out; - } - - iflib_stop(ctx); + restart = (if_getflags(ifp) & IFF_UP) != 0; + running = (if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0; + if (restart || running) + iflib_stop(ctx); error = IFDI_IOV_INIT(ctx, num_vfs, params); - iflib_init_locked(ctx); -out: + if (restart) + iflib_init_locked(ctx); CTX_UNLOCK(ctx); return (error); }