NXP iMX8M Plus 雙網(wǎng)口性能測試

By Toradex胡珊逢

Verdin iMX8M Plus?是?Toradex?采用?NXP?最新的?i.MX 8M Plus?處理器的計(jì)算機(jī)模塊击喂,其具有?4x Cortex-A53?和?Cortex-M7?核心,支持神經(jīng)網(wǎng)絡(luò)加速運(yùn)算的?NPU碰辅,H.265?硬件編碼懂昂,CAN FD?,以及雙路千兆以太網(wǎng)没宾。配合?Verdin?開發(fā)板凌彬,用戶可以直接測試兩路以太網(wǎng)。文章將對網(wǎng)絡(luò)性能做簡要的測試循衰。


使用?Toradex Easy Installer?安裝?Linux BSP v5.3.0铲敛,?默認(rèn)的配置已經(jīng)支持兩路千兆以太網(wǎng)。因此安裝完成重啟后即可看到兩個(gè)網(wǎng)絡(luò)接口会钝。


----------------------------------

root@verdin-imx8mp:~# ifconfig

eth0 ?????Link encap:Ethernet ?HWaddr 00:14:2D:78:82:04 ?

??????????inet addr:192.168.20.120 ?Bcast:192.168.20.255 ?Mask:255.255.255.0

??????????inet6 addr: fe80::214:2dff:fe78:8204/64 Scope:Link

??????????UP BROADCAST RUNNING MULTICAST ?MTU:1500 ?Metric:1

??????????RX packets:5105505 errors:0 dropped:0 overruns:0 frame:0

??????????TX packets:5988237 errors:0 dropped:0 overruns:0 carrier:0

??????????collisions:0 txqueuelen:1000

??????????RX bytes:7344324802 (6.8 GiB) ?TX bytes:8611102924 (8.0 GiB)

??????????Interrupt:48


eth1 ?????Link encap:Ethernet ?HWaddr 00:14:2D:68:82:04 ?

??????????inet addr:192.168.200.150 ?Bcast:192.168.200.255 ?Mask:255.255.255.0

??????????inet6 addr: fe80::214:2dff:fe68:8204/64 Scope:Link

??????????UP BROADCAST RUNNING MULTICAST ?MTU:1500 ?Metric:1

??????????RX packets:6686311 errors:0 dropped:0 overruns:0 frame:0

??????????TX packets:247321 errors:0 dropped:0 overruns:0 carrier:0

??????????collisions:0 txqueuelen:1000

??????????RX bytes:6234153398 (5.8 GiB) ?TX bytes:8180651220 (7.6 GiB)

----------------------------------


Verdin?開發(fā)板分別和兩臺(tái)電腦相連伐蒋,鏈路速度為?1000Mbps。


IP?地址設(shè)置如下迁酸。

PC1:192.168.200.1

PC2:192.168.20.132

Eth0: 192.168.200.150

Eth1:192.168.20.120


測試場景為

l?Eth0和?Eth1?單獨(dú)向?PC1?和?PC2?發(fā)送數(shù)據(jù)

l?Eth0和?Eth1同時(shí)向?PC1?和?PC2?發(fā)送數(shù)據(jù)

l?Eth0和?Eth1?單獨(dú)接收來自?PC1?和?PC2?的數(shù)據(jù)

l?Eth0和?Eth1?同時(shí)接收來自?PC1?和?PC2?的數(shù)據(jù)

l?Eth0?上的數(shù)據(jù)轉(zhuǎn)發(fā)到?Eth1

期間測試模塊?Eth0和?Eth1?的最大帶寬以及?CPU?占用率先鱼。


Eth0和?Eth1?單獨(dú)向?PC1?和?PC2?發(fā)送數(shù)據(jù)

在?PC1?和?PC2?上運(yùn)行?iperf3?服務(wù)器。

----------------------------------

$ iperf3 -s

----------------------------------


在?Verdin iMX8M Plus?運(yùn)行?iperf3?向?PC?發(fā)送數(shù)據(jù)奸鬓。Eth0?和?Eth1?的測試數(shù)據(jù)如下焙畔。

Eth0:

----------------------------------

root@verdin-imx8mp:~# iperf3 -c 192.168.20.132

Connecting to host 192.168.20.132, port 5201

[ ?5] local 192.168.20.120 port 34982 connected to 192.168.20.132 port 5201

[ ID] Interval ??????????Transfer ????Bitrate ????????Retr ?Cwnd

[ ?5] ??0.00-1.00 ??sec ??114 MBytes ??957 Mbits/sec ???0 ???373 KBytes ??????

