[Bug 298121] SR-IOV: Kernel thread hangs while adding a VF interface

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 02 Sep 2026 19:58:06 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298121

--- Comment #2 from commit-hook@FreeBSD.org ---
A commit in branch main references this bug:

URL:
https://cgit.FreeBSD.org/src/commit/?id=9d59ca793f7097575351d6de2fd61431233b5ed9

commit 9d59ca793f7097575351d6de2fd61431233b5ed9
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-08-31 23:24:49 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-09-02 19:56:14 +0000

    iflib: Do not hold the ifnet lock across registration

    iflib_device_register() acquired IFNET_WLOCK to preserve lock order
    when ether_ifattach() was called with the context lock held.  The context
    lock is now released around ether_ifattach(), making registration-wide
    ifnet serialization unnecessary.

    Keeping IFNET_WLOCK across driver attachment also allows synchronous
    interface event handlers to recurse on it.  The rtnetlink interface-group
    dump does so through if_foreach_group() while handling the interface
    attachment event.

    Remove the outer lock and the corresponding failure-path unlock and
    relock transitions.  Continue to drop the context lock around
    ether_ifattach() and taskqueue drains, and preserve context-lock coverage
    for driver attach and detach.

    Validated under WITNESS on 82576 and I226 controllers.  Multiple VF
    attach and detach cycles, netmap control operations, and every iflib
    registration failure injection point completed without lock or cleanup
    errors.

    PR:             298121
    Reported by:    glebius, netchild, Yuichiro NAITO
<naito.yuichiro@gmail.com>
    Reviewed by:    gallatin, glebius
    Fixes:          e0e12405285b ("netmap: fix LOR in iflib_netmap_register")
    Fixes:          2f8f892ca344 ("rtnetlink: Add FreeBSD-specific IFLAF_GROUP
support")
    Fixes:          90e7dbe5e2ca ("iflib: Add registration failure injection
points")
    MFC after:      2 weeks
    Sponsored by:   BBOX.io
    Differential Revision:  https://reviews.freebsd.org/D59294

 sys/net/iflib.c | 23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)

-- 
You are receiving this mail because:
You are the assignee for the bug.