Mellanox ConnectX-5 和 DPDK 在 rxonly 模式下的特殊行为

问题描述

最近,我观察到 Mellanox ConnectX-5 100 Gbps 网卡的异常行为。在使用 DPDK rxonly 模式处理 100 Gbps rxonly 时。据观察,我能够使用 12 个队列接收 142 Mpps。但是11个队列只有96 Mpps,10个队列94 Mpps,9个队列92 Mpps。谁能解释为什么捕获性能从 11 个队列突然/突然跃升到 12 个队列?

下面提到了设置的细节。

我已将两台服务器背靠背连接。其中一个(server-1)用于流量生成,另一个(server-2)用于流量接收。在两台服务器中,我都使用 Mellanox ConnectX-5 NIC。 遵循了 https://fast.dpdk.org/doc/perf/DPDK_19_08_Mellanox_NIC_performance_report.pdf [pg no.:11,12] 第 3 节中提到的性能调整参数

两台服务器的配置相同。

服务器配置

  1. 处理器:英特尔至强可扩展处理器,6148 系列,20 核 HT,2.4 GHz,27.5 三级缓存
  2. 没有。处理器数量:4 个。
  3. RAM:256 GB,2666 MHz 速度

使用的DPDK版本是dpdk-19.11,操作系统是RHEL-8.0

使用 --forward=txonly 和 --txonly-multi-flow 生成流量 testpmd。使用的命令如下。

server-1 中的数据包生成 testpmd 命令

./testpmd -l 4,5,6,7,8,9,10,11,12,13,14,15,16 -n 6 -w 17:00.0,mprq_en=1,rxq_pkt_pad_en=1 - -socket-mem=4096,0 -- --socket-num=0 --burst=64 --txd=4096 --rxd=4096--mbcache=512 --rxq=12 --txq= 12 --nb-cores=12 -i -a --RSS-ip --no-numa --forward=txonly --txonly-multi-flow

testpmd> set txpkts 64

它能够以 142.2 Mpps 的持续速率生成 64 字节的数据包。这用作在 rxonly 模式下工作的第二个服务器的输入。接收命令如下所述

server-2 中有 12 个内核的数据包接收命令

./testpmd -l 4,0 -- --socket-num=0 --burst=64 --txd=4096 --rxd=4096--mbcache=512 --rxq=12 --txq= 12 --nb-cores=12 -i -a --RSS-ip --no-numa

testpmd> set fwd rxonly

testpmd> show port stats all

  ######################## NIC statistics for port 0  ########################
  RX-packets: 1363328297 RX-missed: 0          RX-bytes:  87253027549
  RX-errors: 0
  RX-nombuf:  0         
  TX-packets: 19         TX-errors: 0          TX-bytes:  3493

  Throughput (since last show)
  Rx-pps:    142235725          Rx-bps:  20719963768
  Tx-pps:            0          Tx-bps:            0
  ############################################################################

server-2 中有 11 个内核的数据包接收命令

./testpmd -l 4,15 -n 6 -w 17:00.0,rxq_pkt_pad_en=1 --socket -mem=4096,0 -- --socket-num=0 --burst=64 --txd=4096 --rxd=4096--mbcache=512 --rxq=11 --txq=11 - -nb-cores=11 -i -a --RSS-ip --no-numa

testpmd> set fwd rxonly

testpmd> show port stats all

  ######################## NIC statistics for port 0  ########################
  RX-packets: 1507398174 RX-missed: 112937160  RX-bytes:  96473484013
  RX-errors: 0
  RX-nombuf:  0         
  TX-packets: 867061720  TX-errors: 0          TX-bytes:  55491950935

  Throughput (since last show)
  Rx-pps:     96718960          Rx-bps:  49520107600
  Tx-pps:            0          Tx-bps:            0
  ############################################################################

如果您看到 Rx-pps 从 11 个内核突然跃升到 12 个内核。这种变化在其他地方没有观察到,比如 8 到 9、9 到 10 或 10 到 11 等等。

谁能解释一下性能突然飙升的原因。

进行了相同的实验,这次使用 11 个内核来生成流量。

./testpmd -l 4,0 -- --socket-num=0 --burst=64 --txd=4096 --rxd=4096--mbcache=512 --rxq=11 --txq=11 - -nb-cores=11 -i -a --RSS-ip --no-numa --forward=txonly --txonly-multi-flow

testpmd> show port stats all 

  ######################## NIC statistics for port 0  ########################
  RX-packets: 0          RX-missed: 0          RX-bytes:  0
  RX-errors: 0
  RX-nombuf:  0         
  TX-packets: 2473087484 TX-errors: 0          TX-bytes:  158277600384

  Throughput (since last show)
  Rx-pps:            0          Rx-bps:            0
  Tx-pps:    142227777          Tx-bps:  72820621904
  ############################################################################

在具有 11 个内核的捕获端

./testpmd -l 1,2,3,4,0 -- --socket-num=0 --burst=64 --txd=1024 --rxd=1024--mbcache=512 --rxq=11 --txq=11 - -nb-cores=11 -i -a --RSS-ip --no-numa

testpmd> set fwd rxonly

testpmd> show port stats all

  ######################## NIC statistics for port 0  ########################
  RX-packets: 8411445440 RX-missed: 9685       RX-bytes:  538332508206
  RX-errors: 0
  RX-nombuf:  0         
  TX-packets: 0          TX-errors: 0          TX-bytes:  0

  Throughput (since last show)
  Rx-pps:     97597509          Rx-bps:    234643872
  Tx-pps:            0          Tx-bps:            0
  ############################################################################

在具有 12 个内核的捕获端

./testpmd -l 1,0 -- --socket-num=0 --burst=64 --txd=1024 --rxd=1024--mbcache=512 --rxq=12 --txq= 12 --nb-cores=12 -i -a --RSS-ip --no-numa

testpmd> set fwd rxonly

testpmd> show port stats all 

  ######################## NIC statistics for port 0  ########################
  RX-packets: 9370629638 RX-missed: 6124       RX-bytes:  554429504128
  RX-errors: 0
  RX-nombuf:  0         
  TX-packets: 0          TX-errors: 0          TX-bytes:  0

  Throughput (since last show)
  Rx-pps:    140664658          Rx-bps:    123982640
  Tx-pps:            0          Tx-bps:            0
  ############################################################################

性能从 11 核突然跃升至 12 核仍然保持不变。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)