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

Function vring_state_changed

dpdk/examples/vhost/main.c:1779–1797  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1777}
1778
1779static int
1780vring_state_changed(int vid, uint16_t queue_id, int enable)
1781{
1782 struct vhost_dev *vdev = NULL;
1783
1784 TAILQ_FOREACH(vdev, &vhost_dev_list, global_vdev_entry) {
1785 if (vdev->vid == vid)
1786 break;
1787 }
1788 if (!vdev)
1789 return -1;
1790
1791 if (dma_bind[vid2socketid[vid]].dmas[queue_id].async_enabled) {
1792 if (!enable)
1793 vhost_clear_queue_thread_unsafe(vdev, queue_id);
1794 }
1795
1796 return 0;
1797}
1798
1799/*
1800 * These callback allow devices to be added to the data core when configuration

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected