Page MenuHomeFreeBSD

iflib: Remove redundant VLAN events deregistration

Authored by on Sep 19 2019, 9:20 AM.



r351152 introduced iflib_deregister() function calling
EVENTHANDLER_DEREGISTER() to unregister VLAN events. This patch removes
duplicate of EVENTHANDLER_DEREGISTER() calls placed in
iflib_device_deregister() as this function is now calling
iflib_deregister(). This is to avoid deregistering same event twice.

This patch also adds check in iflib_vlan_register() to prevent
registering VLAN while being in detach.

Patch co-authored by Krzysztof Galazka <>,
erj <> and Jacob Keller <>.

Signed-off-by: Piotr Pietruszewski <>

Test Plan

Before applying this patch, kernel panic should be observed after issuing:

for i in {1..10}; do kldunload if_ix; kldload if_ix; done

Usually, less than 10 cycles are needed to trigger the panic. After applying
the patch, panic should be gone.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

gallatin accepted this revision.Sep 20 2019, 8:15 AM
This revision is now accepted and ready to land.Sep 20 2019, 8:15 AM
erj accepted this revision.Sep 24 2019, 4:59 PM
This revision was automatically updated to reflect the committed changes.