[ ?5] ??1.00-2.00 ??sec ??112 MBytes ??942 Mbits/sec ???0 ???373 KBytes ??????

[ ?5] ??2.00-3.00 ??sec ??112 MBytes ??937 Mbits/sec ???0 ???410 KBytes ??????

[ ?5] ??3.00-4.00 ??sec ??112 MBytes ??942 Mbits/sec ???0 ???410 KBytes ??????

- - - - - - - - - - - - - - - - - - - - - - - - -

[ ID] Interval ??????????Transfer ????Bitrate ????????Retr

[ ?5] ??0.00-10.00 ?sec ?1.10 GBytes ??942 Mbits/sec ???0 ????????????sender

[ ?5] ??0.00-10.00 ?sec ?1.10 GBytes ??941 Mbits/sec ?????????????????receiver


iperf Done.

----------------------------------


Eth1:

----------------------------------

root@verdin-imx8mp:~# iperf3 -c 192.168.200.1

Connecting to host 192.168.200.1, port 5201

[ ?5] local 192.168.200.150 port 59206 connected to 192.168.200.1 port 5201

[ ID] Interval ??????????Transfer ????Bitrate ????????Retr ?Cwnd

[ ?5] ??0.00-1.00 ??sec ??111 MBytes ??934 Mbits/sec ???0 ??1.14 MBytes ??????

[ ?5] ??1.00-2.00 ??sec ??112 MBytes ??944 Mbits/sec ???0 ??1.23 MBytes ??????

[ ?5] ??2.00-3.00 ??sec ??111 MBytes ??933 Mbits/sec ???0 ??1.23 MBytes ??????

[ ?5] ??3.00-4.00 ??sec ??112 MBytes ??943 Mbits/sec ???0 ??1.23 MBytes ??????

- - - - - - - - - - - - - - - - - - - - - - - - -

[ ID] Interval ??????????Transfer ????Bitrate ????????Retr

[ ?5] ??0.00-10.00 ?sec ?1.09 GBytes ??940 Mbits/sec ???0 ????????????sender

[ ?5] ??0.00-10.00 ?sec ?1.09 GBytes ??937 Mbits/sec ?????????????????receiver


iperf Done.

----------------------------------


Verdin iMX8M Plus CPU?占用率:


Eth0和?Eth1同時(shí)向?PC1?和?PC2?發(fā)送數(shù)據(jù)

Eth0:

----------------------------------

root@verdin-imx8mp:~# iperf3 -c 192.168.20.132

Connecting to host 192.168.20.132, port 5201

[ ?5] local 192.168.20.120 port 34994 connected to 192.168.20.132 port 5201

[ ID] Interval ??????????Transfer ????Bitrate ????????Retr ?Cwnd

[ ?5] ??0.00-1.00 ??sec ??113 MBytes ??949 Mbits/sec ???0 ???438 KBytes ??????

[ ?5] ??1.00-2.00 ??sec ??112 MBytes ??937 Mbits/sec ???0 ???464 KBytes ??????

[ ?5] ??2.00-3.00 ??sec ??112 MBytes ??943 Mbits/sec ???0 ???464 KBytes ??????

[ ?5] ??3.00-4.00 ??sec ??111 MBytes ??935 Mbits/sec ???0 ???464 KBytes ??????

- - - - - - - - - - - - - - - - - - - - - - - - -

[ ID] Interval ??????????Transfer ????Bitrate ????????Retr

[ ?5] ??0.00-10.00 ?sec ?1.09 GBytes ??940 Mbits/sec ???0 ????????????sender

[ ?5] ??0.00-10.00 ?sec ?1.09 GBytes ??939 Mbits/sec ?????????????????receiver


iperf Done.

----------------------------------


Eth1:

----------------------------------

root@verdin-imx8mp:~# iperf3 -c 192.168.200.1

Connecting to host 192.168.200.1, port 5201

[ ?5] local 192.168.200.150 port 59210 connected to 192.168.200.1 port 5201

[ ID] Interval ??????????Transfer ????Bitrate ????????Retr ?Cwnd

[ ?5] ??0.00-1.00 ??sec ??111 MBytes ??929 Mbits/sec ???0 ??1.14 MBytes ??????

[ ?5] ??1.00-2.00 ??sec ??112 MBytes ??944 Mbits/sec ???0 ??1.14 MBytes ??????

[ ?5] ??2.00-3.00 ??sec ??111 MBytes ??933 Mbits/sec ???0 ??1.14 MBytes ??????

- - - - - - - - - - - - - - - - - - - - - - - - -

[ ID] Interval ??????????Transfer ????Bitrate ????????Retr

