同时使用 PCIe 和 USB3 时的 iMX8MP 带宽限制 你好 一位客户报告了使用 USB 3 摄像机时的带宽限制。在正常情况下,摄像头运行良好,但一旦开始向 NVMe PCIe 驱动器写入数据,流水线就会因带宽不足而崩溃。 他们进行了一项不同的测试,结果非常有趣。他们没有使用 USB3 摄像头,而是连接了一个 USB3 千兆以太网接口,并开始使用 iperf3 进行带宽测试。测试速度保持在约 900MB/s,直到他们开始使用 dd 向 NVMe 硬盘写入。当出现这种情况时,USB3 的带宽将降至每秒约 400MB。 这是预期行为吗? 我注意到 USB3 和 PCIe 都直接连接到 AXI 总线,这条总线上有 1Gb/s 的限制吗? 在将视频数据写入 NVMe 硬盘时,客户需要稳定的 USB3 带宽(至少足以持续收集帧)。 如有任何帮助,我们将不胜感激、 拉斐尔 Re: iMX8MP bandwidth limitation with simultaneous PCIe and USB3 use 我进行了以下测试,以了解带宽降低的情况。我连接了一个 NVMe 磁盘并将其挂载在 /mnt,并通过电缆将一个 USB3 千兆以太网接口直接连接到我的机器。在不向磁盘写入数据的情况下启动 iperf3,输出结果如下: root@verdin-imx8mp-15207903:~# iperf3 -c 192.168.50.1
Connecting to host 192.168.50.1, port 5201
[ 5] local 192.168.50.58 port 42800 connected to 192.168.50.1 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 113 MBytes 950 Mbits/sec 0 293 KBytes
[ 5] 1.00-2.00 sec 112 MBytes 942 Mbits/sec 0 307 KBytes
[ 5] 2.00-3.00 sec 112 MBytes 938 Mbits/sec 0 321 KBytes
[ 5] 3.00-4.00 sec 112 MBytes 940 Mbits/sec 0 338 KBytes
[ 5] 4.00-5.00 sec 112 MBytes 938 Mbits/sec 0 338 KBytes
[ 5] 5.00-6.00 sec 112 MBytes 938 Mbits/sec 0 338 KBytes
[ 5] 6.00-7.00 sec 112 MBytes 940 Mbits/sec 0 372 KBytes
[ 5] 7.00-8.00 sec 112 MBytes 942 Mbits/sec 0 372 KBytes
[ 5] 8.00-9.00 sec 113 MBytes 945 Mbits/sec 0 372 KBytes
[ 5] 9.00-10.00 sec 112 MBytes 941 Mbits/sec 0 372 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 1.10 GBytes 943 Mbits/sec 0 sender
[ 5] 0.00-10.00 sec 1.10 GBytes 941 Mbits/sec receiver
iperf Done. 现在,我在另一个终端上开始向 NVMe 磁盘写入数据: root@verdin-imx8mp-15207903:~# dd if=/dev/zero of=/mnt/bla bs=1M count=10000
10000+0 records in
10000+0 records out
10485760000 bytes (10 GB, 9.8 GiB) copied, 76.2779 s, 137 MB/s 同时,我再次启动 iperf3: root@verdin-imx8mp-15207903:~# iperf3 -c 192.168.50.1 -t 60
Connecting to host 192.168.50.1, port 5201
[ 5] local 192.168.50.58 port 59494 connected to 192.168.50.1 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 54.8 MBytes 457 Mbits/sec 0 317 KBytes
[ 5] 1.00-2.00 sec 1.38 MBytes 11.5 Mbits/sec 0 317 KBytes
[ 5] 2.00-3.01 sec 2.00 MBytes 16.7 Mbits/sec 0 317 KBytes
[ 5] 3.01-4.00 sec 1.38 MBytes 11.6 Mbits/sec 0 317 KBytes
[ 5] 4.00-5.00 sec 1.88 MBytes 15.7 Mbits/sec 0 317 KBytes
[ 5] 5.00-6.00 sec 112 MBytes 937 Mbits/sec 0 335 KBytes
[ 5] 6.00-7.00 sec 112 MBytes 942 Mbits/sec 0 335 KBytes
[ 5] 7.00-8.00 sec 15.0 MBytes 126 Mbits/sec 0 335 KBytes
[ 5] 8.00-9.00 sec 1.38 MBytes 11.5 Mbits/sec 0 335 KBytes
[ 5] 9.00-10.00 sec 1.62 MBytes 13.6 Mbits/sec 0 335 KBytes
[ 5] 10.00-11.00 sec 1.88 MBytes 15.7 Mbits/sec 0 335 KBytes
[ 5] 11.00-12.00 sec 71.9 MBytes 604 Mbits/sec 0 335 KBytes
[ 5] 12.00-13.00 sec 113 MBytes 946 Mbits/sec 0 335 KBytes
[ 5] 13.00-14.00 sec 65.1 MBytes 546 Mbits/sec 0 335 KBytes
[ 5] 14.00-15.00 sec 47.9 MBytes 400 Mbits/sec 0 498 KBytes
[ 5] 15.00-16.00 sec 37.2 MBytes 313 Mbits/sec 0 498 KBytes
[ 5] 16.00-17.00 sec 39.6 MBytes 331 Mbits/sec 0 498 KBytes
[ 5] 17.00-18.00 sec 45.6 MBytes 384 Mbits/sec 0 498 KBytes
[ 5] 18.00-19.00 sec 30.0 MBytes 251 Mbits/sec 0 498 KBytes
[ 5] 19.00-20.00 sec 1.38 MBytes 11.6 Mbits/sec 0 498 KBytes
[ 5] 20.00-21.00 sec 2.00 MBytes 16.8 Mbits/sec 0 498 KBytes
[ 5] 21.00-22.01 sec 2.00 MBytes 16.7 Mbits/sec 0 498 KBytes
[ 5] 22.01-23.00 sec 14.4 MBytes 121 Mbits/sec 0 498 KBytes
[ 5] 23.00-24.00 sec 113 MBytes 946 Mbits/sec 0 747 KBytes
[ 5] 24.00-25.00 sec 113 MBytes 950 Mbits/sec 0 747 KBytes
[ 5] 25.00-26.00 sec 40.6 MBytes 339 Mbits/sec 0 747 KBytes
[ 5] 26.00-27.00 sec 48.1 MBytes 405 Mbits/sec 0 747 KBytes
[ 5] 27.00-28.00 sec 25.6 MBytes 215 Mbits/sec 0 747 KBytes
[ 5] 28.00-29.01 sec 46.9 MBytes 391 Mbits/sec 0 747 KBytes
[ 5] 29.01-30.00 sec 42.4 MBytes 358 Mbits/sec 0 747 KBytes
[ 5] 30.00-31.00 sec 29.1 MBytes 244 Mbits/sec 0 747 KBytes
[ 5] 31.00-32.01 sec 2.75 MBytes 23.0 Mbits/sec 0 747 KBytes
[ 5] 32.01-33.01 sec 1.00 MBytes 8.38 Mbits/sec 0 747 KBytes
[ 5] 33.01-34.00 sec 1.50 MBytes 12.7 Mbits/sec 0 747 KBytes
[ 5] 34.00-35.00 sec 18.1 MBytes 152 Mbits/sec 0 747 KBytes
[ 5] 35.00-36.00 sec 112 MBytes 943 Mbits/sec 0 747 KBytes
[ 5] 36.00-37.01 sec 111 MBytes 922 Mbits/sec 0 747 KBytes
[ 5] 37.01-38.00 sec 1.62 MBytes 13.7 Mbits/sec 0 747 KBytes
[ 5] 38.00-39.00 sec 1.62 MBytes 13.6 Mbits/sec 0 747 KBytes
[ 5] 39.00-40.00 sec 1.50 MBytes 12.6 Mbits/sec 0 747 KBytes
[ 5] 40.00-41.00 sec 1.38 MBytes 11.5 Mbits/sec 0 747 KBytes
[ 5] 41.00-42.00 sec 94.1 MBytes 791 Mbits/sec 0 747 KBytes
[ 5] 42.00-43.00 sec 112 MBytes 944 Mbits/sec 0 747 KBytes
[ 5] 43.00-44.00 sec 40.5 MBytes 339 Mbits/sec 0 747 KBytes
[ 5] 44.00-45.00 sec 1.62 MBytes 13.6 Mbits/sec 0 747 KBytes
[ 5] 45.00-46.00 sec 2.88 MBytes 24.1 Mbits/sec 0 747 KBytes
[ 5] 46.00-47.00 sec 1.38 MBytes 11.5 Mbits/sec 0 747 KBytes
[ 5] 47.00-48.00 sec 54.2 MBytes 456 Mbits/sec 0 747 KBytes
[ 5] 48.00-49.00 sec 112 MBytes 937 Mbits/sec 0 747 KBytes
[ 5] 49.00-50.00 sec 97.6 MBytes 816 Mbits/sec 0 747 KBytes
[ 5] 50.00-51.00 sec 1.38 MBytes 11.6 Mbits/sec 0 747 KBytes
[ 5] 51.00-52.01 sec 1.50 MBytes 12.5 Mbits/sec 0 747 KBytes
[ 5] 52.01-53.00 sec 1.75 MBytes 14.8 Mbits/sec 0 747 KBytes
[ 5] 53.00-54.00 sec 1.38 MBytes 11.5 Mbits/sec 0 747 KBytes
[ 5] 54.00-55.00 sec 108 MBytes 904 Mbits/sec 0 747 KBytes
[ 5] 55.00-56.00 sec 113 MBytes 947 Mbits/sec 0 747 KBytes
[ 5] 56.00-57.00 sec 22.6 MBytes 189 Mbits/sec 0 747 KBytes
[ 5] 57.00-58.00 sec 1.38 MBytes 11.6 Mbits/sec 0 747 KBytes
[ 5] 58.00-59.00 sec 1.38 MBytes 11.5 Mbits/sec 0 747 KBytes
[ 5] 59.00-60.36 sec 2.75 MBytes 16.9 Mbits/sec 0 747 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-60.36 sec 2.21 GBytes 314 Mbits/sec 0 sender
[ 5] 0.00-60.37 sec 2.20 GBytes 313 Mbits/sec receiver
iperf Done. dd 写入完成后,以太网端口的带宽就会恢复到约 940Mbits/s。 我们的客户面临的问题略有不同。当它们开始写入 NVMe 磁盘时,由于带宽低,USB3 摄像机捕获失败。如果没有写入磁盘,也不会失败。 Re: iMX8MP bandwidth limitation with simultaneous PCIe and USB3 use 你好
我没有任何记录表明我的团队以前见过这种行为。
AXI 总线不应限制在 1Gb/s 以内,因为只有一条 PCIe 线路将占用几乎所有的带宽。
能否详细介绍一下您的测试设置?
顺祝商祺! Re: iMX8MP bandwidth limitation with simultaneous PCIe and USB3 use 你好
感谢您提供的信息,我将与内部团队分享这些信息,并尽快向您通报最新情况。
顺祝商祺! Re: iMX8MP bandwidth limitation with simultaneous PCIe and USB3 use 另外,我还创建了一个 cgroup 设置,可以对写入 NVMe 磁盘的数据进行节流。看起来 USB3 和 PCIe 子系统在 SoC 内共享一条约 1Gb/s 的管道,因为结果非常直接。如果我增加节流量,USB3 就能立即获得更多带宽。 Re: iMX8MP bandwidth limitation with simultaneous PCIe and USB3 use 你好
感谢您提供的信息。
据内部团队说,他们以前也做过类似的测试,但没有遇到问题。i.MX8MP 支持 USB 和 PCIE 端口同时运行。
你能提供电路板支持包版本吗,我会再试一次。
顺祝商祺! Re: iMX8MP bandwidth limitation with simultaneous PCIe and USB3 use 我使用 Toradex 电路板支持包 7.4.0 进行了测试,它使用恩智浦下游内核 6.6.101。 传输同时进行,只是它们似乎在共享带宽。 Re: iMX8MP bandwidth limitation with simultaneous PCIe and USB3 use 你好,我有最新消息。
我们的内部团队可以重现该问题:
我在 i.MX8MPEVK 上重现了这个问题。目前怀疑是 NOC 带宽造成的问题。
如果使用 eth0/eth1 进行同样的测试不能解决问题,因此不受 AXI 总线的限制。
使用 USB3.0 以太网进行测试:
top - 12:36:31 up 43 min, 2 users, load average: 0.41, 0.23, 0.15
Tasks: 160 total, 4 running, 155 sleep, 1 d-sleep, 0 stopped, 0 zombie
%Cpu0 : 0.0 us, 7.9 sy, 0.0 ni, 53.5 id, 5.0 wa, 11.9 hi, 21.8 si, 0.0 st
%Cpu1 : 2.0 us, 21.8 sy, 0.0 ni, 51.5 id, 20.8 wa, 3.0 hi, 1.0 si, 0.0 st
%Cpu2 : 1.1 us, 22.1 sy, 0.0 ni, 50.5 id, 23.2 wa, 3.2 hi, 0.0 si, 0.0 st
%Cpu3 : 0.0 us, 2.1 sy, 0.0 ni, 6.4 id, 0.0 wa, 12.8 hi, 78.7 si, 0.0 st
MiB Mem : 5606.6 total, 5171.0 free, 403.9 used, 192.0 buff/cache
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 5202.7 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
34 root 20 0 0 0 0 R 38.8 0.0 0:38.37 ksoftirqd/3
1962 root 20 0 3304 2148 1124 D 32.9 0.0 0:03.39 dd
1959 root 20 0 17896 3360 2720 S 13.6 0.1 0:01.91 iperf3
748 parsec 20 0 279360 5148 4636 R 2.9 0.1 0:10.60 parsec
1963 root 20 0 7644 5072 2896 R 1.9 0.1 0:00.10 top
16 root 20 0 0 0 0 R 1.0 0.0 0:25.62 ksoftirqd/0
29 root 20 0 0 0 0 S 1.0 0.0 0:00.20 ksoftirqd/2
801 ntp 20 0 77012 4968 4200 S 1.0 0.1 0:00.23 ntpd
我们将继续在内部讨论这个问题。
顺祝商祺! Re: iMX8MP bandwidth limitation with simultaneous PCIe and USB3 use 你好,@rbeims、
内部团队确认是带宽限制。
在这种情况下,可以尝试使用 CSI 接口摄像头。
顺便问一下,客户能否分享您的 CPU 负载信息?
顺祝商祺! Re: iMX8MP bandwidth limitation with simultaneous PCIe and USB3 use 你好,@rbeims、
感谢您的更新。
能否请您分享一下 CPU 负载?
我会检查是否有办法对优先级进行收费。
致以最崇高的敬意 Re: iMX8MP bandwidth limitation with simultaneous PCIe and USB3 use 你好
在 NOC 块中,PCIE 和 USB 是同一个块,在 doc 中,它们的优先级相同。因此,无法通过修改优先级来实现。
顺祝商祺! Re: iMX8MP bandwidth limitation with simultaneous PCIe and USB3 use 谢谢你的澄清!
查看全文