MCPcopy Create free account
hub / github.com/F-Stack/f-stack / reset_device

Function reset_device

dpdk/lib/vhost/vhost.c:668–687  ·  view source on GitHub ↗

* Reset some variables in device structure, while keeping few * others untouched, such as vid, ifname, nr_vring: they * should be same unless the device is removed. */

Source from the content-addressed store, hash-verified

666 * should be same unless the device is removed.
667 */
668void
669reset_device(struct virtio_net *dev)
670{
671 uint32_t i;
672
673 dev->features = 0;
674 dev->protocol_features = 0;
675 dev->flags &= VIRTIO_DEV_BUILTIN_VIRTIO_NET;
676
677 for (i = 0; i < dev->nr_vring; i++) {
678 struct vhost_virtqueue *vq = dev->virtqueue[i];
679
680 if (!vq) {
681 VHOST_LOG_CONFIG(dev->ifname, ERR,
682 "failed to reset vring, virtqueue not allocated (%d)\n", i);
683 continue;
684 }
685 reset_vring_queue(dev, vq);
686 }
687}
688
689/*
690 * Invoked when there is a new vhost-user connection established (when

Callers 1

vhost_user_reset_ownerFunction · 0.70

Calls 1

reset_vring_queueFunction · 0.85

Tested by

no test coverage detected