[ ?5] ??0.00-10.00 ?sec ?1.09 GBytes ??936 Mbits/sec ???0 ????????????sender

[ ?5] ??0.00-10.00 ?sec ?1.09 GBytes ??933 Mbits/sec ?????????????????receiver


iperf Done.

----------------------------------


Verdin iMX8M Plus CPU?占用率:


Eth0和?Eth1?單獨(dú)接收來自?PC1?和?PC2?的數(shù)據(jù)

在?Verdin iMX8M Plus?分別運(yùn)行?iperf3?服務(wù)器,針對?Eth0?和?Eth1?使用不同的端口全蝶。

----------------------------------

root@verdin-imx8mp:~# iperf3 -B 192.168.20.120 -s

root@verdin-imx8mp:~# iperf3 -B 192.168.200.150 -p 5202 -s

----------------------------------


Eth0:

----------------------------------

root@verdin-imx8mp:~# iperf3 -B 192.168.20.120 -s

-----------------------------------------------------------

Server listening on 5201

-----------------------------------------------------------

Accepted connection from 192.168.20.132, port 48674

[ ?5] local 192.168.20.120 port 5201 connected to 192.168.20.132 port 48676

[ ID] Interval ??????????Transfer ????Bitrate

[ ?5] ??0.00-1.00 ??sec ??111 MBytes ??933 Mbits/sec ?????????????????

[ ?5] ??1.00-2.00 ??sec ??111 MBytes ??935 Mbits/sec ?????????????????

[ ?5] ??2.00-3.00 ??sec ??111 MBytes ??934 Mbits/sec ?????????????????

[ ?5] ??3.00-4.00 ??sec ??111 MBytes ??935 Mbits/sec ?????????????????

- - - - - - - - - - - - - - - - - - - - - - - - -

[ ID] Interval ??????????Transfer ????Bitrate

[ ?5] ??0.00-10.00 ?sec ?1.09 GBytes ??934 Mbits/sec ?????????????????receiver

-----------------------------------------------------------

Server listening on 5201

-----------------------------------------------------------

----------------------------------


Eth1:

----------------------------------

root@verdin-imx8mp:~# iperf3 -B 192.168.200.150 -p 5202 -s

-----------------------------------------------------------

Server listening on 5202

-----------------------------------------------------------

Accepted connection from 192.168.200.1, port 47290

[ ?5] local 192.168.200.150 port 5202 connected to 192.168.200.1 port 47292

[ ID] Interval ??????????Transfer ????Bitrate

[ ?5] ??0.00-1.00 ??sec ??110 MBytes ??919 Mbits/sec ?????????????????

[ ?5] ??1.00-2.00 ??sec ??112 MBytes ??939 Mbits/sec ?????????????????

[ ?5] ??2.00-3.00 ??sec ??112 MBytes ??941 Mbits/sec ?????????????????

[ ?5] ??3.00-4.00 ??sec ??112 MBytes ??941 Mbits/sec ?????????????????

- - - - - - - - - - - - - - - - - - - - - - - - -

[ ID] Interval ??????????Transfer ????Bitrate

[ ?5] ??0.00-10.00 ?sec ?1.09 GBytes ??938 Mbits/sec ?????????????????receiver

----------------------------------


Verdin iMX8M Plus CPU?占用率:




Eth0和?Eth1?同時(shí)接收來自?PC1?和?PC2?的數(shù)據(jù)


Eth0:

----------------------------------

root@verdin-imx8mp:~# iperf3 -B 192.168.20.120 -s

-----------------------------------------------------------

Server listening on 5201

-----------------------------------------------------------

Accepted connection from 192.168.20.132, port 48712

[ ?5] local 192.168.20.120 port 5201 connected to 192.168.20.132 port 48714

[ ID] Interval ??????????Transfer ????Bitrate

[ ?5] ??0.00-1.00 ??sec ??111 MBytes ??931 Mbits/sec ?????????????????

[ ?5] ??1.00-2.00 ??sec ??111 MBytes ??934 Mbits/sec ?????????????????

[ ?5] ??2.00-3.00 ??sec ??111 MBytes ??934 Mbits/sec ?????????????????

[ ?5] ??3.00-4.00 ??sec ??111 MBytes ??935 Mbits/sec ?????????????????

- - - - - - - - - - - - - - - - - - - - - - - - -

[ ID] Interval ??????????Transfer ????Bitrate

[ ?5] ??0.00-10.00 ?sec ?1.09 GBytes ??934 Mbits/sec ?????????????????receiver

-----------------------------------------------------------

Server listening on 5201

-----------------------------------------------------------

----------------------------------



Eth1:

----------------------------------

root@verdin-imx8mp:~# iperf3 -B 192.168.200.150 -p 5202 -s

-----------------------------------------------------------

Server listening on 5202

-----------------------------------------------------------

Accepted connection from 192.168.200.1, port 47308

[ ?5] local 192.168.200.150 port 5202 connected to 192.168.200.1 port 47310

[ ID] Interval ??????????Transfer ????Bitrate

[ ?5] ??0.00-1.00 ??sec ??110 MBytes ??919 Mbits/sec ?????????????????

[ ?5] ??1.00-2.00 ??sec ??112 MBytes ??941 Mbits/sec ?????????????????

[ ?5] ??2.00-3.00 ??sec ??112 MBytes ??941 Mbits/sec ?????????????????

[ ?5] ??3.00-4.00 ??sec ??112 MBytes ??941 Mbits/sec ?????????????????

[ ?5] ??4.00-5.00 ??sec ??112 MBytes ??941 Mbits/sec ?????????????????

- - - - - - - - - - - - - - - - - - - - - - - - -

[ ID] Interval ??????????Transfer ????Bitrate

[ ?5] ??0.00-10.00 ?sec ?1.08 GBytes ??928 Mbits/sec ?????????????????receiver

-----------------------------------------------------------

Server listening on 5202

-----------------------------------------------------------

----------------------------------


Verdin iMX8M Plus CPU?占用率:





Eth0?上的數(shù)據(jù)轉(zhuǎn)發(fā)到?Eth1

為了將?Eth0?的數(shù)據(jù)轉(zhuǎn)發(fā)到?Eth1闹蒜,需要設(shè)置?/etc/sysctl.conf?寺枉。

----------------------------------

# needed for routing, including masquerading or NAT

net/ipv4/ip_forward=1 ?

----------------------------------


然后運(yùn)行sysctl?另設(shè)置生效,當(dāng)然重啟系統(tǒng)也可以绷落。

----------------------------------

root@verdin-imx8mp:~# sysctl -p

----------------------------------


設(shè)置轉(zhuǎn)發(fā)規(guī)則姥闪。

----------------------------------

root@verdin-imx8mp:~# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

root@verdin-imx8mp:~# iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT

root@verdin-imx8mp:~# iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT

----------------------------------


在?PC2?上啟動(dòng)?iperf3?服務(wù)器,PC 1?運(yùn)行?iper3?客戶端發(fā)送數(shù)據(jù)砌烁,所有的數(shù)據(jù)由?Verdin iMX8M Plus?負(fù)責(zé)從?Eth0?轉(zhuǎn)發(fā)到?Eth1?上筐喳。


PC2 Server:

----------------------------------

$ iperf3 -s

-----------------------------------------------------------

Server listening on 5201

-----------------------------------------------------------

Accepted connection from 192.168.20.120, port 55360

[ ?5] local 192.168.20.132 port 5201 connected to 192.168.20.120 port 55362

[ ID] Interval ??????????Transfer ????Bitrate

[ ?5] ??0.00-1.00 ??sec ??105 MBytes ??881 Mbits/sec ?????????????????

[ ?5] ??1.00-2.00 ??sec ??111 MBytes ??928 Mbits/sec ?????????????????

[ ?5] ??2.00-3.00 ??sec ??110 MBytes ??921 Mbits/sec ?????????????????

- - - - - - - - - - - - - - - - - - - - - - - - -

[ ID] Interval ??????????Transfer ????Bitrate

[ ?5] ??0.00-10.00 ?sec ?1.08 GBytes ??931 Mbits/sec ?????????????????receiver


----------------------------------



PC1 Client:

----------------------------------

$ iperf3 -c 192.168.20.132

Connecting to host 192.168.20.132, port 5201

[ ?5] local 192.168.200.1 port 55362 connected to 192.168.20.132 port 5201

[ ID] Interval ??????????Transfer ????Bitrate ????????Retr ?Cwnd

[ ?5] ??0.00-1.00 ??sec ??108 MBytes ??904 Mbits/sec ???0 ???471 KBytes ??????

[ ?5] ??1.00-2.00 ??sec ??110 MBytes ??926 Mbits/sec ???0 ???492 KBytes ??????

[ ?5] ??2.00-3.00 ??sec ??109 MBytes ??916 Mbits/sec ???0 ???492 KBytes ??????

[ ?5] ??3.00-4.00 ??sec ??112 MBytes ??938 Mbits/sec ???0 ???492 KBytes ??????

- - - - - - - - - - - - - - - - - - - - - - - - -

[ ID] Interval ??????????Transfer ????Bitrate ????????Retr

