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

Function vhost_setup_virtio_net

dpdk/lib/vhost/vhost.c:809–838  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

807}
808
809void
810vhost_setup_virtio_net(int vid, bool enable, bool compliant_ol_flags, bool stats_enabled,
811 bool support_iommu)
812{
813 struct virtio_net *dev = get_device(vid);
814
815 if (dev == NULL)
816 return;
817
818 if (enable)
819 dev->flags |= VIRTIO_DEV_BUILTIN_VIRTIO_NET;
820 else
821 dev->flags &= ~VIRTIO_DEV_BUILTIN_VIRTIO_NET;
822 if (!compliant_ol_flags)
823 dev->flags |= VIRTIO_DEV_LEGACY_OL_FLAGS;
824 else
825 dev->flags &= ~VIRTIO_DEV_LEGACY_OL_FLAGS;
826 if (stats_enabled)
827 dev->flags |= VIRTIO_DEV_STATS_ENABLED;
828 else
829 dev->flags &= ~VIRTIO_DEV_STATS_ENABLED;
830 if (support_iommu)
831 dev->flags |= VIRTIO_DEV_SUPPORT_IOMMU;
832 else
833 dev->flags &= ~VIRTIO_DEV_SUPPORT_IOMMU;
834
835 if (vhost_user_iotlb_init(dev) < 0)
836 VHOST_LOG_CONFIG("device", ERR, "failed to init IOTLB\n");
837
838}
839
840void
841vhost_enable_extbuf(int vid)

Callers 2

vduse_device_createFunction · 0.85

Calls 2

get_deviceFunction · 0.85
vhost_user_iotlb_initFunction · 0.85

Tested by

no test coverage detected