【Intel DPDK】Qos_Sched实例在虚拟机中运行注意事项。

来源:互联网 发布:杨焕明 知乎 编辑:程序博客网 时间:2024/05/16 01:07

qos实例运行命令:./build/qos_sched -c 0x7 -n 4 -- --mst 0 --pfc 0,1,1,2 --pfc 1,0,1,2 --msz 1024 --cfg ./profile.cfg

1、大页内存不足,从头文件中可以看到这2个宏定义,NB_MBUF   (2*1024*1024)  #define MBUF_SIZE (1528 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM),即内存池中mbuf大小和mbuf数量为2G左右,所以设置大页时至少要设置1024个大页,每个大页2M,这是在pfc为1个的情况,如果存在2个pfc则需要设置2048大页才能运行;或者是修改msz参数指定mbuf数量即NB_MBUF数量来获取较小的内存,这样设置程序内存后才能正常启动。

2、网卡速度与profile.cfg中配置不符。如下配置文件中tb rate = 125000000 此值是我修改后的值因为我的是千兆网卡所以速率为1 * 1000 * 1000 *1000 /8 Byte/s,此处不修改将导致rte_sched_subport_config函数执行失败即真正的port速率要大于等于子端口的速率。

; Port configuration
[port]
frame overhead = 24
number of subports per port = 1
number of pipes per subport = 4096
queue sizes = 64 64 64 64

; Subport configuration
[subport 0]
tb rate = 125000000           ; Bytes per second
tb size = 1000000              ; Bytes

tc 0 rate = 125000000         ; Bytes per second
tc 1 rate = 125000000         ; Bytes per second
tc 2 rate = 125000000         ; Bytes per second
tc 3 rate = 125000000         ; Bytes per second
tc period = 10                 ; Milliseconds

pipe 0-4095 = 0                ; These pipes are configured with pipe profile 0

; Pipe configuration
[pipe profile 0]
tb rate = 305175               ; Bytes per second
tb size = 1000000              ; Bytes
0 0