vpp支持两套qos实现,一套是基于policer实现的qos,另外一套是基于dpdk的qos套件实现的hqos。
(免费订阅,永久学习)学习地址: Dpdk/网络协议栈/vpp/OvS/DDos/NFV/虚拟化/高性能专家-学习视频教程-腾讯课堂
更多DPDK相关学习资料有需要的可以自行报名学习,免费订阅,永久学习,或点击这里加qun免费
领取,关注我持续更新哦! !

如上图所示,worker线程从nic中读取报文进行处理,调用dpdk设备发送函数时,如果配置了hqos,那么设置hqos相关参数,将其送入swq队列(swq队列与worker线程是1:1的关系),worker线程处理结束,hqos线程(根据配置决定个数)轮询从swq中读取报文进行qos处理,qos使用的是dpdk qos套件。
dpdk {
socket-mem 16384,16384
dev 0000:02:00.0 {
num-rx-queues 2
hqos #使能网卡hqos
}
dev 0000:06:00.0 {
num-rx-queues 2
hqos #使能网卡hqos
}
num-mbufs 1000000
}
cpu {
main-core 0
corelist-workers 1, 2, 3, 4
corelist-hqos-threads 5, 6 #启动两个hqos线程,分别使用cpu5和6
}
通过上面两步配置即可开启hqos配置,会使用默认的hqos配置。
port {
rate 1250000000 /* Assuming 10GbE port */
frame_overhead 24 /* Overhead fields per Ethernet frame:
* 7B (Preamble) +
* 1B (Start of Frame Delimiter (SFD)) +
* 4B (Frame Check Sequence (FCS)) +
* 12B (Inter Frame Gap (IFG))
*/
mtu 1522 /* Assuming Ethernet/IPv4 pkt (FCS not included) */
n_subports_per_port 1 /* Number of subports per output interface */
n_pipes_per_subport 4096 /* Number of pipes (users/subscribers) */
queue_sizes 64 64 64 64 /* Packet queue size for each traffic class.
* All queues within the same pipe traffic class
* have the same size. Queues from different
* pipes serving the same traffic class have
* the same size. */
}
subport 0 {
tb_rate 1250000000 /* Subport level token bucket rate (bytes per second) */
tb_size 1000000 /* Subport level token bucket size (bytes) */
tc0_rate 1250000000 /* Subport level token bucket rate for traffic class 0 (bytes per s