Page MenuHomeFreeBSD

D23073.diff
No OneTemporary

D23073.diff

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

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)

Event Timeline