This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3358 :Re] AM3358 eth0 packet not being received...

Part Number: AM3358


Hello Ti,

Here is an additional question from the link below.

https://e2e.ti.com/support/processors/f/791/t/927724 

eth1 was also used for further testing.

If you set up as below and continue to up/down eth0, you will not receive eth0 packets at all.

eth0/eth1 is connected to the switch hub and is listening to multicast IP.

[root@(none) ~]# ifconfig

eth0 Link encap:Ethernet HWaddr 38:D2:69:5D:0D:C5
inet addr:10.254.254.100 Bcast:10.254.254.127 Mask:255.255.255.128
inet6 addr: fe80::3ad2:69ff:fe5d:dc5/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:290448 errors:0 dropped:0 overruns:0 frame:0
TX packets:174 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:411939372 (392.8 MiB) TX bytes:12438 (12.1 KiB)
Interrupt:173

eth1 Link encap:Ethernet HWaddr 38:D2:69:5D:0D:C7
inet addr:10.254.254.200 Bcast:10.254.254.255 Mask:255.255.255.128
inet6 addr: fe80::3ad2:69ff:fe5d:dc7/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:1584198 errors:0 dropped:0 overruns:0 frame:0
TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2246652148 (2.0 GiB) TX bytes:1068 (1.0 KiB)

eth2 Link encap:Ethernet HWaddr 9A:49:3F:C0:F8:17
inet addr:192.168.0.123 Bcast:192.168.255.255 Mask:255.255.0.0
inet6 addr: fe80::9849:3fff:fec0:f817/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5509 errors:0 dropped:2040 overruns:0 frame:0
TX packets:2427 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:432694 (422.5 KiB) TX bytes:619873 (605.3 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:358 errors:0 dropped:0 overruns:0 frame:0
TX packets:358 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:189024 (184.5 KiB) TX bytes:189024 (184.5 KiB)

[root@(none) ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth2
10.254.254.0 * 255.255.255.128 U 0 0 0 eth0
10.254.254.128 * 255.255.255.128 U 0 0 0 eth1
192.168.0.0 * 255.255.0.0 U 0 0 0 eth2
[root@(none) ~]#

When normal,

[root@(none) ~]# ethtool -S eth0
NIC statistics:
Good Rx Frames: 358624
Broadcast Rx Frames: 8
Multicast Rx Frames: 358616
Pause Rx Frames: 0
Rx CRC Errors: 0
Rx Align/Code Errors: 0
Oversize Rx Frames: 0
Rx Jabbers: 0
Undersize (Short) Rx Frames: 0
Rx Fragments: 0
Rx Octets: 510031260
Good Tx Frames: 30
Broadcast Tx Frames: 0
Multicast Tx Frames: 30
Pause Tx Frames: 0
Deferred Tx Frames: 0
Collisions: 0
Single Collision Tx Frames: 0
Multiple Collision Tx Frames: 0
Excessive Collisions: 0
Late Collisions: 0
Tx Underrun: 0
Carrier Sense Errors: 0
Tx Octets: 2256
Rx + Tx 64 Octet Frames: 28
Rx + Tx 65-127 Octet Frames: 39
Rx + Tx 128-255 Octet Frames: 10
Rx + Tx 256-511 Octet Frames: 0
Rx + Tx 512-1023 Octet Frames: 0
Rx + Tx 1024-Up Octet Frames: 358577
Net Octets: 510033516
Rx Start of Frame Overruns: 0
Rx Middle of Frame Overruns: 0
Rx DMA Overruns: 0
Rx DMA chan: head_enqueue: 1
Rx DMA chan: tail_enqueue: 332082
Rx DMA chan: pad_enqueue: 0
Rx DMA chan: misqueued: 0
Rx DMA chan: desc_alloc_fail: 0
Rx DMA chan: pad_alloc_fail: 0
Rx DMA chan: runt_receive_buf: 0
Rx DMA chan: runt_transmit_buf: 0
Rx DMA chan: empty_dequeue: 0
Rx DMA chan: busy_dequeue: 241006
Rx DMA chan: good_dequeue: 331955
Rx DMA chan: requeue: 0
Rx DMA chan: teardown_dequeue: 0
Tx DMA chan: head_enqueue: 30
Tx DMA chan: tail_enqueue: 0
Tx DMA chan: pad_enqueue: 0
Tx DMA chan: misqueued: 0
Tx DMA chan: desc_alloc_fail: 0
Tx DMA chan: pad_alloc_fail: 0
Tx DMA chan: runt_receive_buf: 0
Tx DMA chan: runt_transmit_buf: 14
Tx DMA chan: empty_dequeue: 30
Tx DMA chan: busy_dequeue: 0
Tx DMA chan: good_dequeue: 30
Tx DMA chan: requeue: 30
Tx DMA chan: teardown_dequeue: 0

When abnormal,

[root@(none) ~]# ethtool -S eth0
NIC statistics:
Good Rx Frames: 1347594
Broadcast Rx Frames: 39
Multicast Rx Frames: 1347555
Pause Rx Frames: 0
Rx CRC Errors: 0
Rx Align/Code Errors: 0
Oversize Rx Frames: 0
Rx Jabbers: 0
Undersize (Short) Rx Frames: 0
Rx Fragments: 0
Rx Octets: 1916559718
Good Tx Frames: 105
Broadcast Tx Frames: 0
Multicast Tx Frames: 105
Pause Tx Frames: 0
Deferred Tx Frames: 0
Collisions: 0
Single Collision Tx Frames: 0
Multiple Collision Tx Frames: 0
Excessive Collisions: 0
Late Collisions: 0
Tx Underrun: 0
Carrier Sense Errors: 0
Tx Octets: 8886
Rx + Tx 64 Octet Frames: 53
Rx + Tx 65-127 Octet Frames: 193
Rx + Tx 128-255 Octet Frames: 16
Rx + Tx 256-511 Octet Frames: 0
Rx + Tx 512-1023 Octet Frames: 0
Rx + Tx 1024-Up Octet Frames: 1347437
Net Octets: 1916568604
Rx Start of Frame Overruns: 169
Rx Middle of Frame Overruns: 0
Rx DMA Overruns: 169
Rx DMA chan: head_enqueue: 1
Rx DMA chan: tail_enqueue: 1320845
Rx DMA chan: pad_enqueue: 0
Rx DMA chan: misqueued: 2
Rx DMA chan: desc_alloc_fail: 0
Rx DMA chan: pad_alloc_fail: 0
Rx DMA chan: runt_receive_buf: 0
Rx DMA chan: runt_transmit_buf: 0
Rx DMA chan: empty_dequeue: 0
Rx DMA chan: busy_dequeue: 1448729
Rx DMA chan: good_dequeue: 1320718
Rx DMA chan: requeue: 1
Rx DMA chan: teardown_dequeue: 0
Tx DMA chan: head_enqueue: 105
Tx DMA chan: tail_enqueue: 0
Tx DMA chan: pad_enqueue: 0
Tx DMA chan: misqueued: 0
Tx DMA chan: desc_alloc_fail: 0
Tx DMA chan: pad_alloc_fail: 0
Tx DMA chan: runt_receive_buf: 0
Tx DMA chan: runt_transmit_buf: 22
Tx DMA chan: empty_dequeue: 105
Tx DMA chan: busy_dequeue: 0
Tx DMA chan: good_dequeue: 105
Tx DMA chan: requeue: 105
Tx DMA chan: teardown_dequeue: 0

Thank you,

Best regards.

Gyosun.

  • Hi,

    One problem that is the same as the previous thread is that ports eth0 and eth1 cannot be the same subnet, this causes a conflict for the kernel. Regardless of 

    eth0 Link encap:Ethernet HWaddr 38:D2:69:5D:0D:C5
    inet addr:10.254.254.100 Bcast:10.254.254.127 Mask:255.255.255.128

    eth1 Link encap:Ethernet HWaddr 38:D2:69:5D:0D:C7
    inet addr:10.254.254.200 Bcast:10.254.254.255 Mask:255.255.255.128

    Please look at this presentation on describing the issue that happens with two ports are on the same subnet. Start with slide 51. There is also a video of the presentation at this link.

    One other thing to consider is that the having ports 0 and 1 listen to the same subnet will effectively double the traffic on that is occurring simultaneously inside the CPSW. Which may lead to several dropped frames. For example in the stats dump you provided there are several frames being dropped due to DMA overruns. This means that CPSW RX descriptors most likely got exhausted which means packets are coming faster than what is currently configured for.

    Rx Start of Frame Overruns: 169
    Rx Middle of Frame Overruns: 0
    Rx DMA Overruns: 169

    If you also look at /proc/net/snmp you may also find lots of packets being dropped at the network stack level. 

    My recommendation is that eth0 and eth0 cannot be on the same 10.254.254.x subnet.

    Best Regards,

    Schuyler

  • Hi Schuyler,

    I have additional questions.

    1. The masks of eth0 and eth1 are set to 255.255.255.128, so it is determined that they are separated into different networks.

    Is it not possible to separate the network by setting the mask?

    eth0 Link encap:Ethernet HWaddr 38:D2:69:5D:0D:C5

    inet addr:10.254.254.100 Bcast:10.254.254.127 Mask:255.255.255.128

    eth1 Link encap:Ethernet HWaddr 38:D2:69:5D:0D:C7
    inet addr:10.254.254.200 Bcast:10.254.254.255 Mask:255.255.255.128

    2. Even if there is a problem with the operation, if you link up, it should communicate again.

    The packet is not received at all and rebooting will solve the problem.

    Is there a problem with the CPSW driver? Is there a related patch?

    3. The subnet was isolated and tested.

    However, in the same way, eth0 does not receive packets at all after a certain period of time.

    [root@(none) ~]# ifconfig

    eth0 Link encap:Ethernet HWaddr 38:D2:69:5D:0D:C5
    inet addr:10.254.254.100 Bcast:0.0.0.0 Mask:255.255.255.0
    inet6 addr: fe80::3ad2:69ff:fe5d:dc5/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:543042 errors:0 dropped:123 overruns:0 frame:0
    TX packets:335 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:770005730 (734.3 MiB) TX bytes:27692 (27.0 KiB)
    Interrupt:173

    eth1 Link encap:Ethernet HWaddr 38:D2:69:5D:0D:C7
    inet addr:172.16.0.100 Bcast:172.16.0.255 Mask:255.255.255.0
    inet6 addr: fe80::3ad2:69ff:fe5d:dc7/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:2359553 errors:0 dropped:509 overruns:0 frame:0
    TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:3345867979 (3.1 GiB) TX bytes:1068 (1.0 KiB)

    eth2 Link encap:Ethernet HWaddr 7E:22:D8:E5:AD:E9
    inet addr:192.168.0.123 Bcast:0.0.0.0 Mask:255.255.0.0
    inet6 addr: fe80::7c22:d8ff:fee5:ade9/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:12840 errors:0 dropped:2531 overruns:0 frame:0
    TX packets:8340 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:1201270 (1.1 MiB) TX bytes:2151686 (2.0 MiB)

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:65536 Metric:1
    RX packets:1230 errors:0 dropped:0 overruns:0 frame:0
    TX packets:1230 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1
    RX bytes:658096 (642.6 KiB) TX bytes:658096 (642.6 KiB)

    [root@(none) ~]# route
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    default 192.168.0.1 0.0.0.0 UG 0 0 0 eth2
    10.254.254.0 * 255.255.255.0 U 0 0 0 eth0
    172.16.0.0 * 255.255.255.0 U 0 0 0 eth1
    192.168.0.0 * 255.255.0.0 U 0 0 0 eth2
    [root@(none) ~]#

    [root@(none) ~]# ethtool -S eth0
    NIC statistics:
    Good Rx Frames: 3254353
    Broadcast Rx Frames: 828
    Multicast Rx Frames: 3253525
    Pause Rx Frames: 0
    Rx CRC Errors: 0
    Rx Align/Code Errors: 0
    Oversize Rx Frames: 0
    Rx Jabbers: 0
    Undersize (Short) Rx Frames: 0
    Rx Fragments: 0
    Rx Octets: 332184385
    Good Tx Frames: 396
    Broadcast Tx Frames: 0
    Multicast Tx Frames: 396
    Pause Tx Frames: 0
    Deferred Tx Frames: 0
    Collisions: 0
    Single Collision Tx Frames: 0
    Multiple Collision Tx Frames: 0
    Excessive Collisions: 0
    Late Collisions: 0
    Tx Underrun: 0
    Carrier Sense Errors: 0
    Tx Octets: 33104
    Rx + Tx 64 Octet Frames: 939
    Rx + Tx 65-127 Octet Frames: 706
    Rx + Tx 128-255 Octet Frames: 28
    Rx + Tx 256-511 Octet Frames: 0
    Rx + Tx 512-1023 Octet Frames: 0
    Rx + Tx 1024-Up Octet Frames: 3253076
    Net Octets: 332217489
    Rx Start of Frame Overruns: 0
    Rx Middle of Frame Overruns: 0
    Rx DMA Overruns: 0
    Rx DMA chan: head_enqueue: 1
    Rx DMA chan: tail_enqueue: 3226104
    Rx DMA chan: pad_enqueue: 0
    Rx DMA chan: misqueued: 0
    Rx DMA chan: desc_alloc_fail: 0
    Rx DMA chan: pad_alloc_fail: 0
    Rx DMA chan: runt_receive_buf: 0
    Rx DMA chan: runt_transmit_buf: 0
    Rx DMA chan: empty_dequeue: 0
    Rx DMA chan: busy_dequeue: 3817013
    Rx DMA chan: good_dequeue: 3225977
    Rx DMA chan: requeue: 0
    Rx DMA chan: teardown_dequeue: 0
    Tx DMA chan: head_enqueue: 395
    Tx DMA chan: tail_enqueue: 1
    Tx DMA chan: pad_enqueue: 0
    Tx DMA chan: misqueued: 1
    Tx DMA chan: desc_alloc_fail: 0
    Tx DMA chan: pad_alloc_fail: 0
    Tx DMA chan: runt_receive_buf: 0
    Tx DMA chan: runt_transmit_buf: 90
    Tx DMA chan: empty_dequeue: 395
    Tx DMA chan: busy_dequeue: 0
    Tx DMA chan: good_dequeue: 396
    Tx DMA chan: requeue: 395
    Tx DMA chan: teardown_dequeue: 0
    [root@(none) ~]#

    4. How can I increase the number of CPSW RX descriptors?

    5. I tried eth0 / eth1 bonding, but the symptoms were the same.

    6. As I did more experiments today, I found a way to receive packets again when packets are not received.

    If both eth0 and eth1 are down, and up again, devices that were not received will be received.

    But it is not the best way. Packet reception must not be stopped. Why is this?

    7. I want to configure and use the same subnet (10.254.254.x).

    Will there be room for improvement if I update the kernel to the latest version?

    Thank you,

    Best regards.

    Gyosun.

  • Hi,

    The issue with same ports has to do with MAC addresses, the presentation link I provided explains why two ports on the same subnet will not work. The issue is not a CPSW driver issue but a kernel network stack issue. Changing kernel versions will not change this kernel network stack behavior.

    Since you mentioned bonding can you please describe why both ports need to be on the same 10.254.254 subnet? 

    Best Regards,

    Schuyler

  • Hi Schuyler,

    Packets cannot be received even when they are in different subnets.

    If you continue to down/up eth0 or eth1, there will be a phenomenon that packet reception is not possible at all.

    I want to revive only ethx that cannot be received, but all must be down and up to receive packets.

    The results are shown below.

    [root@(none) ~]# ifconfig
    eth0 Link encap:Ethernet HWaddr 38:D2:69:5D:0D:C5
    inet addr:10.254.254.100 Bcast:10.254.254.127 Mask:255.255.255.128
    inet6 addr: fe80::3ad2:69ff:fe5d:dc5/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:6520740 errors:0 dropped:1404 overruns:0 frame:0
    TX packets:43 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:656784604 (626.3 MiB) TX bytes:3084 (3.0 KiB)
    Interrupt:173

    eth1 Link encap:Ethernet HWaddr 38:D2:69:5D:0D:C7
    inet addr:10.10.254.200 Bcast:10.255.255.255 Mask:255.0.0.0
    inet6 addr: fe80::3ad2:69ff:fe5d:dc7/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:3158920 errors:0 dropped:684 overruns:0 frame:0
    TX packets:1044 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:184584656 (176.0 MiB) TX bytes:84240 (82.2 KiB)

    ...

    [root@(none) ~]# ifconfig

    eth0 Link encap:Ethernet HWaddr 38:D2:69:5D:0D:C5
    inet addr:10.254.254.100 Bcast:10.254.254.127 Mask:255.255.255.128
    inet6 addr: fe80::3ad2:69ff:fe5d:dc5/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:6523303 errors:0 dropped:1405 overruns:0 frame:0
    TX packets:43 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:660418500 (629.8 MiB) TX bytes:3084 (3.0 KiB)
    Interrupt:173

    eth1 Link encap:Ethernet HWaddr 38:D2:69:5D:0D:C7
    inet addr:10.10.254.200 Bcast:10.255.255.255 Mask:255.0.0.0
    inet6 addr: fe80::3ad2:69ff:fe5d:dc7/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:3158920 errors:0 dropped:684 overruns:0 frame:0
    TX packets:1044 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:184584656 (176.0 MiB) TX bytes:84240 (82.2 KiB)

    ...

    [root@(none) ~]# ifconfig eth1 down
    [root@(none) ~]# ifconfig eth1 up
    [root@(none) ~]# ifconfig
    eth0 Link encap:Ethernet HWaddr 38:D2:69:5D:0D:C5
    inet addr:10.254.254.100 Bcast:10.254.254.127 Mask:255.255.255.128
    inet6 addr: fe80::3ad2:69ff:fe5d:dc5/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:6975837 errors:0 dropped:1477 overruns:0 frame:0
    TX packets:43 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:1302126876 (1.2 GiB) TX bytes:3084 (3.0 KiB)
    Interrupt:173

    eth1 Link encap:Ethernet HWaddr 38:D2:69:5D:0D:C7
    inet addr:10.10.254.200 Bcast:10.255.255.255 Mask:255.0.0.0
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:3158920 errors:0 dropped:684 overruns:0 frame:0
    TX packets:1096 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:184584656 (176.0 MiB) TX bytes:87360 (85.3 KiB)

    ...

    [root@(none) ~]# ethtool -S eth1
    NIC statistics:
    Good Rx Frames: 6447306
    Broadcast Rx Frames: 1353
    Multicast Rx Frames: 6445953
    Pause Rx Frames: 0
    Rx CRC Errors: 0
    Rx Align/Code Errors: 0
    Oversize Rx Frames: 0
    Rx Jabbers: 0
    Undersize (Short) Rx Frames: 0
    Rx Fragments: 0
    Rx Octets: 578024710
    Good Tx Frames: 464
    Broadcast Tx Frames: 0
    Multicast Tx Frames: 464
    Pause Tx Frames: 0
    Deferred Tx Frames: 0
    Collisions: 0
    Single Collision Tx Frames: 0
    Multiple Collision Tx Frames: 0
    Excessive Collisions: 0
    Late Collisions: 0
    Tx Underrun: 0
    Carrier Sense Errors: 0
    Tx Octets: 36584
    Rx + Tx 64 Octet Frames: 1711
    Rx + Tx 65-127 Octet Frames: 565
    Rx + Tx 128-255 Octet Frames: 0
    Rx + Tx 256-511 Octet Frames: 0
    Rx + Tx 512-1023 Octet Frames: 0
    Rx + Tx 1024-Up Octet Frames: 6445494
    Net Octets: 578061294
    Rx Start of Frame Overruns: 649
    Rx Middle of Frame Overruns: 0
    Rx DMA Overruns: 649
    Rx DMA chan: head_enqueue: 2
    Rx DMA chan: tail_enqueue: 10282304
    Rx DMA chan: pad_enqueue: 0
    Rx DMA chan: misqueued: 28
    Rx DMA chan: desc_alloc_fail: 0
    Rx DMA chan: pad_alloc_fail: 0
    Rx DMA chan: runt_receive_buf: 0
    Rx DMA chan: runt_transmit_buf: 0
    Rx DMA chan: empty_dequeue: 0
    Rx DMA chan: busy_dequeue: 10322840
    Rx DMA chan: good_dequeue: 10282051
    Rx DMA chan: requeue: 21
    Rx DMA chan: teardown_dequeue: 127
    Tx DMA chan: head_enqueue: 1164
    Tx DMA chan: tail_enqueue: 1
    Tx DMA chan: pad_enqueue: 0
    Tx DMA chan: misqueued: 1
    Tx DMA chan: desc_alloc_fail: 0
    Tx DMA chan: pad_alloc_fail: 0
    Tx DMA chan: runt_receive_buf: 0
    Tx DMA chan: runt_transmit_buf: 249
    Tx DMA chan: empty_dequeue: 1165
    Tx DMA chan: busy_dequeue: 0
    Tx DMA chan: good_dequeue: 1165
    Tx DMA chan: requeue: 1164
    Tx DMA chan: teardown_dequeue: 0
    [root@(none) ~]#

    [root@(none) ~]# ifconfig eth0 down
    [root@(none) ~]# ifconfig eth1 down
    [root@(none) ~]# ifconfig eth0 up
    [root@(none) ~]# ifconfig eth1 up
    [root@(none) ~]# ifconfig

    eth0 Link encap:Ethernet HWaddr 38:D2:69:5D:0D:C5
    inet addr:10.254.254.100 Bcast:10.254.254.127 Mask:255.255.255.128
    inet6 addr: fe80::3ad2:69ff:fe5d:dc5/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:7245003 errors:0 dropped:1535 overruns:0 frame:0
    TX packets:51 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:1683797502 (1.5 GiB) TX bytes:3732 (3.6 KiB)
    Interrupt:173

    eth1 Link encap:Ethernet HWaddr 38:D2:69:5D:0D:C7
    inet addr:10.10.254.200 Bcast:10.255.255.255 Mask:255.0.0.0
    inet6 addr: fe80::3ad2:69ff:fe5d:dc7/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:3239742 errors:0 dropped:703 overruns:0 frame:0
    TX packets:1140 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:299193798 (285.3 MiB) TX bytes:90336 (88.2 KiB)

    ...

    How can I reset only eth that is not received?

    Best Regards,

    Gyosun

  • Hi,

    I apologize as I am not understanding what you are trying to test. Could you please describe the expected traffic for the two ports? For example what is the expected bit rate? What is the relation to ports eth0, eth1 and eth2? What is the indication that the packet reception is stopping? 

    Please attach in one zip file the output from the following commands:

    ethtool eth0

    ethtool eth1

    ethtool eth2

    cat /proc/net/snmp

    Best Regards,

    Schuyler

  • Hi Schuyler,

    Sorry for the question not smooth.

    It is structured as shown in the figure below.

    eth0/1 receives multicast packets at up to 50mps.

    The experiment was conducted using the macro of the teraterm terminal.

    As you can see from the experimental results, if you continue down/up, the packet count doesn't increase at some point.

    In order to receive packets again, all eth0/1 must be down and up.

    3426.test.zip

    Best Regards,

    gyosun

  • Hi,

    Thank for you the picture and the logs that does illustrate how you are trying to test. The network stack (above the cpsw driver) is seeing several traffic related errors.

    Udp: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors InCsumErrors IgnoredMulti
    Udp: 2001250           25          116          1157                  116                  0                   0                       899

    Is the board joining the same Multicast streams on both eth0 and eth1? If so the processor is being asked to join the same stream twice which at the least is a burden on the processor as the stack or application is trying to decide what to do with the redundant UDP packets. What is the receiving application doing with the received packets?

    The passing test is seeing similar errors in the UDP area.

    If the setup here is trying to do some sort of traffic redundancy I would look into some level of network bonding. There are several modes of bonding but is bonding is used here the kernel will be able to eliminate redundant packets.

    Best Regards,

    Schuyler

  • Hi Schuyler,

    I'm sorry for late reply.

    As shown in the figure below, video packets are processed after receiving, It is transmitted through RF.

    eth0 and eth1 are receiving the same multicast packet.

    I also tried network bonding, but the same symptoms appear.

    The more important problem than redundant packets is that eth is unable to receive.

    How about reproducing the problem and suggesting a solution?

    If udp packet is sent to eth0/1 and eth0 or eth1 is continuously down/up, reception is not possible.

    Best Regards,

    gyosun

  • Hi Schuyler,

    Tried with the latest kernel, but symptoms are the same.

    am335x-evm-linux-sdk-src-06.03.00.106.tar.xz

    It is a very important issue and must be resolved.

    I'm begging you to please ~

    Best Regards,

    gyosun

  • Hi

    Would it be possible for you to test below change? The idea is to put MAC_SL in idle before disabling it.

    Based on 4.19 Kernel.

    diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
    index fc8e3ed383a2..ccd091a9c41e 100644
    --- a/drivers/net/ethernet/ti/cpsw.c
    +++ b/drivers/net/ethernet/ti/cpsw.c
    @@ -1182,10 +1182,13 @@ static void _cpsw_adjust_link(struct cpsw_slave *slave,
                            dev_warn(priv->dev,
                                     "Speed was changed, CBS shaper speeds are changed!");
            } else {
    -               mac_control = 0;
    +               mac_control = slave->mac_control | BIT(11);
                    /* disable forwarding */
                    cpsw_ale_control_set(cpsw->ale, slave_port,
                                         ALE_PORT_STATE, ALE_PORT_STATE_DISABLE);
    +               writel_relaxed(mac_control, &slave->sliver->mac_control);
    +               msleep(1);
    +               mac_control = 0;
            }
     
            if (mac_control != slave->mac_control) {
    

  • Hi Grygorii,

    Thank you for answer.

    I tested it by modifying it as follows.

    Based on 4.4.19 Kernel

    static void _cpsw_adjust_link(struct cpsw_slave *slave,
    struct cpsw_priv *priv, bool *link)
    {

    ...

    #if 0

      mac_control = 0;
      /* disable forwarding */
      cpsw_ale_control_set(priv->ale, slave_port,
      ALE_PORT_STATE, ALE_PORT_STATE_DISABLE);
    #else
      mac_control = slave->mac_control | BIT(11);
      /* disable forwarding */
      cpsw_ale_control_set(priv->ale, slave_port,
        ALE_PORT_STATE, ALE_PORT_STATE_DISABLE);
      __raw_writel(mac_control, &slave->sliver->mac_control);
      msleep(1);
      mac_control = 0;
    #endif
    }

    if (mac_control != slave->mac_control) {
      phy_print_status(phy);
      __raw_writel(mac_control, &slave->sliver->mac_control);
    }

    slave->mac_control = mac_control;
    }

    However, the same symptoms still occur.

    Any other ideas?

    Thank you.

    Best regards.

    gyosun.

  • 1) What is your kernel version? #uname -a 

    2) Could you confirm that with your Kernel version following functions called when you do "ifconfig eth1 down":

    cpsw_slave_stop(0

    |-> phy_stop()

         |-> _cpsw_adjust_link()

    ??

    3) Do you have following commits in your Kernel:

    530b94b80d61 net: phy: ensure phylib state machine is stopped after calling phy_stop
    f8944b7d70a9 net: phy: call state machine synchronously in phy_stop

    ??

  • Hi Grygorii,

    Referencing the posted patch, it was reapplied to kernel 4.4.19 to confirm normal operation.

    The _cpsw_adjust_link() and cpsw_slave_stop() functions have been modified.cpsw.c

    [root@(none) ~]# uname -a
    Linux (none) 4.4.19-gdb0b54cdad #119 PREEMPT Thu Aug 27 18:06:16 KST 2020 armv7l Generic AM33XX (Flattened Device Tree) GNU/Linux

    It was a great help in solving the problem.

    It would be nice to reflect the patch on the latest TI kernel.

    Thank you.

    Best Regards.

    Gyosun.