On Mon, Oct 2, 2023 at 12:25 AM Linus Walleij <linus.wall...@linaro.org> wrote:
> Test with ping from host: > > PING 192.168.1.220 (192.168.1.220) 1472(1500) bytes of data. > 1480 bytes from 192.168.1.220: icmp_seq=1 ttl=64 time=0.723 ms > 1480 bytes from 192.168.1.220: icmp_seq=2 ttl=64 time=0.562 ms > 1480 bytes from 192.168.1.220: icmp_seq=3 ttl=64 time=0.555 ms > > When this ping reaches the device, the Marvell switch adds 8 bytes of DSA > overhead, > and the Broadcom enetsw adds 6 bytes, resulting in exactly 1514 bytes which > is what > the switch can handle. No wait this isn't correctly stated. I was too tired. OpenWrt adds a VLAN to each port so we get VLAN tags on all frames. So when I ping with ping -s 1472 -M do 192.168.1.220 (command missing) this first turns into a 1500 byte ICMP package (as seen), when it reaches the Marvell switch it adds VLAN_ETH_HLEN + VLAN_HLEN 1500 + 18 + 4 = 1522 and then 6 more bytes for DSA tag ending up with 1528 bytes. Then the Broadcom switch adds another DSA tag of 8 bytes, resulting in 1536 bytes reaching Linux, the maximum. tcpdump (on the target) gives this confirming the suspicion: 00:05:03.678271 AF Unknown (1429722180), length 1532: 0x0000: 3d93 bcae c56b a83d 8874 02fd 0004 8100 =....k.=.t...... 0x0010: 0000 dada 0000 c000 0fff 0800 4500 05dc ............E... 0x0020: 0000 4000 4001 b146 c0a8 0189 c0a8 0101 ..@.@..F........ 0x0030: 0800 1fd0 0068 001f 7231 1b65 0000 0000 .....h..r1.e.... 0x0040: f6ef 0600 0000 0000 1011 1213 1415 1617 ................ 0x0050: 1819 1a1b 1c1d 1e1f 2021 2223 2425 2627 .........!"#$%&' 0x0060: 2829 2a2b 2c2d 2e2f 3031 3233 3435 3637 ()*+,-./01234567 0x0070: 3839 3a3b 3c3d 3e3f 4041 4243 4445 4647 89:;<=>?@ABCDEFG 3d93 = First four bytes are the last two bytes of the destination ethernet address I don't know why the first four are missing, but it sure explains why the paket is 1532 bytes and not 1536. bcae c56b a83b = source ethernet address 8874 02fd 0004 = Broadcom enetsw DSA tag 8100 0000 = VLAN 802.1Q header dada 0000 c000 0fff 0800 = EDSA tag for the Marvell (outer) switch, 0800 is the ethertype obviously Next follows the contents of the ping packet as it appears if we dump it on the DSA interface such as tcpdump -i lan1 etc, there we get the stripped out packet. At the end 4 bytes of FCS. I will add this to the commit so it's clear how this works... Yours, Linus Walleij _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel