virtio-device-model(位于QEMU内部)使用vhost-user协议配置vhost-user库,以及设置irqfd和ioeventfd文件描述符。 客户机分配的virtio内存区域由vhost用户库(即DPDK应用程序)映射(使用mmap 系统调用)。 结果是,DPDK应用程序可以直接在客户机内存中读取和写入数据包,并使用irqfd和ioeventfd机制直接对客户机发出通知。 rte_vh...
vhost-user端,在vhost_user_set_vring_kick中,关键的一句vq->kickfd = file.fd; vhost_user_set_vring_call(structvirtio_net **pdev,structVhostUserMsg *msg,intmain_fd __rte_unused) {structvirtio_net *dev = *pdev;structvhost_vring_file file;structvhost_virtqueue *vq;intexpected_fds; expected_...