ok,
i try to get the statistics for lan0 on my second R2 with “ethertool -i lan0” while ping my router over it (must revert my routing back to cpu_port0 first)
Linux bpi-r2 4.14.19-bpi-r2-gmac #132 SMP Mon Feb 26 16:23:26 CET 2018 armv7l
[16:42] root@bpi-r2:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group defau0
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qle0
link/ether c6:86:c6:05:22:e7 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qle0
link/ether ba:6b:99:cd:5e:20 brd ff:ff:ff:ff:ff:ff
4: wan@eth1: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group 0
link/ether ba:6b:99:cd:5e:20 brd ff:ff:ff:ff:ff:ff
5: lan0@eth0: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group0
link/ether c6:86:c6:05:22:e7 brd ff:ff:ff:ff:ff:ff
6: lan1@eth0: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group0
link/ether c6:86:c6:05:22:e7 brd ff:ff:ff:ff:ff:ff
7: lan2@eth0: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group0
link/ether c6:86:c6:05:22:e7 brd ff:ff:ff:ff:ff:ff
8: lan3@eth0: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN group0
link/ether c6:86:c6:05:22:e7 brd ff:ff:ff:ff:ff:ff
[16:42] root@bpi-r2:~# ethtool -i lan0
driver: dsa
version:
firmware-version: N/A
bus-info: platform
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: yes
supports-priv-flags: no
[16:42] root@bpi-r2:~# ethtool -i wan
driver: dsa
version:
firmware-version: N/A
bus-info: platform
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: yes
supports-priv-flags: no
statistics:
[16:43] root@bpi-r2:~# ethtool -S eth0
NIC statistics:
tx_bytes: 0
tx_packets: 0
tx_skip: 0
tx_collisions: 0
rx_bytes: 0
rx_packets: 0
rx_overflow: 0
rx_fcs_errors: 0
rx_short_errors: 0
rx_long_errors: 0
rx_checksum_errors: 0
rx_flow_control_packets: 0
[16:44] root@bpi-r2:~# ethtool -S eth1
NIC statistics:
tx_bytes: 0
tx_packets: 0
tx_skip: 0
tx_collisions: 0
rx_bytes: 0
rx_packets: 0
rx_overflow: 0
rx_fcs_errors: 0
rx_short_errors: 0
rx_long_errors: 0
rx_checksum_errors: 0
rx_flow_control_packets: 0
p05_TxDrop: 0
p05_TxCrcErr: 0
p05_TxUnicast: 0
p05_TxMulticast: 0
p05_TxBroadcast: 0
p05_TxCollision: 0
p05_TxSingleCollision: 0
p05_TxMultipleCollision: 0
p05_TxDeferred: 0
p05_TxLateCollision: 0
p05_TxExcessiveCollistion: 0
p05_TxPause: 0
p05_TxPktSz64: 0
p05_TxPktSz65To127: 0
p05_TxPktSz128To255: 0
p05_TxPktSz256To511: 0
p05_TxPktSz512To1023: 0
p05_Tx1024ToMax: 0
p05_TxBytes: 0
p05_RxDrop: 0
p05_RxFiltering: 0
p05_RxMulticast: 0
p05_RxBroadcast: 0
p05_RxAlignErr: 0
p05_RxCrcErr: 0
p05_RxUnderSizeErr: 0
p05_RxFragErr: 0
p05_RxOverSzErr: 0
p05_RxJabberErr: 0
p05_RxPause: 0
p05_RxPktSz64: 0
p05_RxPktSz65To127: 0
p05_RxPktSz128To255: 0
p05_RxPktSz256To511: 0
p05_RxPktSz512To1023: 0
p05_RxPktSz1024ToMax: 0
p05_RxBytes: 0
p05_RxCtrlDrop: 0
p05_RxIngressDrop: 0
p05_RxArlDrop: 0
as you see statistics for eth1 (cpu-port1) is more detailed than eth0 (cpu-port0). in eth0 there are p05-sets (port 5 of mt7530??), these entries are missing on eth0 (maybe port 6)
now to lan0:
[16:50] root@bpi-r2:~# ifup lan0
[16:50] root@bpi-r2:~# ifconfig lan0
lan0 Link encap:Ethernet HWaddr 08:00:00:00:00:00
inet addr:192.168.0.10 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::c486:c6ff:fe05:22e7/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:276 errors:0 dropped:4 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:45834 (44.7 KiB) TX bytes:826 (826.0 B)
[16:50] root@bpi-r2:~# ping 192.168.0.5
PING 192.168.0.5 (192.168.0.5) 56(84) bytes of data.
^C
--- 192.168.0.5 ping statistics ---
7 packets transmitted, 0 received, 100% packet loss, time 6235ms
[16:50] root@bpi-r2:~# ethtool -S lan0
NIC statistics:
tx_packets: 36
tx_bytes: 3216
rx_packets: 356
rx_bytes: 54746
TxDrop: 0
TxCrcErr: 0
TxUnicast: 28
TxMulticast: 14
TxBroadcast: 1
TxCollision: 0
TxSingleCollision: 0
TxMultipleCollision: 0
TxDeferred: 0
TxLateCollision: 0
TxExcessiveCollistion: 0
TxPause: 0
TxPktSz64: 2
TxPktSz65To127: 37
TxPktSz128To255: 4
TxPktSz256To511: 0
TxPktSz512To1023: 0
Tx1024ToMax: 0
TxBytes: 3957
RxDrop: 0
RxFiltering: 0
RxMulticast: 229
RxBroadcast: 125
RxAlignErr: 0
RxCrcErr: 0
RxUnderSizeErr: 0
RxFragErr: 0
RxOverSzErr: 0
RxJabberErr: 0
RxPause: 0
RxPktSz64: 174
RxPktSz65To127: 38
RxPktSz128To255: 72
RxPktSz256To511: 45
RxPktSz512To1023: 27
RxPktSz1024ToMax: 0
RxBytes: 61154
RxCtrlDrop: 0
RxIngressDrop: 0
RxArlDrop: 0
as i see there are RX and TX bytes…so lan-port itself works, but the internal routing (is assume mt7530 => SOC) does not work
after the pings eth0 has traffic in booth directions but not the same amount
[17:09] root@bpi-r2:~# ethtool -S eth0
NIC statistics:
tx_bytes: 9258
tx_packets: 98
tx_skip: 0
tx_collisions: 0
rx_bytes: 307700
rx_packets: 2036
rx_overflow: 0
rx_fcs_errors: 0
rx_short_errors: 0
rx_long_errors: 0
rx_checksum_errors: 0
rx_flow_control_packets: 0
where does ethtool measure that traffic on eth0 (on soc-side or switch-side)?
some thinkings: soc->switch works and the backway not (packets from switch are not accepted by soc)…ok…did some extra-tests
ping again my router (192.168.0.5):
[root@bananapi ~]# tcpdump -nni eth0 icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
17:13:34.104680 IP truncated-ip - 6 bytes missing! 192.168.0.10 > 192.168.0.5: ICMP echo request, id 815, seq 1, length 64
17:13:35.150095 IP truncated-ip - 6 bytes missing! 192.168.0.10 > 192.168.0.5: ICMP echo request, id 815, seq 2, length 64
17:13:36.190053 IP truncated-ip - 6 bytes missing! 192.168.0.10 > 192.168.0.5: ICMP echo request, id 815, seq 3, length 64
17:13:37.230044 IP truncated-ip - 6 bytes missing! 192.168.0.10 > 192.168.0.5: ICMP echo request, id 815, seq 4, length 64
17:13:38.270038 IP truncated-ip - 6 bytes missing! 192.168.0.10 > 192.168.0.5: ICMP echo request, id 815, seq 5, length 64
17:13:39.310056 IP truncated-ip - 6 bytes missing! 192.168.0.10 > 192.168.0.5: ICMP echo request, id 815, seq 6, length 64
17:13:40.350044 IP truncated-ip - 6 bytes missing! 192.168.0.10 > 192.168.0.5: ICMP echo request, id 815, seq 7, length 64
17:13:41.390038 IP truncated-ip - 6 bytes missing! 192.168.0.10 > 192.168.0.5: ICMP echo request, id 815, seq 8, length 64
17:13:42.430047 IP truncated-ip - 6 bytes missing! 192.168.0.10 > 192.168.0.5: ICMP echo request, id 815, seq 9, length 64
packet goes out, as assumed, and of course will be answered by my (old) router. for same on r2 i need to install tcpdump (have to temporary boot with working kernel, install and again with gmac-kernel, have done this with ethtool before).
strange is the “truncated-ip”-information…
because i cannot use ssh (no connection to lan) i tcpdumped to file
[17:29] root@bpi-r2:~# tcpdump -nni lan0 icmp > lan0ping.log &
[17:30] root@bpi-r2:~# tcpdump -nni eth0 icmp > eth0ping.log &
pinged again, see incoming pings on my (old) router, but booth files on R2 stay empty
after killing tcpdump the lan0-log contains the outgoing pings:
[17:34] root@bpi-r2:~# tailf lan0ping.log
17:31:34.745963 IP 192.168.0.10 > 192.168.0.5: ICMP echo request, id 791, seq 4,
length 64
17:31:35.785962 IP 192.168.0.10 > 192.168.0.5: ICMP echo request, id 791, seq 5,
length 64
17:31:36.825984 IP 192.168.0.10 > 192.168.0.5: ICMP echo request, id 791, seq 6,
length 64
17:31:37.865970 IP 192.168.0.10 > 192.168.0.5: ICMP echo request, id 791, seq 7,
length 64
17:31:38.905964 IP 192.168.0.10 > 192.168.0.5: ICMP echo request, id 791, seq 8,
length 64
17:31:39.945963 IP 192.168.0.10 > 192.168.0.5: ICMP echo request, id 791, seq 9,
length 64
17:31:40.985961 IP 192.168.0.10 > 192.168.0.5: ICMP echo request, id 791, seq 10
, length 64
17:31:42.025960 IP 192.168.0.10 > 192.168.0.5: ICMP echo request, id 791, seq 11
, length 64
17:31:43.065960 IP 192.168.0.10 > 192.168.0.5: ICMP echo request, id 791, seq 12
, length 64