[ ?5] ??0.00-10.00 ?sec ?1.09 GBytes ??934 Mbits/sec ???0 ????????????sender

[ ?5] ??0.00-10.00 ?sec ?1.08 GBytes ??931 Mbits/sec ?????????????????receiver

----------------------------------


Verdin iMX8M Plus CPU?占用率:




數(shù)據(jù)匯總?cè)缦隆?/p>


兩個(gè)千兆網(wǎng)口無論是在單獨(dú)還是同時(shí)收發(fā)數(shù)據(jù)時(shí)都達(dá)到920Mbps?以上,包括網(wǎng)口之間的數(shù)據(jù)轉(zhuǎn)發(fā)函喉,基本接近滿帶寬避归。在?CPU?占用方面,當(dāng)兩個(gè)千兆網(wǎng)口以接近滿帶寬速率同時(shí)工作時(shí)管呵,其中一個(gè)核心站占用率會(huì)超過?70%梳毙。



總結(jié)

Verdin iMX8M Plus?的雙網(wǎng)口設(shè)計(jì)為多網(wǎng)口需求的應(yīng)用提供了理想的選擇,例如在工業(yè)自動(dòng)化中捐下,一個(gè)網(wǎng)口運(yùn)行實(shí)時(shí)性要求高的應(yīng)用如?EtherCAT账锹,而另外一個(gè)則可以用于一般的網(wǎng)絡(luò)通信】澜螅或者另一個(gè)網(wǎng)口可以用作冗余接口奸柬,或者連接兩個(gè)不同的網(wǎng)絡(luò)。Verdin iMX8M Plus?還有許多其他實(shí)用的功能婴程,我們會(huì)在后續(xù)的文章進(jìn)行介紹

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末廓奕,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子档叔,更是在濱河造成了極大的恐慌桌粉,老刑警劉巖,帶你破解...
    沈念sama閱讀 219,539評論 6 508
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件衙四,死亡現(xiàn)場離奇詭異番甩,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)届搁,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,594評論 3 396
  • 文/潘曉璐 我一進(jìn)店門缘薛,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人卡睦,你說我怎么就攤上這事宴胧。” “怎么了表锻?”我有些...
    開封第一講書人閱讀 165,871評論 0 356
  • 文/不壞的土叔 我叫張陵恕齐,是天一觀的道長。 經(jīng)常有香客問我瞬逊,道長显歧,這世上最難降的妖魔是什么仪或? 我笑而不...
    開封第一講書人閱讀 58,963評論 1 295
  • 正文 為了忘掉前任,我火速辦了婚禮士骤,結(jié)果婚禮上范删,老公的妹妹穿的比我還像新娘。我一直安慰自己拷肌,他們只是感情好到旦,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,984評論 6 393
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著巨缘,像睡著了一般添忘。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上若锁,一...
    開封第一講書人閱讀 51,763評論 1 307
  • 那天搁骑,我揣著相機(jī)與錄音,去河邊找鬼又固。 笑死靶病,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的口予。 我是一名探鬼主播,決...
    沈念sama閱讀 40,468評論 3 420
  • 文/蒼蘭香墨 我猛地睜開眼涕侈,長吁一口氣:“原來是場噩夢啊……” “哼沪停!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起裳涛,我...
    開封第一講書人閱讀 39,357評論 0 276
  • 序言:老撾萬榮一對情侶失蹤木张,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后端三,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體舷礼,經(jīng)...
    沈念sama閱讀 45,850評論 1 317
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,002評論 3 338
  • 正文 我和宋清朗相戀三年郊闯,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了妻献。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 40,144評論 1 351
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡团赁,死狀恐怖育拨,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情欢摄,我是刑警寧澤熬丧,帶...
    沈念sama閱讀 35,823評論 5 346
  • 正文 年R本政府宣布,位于F島的核電站怀挠,受9級特大地震影響析蝴,放射性物質(zhì)發(fā)生泄漏害捕。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,483評論 3 331
  • 文/蒙蒙 一闷畸、第九天 我趴在偏房一處隱蔽的房頂上張望尝盼。 院中可真熱鬧,春花似錦腾啥、人聲如沸东涡。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,026評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽疮跑。三九已至,卻和暖如春凸舵,著一層夾襖步出監(jiān)牢的瞬間祖娘,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,150評論 1 272
  • 我被黑心中介騙來泰國打工啊奄, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留渐苏,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 48,415評論 3 373
  • 正文 我出身青樓菇夸,卻偏偏與公主長得像琼富,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個(gè)殘疾皇子庄新,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,092評論 2 355

推薦閱讀更多精彩內(nèi)容