diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -224,6 +224,7 @@ static uint64_t bnxt_get_baudrate(struct bnxt_link_info *link); static void bnxt_get_wol_settings(struct bnxt_softc *softc); static int bnxt_wol_config(if_ctx_t ctx); +static bool bnxt_if_needs_restart(if_ctx_t, enum iflib_restart_event); /* * Device Interface Declaration @@ -288,6 +289,8 @@ DEVMETHOD(ifdi_shutdown, bnxt_shutdown), DEVMETHOD(ifdi_resume, bnxt_resume), + DEVMETHOD(ifdi_needs_restart, bnxt_if_needs_restart), + DEVMETHOD_END }; @@ -2497,6 +2500,16 @@ return 0; } +static bool +bnxt_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + default: + return (false); + } +} + static int bnxt_shutdown(if_ctx_t ctx) { diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -4383,7 +4383,7 @@ * @ctx: iflib context * @event: event code to check * - * Defaults to returning true for unknown events. + * Defaults to returning false for unknown events. * * @returns true if iflib needs to reinit the interface */ @@ -4392,9 +4392,8 @@ { switch (event) { case IFLIB_RESTART_VLAN_CONFIG: - return (false); default: - return (true); + return (false); } } diff --git a/sys/dev/enetc/if_enetc.c b/sys/dev/enetc/if_enetc.c --- a/sys/dev/enetc/if_enetc.c +++ b/sys/dev/enetc/if_enetc.c @@ -96,6 +96,7 @@ static void enetc_setup_multicast(if_ctx_t); static void enetc_timer(if_ctx_t, uint16_t); static void enetc_update_admin_status(if_ctx_t); +static bool enetc_if_needs_restart(if_ctx_t, enum iflib_restart_event); static miibus_readreg_t enetc_miibus_readreg; static miibus_writereg_t enetc_miibus_writereg; @@ -202,6 +203,8 @@ DEVMETHOD(ifdi_timer, enetc_timer), DEVMETHOD(ifdi_update_admin_status, enetc_update_admin_status), + DEVMETHOD(ifdi_needs_restart, enetc_if_needs_restart), + DEVMETHOD_END }; @@ -1410,6 +1413,16 @@ } } +static bool +enetc_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + default: + return (false); + } +} + static int enetc_miibus_readreg(device_t dev, int phy, int reg) { diff --git a/sys/dev/enic/if_enic.c b/sys/dev/enic/if_enic.c --- a/sys/dev/enic/if_enic.c +++ b/sys/dev/enic/if_enic.c @@ -117,6 +117,7 @@ int (*) (struct vnic_dev *, int *), int arg); static int enic_map_bar(struct enic_softc *, struct enic_bar_info *, int, bool); static void enic_update_packet_filter(struct enic *enic); +static bool enic_if_needs_restart(if_ctx_t, enum iflib_restart_event); typedef enum { ENIC_BARRIER_RD, @@ -174,6 +175,8 @@ DEVMETHOD(ifdi_intr_disable, enic_intr_disable_all), DEVMETHOD(ifdi_msix_intr_assign, enic_msix_intr_assign), + DEVMETHOD(ifdi_needs_restart, enic_if_needs_restart), + DEVMETHOD_END }; @@ -1564,6 +1567,16 @@ ENIC_UNLOCK(softc); } +static bool +enic_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + default: + return (false); + } +} + int enic_setup_finish(struct enic *enic) { diff --git a/sys/dev/iavf/if_iavf_iflib.c b/sys/dev/iavf/if_iavf_iflib.c --- a/sys/dev/iavf/if_iavf_iflib.c +++ b/sys/dev/iavf/if_iavf_iflib.c @@ -74,6 +74,7 @@ static uint64_t iavf_if_get_counter(if_ctx_t ctx, ift_counter cnt); static void iavf_if_init(if_ctx_t ctx); static void iavf_if_stop(if_ctx_t ctx); +static bool iavf_if_needs_restart(if_ctx_t, enum iflib_restart_event); static int iavf_allocate_pci_resources(struct iavf_sc *); static void iavf_free_pci_resources(struct iavf_sc *); @@ -169,6 +170,7 @@ DEVMETHOD(ifdi_vlan_register, iavf_if_vlan_register), DEVMETHOD(ifdi_vlan_unregister, iavf_if_vlan_unregister), DEVMETHOD(ifdi_get_counter, iavf_if_get_counter), + DEVMETHOD(ifdi_needs_restart, iavf_if_needs_restart), DEVMETHOD_END }; @@ -1497,6 +1499,25 @@ } } +/* iavf_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning false for unknown events. + * + * @returns true if iflib needs to reinit the interface + */ +static bool +iavf_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + return (true); + default: + return (false); + } +} + /** * iavf_free_pci_resources - Free PCI resources * @sc: device softc diff --git a/sys/dev/ice/if_ice_iflib.c b/sys/dev/ice/if_ice_iflib.c --- a/sys/dev/ice/if_ice_iflib.c +++ b/sys/dev/ice/if_ice_iflib.c @@ -83,6 +83,7 @@ static int ice_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req); static int ice_if_suspend(if_ctx_t ctx); static int ice_if_resume(if_ctx_t ctx); +static bool ice_if_needs_restart(if_ctx_t, enum iflib_restart_event); static int ice_msix_que(void *arg); static int ice_msix_admin(void *arg); @@ -170,6 +171,7 @@ DEVMETHOD(ifdi_i2c_req, ice_if_i2c_req), DEVMETHOD(ifdi_suspend, ice_if_suspend), DEVMETHOD(ifdi_resume, ice_if_resume), + DEVMETHOD(ifdi_needs_restart, ice_if_needs_restart), DEVMETHOD_END }; @@ -3077,3 +3079,21 @@ return (0); } +/* ice_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning false for unknown events. + * + * @returns true if iflib needs to reinit the interface + */ +static bool +ice_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + default: + return (false); + } +} + diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -2402,7 +2402,7 @@ * @ctx: iflib context * @event: event code to check * - * Defaults to returning true for unknown events. + * Defaults to returning false for unknown events. * * @returns true if iflib needs to reinit the interface */ @@ -2411,9 +2411,8 @@ { switch (event) { case IFLIB_RESTART_VLAN_CONFIG: - return (false); default: - return (true); + return (false); } } diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -1256,7 +1256,7 @@ * @ctx: iflib context * @event: event code to check * - * Defaults to returning true for unknown events. + * Defaults to returning false for unknown events. * * @returns true if iflib needs to reinit the interface */ @@ -1265,9 +1265,8 @@ { switch (event) { case IFLIB_RESTART_VLAN_CONFIG: - return (false); default: - return (true); + return (false); } } diff --git a/sys/dev/mgb/if_mgb.c b/sys/dev/mgb/if_mgb.c --- a/sys/dev/mgb/if_mgb.c +++ b/sys/dev/mgb/if_mgb.c @@ -251,6 +251,7 @@ */ DEVMETHOD(ifdi_vlan_register, mgb_vlan_register), DEVMETHOD(ifdi_vlan_unregister, mgb_vlan_unregister), + DEVMETHOD(ifdi_needs_restart, mgb_if_needs_restart), /* * Needed for WOL support diff --git a/sys/dev/vmware/vmxnet3/if_vmx.c b/sys/dev/vmware/vmxnet3/if_vmx.c --- a/sys/dev/vmware/vmxnet3/if_vmx.c +++ b/sys/dev/vmware/vmxnet3/if_vmx.c @@ -180,6 +180,7 @@ static void vmxnet3_disable_intr(struct vmxnet3_softc *, int); static void vmxnet3_intr_enable_all(if_ctx_t); static void vmxnet3_intr_disable_all(if_ctx_t); +static bool vmxnet3_if_needs_restart(if_ctx_t, enum iflib_restart_event); typedef enum { VMXNET3_BARRIER_RD, @@ -247,6 +248,8 @@ DEVMETHOD(ifdi_suspend, vmxnet3_suspend), DEVMETHOD(ifdi_resume, vmxnet3_resume), + DEVMETHOD(ifdi_needs_restart, vmxnet3_if_needs_restart), + DEVMETHOD_END }; @@ -2505,6 +2508,17 @@ vmxnet3_disable_intr(sc, i); } +static bool +vmxnet3_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + return (true); + default: + return (false); + } +} + /* * Since this is a purely paravirtualized device, we do not have * to worry about DMA coherency. But at times, we must make sure diff --git a/sys/net/ifdi_if.m b/sys/net/ifdi_if.m --- a/sys/net/ifdi_if.m +++ b/sys/net/ifdi_if.m @@ -115,7 +115,7 @@ static bool null_needs_restart(if_ctx_t _ctx __unused, enum iflib_restart_event _event __unused) { - return (true); + return (false); } };