| 407 | } |
| 408 | |
| 409 | void |
| 410 | free_vq(struct virtio_net *dev, struct vhost_virtqueue *vq) |
| 411 | { |
| 412 | if (vq_is_packed(dev)) |
| 413 | rte_free(vq->shadow_used_packed); |
| 414 | else |
| 415 | rte_free(vq->shadow_used_split); |
| 416 | |
| 417 | rte_rwlock_write_lock(&vq->access_lock); |
| 418 | vhost_free_async_mem(vq); |
| 419 | rte_rwlock_write_unlock(&vq->access_lock); |
| 420 | rte_free(vq->batch_copy_elems); |
| 421 | rte_free(vq->log_cache); |
| 422 | rte_free(vq); |
| 423 | } |
| 424 | |
| 425 | /* |
| 426 | * Release virtqueues and device memory. |
no test coverage detected