Page MenuHomeFreeBSD

D22086.id.diff
No OneTemporary

D22086.id.diff

Index: head/sys/net/ifdi_if.m
===================================================================
--- head/sys/net/ifdi_if.m
+++ head/sys/net/ifdi_if.m
@@ -169,6 +169,12 @@
}
return (0);
}
+
+ static bool
+ null_needs_restart(if_ctx_t _ctx __unused, enum iflib_restart_event _event __unused)
+ {
+ return (true);
+ }
};
#
@@ -456,3 +462,8 @@
METHOD void debug {
if_ctx_t _ctx;
} DEFAULT null_void_op;
+
+METHOD bool needs_restart {
+ if_ctx_t _ctx;
+ enum iflib_restart_event _event;
+} DEFAULT null_needs_restart;
Index: head/sys/net/iflib.h
===================================================================
--- head/sys/net/iflib.h
+++ head/sys/net/iflib.h
@@ -377,6 +377,15 @@
#define IFLIB_SINGLE_IRQ_RX_ONLY 0x40000
/*
+ * These enum values are used in iflib_needs_restart to indicate to iflib
+ * functions whether or not the interface needs restarting when certain events
+ * happen.
+ */
+enum iflib_restart_event {
+ IFLIB_RESTART_VLAN_CONFIG,
+};
+
+/*
* field accessors
*/
void *iflib_get_softc(if_ctx_t ctx);
Index: head/sys/net/iflib.c
===================================================================
--- head/sys/net/iflib.c
+++ head/sys/net/iflib.c
@@ -4308,10 +4308,13 @@
return;
CTX_LOCK(ctx);
+ /* Driver may need all untagged packets to be flushed */
+ if (IFDI_NEEDS_RESTART(ctx, IFLIB_RESTART_VLAN_CONFIG))
+ iflib_stop(ctx);
IFDI_VLAN_REGISTER(ctx, vtag);
- /* Re-init to load the changes */
- if (if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER)
- iflib_if_init_locked(ctx);
+ /* Re-init to load the changes, if required */
+ if (IFDI_NEEDS_RESTART(ctx, IFLIB_RESTART_VLAN_CONFIG))
+ iflib_init_locked(ctx);
CTX_UNLOCK(ctx);
}
@@ -4327,10 +4330,13 @@
return;
CTX_LOCK(ctx);
+ /* Driver may need all tagged packets to be flushed */
+ if (IFDI_NEEDS_RESTART(ctx, IFLIB_RESTART_VLAN_CONFIG))
+ iflib_stop(ctx);
IFDI_VLAN_UNREGISTER(ctx, vtag);
- /* Re-init to load the changes */
- if (if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER)
- iflib_if_init_locked(ctx);
+ /* Re-init to load the changes, if required */
+ if (IFDI_NEEDS_RESTART(ctx, IFLIB_RESTART_VLAN_CONFIG))
+ iflib_init_locked(ctx);
CTX_UNLOCK(ctx);
}

File Metadata

Mime Type
text/plain
Expires
Sat, May 16, 10:26 AM (19 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33092735
Default Alt Text
D22086.id.diff (2 KB)

Event Timeline