Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136938368
D23073.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D23073.diff
View Options
Index: head/sys/dev/virtio/network/if_vtnet.c
===================================================================
--- head/sys/dev/virtio/network/if_vtnet.c
+++ head/sys/dev/virtio/network/if_vtnet.c
@@ -337,10 +337,21 @@
switch (type) {
case MOD_LOAD:
- if (loaded++ == 0)
+ if (loaded++ == 0) {
vtnet_tx_header_zone = uma_zcreate("vtnet_tx_hdr",
sizeof(struct vtnet_tx_header),
NULL, NULL, NULL, NULL, 0, 0);
+#ifdef DEBUGNET
+ /*
+ * We need to allocate from this zone in the transmit path, so ensure
+ * that we have at least one item per header available.
+ * XXX add a separate zone like we do for mbufs? otherwise we may alloc
+ * buckets
+ */
+ uma_zone_reserve(vtnet_tx_header_zone, DEBUGNET_MAX_IN_FLIGHT * 2);
+ uma_prealloc(vtnet_tx_header_zone, DEBUGNET_MAX_IN_FLIGHT * 2);
+#endif
+ }
break;
case MOD_QUIESCE:
if (uma_zone_get_cur(vtnet_tx_header_zone) > 0)
@@ -3982,15 +3993,6 @@
*ncl = DEBUGNET_MAX_IN_FLIGHT;
*clsize = sc->vtnet_rx_clsize;
VTNET_CORE_UNLOCK(sc);
-
- /*
- * We need to allocate from this zone in the transmit path, so ensure
- * that we have at least one item per header available.
- * XXX add a separate zone like we do for mbufs? otherwise we may alloc
- * buckets
- */
- uma_zone_reserve(vtnet_tx_header_zone, DEBUGNET_MAX_IN_FLIGHT * 2);
- uma_prealloc(vtnet_tx_header_zone, DEBUGNET_MAX_IN_FLIGHT * 2);
}
static void
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 21, 6:20 PM (5 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25753014
Default Alt Text
D23073.diff (1 KB)
Attached To
Mode
D23073: vtnet: Pre-allocate debugnet data immediately
Attached
Detach File
Event Timeline
Log In to Comment