본문으로 건너뛰기

14. 이더넷 사용량

14.1 이더넷 소개​

ArmSoM 시리즈 제품은 주로 두 개의 이더넷 칩을 사용합니다.

  • RTL8211F-CG
  • RTL8125B

14.2 RTL8211F-CG 칩​

ArmSoM 시리즈의 ArmSoM-AIM7은 RTL8211F-CG 기가비트 이더넷 칩을 사용합니다.

14.2.1 운전사​

드라이버/넷/이더넷/stmicro/stmmac/*

14.2.2 DTS 노드 구성​

칩 수준 공통 구성 kernel/arch/arm64/boot/dts/rockchip/rk3588.dtsi

전체 코드/명령 및 출력 확장(완전 원본)
gmac0: ethernet@fe1b0000 {
compatible = "rockchip,rk3588-gmac", "snps,dwmac-4.20a";
reg = <0x0 0xfe1b0000 0x0 0x10000>;
interrupts = <GIC_SPI 227 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "macirq", "eth_wake_irq";
rockchip,grf = <&sys_grf>;
rockchip,php_grf = <&php_grf>;
clocks = <&cru CLK_GMAC_125M>, <&cru CLK_GMAC_50M>,
<&cru PCLK_GMAC0>, <&cru ACLK_GMAC0>,
<&cru CLK_GMAC0_PTP_REF>;
clock-names = "stmmaceth", "clk_mac_ref",
"pclk_mac", "aclk_mac",
"ptp_ref";
resets = <&cru SRST_A_GMAC0>;
reset-names = "stmmaceth";
power-domains = <&power RK3588_PD_GMAC>;

snps,mixed-burst;
snps,tso;

snps,axi-config = <&gmac0_stmmac_axi_setup>;
snps,mtl-rx-config = <&gmac0_mtl_rx_setup>;
snps,mtl-tx-config = <&gmac0_mtl_tx_setup>;
status = "disabled";

mdio0: mdio {
compatible = "snps,dwmac-mdio";
#address-cells = <0x1>;
#size-cells = <0x0>;
};

gmac0_stmmac_axi_setup: stmmac-axi-config {
snps,wr_osr_lmt = <4>;
snps,rd_osr_lmt = <8>;
snps,blen = <0 0 0 0 16 8 4>;
};

gmac0_mtl_rx_setup: rx-queues-config {
snps,rx-queues-to-use = <1>;
queue0 {};
};

gmac0_mtl_tx_setup: tx-queues-config {
snps,tx-queues-to-use = <1>;
queue0 {};
};
};

커널\arch\arm64\boot\dts\rockchip\rk3588-armsom-aim7.dts

전체 코드/명령 및 출력 확장(완전 원본)
&gmac0 {
/* Use rgmii-rxid mode to disable rx delay inside Soc */
phy-mode = "rgmii-rxid";
clock_in_out = "output";

snps,reset-gpio = <&gpio2 RK_PB4 GPIO_ACTIVE_LOW>;
snps,reset-active-low;
/* Reset time is 20ms, 100ms for rtl8211f */
snps,reset-delays-us = <0 20000 100000>;

pinctrl-names = "default";
pinctrl-0 = <&gmac0_miim
&gmac0_tx_bus2
&gmac0_rx_bus2
&gmac0_rgmii_clk
&gmac0_rgmii_bus>;

tx_delay = <0x43>;
/* rx_delay = <0x3f>; */

phy-handle = <&rgmii_phy>;
status = "okay";
};

&mdio0 {
rgmii_phy: phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0x1>;
};
};

14.3 RTL8125B 칩​

  • ArmSoM 시리즈에서 ArmSoM-Sige7 및 ArmSoM-W3은 RTL8125B 네트워크 컨트롤러 칩을 사용합니다.
  • RTL8125B는 PCIE-RJ45 네트워크 컨트롤러 칩입니다. 낮은 수준의 디버깅 중에는 PCIE만 구성하면 됩니다.

14.3.1 DTS 노드 구성​

  • 커널\arch\arm64\boot\dts\rockchip\rk3588-armsom-sige7.dts
