Page MenuHomeFreeBSD

D24659.id71466.diff
No OneTemporary

D24659.id71466.diff

Index: sys/dev/e1000/if_em.c
===================================================================
--- sys/dev/e1000/if_em.c
+++ sys/dev/e1000/if_em.c
@@ -251,6 +251,7 @@
static void em_if_vlan_register(if_ctx_t ctx, u16 vtag);
static void em_if_vlan_unregister(if_ctx_t ctx, u16 vtag);
static void em_if_watchdog_reset(if_ctx_t ctx);
+static bool em_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event);
static void em_identify_hardware(if_ctx_t ctx);
static int em_allocate_pci_resources(if_ctx_t ctx);
@@ -400,6 +401,7 @@
DEVMETHOD(ifdi_rx_queue_intr_enable, em_if_rx_queue_intr_enable),
DEVMETHOD(ifdi_tx_queue_intr_enable, em_if_tx_queue_intr_enable),
DEVMETHOD(ifdi_debug, em_if_debug),
+ DEVMETHOD(ifdi_needs_restart, em_if_needs_restart),
DEVMETHOD_END
};
@@ -437,6 +439,7 @@
DEVMETHOD(ifdi_rx_queue_intr_enable, igb_if_rx_queue_intr_enable),
DEVMETHOD(ifdi_tx_queue_intr_enable, igb_if_tx_queue_intr_enable),
DEVMETHOD(ifdi_debug, em_if_debug),
+ DEVMETHOD(ifdi_needs_restart, em_if_needs_restart),
DEVMETHOD_END
};
@@ -4038,6 +4041,25 @@
}
}
+/* em_if_needs_restart - Tell iflib when the driver needs to be reinitialized
+ * @ctx: iflib context
+ * @event: event code to check
+ *
+ * Defaults to returning true for unknown events.
+ *
+ * @returns true if iflib needs to reinit the interface
+ */
+static bool
+em_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event)
+{
+ switch (event) {
+ case IFLIB_RESTART_VLAN_CONFIG:
+ return (false);
+ default:
+ return (true);
+ }
+}
+
/* Export a single 32-bit register via a read-only sysctl. */
static int
em_sysctl_reg_handler(SYSCTL_HANDLER_ARGS)
Index: sys/dev/ixgbe/if_ix.c
===================================================================
--- sys/dev/ixgbe/if_ix.c
+++ sys/dev/ixgbe/if_ix.c
@@ -139,6 +139,7 @@
static void ixgbe_if_vlan_register(if_ctx_t ctx, u16 vtag);
static void ixgbe_if_vlan_unregister(if_ctx_t ctx, u16 vtag);
static int ixgbe_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req);
+static bool ixgbe_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event);
int ixgbe_intr(void *arg);
/************************************************************************
@@ -273,6 +274,7 @@
DEVMETHOD(ifdi_vlan_unregister, ixgbe_if_vlan_unregister),
DEVMETHOD(ifdi_get_counter, ixgbe_if_get_counter),
DEVMETHOD(ifdi_i2c_req, ixgbe_if_i2c_req),
+ DEVMETHOD(ifdi_needs_restart, ixgbe_if_needs_restart),
#ifdef PCI_IOV
DEVMETHOD(ifdi_iov_init, ixgbe_if_iov_init),
DEVMETHOD(ifdi_iov_uninit, ixgbe_if_iov_uninit),
@@ -1235,6 +1237,25 @@
return (0);
} /* ixgbe_if_i2c_req */
+/* ixgbe_if_needs_restart - Tell iflib when the driver needs to be reinitialized
+ * @ctx: iflib context
+ * @event: event code to check
+ *
+ * Defaults to returning true for unknown events.
+ *
+ * @returns true if iflib needs to reinit the interface
+ */
+static bool
+ixgbe_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event)
+{
+ switch (event) {
+ case IFLIB_RESTART_VLAN_CONFIG:
+ return (false);
+ default:
+ return (true);
+ }
+}
+
/************************************************************************
* ixgbe_add_media_types
************************************************************************/
Index: sys/dev/ixgbe/if_ixv.c
===================================================================
--- sys/dev/ixgbe/if_ixv.c
+++ sys/dev/ixgbe/if_ixv.c
@@ -110,6 +110,7 @@
static void ixv_if_unregister_vlan(if_ctx_t, u16);
static uint64_t ixv_if_get_counter(if_ctx_t, ift_counter);
+static bool ixv_if_needs_restart(if_ctx_t, enum iflib_restart_event);
static void ixv_save_stats(struct adapter *);
static void ixv_init_stats(struct adapter *);
@@ -172,6 +173,7 @@
DEVMETHOD(ifdi_vlan_register, ixv_if_register_vlan),
DEVMETHOD(ifdi_vlan_unregister, ixv_if_unregister_vlan),
DEVMETHOD(ifdi_get_counter, ixv_if_get_counter),
+ DEVMETHOD(ifdi_needs_restart, ixv_if_needs_restart),
DEVMETHOD_END
};
@@ -1187,6 +1189,25 @@
}
} /* ixv_if_get_counter */
+/* ixv_if_needs_restart - Tell iflib when the driver needs to be reinitialized
+ * @ctx: iflib context
+ * @event: event code to check
+ *
+ * Defaults to returning true for every event.
+ *
+ * @returns true if iflib needs to reinit the interface
+ */
+static bool
+ixv_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event)
+{
+ switch (event) {
+ case IFLIB_RESTART_VLAN_CONFIG:
+ /* XXX: This may not need to return true */
+ default:
+ return (true);
+ }
+}
+
/************************************************************************
* ixv_initialize_transmit_units - Enable transmit unit.
************************************************************************/
Index: sys/dev/ixl/if_iavf.c
===================================================================
--- sys/dev/ixl/if_iavf.c
+++ sys/dev/ixl/if_iavf.c
@@ -92,6 +92,7 @@
static void iavf_if_vlan_unregister(if_ctx_t ctx, u16 vtag);
static uint64_t iavf_if_get_counter(if_ctx_t ctx, ift_counter cnt);
static void iavf_if_stop(if_ctx_t ctx);
+static bool iavf_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event);
static int iavf_allocate_pci_resources(struct iavf_sc *);
static int iavf_reset_complete(struct i40e_hw *);
@@ -190,6 +191,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
};
@@ -1467,7 +1469,27 @@
}
}
-
+/* iavf_if_needs_restart - Tell iflib when the driver needs to be reinitialized
+ * @ctx: iflib context
+ * @event: event code to check
+ *
+ * Defaults to returning true for every event.
+ *
+ * @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:
+ /* This case must return true if VLAN anti-spoof checks are
+ * enabled by the PF driver for the VF.
+ */
+ default:
+ return (true);
+ }
+}
+
static void
iavf_free_pci_resources(struct iavf_sc *sc)
{
Index: sys/dev/ixl/if_ixl.c
===================================================================
--- sys/dev/ixl/if_ixl.c
+++ sys/dev/ixl/if_ixl.c
@@ -117,6 +117,7 @@
static uint64_t ixl_if_get_counter(if_ctx_t ctx, ift_counter cnt);
static int ixl_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req);
static int ixl_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_t data);
+static bool ixl_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event);
#ifdef PCI_IOV
static void ixl_if_vflr_handle(if_ctx_t ctx);
#endif
@@ -187,6 +188,7 @@
DEVMETHOD(ifdi_get_counter, ixl_if_get_counter),
DEVMETHOD(ifdi_i2c_req, ixl_if_i2c_req),
DEVMETHOD(ifdi_priv_ioctl, ixl_if_priv_ioctl),
+ DEVMETHOD(ifdi_needs_restart, ixl_if_needs_restart),
#ifdef PCI_IOV
DEVMETHOD(ifdi_iov_init, ixl_if_iov_init),
DEVMETHOD(ifdi_iov_uninit, ixl_if_iov_uninit),
@@ -1652,6 +1654,24 @@
return (error);
}
+/* ixl_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 every event.
+ *
+ * @returns true if iflib needs to reinit the interface, false otherwise
+ */
+static bool
+ixl_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event)
+{
+ switch (event) {
+ case IFLIB_RESTART_VLAN_CONFIG:
+ default:
+ return (false);
+ }
+}
+
static u_int
ixl_mc_filter_apply(void *arg, struct sockaddr_dl *sdl, u_int count __unused)
{

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 25, 5:36 AM (5 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24162647
Default Alt Text
D24659.id71466.diff (7 KB)

Event Timeline