Lines 243-249
Link Here
|
243 |
static int vtnet_rx_process_limit = 512; |
243 |
static int vtnet_rx_process_limit = 512; |
244 |
TUNABLE_INT("hw.vtnet.rx_process_limit", &vtnet_rx_process_limit); |
244 |
TUNABLE_INT("hw.vtnet.rx_process_limit", &vtnet_rx_process_limit); |
245 |
|
245 |
|
246 |
static uma_zone_t vtnet_tx_header_zone; |
246 |
static uma_zone_t vtnet_tx_header_zone = NULL; |
247 |
|
247 |
|
248 |
static struct virtio_feature_desc vtnet_feature_desc[] = { |
248 |
static struct virtio_feature_desc vtnet_feature_desc[] = { |
249 |
{ VIRTIO_NET_F_CSUM, "TxChecksum" }, |
249 |
{ VIRTIO_NET_F_CSUM, "TxChecksum" }, |
Lines 317-333
Link Here
|
317 |
|
317 |
|
318 |
switch (type) { |
318 |
switch (type) { |
319 |
case MOD_LOAD: |
319 |
case MOD_LOAD: |
320 |
vtnet_tx_header_zone = uma_zcreate("vtnet_tx_hdr", |
320 |
if (!vtnet_tx_header_zone) |
321 |
sizeof(struct vtnet_tx_header), |
321 |
vtnet_tx_header_zone = uma_zcreate("vtnet_tx_hdr", |
322 |
NULL, NULL, NULL, NULL, 0, 0); |
322 |
sizeof(struct vtnet_tx_header), |
|
|
323 |
NULL, NULL, NULL, NULL, 0, 0); |
323 |
break; |
324 |
break; |
324 |
case MOD_QUIESCE: |
325 |
case MOD_QUIESCE: |
325 |
case MOD_UNLOAD: |
326 |
case MOD_UNLOAD: |
326 |
if (uma_zone_get_cur(vtnet_tx_header_zone) > 0) |
327 |
if (vtnet_tx_header_zone) { |
327 |
error = EBUSY; |
328 |
if (uma_zone_get_cur(vtnet_tx_header_zone) > 0) |
328 |
else if (type == MOD_UNLOAD) { |
329 |
error = EBUSY; |
329 |
uma_zdestroy(vtnet_tx_header_zone); |
330 |
else if (type == MOD_UNLOAD) { |
330 |
vtnet_tx_header_zone = NULL; |
331 |
uma_zdestroy(vtnet_tx_header_zone); |
|
|
332 |
vtnet_tx_header_zone = NULL; |
333 |
} |
331 |
} |
334 |
} |
332 |
break; |
335 |
break; |
333 |
case MOD_SHUTDOWN: |
336 |
case MOD_SHUTDOWN: |