1、Split virtqueue
组成结构:
• Descriptor Table
• Available Ring
• Used Ring
数据结构:
Descriptor Table
Available Ring
Used Ring
Size & aligment方式:
注:queue size指每个virtqueue具备buffer的深度,queue size=descriptor table num,queue size大小会影响到virtqueue的性能,可以权衡资源和性能选择大小;不同于queue num,queue num表示virtqueue数量。
Split virtqueue一次数据传输的基本操作流程:
When the driver wants to send a buffer to the device, it fills in a slot in the descriptor table (or chains several together), and writes the descriptor index into the available ring. It then notifies the device. When the device has finished a buffer, it writes the descriptor index into the used ring, and sends an interrupt.
Figure 1: Driver writes a buffer in descriptor ring
Figure 2: Driver offers the buffer with avail ring
Figure 3: Device sees chained buffers
Figure 4: Device returns buffer chain
学习地址: Dpdk/网络协议栈/vpp/OvS/DDos/NFV/虚拟化/高性能专家-学习视频教程-腾讯课堂
更多DPDK相关学习资料有需要的可以自行报名学习,免费订阅,久学习,或点击这里加qun免费
领取,关注我持续更新哦! !
Descriptor head idx & avail idx计算方法:
2、Control q
control q的命令结构如下:
正常controlq操作会占用3个描述符,第一个描述符用来传输上图中的class & command,第二个描述符传输command-specific-data[],第三个描述符传输ack信号。
以controq 配置mvp为例:
ctrl_mq结构体如下:
可以看到对应:class=4;command=0来表示ctrl_mq的vq paris set。
ctrl mq配置总共5个字节,驱动分三次来操作,第一次传输class 和command 2个Byte,第二次传输data ,2个byte,就是mvp值,第三次传输ack,1个byte。
三次操作使用三个描述符,组成一个sgl。
原文链接:https://zhuanlan.zhihu.com/p/492959563
Original: https://blog.csdn.net/lingshengxiyou/article/details/127793134
Author: lingshengxiyou
Title: virtio split & ctrl virtqueue
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/656594/
转载文章受原作者版权保护。转载请注明原作者出处!