&pcie2x1l0 {
reset-gpios = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>;
rockchip,init-delay-ms = <100>;
status = "okay";
};

&pcie2x1l2 {
reset-gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_HIGH>;
rockchip,init-delay-ms = <100>;
status = "okay";
};

14.4 이더넷 테스트​

14.4.1 VIP 주소 보기​

1. ifconfig -a
2. ip addr

14.4.2 연결 테스트​

armsom@armsom-sige7:/$ sudo ping -c 10 www.baidu.com
PING www.a.shifen.com (183.2.172.42) 56(84) bytes of data.
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=1 ttl=52 time=8.40 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=2 ttl=52 time=8.17 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=3 ttl=52 time=7.81 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=4 ttl=52 time=8.38 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=5 ttl=52 time=10.1 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=6 ttl=52 time=8.59 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=7 ttl=52 time=8.62 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=8 ttl=52 time=8.89 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=9 ttl=52 time=8.70 ms
64 bytes from 183.2.172.42 (183.2.172.42): icmp_seq=10 ttl=52 time=8.81 ms

--- www.a.shifen.com ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9015ms
rtt min/avg/max/mdev = 7.806/8.644/10.086/0.568 ms

14.4.3 2.5G 네트워크 속도 테스트​

iperf는 두 컴퓨터 간에 데이터를 전송하여 네트워크 대역폭을 측정하는 네트워크 성능 테스트 도구입니다. 이 경우 armsom-w3은 iperf 서버 역할을 하고 armsom-sige7은 iperf 클라이언트 역할을 합니다. 서버는 지정된 포트에서 수신 대기하며 iperf 클라이언트는 특정 크기의 데이터 스트림을 생성하고 TCP 또는 UDP 프로토콜을 통해 서버에 데이터를 보냅니다. 테스트 결과는 다음과 같습니다.

  • 클라이언트:
armsom@armsom-sige7:/$ sudo iperf -c 192.168.100.111 -t 10 -i 1
-------------------------------------------------------------
Client connecting to 192.168.100.111, TCP port 5001
TCP window size: 45.0 KByte (default)
-------------------------------------------------------------
[ 3] local 192.168.100.110 port 60564 connected with 192.168.100.111 port 5001
[ID] Interval Transfer Bandwidth
[ 3] 0.0000-1.0000 sec 275 MBytes 2.31 Gbits/sec
[ 3] 1.0000-2.0000 sec 281 MBytes 2.35 Gbits/sec
[ 3] 2.0000-3.0000 sec 278 MBytes 2.34 Gbits/sec
[ 3] 3.0000-4.0000 sec 280 MBytes 2.35 Gbits/sec
[ 3] 4.0000-5.0000 sec 279 MBytes 2.34 Gbits/sec
[ 3] 5.0000-6.0000 sec 279 MBytes 2.34 Gbits/sec
[ 3] 6.0000-7.0000 sec 276 MBytes 2.32 Gbits/sec
[ 3] 7.0000-8.0000 sec 282 MBytes 2.36 Gbits/sec
[ 3] 8.0000-9.0000 sec 279 MBytes 2.34 Gbits/sec
[ 3] 9.0000-10.0000 sec 278 MBytes 2.33 Gbits/sec
[ 3] 10.0000-10.0002 sec 256 KBytes 11.2 Gbits/sec
[ 3] 0.0000-10.0002 sec 2.72 GBytes 2.34 Gbits/sec
  • 서버:
armsom@armsom-w3:/$ iperf -s
-------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 128 KByte (default)
-------------------------------------------------------------
[ 4] local 192.168.100.111 port 5001 connected with 192.168.100.110 port 60564
[ID] Interval Transfer Bandwidth
[ 4] 0.0000-10.0045 sec 2.72 GBytes 2.34 Gbits/sec

테스트 결과에서 초당 대역폭은 대략 2.31 Gbits/sec와 2.36 Gbits/sec 사이에서 변동하며 최종 평균 대역폭은 2.34 Gbits/sec입니다.

문의하기