AM6422: AM6422 RSTP convergence test issue

Part Number: AM6422
Other Parts Discussed in Thread: TMDS64EVM, AM6442

Hello,

Problem Description:RSTP convergence test does not meet the time requirement, with occasional convergence times exceeding 20s.

Test Description:The DUT is connected to switches to form a ring network, with RSTP enabled (using the userspace program mstpd 0.1.0). A PC uses ICMP to test RSTP convergence time.

Test Topology:PC - Switch 1 --(eth0) DUT1(eth1) -- (eth0)DUT2(eth1) -- (eth0)DUT3 (eth1)-- Switch 2 -- Switch 1

Test Steps and Observed Issues:

The DUT device is AM6422, with eth0 and eth1 configured in CPSW Switch mode.

When Switch 2 is powered on, DUT2 eth1 negotiates to the Alternate port state.

When Switch 2 is powered off, DUT2 eth1 negotiates to the Designated port state.

During the transition from Switch 2 power-on to power-off, the PC-to-DUT3 ping convergence time occasionally exceeds 20s.

Problem Investigation:
After Switch 2 is powered off, port mirroring enabled on  Switch 1 captures a large number of ICMP request packets from the PC pinging DUT3. However, when DUT1 captures packets on eth0 using tcpdump, these ICMP requests are not observed.

Question:Is it possible that the ALE FDB is not flushed, causing ICMP requests to be dropped before the FDB entries age out?

Additional Information:
The mstpd 0.1.0 logs show that when an RSTP topology change occurs, it calls/sys/class/net/eth0/brport/flush to clear the bridge FDB. This ultimately calls am65_cpsw_switchdev_event_work with SWITCHDEV_FDB_DEL_TO_DEVICE. However, since the FDB entry is not added_by_user, the function returns directly without calling the final cpsw_ale_del_ucast.

SDK Version:ti-processor-sdk-linux-am64xx-evm-11.02.08.02

  • Hello, 

    Thanks for providing the SDK version you are using.

    Can you provide the specific commands/script you are using to setup RSTP? 

    What specific steps/script did you use to configure the DUT devices into CPSW switch mode?

    The mstpd 0.1.0 logs show that when an RSTP topology change occurs, it calls/sys/class/net/eth0/brport/flush to clear the bridge FDB.

    Can you share the contents of the mstpd logs?

    Question:Is it possible that the ALE FDB is not flushed, causing ICMP requests to be dropped before the FDB entries age out?

    Is it possible for you to do a sanity check on this perhaps by manually forcing an fdb flush?

    # On each DUT, after Switch 2 power-off:
    bridge fdb flush dev eth0 # Or your bridge interface (e.g., br0)
    # Monitor if ping convergence improves immediately

    -Daolin

  • Hello, 

    1. RSTP test script

    PC run a  script to continued ping all duts with 20 ms timout,  during testing power on and off switch2 by a relay auto

    2. CPSW switch mode script :

    • devlink dev param set platform/8000000.ethernet name switch_mode value true cmode runtime
    • interfac config script:
      config device 'br_lan_device'
      option name 'br-lan'
      option type 'bridge'
      list ifname 'eth0'
      list ifname 'eth1'
      option stp '1'

      config interface 'lan'
      option device 'br-lan'
      option proto 'static'
      option netmask 'xx'
      option gateway 'xx'
      option auto '1'
      option ipaddr 'xx

    3. DUT1 mstpd logs:

    Jul 15 07:02:30 aug mstpd[581]: MSTP_OUT_flush_all_fids: br-lan:eth0:0 Flushing forwarding database
    Jul 15 07:02:30 aug mstpd[581]: set_if_up: Port eth0 : up

    Jul 15 07:04:39 aug mstpd[581]: MSTP_OUT_flush_all_fids: br-lan:eth1:0 Flushing forwarding database
    Jul 15 07:04:39 aug mstpd[581]: set_if_up: Port eth1 : up
    Jul 15 07:04:41 aug mstpd[581]: MSTP_OUT_flush_all_fids: br-lan:eth1:0 Flushing forwarding database
    Jul 15 07:04:41 aug mstpd[581]: set_if_up: Port eth1 : up

    4. bridge fdb flush command not support on my system,  I just try to remove added_by_user check. It seems work, no exceeding 20s.

  • Hello Daolin,

      Any progress about this issue?

  • Hi Daolin

    Could you please help on this case?

    Thanks

    Zekun

  • Hi Du Wei,

    Apologies for the delayed response.

    4. bridge fdb flush command not support on my system,  I just try to remove added_by_user check. It seems work, no exceeding 20s.

    In order to verify if this is an issue with the driver and your workaround is the solution to the problem, I would need some time to reproduce the problem. To do this 1. can this issue be reproducible on TMDS64EVM? 2. is there a simpler topology than the one described that can reproduce the problem?

    -Daolin

  • Hello Daolin,

    Current TMDS64EVM is not available.

    Please refer the following simple topology to reproduce this problem:

    Ring Network link

    SW - DUT1 - DUT 2 -- DUT3 - SW

    RSTP topology

    SW:  root bridge

    DUT 2(Alternate Port) -- DUT3:   DUT2 eth1 port is Alternate Port connect to DUT3

    Test step

    1. ping DUT1 on DUT3,   DUT1  eth 0 study DUT3 MAC, please refer picture 1.1

    2. PC continuous ping DUT3 , please refer picture 1.2 about the first 4 ping request

    3. Unplug cable between DUT3 and SW,  ping timeout about 30 times, refer 1.2

    4. the DUT1  eth 1 study DUT3 MAC and ping restore, please refer picture 1.3

    Log:

    DUT1 ALE dump log and eth0 packets drop in ale dump and drop log.txt  

    $ sudo /home/aug/glibc-2.34/lib/ld-linux-aarch64.so.1 --library-path ~/glibc-2.34/lib/aarch64-linux-gnu/ ~/switch-config -             d
    K3 cpsw dump version (1) len(11704)
    ALE table dump ents(512):
    0   : type: vlan , vid = 0, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    1   : type: mcast, addr = 01:80:c2:00:00:00, mcast_state = blf, super, port_mask = 0x1
    2   : type: ucast, vid = 1, addr = 8c:08:79:73:c4:6f, ucast_type = persistant, port_num = 0x0, Secure
    3   : type: mcast, vid = 1, addr = ff:ff:ff:ff:ff:ff, mcast_state = f, no super, port_mask = 0x7
    4   : type: mcast, addr = 33:33:00:00:00:01, mcast_state = f, no super, port_mask = 0x1
    5   : type: mcast, addr = 01:00:5e:00:00:01, mcast_state = f, no super, port_mask = 0x1
    6   : type: vlan , vid = 1, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    23  : type: ucast, vid = 1, addr = 94:ae:e3:b8:0a:04, ucast_type = untouched , port_num = 0x1
    24  : type: ucast, vid = 1, addr = 18:3d:2d:d0:26:91, ucast_type = touched   , port_num = 0x1
    32  : type: ucast, vid = 1, addr = 94:ae:e3:b8:0a:0c, ucast_type = touched   , port_num = 0x1
    68  : type: ucast, vid = 1, addr = 9c:69:d3:2d:a7:ea, ucast_type = untouched , port_num = 0x1
    132 : type: ucast, vid = 1, addr = 8c:08:79:73:c4:b7, ucast_type = touched   , port_num = 0x1
    AUGOS/arm64: aug@aug in /tmp
    $ sudo /home/aug/glibc-2.34/lib/ld-linux-aarch64.so.1 --library-path ~/glibc-2.34/lib/aarch64-linux-gnu/ ~/switch-config -             d
    K3 cpsw dump version (1) len(11704)
    ALE table dump ents(512):
    0   : type: vlan , vid = 0, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    1   : type: mcast, addr = 01:80:c2:00:00:00, mcast_state = blf, super, port_mask = 0x1
    2   : type: ucast, vid = 1, addr = 8c:08:79:73:c4:6f, ucast_type = persistant, port_num = 0x0, Secure
    3   : type: mcast, vid = 1, addr = ff:ff:ff:ff:ff:ff, mcast_state = f, no super, port_mask = 0x7
    4   : type: mcast, addr = 33:33:00:00:00:01, mcast_state = f, no super, port_mask = 0x1
    5   : type: mcast, addr = 01:00:5e:00:00:01, mcast_state = f, no super, port_mask = 0x1
    6   : type: vlan , vid = 1, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    23  : type: ucast, vid = 1, addr = 94:ae:e3:b8:0a:04, ucast_type = untouched , port_num = 0x1
    24  : type: ucast, vid = 1, addr = 18:3d:2d:d0:26:91, ucast_type = touched   , port_num = 0x1
    32  : type: ucast, vid = 1, addr = 94:ae:e3:b8:0a:0c, ucast_type = touched   , port_num = 0x1
    68  : type: ucast, vid = 1, addr = 9c:69:d3:2d:a7:ea, ucast_type = touched   , port_num = 0x1
    132 : type: ucast, vid = 1, addr = 8c:08:79:73:c4:b7, ucast_type = touched   , port_num = 0x1
    AUGOS/arm64: aug@aug in /tmp
    $ bridge fdb show
    8c:08:79:73:c4:b7 dev eth0 master br-lan
    94:ae:e3:b8:0a:04 dev eth0 master br-lan
    18:3d:2d:d0:26:91 dev eth0 master br-lan
    9c:69:d3:2d:a7:ea dev eth0 master br-lan
    94:ae:e3:b8:0a:0c dev eth0 master br-lan
    8c:08:79:73:c4:6f dev eth0 vlan 1 master br-lan permanent
    8c:08:79:73:c4:6f dev eth0 master br-lan permanent
    33:33:00:00:00:01 dev eth0 self permanent
    01:00:5e:00:00:01 dev eth0 self permanent
    33:33:00:00:00:01 dev eth1 self permanent
    01:00:5e:00:00:01 dev eth1 self permanent
    33:33:00:00:00:01 dev eth2 self permanent
    01:00:5e:00:00:01 dev eth2 self permanent
    33:33:00:00:00:01 dev eth3 self permanent
    01:00:5e:00:00:01 dev eth3 self permanent
    33:33:00:00:00:01 dev br-lan self permanent
    01:00:5e:00:00:01 dev br-lan self permanent
    33:33:ff:73:c4:6f dev br-lan self permanent
    01:00:5e:00:00:fc dev br-lan self permanent
    33:33:00:01:00:03 dev br-lan self permanent
    33:33:00:01:00:02 dev br-lan self permanent
    33:33:00:00:00:02 dev br-lan self permanent
    AUGOS/arm64: aug@aug in /tmp
    $
    AUGOS/arm64: aug@aug in /tmp
    $
    AUGOS/arm64: aug@aug in /tmp
    $ sudo /home/aug/glibc-2.34/lib/ld-linux-aarch64.so.1 --library-path ~/glibc-2.34/lib/aarch64-linux-gnu/ ~/switch-config -             d
    K3 cpsw dump version (1) len(11704)
    ALE table dump ents(512):
    0   : type: vlan , vid = 0, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    1   : type: mcast, addr = 01:80:c2:00:00:00, mcast_state = blf, super, port_mask = 0x1
    2   : type: ucast, vid = 1, addr = 8c:08:79:73:c4:6f, ucast_type = persistant, port_num = 0x0, Secure
    3   : type: mcast, vid = 1, addr = ff:ff:ff:ff:ff:ff, mcast_state = f, no super, port_mask = 0x7
    4   : type: mcast, addr = 33:33:00:00:00:01, mcast_state = f, no super, port_mask = 0x1
    5   : type: mcast, addr = 01:00:5e:00:00:01, mcast_state = f, no super, port_mask = 0x1
    6   : type: vlan , vid = 1, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    23  : type: ucast, vid = 1, addr = 94:ae:e3:b8:0a:04, ucast_type = untouched , port_num = 0x1
    24  : type: ucast, vid = 1, addr = 18:3d:2d:d0:26:91, ucast_type = touched   , port_num = 0x1
    32  : type: ucast, vid = 1, addr = 94:ae:e3:b8:0a:0c, ucast_type = touched   , port_num = 0x1
    68  : type: ucast, vid = 1, addr = 9c:69:d3:2d:a7:ea, ucast_type = touched   , port_num = 0x1
    132 : type: ucast, vid = 1, addr = 8c:08:79:73:c4:b7, ucast_type = touched   , port_num = 0x1
    AUGOS/arm64: aug@aug in /tmp
    $ sudo /home/aug/glibc-2.34/lib/ld-linux-aarch64.so.1 --library-path ~/glibc-2.34/lib/aarch64-linux-gnu/ ~/switch-config -             d
    K3 cpsw dump version (1) len(11704)
    ALE table dump ents(512):
    0   : type: vlan , vid = 0, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    1   : type: mcast, addr = 01:80:c2:00:00:00, mcast_state = blf, super, port_mask = 0x1
    2   : type: ucast, vid = 1, addr = 8c:08:79:73:c4:6f, ucast_type = persistant, port_num = 0x0, Secure
    3   : type: mcast, vid = 1, addr = ff:ff:ff:ff:ff:ff, mcast_state = f, no super, port_mask = 0x7
    4   : type: mcast, addr = 33:33:00:00:00:01, mcast_state = f, no super, port_mask = 0x1
    5   : type: mcast, addr = 01:00:5e:00:00:01, mcast_state = f, no super, port_mask = 0x1
    6   : type: vlan , vid = 1, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    24  : type: ucast, vid = 1, addr = 18:3d:2d:d0:26:91, ucast_type = touched   , port_num = 0x1
    32  : type: ucast, vid = 1, addr = 94:ae:e3:b8:0a:0c, ucast_type = touched   , port_num = 0x1
    45  : type: ucast, vid = 1, addr = 94:ae:e3:b8:0a:04, ucast_type = touched   , port_num = 0x1
    68  : type: ucast, vid = 1, addr = 9c:69:d3:2d:a7:ea, ucast_type = untouched , port_num = 0x1
    69  : type: ucast, vid = 1, addr = 8c:08:79:73:c4:6e, ucast_type = untouched , port_num = 0x2
    132 : type: ucast, vid = 1, addr = 8c:08:79:73:c4:b7, ucast_type = untouched , port_num = 0x1
    AUGOS/arm64: aug@aug in /tmp
    $ sudo /home/aug/glibc-2.34/lib/ld-linux-aarch64.so.1 --library-path ~/glibc-2.34/lib/aarch64-linux-gnu/ ~/switch-config -             d
    K3 cpsw dump version (1) len(11704)
    ALE table dump ents(512):
    0   : type: vlan , vid = 0, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    1   : type: mcast, addr = 01:80:c2:00:00:00, mcast_state = blf, super, port_mask = 0x1
    2   : type: ucast, vid = 1, addr = 8c:08:79:73:c4:6f, ucast_type = persistant, port_num = 0x0, Secure
    3   : type: mcast, vid = 1, addr = ff:ff:ff:ff:ff:ff, mcast_state = f, no super, port_mask = 0x7
    4   : type: mcast, addr = 33:33:00:00:00:01, mcast_state = f, no super, port_mask = 0x1
    5   : type: mcast, addr = 01:00:5e:00:00:01, mcast_state = f, no super, port_mask = 0x1
    6   : type: vlan , vid = 1, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    24  : type: ucast, vid = 1, addr = 18:3d:2d:d0:26:91, ucast_type = touched   , port_num = 0x1
    32  : type: ucast, vid = 1, addr = 94:ae:e3:b8:0a:0c, ucast_type = touched   , port_num = 0x1
    45  : type: ucast, vid = 1, addr = 94:ae:e3:b8:0a:04, ucast_type = touched   , port_num = 0x1
    68  : type: ucast, vid = 1, addr = 9c:69:d3:2d:a7:ea, ucast_type = untouched , port_num = 0x1
    69  : type: ucast, vid = 1, addr = 8c:08:79:73:c4:6e, ucast_type = untouched , port_num = 0x2
    132 : type: ucast, vid = 1, addr = 8c:08:79:73:c4:b7, ucast_type = untouched , port_num = 0x1
    AUGOS/arm64: aug@aug in /tmp
    $ sudo /home/aug/glibc-2.34/lib/ld-linux-aarch64.so.1 --library-path ~/glibc-2.34/lib/aarch64-linux-gnu/ ~/switch-config -             d
    K3 cpsw dump version (1) len(11704)
    ALE table dump ents(512):
    0   : type: vlan , vid = 0, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    1   : type: mcast, addr = 01:80:c2:00:00:00, mcast_state = blf, super, port_mask = 0x1
    2   : type: ucast, vid = 1, addr = 8c:08:79:73:c4:6f, ucast_type = persistant, port_num = 0x0, Secure
    3   : type: mcast, vid = 1, addr = ff:ff:ff:ff:ff:ff, mcast_state = f, no super, port_mask = 0x7
    4   : type: mcast, addr = 33:33:00:00:00:01, mcast_state = f, no super, port_mask = 0x1
    5   : type: mcast, addr = 01:00:5e:00:00:01, mcast_state = f, no super, port_mask = 0x1
    6   : type: vlan , vid = 1, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    24  : type: ucast, vid = 1, addr = 18:3d:2d:d0:26:91, ucast_type = touched   , port_num = 0x1
    32  : type: ucast, vid = 1, addr = 94:ae:e3:b8:0a:0c, ucast_type = touched   , port_num = 0x1
    45  : type: ucast, vid = 1, addr = 94:ae:e3:b8:0a:04, ucast_type = touched   , port_num = 0x1
    68  : type: ucast, vid = 1, addr = 9c:69:d3:2d:a7:ea, ucast_type = touched   , port_num = 0x1
    69  : type: ucast, vid = 1, addr = 8c:08:79:73:c4:6e, ucast_type = untouched , port_num = 0x2
    132 : type: ucast, vid = 1, addr = 8c:08:79:73:c4:b7, ucast_type = untouched , port_num = 0x1
    AUGOS/arm64: aug@aug in /tmp
    $ sudo /home/aug/glibc-2.34/lib/ld-linux-aarch64.so.1 --library-path ~/glibc-2.34/lib/aarch64-linux-gnu/ ~/switch-config -             d
    K3 cpsw dump version (1) len(11704)
    ALE table dump ents(512):
    0   : type: vlan , vid = 0, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    1   : type: mcast, addr = 01:80:c2:00:00:00, mcast_state = blf, super, port_mask = 0x1
    2   : type: ucast, vid = 1, addr = 8c:08:79:73:c4:6f, ucast_type = persistant, port_num = 0x0, Secure
    3   : type: mcast, vid = 1, addr = ff:ff:ff:ff:ff:ff, mcast_state = f, no super, port_mask = 0x7
    4   : type: mcast, addr = 33:33:00:00:00:01, mcast_state = f, no super, port_mask = 0x1
    5   : type: mcast, addr = 01:00:5e:00:00:01, mcast_state = f, no super, port_mask = 0x1
    6   : type: vlan , vid = 1, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    24  : type: ucast, vid = 1, addr = 18:3d:2d:d0:26:91, ucast_type = touched   , port_num = 0x1
    32  : type: ucast, vid = 1, addr = 94:ae:e3:b8:0a:0c, ucast_type = touched   , port_num = 0x1
    45  : type: ucast, vid = 1, addr = 94:ae:e3:b8:0a:04, ucast_type = touched   , port_num = 0x1
    68  : type: ucast, vid = 1, addr = 9c:69:d3:2d:a7:ea, ucast_type = touched   , port_num = 0x1
    69  : type: ucast, vid = 1, addr = 8c:08:79:73:c4:6e, ucast_type = untouched , port_num = 0x2
    132 : type: ucast, vid = 1, addr = 8c:08:79:73:c4:b7, ucast_type = touched   , port_num = 0x2
    AUGOS/arm64: aug@aug in /tmp
    $ sudo ethtool eth0
    Settings for eth0:
            Supported ports: [ TP    MII ]
            Supported link modes:   10baseT/Half 10baseT/Full
                                    100baseT/Half 100baseT/Full
            Supported pause frame use: Symmetric
            Supports auto-negotiation: Yes
            Supported FEC modes: Not reported
            Advertised link modes:  10baseT/Half 10baseT/Full
                                    100baseT/Half 100baseT/Full
            Advertised pause frame use: Symmetric
            Advertised auto-negotiation: Yes
            Advertised FEC modes: Not reported
            Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                                 100baseT/Half 100baseT/Full
            Link partner advertised pause frame use: No
            Link partner advertised auto-negotiation: Yes
            Link partner advertised FEC modes: Not reported
            Speed: 100Mb/s
            Duplex: Full
            Auto-negotiation: on
            Port: Twisted Pair
            PHYAD: 1
            Transceiver: external
            MDI-X: Unknown
            Supports Wake-on: gs
            Wake-on: d
            SecureOn password: 00:00:00:00:00:00
            Current message level: 0x000020f7 (8439)
                                   drv probe link ifdown ifup rx_err tx_err hw
            Link detected: yes
    AUGOS/arm64: aug@aug in /tmp
    $ sudo ethtool -S eth0
    NIC statistics:
         p0_rx_good_frames: 42099
         p0_rx_broadcast_frames: 7
         p0_rx_multicast_frames: 2252
         p0_rx_crc_errors: 0
         p0_rx_oversized_frames: 0
         p0_rx_undersized_frames: 0
         p0_ale_drop: 0
         p0_ale_overrun_drop: 0
         p0_rx_octets: 32953647
         p0_tx_good_frames: 34876
         p0_tx_broadcast_frames: 406
         p0_tx_multicast_frames: 5445
         p0_tx_octets: 2624283
         p0_tx_64B_frames: 15005
         p0_tx_65_to_127B_frames: 40257
         p0_tx_128_to_255B_frames: 491
         p0_tx_256_to_511B_frames: 469
         p0_tx_512_to_1023B_frames: 139
         p0_tx_1024B_frames: 20614
         p0_net_octets: 35577930
         p0_rx_bottom_fifo_drop: 0
         p0_rx_port_mask_drop: 0
         p0_rx_top_fifo_drop: 0
         p0_ale_rate_limit_drop: 0
         p0_ale_vid_ingress_drop: 0
         p0_ale_da_eq_sa_drop: 0
         p0_ale_block_drop: 0
         p0_ale_secure_drop: 0
         p0_ale_auth_drop: 0
         p0_ale_unknown_ucast: 0
         p0_ale_unknown_ucast_bytes: 0
         p0_ale_unknown_mcast: 0
         p0_ale_unknown_mcast_bytes: 0
         p0_ale_unknown_bcast: 0
         p0_ale_unknown_bcast_bytes: 0
         p0_ale_pol_match: 0
         p0_ale_pol_match_red: 0
         p0_ale_pol_match_yellow: 0
         p0_ale_mcast_sa_drop: 0
         p0_ale_dual_vlan_drop: 0
         p0_ale_len_err_drop: 0
         p0_ale_ip_next_hdr_drop: 0
         p0_ale_ipv4_frag_drop: 0
         p0_tx_mem_protect_err: 0
         p0_tx_pri0: 34876
         p0_tx_pri1: 0
         p0_tx_pri2: 0
         p0_tx_pri3: 0
         p0_tx_pri4: 0
         p0_tx_pri5: 0
         p0_tx_pri6: 0
         p0_tx_pri7: 0
         p0_tx_pri0_bcnt: 2624283
         p0_tx_pri1_bcnt: 0
         p0_tx_pri2_bcnt: 0
         p0_tx_pri3_bcnt: 0
         p0_tx_pri4_bcnt: 0
         p0_tx_pri5_bcnt: 0
         p0_tx_pri6_bcnt: 0
         p0_tx_pri7_bcnt: 0
         p0_tx_pri0_drop: 0
         p0_tx_pri1_drop: 0
         p0_tx_pri2_drop: 0
         p0_tx_pri3_drop: 0
         p0_tx_pri4_drop: 0
         p0_tx_pri5_drop: 0
         p0_tx_pri6_drop: 0
         p0_tx_pri7_drop: 0
         p0_tx_pri0_drop_bcnt: 0
         p0_tx_pri1_drop_bcnt: 0
         p0_tx_pri2_drop_bcnt: 0
         p0_tx_pri3_drop_bcnt: 0
         p0_tx_pri4_drop_bcnt: 0
         p0_tx_pri5_drop_bcnt: 0
         p0_tx_pri6_drop_bcnt: 0
         p0_tx_pri7_drop_bcnt: 0
         rx_good_frames: 75311
         rx_broadcast_frames: 405
         rx_multicast_frames: 5361
         rx_pause_frames: 0
         rx_crc_errors: 0
         rx_align_code_errors: 0
         rx_oversized_frames: 0
         rx_jabber_frames: 0
         rx_undersized_frames: 0
         rx_fragments: 0
         ale_drop: 2
         ale_overrun_drop: 0
         rx_octets: 44710203
         tx_good_frames: 62150
         tx_broadcast_frames: 5
         tx_multicast_frames: 88
         tx_pause_frames: 0
         tx_deferred_frames: 0
         tx_collision_frames: 0
         tx_single_coll_frames: 0
         tx_mult_coll_frames: 0
         tx_excessive_collisions: 0
         tx_late_collisions: 0
         rx_ipg_error: 0
         tx_carrier_sense_errors: 0
         tx_octets: 34506817
         tx_64B_frames: 19381
         tx_65_to_127B_frames: 67712
         tx_128_to_255B_frames: 980
         tx_256_to_511B_frames: 1027
         tx_512_to_1023B_frames: 1031
         tx_1024B_frames: 47330
         net_octets: 79217020
         rx_bottom_fifo_drop: 0
         rx_port_mask_drop: 102
         rx_top_fifo_drop: 0
         ale_rate_limit_drop: 0
         ale_vid_ingress_drop: 0
         ale_da_eq_sa_drop: 0
         ale_block_drop: 0
         ale_secure_drop: 0
         ale_auth_drop: 0
         ale_unknown_ucast: 4
         ale_unknown_ucast_bytes: 768
         ale_unknown_mcast: 44
         ale_unknown_mcast_bytes: 4297
         ale_unknown_bcast: 32
         ale_unknown_bcast_bytes: 2048
         ale_pol_match: 0
         ale_pol_match_red: 0
         ale_pol_match_yellow: 0
         ale_mcast_sa_drop: 0
         ale_dual_vlan_drop: 0
         ale_len_err_drop: 0
         ale_ip_next_hdr_drop: 0
         ale_ipv4_frag_drop: 0
         iet_rx_assembly_err: 0
         iet_rx_assembly_ok: 0
         iet_rx_smd_err: 0
         iet_rx_frag: 0
         iet_tx_hold: 0
         iet_tx_frag: 0
         tx_mem_protect_err: 0
         tx_pri0: 62150
         tx_pri1: 0
         tx_pri2: 0
         tx_pri3: 0
         tx_pri4: 0
         tx_pri5: 0
         tx_pri6: 0
         tx_pri7: 0
         tx_pri0_bcnt: 34506817
         tx_pri1_bcnt: 0
         tx_pri2_bcnt: 0
         tx_pri3_bcnt: 0
         tx_pri4_bcnt: 0
         tx_pri5_bcnt: 0
         tx_pri6_bcnt: 0
         tx_pri7_bcnt: 0
         tx_pri0_drop: 0
         tx_pri1_drop: 0
         tx_pri2_drop: 0
         tx_pri3_drop: 0
         tx_pri4_drop: 0
         tx_pri5_drop: 0
         tx_pri6_drop: 0
         tx_pri7_drop: 0
         tx_pri0_drop_bcnt: 0
         tx_pri1_drop_bcnt: 0
         tx_pri2_drop_bcnt: 0
         tx_pri3_drop_bcnt: 0
         tx_pri4_drop_bcnt: 0
         tx_pri5_drop_bcnt: 0
         tx_pri6_drop_bcnt: 0
         tx_pri7_drop_bcnt: 0
    AUGOS/arm64: aug@aug in /tmp
    $
    AUGOS/arm64: aug@aug in /tmp
    $ sudo ethtool -S eth0 | grep drop
         p0_ale_drop: 0
         p0_ale_overrun_drop: 0
         p0_rx_bottom_fifo_drop: 0
         p0_rx_port_mask_drop: 0
         p0_rx_top_fifo_drop: 0
         p0_ale_rate_limit_drop: 0
         p0_ale_vid_ingress_drop: 0
         p0_ale_da_eq_sa_drop: 0
         p0_ale_block_drop: 0
         p0_ale_secure_drop: 0
         p0_ale_auth_drop: 0
         p0_ale_mcast_sa_drop: 0
         p0_ale_dual_vlan_drop: 0
         p0_ale_len_err_drop: 0
         p0_ale_ip_next_hdr_drop: 0
         p0_ale_ipv4_frag_drop: 0
         p0_tx_pri0_drop: 0
         p0_tx_pri1_drop: 0
         p0_tx_pri2_drop: 0
         p0_tx_pri3_drop: 0
         p0_tx_pri4_drop: 0
         p0_tx_pri5_drop: 0
         p0_tx_pri6_drop: 0
         p0_tx_pri7_drop: 0
         p0_tx_pri0_drop_bcnt: 0
         p0_tx_pri1_drop_bcnt: 0
         p0_tx_pri2_drop_bcnt: 0
         p0_tx_pri3_drop_bcnt: 0
         p0_tx_pri4_drop_bcnt: 0
         p0_tx_pri5_drop_bcnt: 0
         p0_tx_pri6_drop_bcnt: 0
         p0_tx_pri7_drop_bcnt: 0
         ale_drop: 2
         ale_overrun_drop: 0
         rx_bottom_fifo_drop: 0
         rx_port_mask_drop: 102
         rx_top_fifo_drop: 0
         ale_rate_limit_drop: 0
         ale_vid_ingress_drop: 0
         ale_da_eq_sa_drop: 0
         ale_block_drop: 0
         ale_secure_drop: 0
         ale_auth_drop: 0
         ale_mcast_sa_drop: 0
         ale_dual_vlan_drop: 0
         ale_len_err_drop: 0
         ale_ip_next_hdr_drop: 0
         ale_ipv4_frag_drop: 0
         tx_pri0_drop: 0
         tx_pri1_drop: 0
         tx_pri2_drop: 0
         tx_pri3_drop: 0
         tx_pri4_drop: 0
         tx_pri5_drop: 0
         tx_pri6_drop: 0
         tx_pri7_drop: 0
         tx_pri0_drop_bcnt: 0
         tx_pri1_drop_bcnt: 0
         tx_pri2_drop_bcnt: 0
         tx_pri3_drop_bcnt: 0
         tx_pri4_drop_bcnt: 0
         tx_pri5_drop_bcnt: 0
         tx_pri6_drop_bcnt: 0
         tx_pri7_drop_bcnt: 0
    AUGOS/arm64: aug@aug in /tmp
    $ ifconfig
    br-lan: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 192.168.1.2  netmask 255.255.255.0  broadcast 192.168.1.255
            inet6 fe80::8e08:79ff:fe73:c46f  prefixlen 64  scopeid 0x20<link>
            ether 8c:08:79:73:c4:6f  txqueuelen 1000  (Ethernet)
            RX packets 32124  bytes 1750145 (1.6 MiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 20112  bytes 31586717 (30.1 MiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    can0: flags=193<UP,RUNNING,NOARP>  mtu 16
            unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 1023  (UNSPEC)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 32 overruns 0  carrier 32  collisions 0
            device interrupt 72
    
    can1: flags=193<UP,RUNNING,NOARP>  mtu 16
            unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 1023  (UNSPEC)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 32 overruns 0  carrier 32  collisions 0
            device interrupt 73
    
    can2: flags=193<UP,RUNNING,NOARP>  mtu 16
            unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 1023  (UNSPEC)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 9 overruns 0  carrier 9  collisions 0
            device interrupt 82
    
    can3: flags=193<UP,RUNNING,NOARP>  mtu 16
            unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 1023  (UNSPEC)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 9 overruns 0  carrier 9  collisions 0
            device interrupt 96
    
    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            ether 8c:08:79:73:c4:6f  txqueuelen 1000  (Ethernet)
            RX packets 34986  bytes 2498816 (2.3 MiB)
            RX errors 0  dropped 144  overruns 0  frame 0
            TX packets 40005  bytes 32660711 (31.1 MiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            ether 8c:08:79:73:c4:6f  txqueuelen 1000  (Ethernet)
            RX packets 90  bytes 7658 (7.4 KiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 2200  bytes 118230 (115.4 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    eth2: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
            inet 192.168.2.10  netmask 255.255.255.0  broadcast 192.168.2.255
            ether 9a:19:e9:e2:30:cd  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    eth3: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
            ether 26:75:01:f9:0d:5a  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
            inet 127.0.0.1  netmask 255.0.0.0
            inet6 ::1  prefixlen 128  scopeid 0x10<host>
            loop  txqueuelen 1000  (Local Loopback)
            RX packets 64  bytes 6078 (5.9 KiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 64  bytes 6078 (5.9 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    

  • Hi Du Wei,

    SW:  root bridge

    Is the SW absolutely necessary? Is using just 3 DUT (for example TMDS64EVM) possible?

    Also, maybe I missed this but was there a specific setup guide you were using from the TI SDK documentation to setup RSTP? Is there a specific user space application or setup script you are using to set up RSTP? It was mentioned a script was used for pinging but not clear any configuration needed to set up RSTP. I see you mentioned MSTPD logs which indicate some sort of daemon was used.

    -Daolin

  • Hello Daolin,

    We use openwrt uci tool to setup rstp.  It equivalents to below commands.  The mstpd veriosn is  0.1.0 

    ip link set dev eth0 down

    ip link set dev eth1 down

    sleep 1

    ip link set dev eth0 up

    ip link set dev eth1 up

    sleep 2

    devlink dev param set platform/8000000.ethernet name switch_mode value true cmode runtime

    sleep 1

    ip link add name br0 type bridge

    sleep 1

    ip link set dev eth0 master br0

    ip link set dev eth1 master br0

    ip link set dev br0 type bridge stp_state 2

    ip link set dev br0 up

    bridge vlan add dev br0 vid 1 self

    bridge vlan add dev br0 vid 1 pvid untagged self

    ip addr add 192.168.1.10/24 dev br0

    sudo mstpd
    sudo mstpctl setforcevers br0 rstp
    sudo mstpctl addbridge br0

  • Hello Daolin,

      SW is necessary. PC needs connect SW to ping DUTs.

      I add some debug log to trace this issue. You can refer it.

      BPDU TC occurs, mstpd will call flush.  The debug log added in am65-cpsw-switchdev.c shows cpsw_ale_del_ucast is not called.

    Jul 29 03:05:55 aug kernel: [ 872.673334] br-lan: port 2(eth1) entered blocking state
    Jul 29 03:05:55 aug kernel: [ 872.678650] am65-cpsw-nuss 8000000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx
    Jul 29 03:05:55 aug mstpd[588]: set_if_up: Port eth1 : up
    Jul 29 03:05:55 aug netifd[368]: Network device 'eth1' link is up
    Jul 29 03:05:55 aug mstpd[588]: MSTP_OUT_set_state: br-lan:eth1:0 entering learning state
    Jul 29 03:05:55 aug mstpd[588]: MSTP_OUT_set_state: br-lan:eth1:0 entering forwarding state
    Jul 29 03:05:55 aug kernel: [ 872.709878] br-lan: port 2(eth1) entered learning state
    Jul 29 03:05:55 aug kernel: [ 872.715586] br-lan: port 2(eth1) entered forwarding state
    Jul 29 03:05:55 aug kernel: [ 872.722099] am65-cpsw-nuss 8000000.ethernet eth0: cpsw_fdb_del: MACID = 8c:08:79:73:c4:d5 vid = 0 flags = 0 0 -- port 1
    Jul 29 03:05:55 aug mstpd[588]: MSTP_OUT_flush_all_fids: br-lan:eth0:0 Flushing forwarding database
    Jul 29 03:05:55 aug mstpd[588]: set_if_up: Port eth1 : up
    Jul 29 03:05:55 aug kernel: [ 872.733111] am65-cpsw-nuss 8000000.ethernet eth0: cpsw_fdb_del: MACID = dc:be:04:bd:a0:e2 vid = 0 flags = 0 0 -- port 1
    Jul 29 03:05:55 aug kernel: [ 872.744058] am65-cpsw-nuss 8000000.ethernet eth0: cpsw_fdb_del: MACID = 8c:08:79:73:b0:99 vid = 0 flags = 0 0 -- port 1
    Jul 29 03:05:55 aug mstpd[588]: set_if_up: Port eth1 : up
    Jul 29 03:05:55 aug mstpd[588]: set_if_up: Port eth0 : up
    Jul 29 03:05:57 aug mstpd[588]: MSTP_OUT_flush_all_fids: br-lan:eth0:0 Flushing forwarding database
    Jul 29 03:05:57 aug mstpd[588]: set_if_up: Port eth0 : up
    Jul 29 03:05:57 aug kernel: [ 873.913588] am65-cpsw-nuss 8000000.ethernet eth0: cpsw_fdb_del: MACID = 8c:08:79:73:b0:99 vid = 0 flags = 0 0 -- port 1
    Jul 29 03:06:28 aug systemd[1]: Starting Cleanup of Temporary Directories...
    Jul 29 03:06:28 aug systemd[1]: systemd-tmpfiles-clean.service: Succeeded.
    Jul 29 03:06:28 aug systemd[1]: Finished Cleanup of Temporary Directories.

  • Hi Du Wei,

    Thanks for sending the setup details. I will see what I can do to try and reproduce the problem.

    If you don't hear from me by Wednesday next week, please kindly ping this thread.

    -Daolin

  • Hi Du Wei, 

      SW is necessary. PC needs connect SW to ping DUTs.

    What kind of SW is needed? I'm assuming it has to be RSTP capable? If so, the reason why I ask if problem can be reproduced without SW is due to us currently potentially not having an RSTP capable switch. It would be quicker if possible to see if the problem can be reproduced with just the 3 DUTs. Is this something you can verify as well?

    ip link set dev br0 type bridge stp_state 2

    Additionally, what is the result of "cat /sys/class/net/br0/bridge/stp_state" in your setup? I see that you are trying to set it to stp_state 2 in your script but when I try running the script, the result is that stp_state remains 1. 

    What version of iproute2 (ip) do you have? I'm using what is currently packaged into SDK 12.1 which is iproute2-6.19.0

    -Daolin

  • Hello Daolin,

    stp_state: 

    iproute2 version:

    You can try the following steps to reproduce this issue without a switch.

    Ring Network and RSTP topology

    DUT3(root bridge)-DUT4-DUT5-DUT1-DUT2-DUT3

    Test step

    1. Log into the terminals of DUT2 and DUT3 respectively, and continuous ping DUT1

    2. stop ping DUT1 on DUT3

    3. Unplug cable between DUT1 and DUT2

    You can observe that ping DUT1 on DUT2 will  be timeout about 30 seconds.

    This issue may be caused by the CPSW's FDB not being flushed.

    • Test Step 1: Dump the ALE on DUT3, and you can see that DUT3's eth0 has learned DUT1's MAC address.

    • Test Step 2: It can be observed that the DUT1 MAC address learned by DUT3 does not age out.

    • Test Step 3: Due to a change in the RSTP topology, the ping request from DUT2 to DUT1 will be sent to DUT3's eth1 interface. At this point, the MAC address of DUT1 learned on eth0 has not yet aged out, so on DUT3 the CPSW will drop the request.

    Once the MAC address of DUT1 learned on eth0 ages out, the ping request from DUT2 to DUT1 will be flooded. Dumping the ALE will show that DUT3's eth1 has learned DUT1's MAC address, and the ping from DUT2 to DUT1 will return to normal.

    And when RSTP topology changes, mstpd will flush mac by write /sys/class/net/eth0/brport/flush. But this flush action is not 

    effective at cpsw driver dut to some check rule, like added_by_user and vid.

  • Hi Du Wei,

    SDK Version:ti-processor-sdk-linux-am64xx-evm-11.02.08.02

    I should have asked this before, but do you also see the same issue with SDK 12.x? Our support model is typically reproduce the issue on the latest SDK and then fix on latest SDK. For that reason if issue is only reproducible on SDK 11.2 but not on latest SDK, we usually don't go back on an older SDK model to fix issues.

    stp_state: 

    Since I'm working on trying reproduce the issue on SDK 12.1, there may have been differences in setup script for RSTP. For instance using the exact script you used, I saw stp_state is 1, I had spent some time figuring out that the below order is needed on SDK 12.1 to get the proper stp_state of 2. After this, I noticed that one port on each EVM is always alternating between learning, forwarding, blocking, and have not stabilized even after several minutes of cycling. Just for your awareness, I need to first figure this issue before finally getting to the same point you are at. It would be helpful if you can also see if the issue is also on SDK 12.1 if possible.

    cat rstp-se-convergence-test.sh:
    killall mstpd
    systemctl stop mstpd
    
    ip link set dev eth0 down
    ip link set dev eth1 down
    sleep 1
    ip link set dev eth0 up
    ip link set dev eth1 up
    sleep 2
    devlink dev param set platform/8000000.ethernet name switch_mode value true cmode runtime
    sleep 1
    ip link add name br0 type bridge
    sleep 1
    ip link set dev eth0 master br0
    ip link set dev eth1 master br0
    #ip link set dev br0 type bridge stp_state 2
    ip link set dev br0 up
    bridge vlan add dev br0 vid 1 self
    bridge vlan add dev br0 vid 1 pvid untagged self
    ip addr add 192.168.1.10/24 dev br0
    
    systemctl start mstpd
    sleep 3
    ip link set dev br0 type bridge stp_state 1
    mstpctl setforcevers br0 rstp
    mstpctl setportadminedge br0 eth0 no
    mstpctl setportadminedge br0 eth1 no
    mstpctl setportautoedge br0 eth0 no
    mstpctl setportautoedge br0 eth1 no
    
    cat /sys/class/net/br0/bridge/stp_state 

    -Daolin

  • Hello Daolin,

      Same issue on SDK 12.01.00.05.03

     1) ALE dump on DUT3, 8c:08:79:73:c4:6f is DUT1:

    2) ping DUT1 on DUT2

  • Hi Du Wei, 

    Thanks for the confirmation that you also see the same issue on SDK 12.1 

    Jul 29 03:06:28 aug systemd[1]: Finished Cleanup of Temporary Directories.

    4. bridge fdb flush command not support on my system,  I just try to remove added_by_user check. It seems work, no exceeding 20s.

    1. For these changes, can you provide an official patch?

    2. Despite being on same SDK 12.1, my setup behavior is different from yours, I would like to be on the same page as you and need to check if there is any software changes you have made to beyond the above lines that were pointed out? 

    3. Are you using the mstpd by default already packaged into SDK 12.1?

    Additionally, what is the result of "cat /sys/class/net/br0/bridge/stp_state" in your setup?

    4. Using your steps, do you see the result of this being 1 or 2 for 12.1? On my setup I had to modify your steps to get the result of stp_state to be 2.

    5. Below is sample of what I saw using the script I sent in my last message across all 3 DUTs connected in a ring. Do you see similar results after running your setup script?

    DUT1 sample log:

    [ 1868.591233] br0: port 1(eth0) entered blocking state
    [ 1874.595886] br0: port 1(eth0) entered learning state
    [ 1876.595888] br0: port 1(eth0) entered forwarding state
    [ 1876.599353] br0: port 1(eth0) entered blocking state
    [ 1883.595660] br0: port 1(eth0) entered learning state
    [ 1885.595657] br0: port 1(eth0) entered forwarding state
    [ 1885.599766] br0: port 1(eth0) entered blocking state
    [ 1892.595893] br0: port 1(eth0) entered learning state
    [ 1894.596933] br0: port 1(eth0) entered forwarding state
    [ 1894.600121] br0: port 1(eth0) entered blocking state
    [ 1901.595655] br0: port 1(eth0) entered learning state 

    DUT2 sample log:

    [ 1883.932028] br0: port 2(eth1) entered learning state
    [ 1885.931850] br0: port 2(eth1) entered forwarding state
    [ 1890.937090] br0: port 2(eth1) entered blocking state
    [ 1892.932379] br0: port 2(eth1) entered learning state
    [ 1894.932287] br0: port 2(eth1) entered forwarding state
    [ 1899.937751] br0: port 2(eth1) entered blocking state
    [ 1901.931467] br0: port 2(eth1) entered learning state
    [ 1903.932242] br0: port 2(eth1) entered forwarding state
    [ 1908.937076] br0: port 2(eth1) entered blocking state
    [ 1910.932015] br0: port 2(eth1) entered learning state
    [ 1912.931980] br0: port 2(eth1) entered forwarding state 

    DUT3 sample log:

    [ 1238.275941] br0: port 1(eth0) entered learning state
    [ 1240.276437] br0: port 1(eth0) entered forwarding state
    [ 1245.497946] br0: port 1(eth0) entered blocking state
    [ 1247.276477] br0: port 1(eth0) entered learning state
    [ 1249.276604] br0: port 1(eth0) entered forwarding state
    [ 1254.498076] br0: port 1(eth0) entered blocking state
    [ 1256.276629] br0: port 1(eth0) entered learning state
    [ 1258.276517] br0: port 1(eth0) entered forwarding state
    [ 1263.497786] br0: port 1(eth0) entered blocking state
    [ 1265.276717] br0: port 1(eth0) entered learning state
    [ 1267.276659] br0: port 1(eth0) entered forwarding state
    [ 1272.498478] br0: port 1(eth0) entered blocking state
    [ 1274.276250] br0: port 1(eth0) entered learning state

    -Daolin

  • Hello Daolin,

    1) Please refer following changes, patch file not allowed upload. This patch is just for debug, not official as unable to evaluate any other impacts

    diff --git a/drivers/net/ethernet/ti/am65-cpsw-switchdev.c b/drivers/net/ethernet/ti/am65-cpsw-switchdev.c
    index b284202bf..b0dc24c9c 100644
    --- a/drivers/net/ethernet/ti/am65-cpsw-switchdev.c
    +++ b/drivers/net/ethernet/ti/am65-cpsw-switchdev.c
    @@ -397,7 +397,9 @@ static void am65_cpsw_switchdev_event_work(struct work_struct *work)
    fdb->addr, fdb->vid, fdb->added_by_user,
    fdb->offloaded, port_id);

    - if (!fdb->added_by_user || fdb->is_local)
    + // if (!fdb->added_by_user || fdb->is_local)
    + // break;
    + if (fdb->is_local)
    break;
    if (memcmp(port->slave.mac_addr, (u8 *)fdb->addr, ETH_ALEN) == 0)
    port_id = HOST_PORT_NUM;
    diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c
    index 843d6b4de..41d5512ab 100644
    --- a/drivers/net/ethernet/ti/cpsw_ale.c
    +++ b/drivers/net/ethernet/ti/cpsw_ale.c
    @@ -387,8 +387,8 @@ static int cpsw_ale_match_addr(struct cpsw_ale *ale, const u8 *addr, u16 vid)
    type = cpsw_ale_get_entry_type(ale_entry);
    if (type != ALE_TYPE_ADDR && type != ALE_TYPE_VLAN_ADDR)
    continue;
    - if (cpsw_ale_get_vlan_id(ale_entry) != vid)
    - continue;
    + // if (cpsw_ale_get_vlan_id(ale_entry) != vid)
    + // continue;
    cpsw_ale_get_addr(ale_entry, entry_addr);
    if (ether_addr_equal(entry_addr, addr))
    return idx;

    2. Kernel image is same to SDK, just modify DTS file to fit our board.  Rootfs is ours

    3. mstpd is ours, not from SDK default.  

    4. sys/class/net/br0/bridge/stp_state is always 2

    5. No these print log. All duts ports are stable.

    And reproduce this issue needs 5 DUTs if no SW.

  • Hello Daolin,

      Following test steps can reproduce this issue with rstp disable.

      Network topology, 5 DUTS connect, not a ring

     DUT5-DU4-DUT1-DUT2-DUT3

    Test step

    1. Log into the terminals of DUT1 and DUT2 respectively, and continuous ping DUT3

    2. stop ping DUT3 on DUT1

    3. Unplug cable between DUT2 and DUT3

    4. plug cable between DUT3 and DUT5 immediately

    5. Flush DUT1 eth0 fdb by mannaul with sudo sh -c 'echo 1 > /sys/class/net/eth0/brport/flush'  This command simulates RSTP TC  events.

     You can observe that ping DUT3 on DUT2 will  be timeout about 30 seconds.

    These my test log

    DUT1 log;

    $ ping 192.168.1.2
    PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data.
    64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=0.530 ms
    ^C
    --- 192.168.1.2 ping statistics ---
    1 packets transmitted, 1 received, 0% packet loss, time 0ms
    rtt min/avg/max/mdev = 0.530/0.530/0.530/0.000 ms
    AUGOS/arm64: aug@aug in ~
    $
    AUGOS/arm64: aug@aug in ~
    $ bridge fdb show
    22:11:a3:8c:a6:d8 dev eth0 master br-lan
    8c:08:79:73:c4:d5 dev eth0 master br-lan
    8c:08:79:73:b0:99 dev eth0 vlan 1 master br-lan permanent
    8c:08:79:73:b0:99 dev eth0 master br-lan permanent
    33:33:00:00:00:01 dev eth0 self permanent
    01:00:5e:00:00:01 dev eth0 self permanent
    dc:be:04:bd:a0:e2 dev eth1 master br-lan
    33:33:00:00:00:01 dev eth1 self permanent
    01:00:5e:00:00:01 dev eth1 self permanent
    33:33:00:00:00:01 dev eth2 self permanent
    01:00:5e:00:00:01 dev eth2 self permanent
    33:33:ff:00:74:b1 dev eth2 self permanent
    01:00:5e:00:00:fc dev eth2 self permanent
    33:33:00:01:00:03 dev eth2 self permanent
    33:33:00:01:00:02 dev eth2 self permanent
    33:33:00:00:00:02 dev eth2 self permanent
    33:33:00:00:00:01 dev eth3 self permanent
    01:00:5e:00:00:01 dev eth3 self permanent
    33:33:00:00:00:01 dev br-lan self permanent
    01:00:5e:00:00:01 dev br-lan self permanent
    33:33:ff:f2:b2:2a dev br-lan self permanent
    01:00:5e:00:00:fc dev br-lan self permanent
    33:33:00:01:00:03 dev br-lan self permanent
    33:33:00:01:00:02 dev br-lan self permanent
    33:33:00:00:00:02 dev br-lan self permanent
    0e:c2:49:f2:b2:2a dev br-lan vlan 1 master br-lan permanent
    0e:c2:49:f2:b2:2a dev br-lan master br-lan permanent
    AUGOS/arm64: aug@aug in ~
    $ sudo /home/aug/glibc-2.34/lib/ld-linux-aarch64.so.1 --library-path ~/glibc-2.34/lib/aarch64-linux-gnu/ ~/switch-config -d
    K3 cpsw dump version (1) len(11704)
    ALE table dump ents(512):
    0 : type: vlan , vid = 0, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    1 : type: mcast, addr = 01:80:c2:00:00:00, mcast_state = blf, super, port_mask = 0x1
    2 : type: ucast, vid = 1, addr = 8c:08:79:73:b0:99, ucast_type = persistant, port_num = 0x0, Secure
    3 : type: mcast, vid = 1, addr = ff:ff:ff:ff:ff:ff, mcast_state = f, no super, port_mask = 0x7
    4 : type: mcast, addr = 33:33:00:00:00:01, mcast_state = f, no super, port_mask = 0x7
    5 : type: mcast, addr = 01:00:5e:00:00:01, mcast_state = f, no super, port_mask = 0x7
    6 : type: vlan , vid = 1, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    16 : type: ucast, vid = 1, addr = 8c:08:79:73:c4:d5, ucast_type = touched , port_num = 0x1
    21 : type: ucast, vid = 1, addr = dc:be:04:bd:a0:e2, ucast_type = touched , port_num = 0x2
    68 : type: ucast, vid = 1, addr = 22:11:a3:8c:a6:d8, ucast_type = untouched , port_num = 0x1
    AUGOS/arm64: aug@aug in ~
    $
    AUGOS/arm64: aug@aug in ~
    $ sudo sh -c 'echo 1 > /sys/class/net/eth0/brport/flush'
    AUGOS/arm64: aug@aug in ~
    $ bridge fdb show
    8c:08:79:73:c4:d5 dev eth0 master br-lan
    8c:08:79:73:b0:99 dev eth0 vlan 1 master br-lan permanent
    8c:08:79:73:b0:99 dev eth0 master br-lan permanent
    33:33:00:00:00:01 dev eth0 self permanent
    01:00:5e:00:00:01 dev eth0 self permanent
    dc:be:04:bd:a0:e2 dev eth1 master br-lan
    33:33:00:00:00:01 dev eth1 self permanent
    01:00:5e:00:00:01 dev eth1 self permanent
    33:33:00:00:00:01 dev eth2 self permanent
    01:00:5e:00:00:01 dev eth2 self permanent
    33:33:ff:00:74:b1 dev eth2 self permanent
    01:00:5e:00:00:fc dev eth2 self permanent
    33:33:00:01:00:03 dev eth2 self permanent
    33:33:00:01:00:02 dev eth2 self permanent
    33:33:00:00:00:02 dev eth2 self permanent
    33:33:00:00:00:01 dev eth3 self permanent
    01:00:5e:00:00:01 dev eth3 self permanent
    33:33:00:00:00:01 dev br-lan self permanent
    01:00:5e:00:00:01 dev br-lan self permanent
    33:33:ff:f2:b2:2a dev br-lan self permanent
    01:00:5e:00:00:fc dev br-lan self permanent
    33:33:00:01:00:03 dev br-lan self permanent
    33:33:00:01:00:02 dev br-lan self permanent
    33:33:00:00:00:02 dev br-lan self permanent
    0e:c2:49:f2:b2:2a dev br-lan vlan 1 master br-lan permanent
    0e:c2:49:f2:b2:2a dev br-lan master br-lan permanent
    AUGOS/arm64: aug@aug in ~
    $ sudo /home/aug/glibc-2.34/lib/ld-linux-aarch64.so.1 --library-path ~/glibc-2.34/lib/aarch64-linux-gnu/ ~/switch-config -d
    K3 cpsw dump version (1) len(11704)
    ALE table dump ents(512):
    0 : type: vlan , vid = 0, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    1 : type: mcast, addr = 01:80:c2:00:00:00, mcast_state = blf, super, port_mask = 0x1
    2 : type: ucast, vid = 1, addr = 8c:08:79:73:b0:99, ucast_type = persistant, port_num = 0x0, Secure
    3 : type: mcast, vid = 1, addr = ff:ff:ff:ff:ff:ff, mcast_state = f, no super, port_mask = 0x7
    4 : type: mcast, addr = 33:33:00:00:00:01, mcast_state = f, no super, port_mask = 0x7
    5 : type: mcast, addr = 01:00:5e:00:00:01, mcast_state = f, no super, port_mask = 0x7
    6 : type: vlan , vid = 1, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    16 : type: ucast, vid = 1, addr = 8c:08:79:73:c4:d5, ucast_type = touched , port_num = 0x1
    21 : type: ucast, vid = 1, addr = dc:be:04:bd:a0:e2, ucast_type = touched , port_num = 0x2
    68 : type: ucast, vid = 1, addr = 22:11:a3:8c:a6:d8, ucast_type = untouched , port_num = 0x1
    AUGOS/arm64: aug@aug in ~
    $ sudo /home/aug/glibc-2.34/lib/ld-linux-aarch64.so.1 --library-path ~/glibc-2.34/lib/aarch64-linux-gnu/ ~/switch-config -d
    K3 cpsw dump version (1) len(11704)
    ALE table dump ents(512):
    0 : type: vlan , vid = 0, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    1 : type: mcast, addr = 01:80:c2:00:00:00, mcast_state = blf, super, port_mask = 0x1
    2 : type: ucast, vid = 1, addr = 8c:08:79:73:b0:99, ucast_type = persistant, port_num = 0x0, Secure
    3 : type: mcast, vid = 1, addr = ff:ff:ff:ff:ff:ff, mcast_state = f, no super, port_mask = 0x7
    4 : type: mcast, addr = 33:33:00:00:00:01, mcast_state = f, no super, port_mask = 0x7
    5 : type: mcast, addr = 01:00:5e:00:00:01, mcast_state = f, no super, port_mask = 0x7
    6 : type: vlan , vid = 1, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    16 : type: ucast, vid = 1, addr = 8c:08:79:73:c4:d5, ucast_type = touched , port_num = 0x1
    21 : type: ucast, vid = 1, addr = dc:be:04:bd:a0:e2, ucast_type = touched , port_num = 0x2
    68 : type: ucast, vid = 1, addr = 22:11:a3:8c:a6:d8, ucast_type = touched , port_num = 0x2

    DUT2 log
    64 bytes from 192.168.1.2: icmp_seq=62 ttl=64 time=0.497 ms
    64 bytes from 192.168.1.2: icmp_seq=63 ttl=64 time=0.493 ms
    64 bytes from 192.168.1.2: icmp_seq=64 ttl=64 time=0.517 ms
    64 bytes from 192.168.1.2: icmp_seq=65 ttl=64 time=0.500 ms
    64 bytes from 192.168.1.2: icmp_seq=66 ttl=64 time=0.496 ms
    64 bytes from 192.168.1.2: icmp_seq=67 ttl=64 time=0.495 ms
    [ 1190.369878] am65-cpsw-nuss 8000000.ethernet eth0: Link is Down
    [ 1190.376281] br-lan: port 1(eth0) entered disabled state
    64 bytes from 192.168.1.2: icmp_seq=99 ttl=64 time=0.894 ms
    64 bytes from 192.168.1.2: icmp_seq=100 ttl=64 time=0.488 ms
    64 bytes from 192.168.1.2: icmp_seq=101 ttl=64 time=0.466 ms
    64 bytes from 192.168.1.2: icmp_seq=102 ttl=64 time=0.540 ms
    64 bytes from 192.168.1.2: icmp_seq=103 ttl=64 time=0.468 ms
    64 bytes from 192.168.1.2: icmp_seq=104 ttl=64 time=0.463 ms
    64 bytes from 192.168.1.2: icmp_seq=105 ttl=64 time=0.465 ms
    64 bytes from 192.168.1.2: icmp_seq=106 ttl=64 time=0.449 ms
    64 bytes from 192.168.1.2: icmp_seq=107 ttl=64 time=0.467 ms
    64 bytes from 192.168.1.2: icmp_seq=108 ttl=64 time=0.497 ms
    64 bytes from 192.168.1.2: icmp_seq=109 ttl=64 time=0.448 ms
    ^C
    --- 192.168.1.2 ping statistics ---
    109 packets transmitted, 78 received, 28.4404% packet loss, time 110632ms
    rtt min/avg/max/mdev = 0.423/0.501/0.894/0.052 ms
    AUGOS/arm64: aug@aug in ~

  • Hi,

    I am recommending that we return back to original post to recreate and test the proposed solution since this question revolves around if RSTP daemon is able purge an entry quickly from the CPSW ALE. I am setting up what was described in the first part of the post which using the 11.2 SDK on the TI AM6442 EVM.

    To make sure we are aligned to your original setup:

    - Please attach the result of uname -a on the 11.5 kernel that you are using, I want to confirm that the git tag of the kernel matches what I am setting up.

    - Is the kernel built with the same kconfig as the TI SDK?

    - It has been stated that the mstpd is different than what is in the SDK. Could you please share the reason for the difference? This important to understand if the TI SDK using mstpd is causing an issue. 

    We appreciate the alternative test procedures that were provided, we feel that reproducing the issue on the 11.5 kernel using RSTP and then applying the patch provided to see if this resolves the issue is the path to work on.  Thank you for providing the patch.

    We will respond on Monday afternoon with the results of the setup such as reproducing the issue and if the patch provides resolution. We will review the proposed patch with the Software Development team sometime next week.

    Best Regards,

    Schuyler

  • Hello,

    We will reproduce this issue using the method in the image below。

    Please feel free to review it beforehand

  • Hi,

    I tried the setup, thank you for providing the topology. I am not able to reproduce the issue that you are experiencing. It was mentioned earlier in the thread the mstpd being is different from the SDK. From the SW manifest for this release is this version I believe, 0.1.0+git0+181c453fc1-r0.50, is this same one that is used on your platform?

    This the script I am using is attached. Please note that the I created 5 scripts for each TI EVM. I am only attaching one, they are the same except for the ip address for the bridge. I used IP addresses 192.168.1.10 through 192.168.1.14 for the TI EVMs.

    I was running a ping between the two endpoints, the ping resumed a couple of seconds after the cables were re-attached. I will continue to try to re-create the issue tomorrow.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/rstp_5F00_14.txt.sh

    Best Regards,

    Schuyler

  • Hi  
    Here is the patch to clear all ale during STP state change. Please apply this patch on origin/ti-linux-6.12.y-cicd branch and test.
    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/0001_2D00_net_2D00_ti_2D00_cpsw_5F00_ale_2D00_flush_2D00_dynamic_2D00_ALE_2D00_unicast_2D00_entries_2D00_on.patch

  • Hello,

    You can reproduce this issue with following topology. This much more simple.

  • Hi Md Danish Anwar 

       Our product works with SDK Version 09.00.00.006 on ti-linux-6.1.y branch and kernel 6.1.33.

       It's relatively friendly to submit patches based on 6.1.y. Anyway, I will try to merge the 6.12 patch into our system.

       

  • Hi Md Danish Anwar 

    I reviewed the patch. It depends on port STP status change.

    But in RSTP ring topology connect broken test, only alternated and disconnet port will change stp status.  Other ports always forward status.

    And usersapce mstpd call “/sys/class/net/eth0/brport/flush” to flush fdb.

  • Hi  

    I thought userspace is calling /sys/class/net/eth0/brport/flush” only to the ports whose status has changed. If fdb flush is called for ports without state change, then this patch won't work. I will let  reproduce this.

     

  • Hi,

    I am not able to replicate the issue with the update block diagram. I un-plugged the cable to pc 2 and issued the flush command, reconnected the cable and I was able to resume pinging immediately.

    Is there perhaps an difference between the user spaces? I am using the TI SDK Yocto file system. The commands provided are using sudo, is this debian filesystem? Using two different file systems might two different mstpd daemons, could that be causing the issue here?

    Best Regards,

    Schuyler

  • Hello,

    The update block diagram does not enable rstp, mstpd daemon not load.

    Could you provide the print out about “fdb bridge show“ and “swtich-config -d” in following steps

    1. before unplug,  AM64 ping PC2

    2. unplug

    3.  after call '/sys/class/net/eth0/brport/flush'

    And the update block diagram just check the ALE aging issue.  If you reconnected, the ping should resume ping immediately.

  • Hi, 

    Please see the attached log of the steps performed above. I am not using rstp, the mstpd daemon is not loaded. I do not see any missing or delayed ping messages. I will have to ask a colleague for review on the ALE aging issue that you are asking about.  The MAC ID of the PC is d4:81:d7:ca:5c:b2.

    root@am64xx-evm:~# 
    root@am64xx-evm:~# 
    root@am64xx-evm:~# bridge fdb show
    33:33:00:00:00:01 dev eth0 self permanent
    01:00:5e:00:00:01 dev eth0 self permanent
    01:80:c2:00:00:0e dev eth0 self permanent
    01:80:c2:00:00:03 dev eth0 self permanent
    01:80:c2:00:00:00 dev eth0 self permanent
    33:33:ff:bf:0b:74 dev eth0 self permanent
    01:00:5e:00:00:fb dev eth0 self permanent
    33:33:00:00:00:fb dev eth0 self permanent
    33:33:00:00:00:01 dev eth1 self permanent
    01:80:c2:00:00:0e dev eth1 self permanent
    01:80:c2:00:00:03 dev eth1 self permanent
    01:80:c2:00:00:00 dev eth1 self permanent
    33:33:00:00:00:01 dev eth2 self permanent
    01:00:5e:00:00:01 dev eth2 self permanent
    01:80:c2:00:00:0e dev eth2 self permanent
    01:80:c2:00:00:03 dev eth2 self permanent
    01:80:c2:00:00:00 dev eth2 self permanent
    root@am64xx-evm:~# switch-config -d
    K3 cpsw dump version (1) len(11704)
    ALE table dump ents(512): 
    0   : type: vlan , vid = 0, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    1   : type: ucast, addr = 30:30:d0:bf:0b:74, ucast_type = persistant, port_num = 0x0, Secure
    2   : type: mcast, vid = 0, addr = ff:ff:ff:ff:ff:ff, mcast_state = f, no super, port_mask = 0x7
    3   : type: mcast, addr = 33:33:00:00:00:01, mcast_state = f, no super, port_mask = 0x3
    4   : type: mcast, addr = 01:00:5e:00:00:01, mcast_state = f, no super, port_mask = 0x3
    5   : type: ucast, addr = 70:ff:76:20:1e:25, ucast_type = persistant, port_num = 0x0, Secure
    6   : type: mcast, addr = 01:80:c2:00:00:0e, mcast_state = f, no super, port_mask = 0x3
    7   : type: mcast, addr = 01:80:c2:00:00:03, mcast_state = f, no super, port_mask = 0x3
    8   : type: mcast, addr = 01:80:c2:00:00:00, mcast_state = f, no super, port_mask = 0x3
    9   : type: mcast, addr = 33:33:ff:bf:0b:74, mcast_state = f, no super, port_mask = 0x3
    10  : type: mcast, addr = 01:00:5e:00:00:fb, mcast_state = f, no super, port_mask = 0x3
    11  : type: mcast, addr = 33:33:00:00:00:fb, mcast_state = f, no super, port_mask = 0x3
    root@am64xx-evm:~# ./bridge_setup.sh 
    [  161.934576] am65-cpsw-nuss 8000000.ethernet eth0: Link is Down
    [  163.000100] am65-cpsw-nuss 8000000.ethernet eth0: PHY [8000f00.mdio:00] driver [TI DP83867] (irq=POLL)
    [  163.009987] am65-cpsw-nuss 8000000.ethernet eth0: configuring for phy/rgmii-rxid link mode
    [  163.047048] am65-cpsw-nuss 8000000.ethernet eth1: PHY [mdio_mux-0.1:03] driver [TI DP83869] (irq=POLL)
    [  163.056450] am65-cpsw-nuss 8000000.ethernet eth1: configuring for phy/rgmii-rxid link mode
    [  165.060380] am65-cpsw-nuss 8000000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
    kernel answers: No such device
    [  166.135877] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need .
    [  167.176679] br0: port 1(eth0) entered blocking state
    [  167.181776] br0: port 1(eth0) entered disabled state
    [  167.186922] am65-cpsw-nuss 8000000.ethernet eth0: entered allmulticast mode
    [  167.197657] am65-cpsw-nuss 8000000.ethernet eth0: entered promiscuous mode
    [  167.204753] kauditd_printk_skb: 5 callbacks suppressed
    [  167.204771] audit: type=1700 audit(1749242018.436:19): dev=eth0 prom=256 old_prom=0 auid=4294967295 uid=0 gid=0 ses=4294967295
    [  167.207253] am65-cpsw-nuss 8000000.ethernet: Adding vlan 1 to vlan filter
    [  167.231246] audit: type=1300 audit(1749242018.436:19): arch=c00000b7 syscall=211 success=yes exit=40 a0=3 a1=ffffd4dba848 a2=0 a3=1 items=0)
    [  167.240926] br0: port 2(eth1) entered blocking state
    [  167.260151] audit: type=1327 audit(1749242018.436:19): proctitle=6970006C696E6B00736574006465760065746830006D617374657200627230
    [  167.264149] br0: port 2(eth1) entered disabled state
    [  167.280889] am65-cpsw-nuss 8000000.ethernet eth1: entered allmulticast mode
    [  167.289822] am65-cpsw-nuss 8000000.ethernet eth1: entered promiscuous mode
    [  167.297265] audit: type=1700 audit(1749242018.500:20): dev=eth1 prom=256 old_prom=0 auid=4294967295 uid=0 gid=0 ses=4294967295
    [  167.298231] am65-cpsw-nuss 8000000.ethernet: Adding vlan 1 to vlan filter
    [  167.317270] audit: type=1300 audit(1749242018.500:20): arch=c00000b7 syscall=211 success=yes exit=40 a0=3 a1=ffffe9c37f78 a2=0 a3=1 items=0)
    [  167.325879] br0: port 1(eth0) entered blocking state
    [  167.346378] audit: type=1327 audit(1749242018.500:20): proctitle=6970006C696E6B00736574006465760065746831006D617374657200627230
    [  167.350051] br0: port 1(eth0) entered forwarding state
    udhcpc: started, v1.36.1
    Dropped protocol specifier '.udhcpc' from 'br0.udhcpc'. Using 'br0' (ifindex=7).
    udhcpc: broadcasting discover
    udhcpc: broadcasting select for 192.168.10.105, server 192.168.10.1
    udhcpc: lease of 192.168.10.105 obtained from 192.168.10.1, lease time 604800
    /etc/udhcpc.d/50default: Adding DNS 192.168.10.1
    Dropped protocol specifier '.udhcpc' from 'br0.udhcpc'. Using 'br0' (ifindex=7).
    done....
    root@am64xx-evm:~# bridge fdb show
    00:14:d1:b7:1a:03 dev eth0 master br0 
    30:30:d0:bf:0b:74 dev eth0 vlan 1 master br0 permanent
    30:30:d0:bf:0b:74 dev eth0 master br0 permanent
    01:80:c2:00:00:0e dev eth0 self permanent
    01:80:c2:00:00:03 dev eth0 self permanent
    01:80:c2:00:00:00 dev eth0 self permanent
    01:00:5e:00:00:01 dev eth0 self permanent
    33:33:00:00:00:01 dev eth0 self permanent
    33:33:ff:bf:0b:74 dev eth0 self permanent
    01:00:5e:00:00:fb dev eth0 self permanent
    33:33:00:00:00:fb dev eth0 self permanent
    70:ff:76:20:1e:25 dev eth1 vlan 1 master br0 permanent
    70:ff:76:20:1e:25 dev eth1 master br0 permanent
    33:33:00:00:00:01 dev eth1 self permanent
    01:80:c2:00:00:0e dev eth1 self permanent
    01:80:c2:00:00:03 dev eth1 self permanent
    01:80:c2:00:00:00 dev eth1 self permanent
    01:00:5e:00:00:01 dev eth1 self permanent
    33:33:00:00:00:01 dev eth2 self permanent
    01:00:5e:00:00:01 dev eth2 self permanent
    01:80:c2:00:00:0e dev eth2 self permanent
    01:80:c2:00:00:03 dev eth2 self permanent
    01:80:c2:00:00:00 dev eth2 self permanent
    33:33:00:00:00:01 dev br0 self permanent
    01:00:5e:00:00:6a dev br0 self permanent
    33:33:00:00:00:6a dev br0 self permanent
    01:00:5e:00:00:01 dev br0 self permanent
    33:33:ff:c2:51:34 dev br0 self permanent
    33:33:00:00:00:fb dev br0 self permanent
    01:00:5e:00:00:fb dev br0 self permanent
    3a:80:24:c2:51:34 dev br0 vlan 1 master br0 permanent
    3a:80:24:c2:51:34 dev br0 master br0 permanent
    root@am64xx-evm:~# switch-config -d
    K3 cpsw dump version (1) len(11704)
    ALE table dump ents(512): 
    0   : type: vlan , vid = 0, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    1   : type: ucast, addr = 30:30:d0:bf:0b:74, ucast_type = persistant, port_num = 0x0, Secure
    2   : type: mcast, vid = 0, addr = ff:ff:ff:ff:ff:ff, mcast_state = f, no super, port_mask = 0x7
    3   : type: mcast, addr = 01:80:c2:00:00:0e, mcast_state = f, no super, port_mask = 0x7
    4   : type: mcast, addr = 01:80:c2:00:00:03, mcast_state = f, no super, port_mask = 0x7
    5   : type: mcast, addr = 01:80:c2:00:00:00, mcast_state = f, no super, port_mask = 0x7
    6   : type: mcast, addr = 01:00:5e:00:00:01, mcast_state = f, no super, port_mask = 0x7
    7   : type: ucast, addr = 70:ff:76:20:1e:25, ucast_type = persistant, port_num = 0x0, Secure
    8   : type: mcast, addr = 33:33:00:00:00:01, mcast_state = f, no super, port_mask = 0x7
    9   : type: mcast, addr = 33:33:ff:bf:0b:74, mcast_state = f, no super, port_mask = 0x3
    10  : type: mcast, addr = 01:00:5e:00:00:fb, mcast_state = f, no super, port_mask = 0x3
    11  : type: mcast, addr = 33:33:00:00:00:fb, mcast_state = f, no super, port_mask = 0x3
    12  : type: vlan , vid = 1, untag_force = 0x0, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    root@am64xx-evm:~# ping 192.168.10.102
    PING 192.168.10.102 (192.168.10.102) 56(84) bytes of data.
    64 bytes from 192.168.10.102: icmp_seq=1 ttl=64 time=1.04 ms
    64 bytes from 192.168.10.102: icmp_seq=2 ttl=64 time=0.798 ms
    64 bytes from 192.168.10.102: icmp_seq=3 ttl=64 time=0.632 ms
    64 bytes from 192.168.10.102: icmp_seq=4 ttl=64 time=0.780 ms
    64 bytes from 192.168.10.102: icmp_seq=5 ttl=64 time=0.785 ms
    64 bytes from 192.168.10.102: icmp_seq=6 ttl=64 time=0.626 ms
    64 bytes from 192.168.10.102: icmp_seq=7 ttl=64 time=0.673 ms
    64 bytes from 192.168.10.102: icmp_seq=8 ttl=64 time=0.775 ms
    ^C
    --- 192.168.10.102 ping statistics ---
    8 packets transmitted, 8 received, 0% packet loss, time 7054ms
    rtt min/avg/max/mdev = 0.626/0.763/1.042/0.124 ms
    root@am64xx-evm:~# echo unplugged
    unplugged
    root@am64xx-evm:~# 
    root@am64xx-evm:~# bridge fdb show
    d4:81:d7:ca:5c:b2 dev eth0 master br0 
    00:14:d1:b7:1a:03 dev eth0 master br0 
    30:30:d0:bf:0b:74 dev eth0 vlan 1 master br0 permanent
    30:30:d0:bf:0b:74 dev eth0 master br0 permanent
    01:80:c2:00:00:0e dev eth0 self permanent
    01:80:c2:00:00:03 dev eth0 self permanent
    01:80:c2:00:00:00 dev eth0 self permanent
    01:00:5e:00:00:01 dev eth0 self permanent
    33:33:00:00:00:01 dev eth0 self permanent
    33:33:ff:bf:0b:74 dev eth0 self permanent
    01:00:5e:00:00:fb dev eth0 self permanent
    33:33:00:00:00:fb dev eth0 self permanent
    70:ff:76:20:1e:25 dev eth1 vlan 1 master br0 permanent
    70:ff:76:20:1e:25 dev eth1 master br0 permanent
    33:33:00:00:00:01 dev eth1 self permanent
    01:80:c2:00:00:0e dev eth1 self permanent
    01:80:c2:00:00:03 dev eth1 self permanent
    01:80:c2:00:00:00 dev eth1 self permanent
    01:00:5e:00:00:01 dev eth1 self permanent
    33:33:00:00:00:01 dev eth2 self permanent
    01:00:5e:00:00:01 dev eth2 self permanent
    01:80:c2:00:00:0e dev eth2 self permanent
    01:80:c2:00:00:03 dev eth2 self permanent
    01:80:c2:00:00:00 dev eth2 self permanent
    33:33:00:00:00:01 dev br0 self permanent
    01:00:5e:00:00:6a dev br0 self permanent
    33:33:00:00:00:6a dev br0 self permanent
    01:00:5e:00:00:01 dev br0 self permanent
    33:33:ff:c2:51:34 dev br0 self permanent
    33:33:00:00:00:fb dev br0 self permanent
    01:00:5e:00:00:fb dev br0 self permanent
    3a:80:24:c2:51:34 dev br0 vlan 1 master br0 permanent
    3a:80:24:c2:51:34 dev br0 master br0 permanent
    root@am64xx-evm:~# switch-config -d
    K3 cpsw dump version (1) len(11704)
    ALE table dump ents(512): 
    0   : type: vlan , vid = 0, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    1   : type: ucast, addr = 30:30:d0:bf:0b:74, ucast_type = persistant, port_num = 0x0, Secure
    2   : type: mcast, vid = 0, addr = ff:ff:ff:ff:ff:ff, mcast_state = f, no super, port_mask = 0x7
    3   : type: mcast, addr = 01:80:c2:00:00:0e, mcast_state = f, no super, port_mask = 0x7
    4   : type: mcast, addr = 01:80:c2:00:00:03, mcast_state = f, no super, port_mask = 0x7
    5   : type: mcast, addr = 01:80:c2:00:00:00, mcast_state = f, no super, port_mask = 0x7
    6   : type: mcast, addr = 01:00:5e:00:00:01, mcast_state = f, no super, port_mask = 0x7
    7   : type: ucast, addr = 70:ff:76:20:1e:25, ucast_type = persistant, port_num = 0x0, Secure
    8   : type: mcast, addr = 33:33:00:00:00:01, mcast_state = f, no super, port_mask = 0x7
    9   : type: mcast, addr = 33:33:ff:bf:0b:74, mcast_state = f, no super, port_mask = 0x3
    10  : type: mcast, addr = 01:00:5e:00:00:fb, mcast_state = f, no super, port_mask = 0x3
    11  : type: mcast, addr = 33:33:00:00:00:fb, mcast_state = f, no super, port_mask = 0x3
    12  : type: vlan , vid = 1, untag_force = 0x0, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    root@am64xx-evm:~# echo 1 > /sys/class/net/eth0/brport/flush
    root@am64xx-evm:~# switch-config -d
    K3 cpsw dump version (1) len(11704)
    ALE table dump ents(512): 
    0   : type: vlan , vid = 0, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    1   : type: ucast, addr = 30:30:d0:bf:0b:74, ucast_type = persistant, port_num = 0x0, Secure
    2   : type: mcast, vid = 0, addr = ff:ff:ff:ff:ff:ff, mcast_state = f, no super, port_mask = 0x7
    3   : type: mcast, addr = 01:80:c2:00:00:0e, mcast_state = f, no super, port_mask = 0x7
    4   : type: mcast, addr = 01:80:c2:00:00:03, mcast_state = f, no super, port_mask = 0x7
    5   : type: mcast, addr = 01:80:c2:00:00:00, mcast_state = f, no super, port_mask = 0x7
    6   : type: mcast, addr = 01:00:5e:00:00:01, mcast_state = f, no super, port_mask = 0x7
    7   : type: ucast, addr = 70:ff:76:20:1e:25, ucast_type = persistant, port_num = 0x0, Secure
    8   : type: mcast, addr = 33:33:00:00:00:01, mcast_state = f, no super, port_mask = 0x7
    9   : type: mcast, addr = 33:33:ff:bf:0b:74, mcast_state = f, no super, port_mask = 0x3
    10  : type: mcast, addr = 01:00:5e:00:00:fb, mcast_state = f, no super, port_mask = 0x3
    11  : type: mcast, addr = 33:33:00:00:00:fb, mcast_state = f, no super, port_mask = 0x3
    12  : type: vlan , vid = 1, untag_force = 0x0, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    root@am64xx-evm:~# bridge fdb show
    00:14:d1:b7:1a:03 dev eth0 master br0 
    30:30:d0:bf:0b:74 dev eth0 vlan 1 master br0 permanent
    30:30:d0:bf:0b:74 dev eth0 master br0 permanent
    01:80:c2:00:00:0e dev eth0 self permanent
    01:80:c2:00:00:03 dev eth0 self permanent
    01:80:c2:00:00:00 dev eth0 self permanent
    01:00:5e:00:00:01 dev eth0 self permanent
    33:33:00:00:00:01 dev eth0 self permanent
    33:33:ff:bf:0b:74 dev eth0 self permanent
    01:00:5e:00:00:fb dev eth0 self permanent
    33:33:00:00:00:fb dev eth0 self permanent
    70:ff:76:20:1e:25 dev eth1 vlan 1 master br0 permanent
    70:ff:76:20:1e:25 dev eth1 master br0 permanent
    33:33:00:00:00:01 dev eth1 self permanent
    01:80:c2:00:00:0e dev eth1 self permanent
    01:80:c2:00:00:03 dev eth1 self permanent
    01:80:c2:00:00:00 dev eth1 self permanent
    01:00:5e:00:00:01 dev eth1 self permanent
    33:33:00:00:00:01 dev eth2 self permanent
    01:00:5e:00:00:01 dev eth2 self permanent
    01:80:c2:00:00:0e dev eth2 self permanent
    01:80:c2:00:00:03 dev eth2 self permanent
    01:80:c2:00:00:00 dev eth2 self permanent
    33:33:00:00:00:01 dev br0 self permanent
    01:00:5e:00:00:6a dev br0 self permanent
    33:33:00:00:00:6a dev br0 self permanent
    01:00:5e:00:00:01 dev br0 self permanent
    33:33:ff:c2:51:34 dev br0 self permanent
    33:33:00:00:00:fb dev br0 self permanent
    01:00:5e:00:00:fb dev br0 self permanent
    3a:80:24:c2:51:34 dev br0 vlan 1 master br0 permanent
    3a:80:24:c2:51:34 dev br0 master br0 permanent
    root@am64xx-evm:~# ping 192.168.10.102
    PING 192.168.10.102 (192.168.10.102) 56(84) bytes of data.
    64 bytes from 192.168.10.102: icmp_seq=1 ttl=64 time=1.71 ms
    64 bytes from 192.168.10.102: icmp_seq=2 ttl=64 time=0.762 ms
    64 bytes from 192.168.10.102: icmp_seq=3 ttl=64 time=0.484 ms
    64 bytes from 192.168.10.102: icmp_seq=4 ttl=64 time=0.762 ms
    64 bytes from 192.168.10.102: icmp_seq=5 ttl=64 time=0.719 ms
    64 bytes from 192.168.10.102: icmp_seq=6 ttl=64 time=0.739 ms
    64 bytes from 192.168.10.102: icmp_seq=7 ttl=64 time=0.728 ms
    ^C
    --- 192.168.10.102 ping statistics ---
    7 packets transmitted, 7 received, 0% packet loss, time 6090ms
    rtt min/avg/max/mdev = 0.484/0.843/1.707/0.364 ms
    root@am64xx-evm:~# bridge fdb show
    d4:81:d7:ca:5c:b2 dev eth0 master br0 
    00:14:d1:b7:1a:03 dev eth0 master br0 
    30:30:d0:bf:0b:74 dev eth0 vlan 1 master br0 permanent
    30:30:d0:bf:0b:74 dev eth0 master br0 permanent
    01:80:c2:00:00:0e dev eth0 self permanent
    01:80:c2:00:00:03 dev eth0 self permanent
    01:80:c2:00:00:00 dev eth0 self permanent
    01:00:5e:00:00:01 dev eth0 self permanent
    33:33:00:00:00:01 dev eth0 self permanent
    33:33:ff:bf:0b:74 dev eth0 self permanent
    01:00:5e:00:00:fb dev eth0 self permanent
    33:33:00:00:00:fb dev eth0 self permanent
    70:ff:76:20:1e:25 dev eth1 vlan 1 master br0 permanent
    70:ff:76:20:1e:25 dev eth1 master br0 permanent
    33:33:00:00:00:01 dev eth1 self permanent
    01:80:c2:00:00:0e dev eth1 self permanent
    01:80:c2:00:00:03 dev eth1 self permanent
    01:80:c2:00:00:00 dev eth1 self permanent
    01:00:5e:00:00:01 dev eth1 self permanent
    33:33:00:00:00:01 dev eth2 self permanent
    01:00:5e:00:00:01 dev eth2 self permanent
    01:80:c2:00:00:0e dev eth2 self permanent
    01:80:c2:00:00:03 dev eth2 self permanent
    01:80:c2:00:00:00 dev eth2 self permanent
    33:33:00:00:00:01 dev br0 self permanent
    01:00:5e:00:00:6a dev br0 self permanent
    33:33:00:00:00:6a dev br0 self permanent
    01:00:5e:00:00:01 dev br0 self permanent
    33:33:ff:c2:51:34 dev br0 self permanent
    33:33:00:00:00:fb dev br0 self permanent
    01:00:5e:00:00:fb dev br0 self permanent
    3a:80:24:c2:51:34 dev br0 vlan 1 master br0 permanent
    3a:80:24:c2:51:34 dev br0 master br0 permanent
    root@am64xx-evm:~# switch-config -d
    K3 cpsw dump version (1) len(11704)
    ALE table dump ents(512): 
    0   : type: vlan , vid = 0, untag_force = 0x7, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    1   : type: ucast, addr = 30:30:d0:bf:0b:74, ucast_type = persistant, port_num = 0x0, Secure
    2   : type: mcast, vid = 0, addr = ff:ff:ff:ff:ff:ff, mcast_state = f, no super, port_mask = 0x7
    3   : type: mcast, addr = 01:80:c2:00:00:0e, mcast_state = f, no super, port_mask = 0x7
    4   : type: mcast, addr = 01:80:c2:00:00:03, mcast_state = f, no super, port_mask = 0x7
    5   : type: mcast, addr = 01:80:c2:00:00:00, mcast_state = f, no super, port_mask = 0x7
    6   : type: mcast, addr = 01:00:5e:00:00:01, mcast_state = f, no super, port_mask = 0x7
    7   : type: ucast, addr = 70:ff:76:20:1e:25, ucast_type = persistant, port_num = 0x0, Secure
    8   : type: mcast, addr = 33:33:00:00:00:01, mcast_state = f, no super, port_mask = 0x7
    9   : type: mcast, addr = 33:33:ff:bf:0b:74, mcast_state = f, no super, port_mask = 0x3
    10  : type: mcast, addr = 01:00:5e:00:00:fb, mcast_state = f, no super, port_mask = 0x3
    11  : type: mcast, addr = 33:33:00:00:00:fb, mcast_state = f, no super, port_mask = 0x3
    12  : type: vlan , vid = 1, untag_force = 0x0, reg_mcast = 0x0, unreg_mcast = 0x0, member_list = 0x7
    root@am64xx-evm:~# 
    CTRL-A Z for help | 115200 8N1 | NOR | Minicom 2.8 | VT102 | Offline | ttyUSB0                                                                
    
    
    
    

    Best Regards,

    Schuyler

  • Hi, 

    As a another means to help with reproduction of the issue. Do you have a AM64 EVM? Would you be able to run the same test with 11.2 SDK? The link to the default 11.2 WIC image is here:

    https://dr-download.ti.com/software-development/software-development-kit-sdk/MD-yXgchBCk98/11.02.08.02/tisdk-default-image-am64xx-evm-11.02.08.02.rootfs.wic.xz

    Best Regards,

    Schuyler

  • Hi,

    Redoing the test again today I wanted confirm that the PC MAC addresses is restoring to the fdb show after the cable is unplugged, the flush command happens, the fdb shows the PC MAC address is flushed and upon the cable being plugged back in the fdb show show the PC MAC address is restored even without a ping command.

    Best Regards,

    Schuyler

  • Hello,

    The PC mac "d4:81:d7:ca:5c:b2" should be studied both by bridge fdb and SW ALE, but from your log the mac only showed in bridge fdb. Please check whether the eth1 port is a CPSW3G switch port. 

    Following PC mac “22:11:a3:8c:a6:d8” is showed in my test. Same issue at SDK9. SDK11 and SDK12

    $ bridge fdb show
    22:11:a3:8c:a6:d8 dev eth0 master br-lan

    $ sudo /home/aug/glibc-2.34/lib/ld-linux-aarch64.so.1 --library-path ~/glibc-2.34/lib/aarch64-linux-gnu/ ~/switch-config -d
    K3 cpsw dump version (1) len(11704)
    ALE table dump ents(512):
    68 : type: ucast, vid = 1, addr = 22:11:a3:8c:a6:d8, ucast_type = untouched , port_num = 0x1

  • Hello,

    I test at AM64 EVM with SDK 12.0.x  official image, same issue.

    Please refer below log.

    1. PC mac is “18:3d:2d:d0:26:91“

    2. After ping PC, both “switch-config -d“ and “bridge fdb show br0” show the MAC is studied.

    3. Then unplug and do flush “sudo sh -c 'echo 1 > /sys/class/net/eth0/brport/flush'

    4. "bridge fdb show br0” will not show PC mac, but “switch-config -d“ still show PC Mac about 30 seconds until aging

    2026-08-27 terminal log.docx

  • Hello Du Wei,

    Schuyler is out of office for the next two weeks. In the meantime, our dev team has generated some test code to try to address the behavior you see. It may be at least a few more business days before I can get someone to run tests on this side. If you are interested in testing out the code yourself, I have attached the code changes and logic below.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/CPSW_2B00_RSTP_2B00_Convergence_2B00_Delay_2B0014202B00_Root_2B00_Cause_2B00_and_2B00_Fix.mht

    Also, I will edit your response above to move the log to a separate file, in order to make it easier to navigate this e2e thread.

    Regards,

    Nick

  • Hello Nick,

    Greatly, seems you already have a clear understanding of the root cause.

    But the patch is same with  provided before.

    It depends on port STP status change.

    In RSTP ring topology connect broken test, only Alternate and disconnet port will change stp status.  Other ports always forward status.

    RSTP Test Topology:

    PC - Switch  --(eth0) DUT1(eth1) -- (eth0)DUT2(eth1 Alternate port) -- (eth0)DUT3 (eth1)-- -- (eth0)DUT4 (eth1)--Switch

    When DUT4's eth1 disconnects from the switch, only DUT4's eth1 and DUT2's eth1 STP port states change.

    When PC continuously pings DUT3, DUT1's ALE will conflict, causing packet loss until the ALE aging timeout expires.

    This patch cannot trigger DUT1 to perform the flush ALE ucast operation.

  • Hello,

    Please find attached the document AM6422_RSTP_CPSW_analysis_and_fix.pdf for your reference.

    This document is based on an analysis generated by Benoît Perier from Schneider Electric, with the assistance of AI.

    It provides valuable insight into the current issue and outlines a proposed solution.

    Please review the analysis and provide your feedback. They are very important to moving this issue forward.

    AM6422_RSTP_CPSW_analysis_and_fix.pdf

  • Hi  

    I read AM6422_RSTP_CPSW_analysis_and_fix.pdf  and I have reviewed the patch dcoumented in the pdf

    The overall approach — adding SWITCHDEV_FDB_FLUSH_TO_DEVICE and bulk-purging ALE unicast entries on topology flush — is correct and addresses the slow-reconvergence issue. However, I found one functional issue that needs to be fixed before this can be used in a VLAN-trunk configuration, and one race condition worth being aware of.

    1. VLAN scoping is dropped — will flush unrelated VLANs on a trunk port (needs fix)

    In am65-cpsw-switchdev.c, the flush handler receives a vid, but never passes it down:

    + case SWITCHDEV_FDB_FLUSH_TO_DEVICE:
    + netdev_dbg(port->ndev, "cpsw_fdb_flush: vid = %u -- port %d\n",
    + switchdev_work->flush_vid, port_id);
    +
    + cpsw_ale_flush_unicast(cpsw->ale, BIT(port_id));
    break;

    And in cpsw_ale.c, cpsw_ale_flush_unicast() only takes a port_mask, no vid:

    +int cpsw_ale_flush_unicast(struct cpsw_ale *ale, int port_mask)
    +{
    + ...
    + port = cpsw_ale_get_port_num(ale_entry, ale->port_num_bits);
    + if (!(BIT(port) & port_mask))
    + continue;
    +
    + cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_FREE);
    + cpsw_ale_write(ale, idx, ale_entry);
    + }
    + return 0;
    +}

    The bridge core calls br_fdb_delete_by_port(port->br, port, vid, 0) with a real, single, non-zero vid when a single VLAN is removed from a trunk port (nbp_vlan_delete(), net/bridge/br_vlan.c). That reaches your flush notifier with the same vid. Since cpsw_ale_flush_unicast() matches by port only, removing one VLAN from a shared trunk port will flush learned unicast MACs for every VLAN on that port, not just the one being removed.

    If you don't run VLANs on shared trunk ports (single VLAN per port, or VLAN-unaware bridging), this doesn't affect you and you can use the patch as-is. If you do use VLAN trunking, this needs vid threaded through cpsw_ale_flush_unicast() — same pattern as the existing cpsw_ale_flush_multicast(ale, port_mask, vid) — before it's safe to deploy.

    2. Possible ordering race between FDB add and flush (needs awareness, lower priority)

    Both the existing ADD_TO_DEVICE case and the new FLUSH_TO_DEVICE case queue work on system_long_wq:

    + case SWITCHDEV_FDB_FLUSH_TO_DEVICE:
    + switchdev_work->flush_vid = flush_info->vid;
    + dev_hold(ndev);
    break;

    system_long_wq has no cross-CPU ordering guarantee. If a static FDB add for a port is queued around the same time as a topology-change flush for that same port (from a different CPU), the flush could run after the add and silently delete the just-added static entry.

    This only matters if you're doing static FDB configuration concurrently with STP topology changes on the same port. If your setup doesn't do that, this isn't a practical concern for you — just flagging it for awareness.

    Thanks,
    Danish

  • Hi Danish,

    I'm a bit confused about the function cpsw_ale_del_ucast(struct cpsw_ale *ale, const u8 *addr, int port, int flags, u16 vid). If the flags does not have the ALE_VLAN bit set, I understand that it should delete the ALE entry based solely on the MAC address. However, in practice, cpsw_ale_match_addr always checks the vid regardless of whether the ALE_VLAN bit is set in flags or not. Could you please confirm this behavior?

  • Hi  

    cpsw_ale_del_ucast() builds the vid argument to cpsw_ale_match_addr() as (flags & ALE_VLAN) ? vid : 0 — so when ALE_VLAN is not set, it doesn't pass vid through unfiltered/ignored, it substitutes 0 and passes that. cpsw_ale_match_addr() itself then unconditionally
    checks cpsw_ale_get_vlan_id(ale_entry) != vid for every entry, with no path that skips the vid comparison.

    Same is the case for cpsw_ale_add_ucast(), if ALE_VLAN is not set entry is added with vid=0

    So if the flag doesn't have ALE_VLAN set and an entry was added, it would have had vid=0. If same entry is getting deleted, the match will happen with vid=0 and the entry will be found and deleted.

    So to answer your question, Yes cpsw_ale_match_addr always checks the vid regardless of whether the ALE_VLAN bit is set in flags or not and this is the expected behaviour.

  • Hi Danish,

    My board's VLAN filtering is currently disabled, but the CPSW driver enables ALE_VLAN_AWARE by default. As a result, the VID match check always failed, because the bridge FDB's VID is always 0, while the ALE table has the default VID 1.

    Please check:

    1. Is there any potential issue in this case where VLAN filtering is disabled but ALE_VLAN_AWARE is enabled?

    2. Why does ALE_VLAN_AWARE not synchronize with the state of VLAN filtering?

  •   By default when bridge is created i.e. switch mode is enabled, CPSW driver sets ALE_VLAN_AWARE, irrespective of whether VLAN filtering is enabled or not. That is the current driver behaviour.

    1. Is there any potential issue in this case where VLAN filtering is disabled but ALE_VLAN_AWARE is enabled?

      1. Yes. This is the same issue that I was talking about in the last call. And this is the reason only removing added_by_user check from del path will not work. An entry when learned by ale will have vid=1, where as vlan filtering is not enabled the same entry when bridge learns will have vid=0. So when bridge sends a command to delete this entry, ale tries to look for entry with vid=0. But since the entry was added with vid=1, look up fails and entry doesn't get deleted at all. 
    2. Why does ALE_VLAN_AWARE not synchronize with the state of VLAN filtering?

      1. This feature is currently not in driver. 

    This VLAN issue was seen with your earlier patch and that is why I suggested the mirror fdb approach. Any time a entry is added to software fdb, same entry should be mirrored to ale and vice versa.

    This way vid=1 entry of ale will get synced to software fdb. And vid=0 software fdb will get synced to ale. And when delete is called, it will be called twice, once for vid=0 and once for vid=1 and both will eventually get deleted from ALE.

  • Hi Danish,

     I try to disable ALE_VLAN_AWARE, then ALE dump will not show vid

    49 : type: ucast, addr = 68:8f:84:05:f5:92, ucast_type = touched , port_num = 0x2
    68 : type: ucast, addr = 00:e0:fc:09:bc:f9, ucast_type = touched , port_num = 0x2

    However, when flush eth1/bport, the ucast del fails also, as the vid still 1 in ALE


    [ 317.864451] am65-cpsw-nuss 8000000.ethernet eth1: cpsw_fdb_del: MAC=00:e0:fc:09:bc:f9 vid=0 flags=0/0 port=2 vlan_filtering=0 dev=eth1 br=br-lan
    [ 317.864482] am65-cpsw-nuss 8000000.ethernet: === cpsw_ale_match_addr: MAC=00:e0:fc:09:bc:f9 8c:08:79:73:c4:6f 0:1 ===
    [ 317.864494] am65-cpsw-nuss 8000000.ethernet: === cpsw_ale_match_addr: MAC=00:e0:fc:09:bc:f9 ff:ff:ff:ff:ff:ff 0:1 ===
    [ 317.864552] am65-cpsw-nuss 8000000.ethernet: === cpsw_ale_match_addr: MAC=00:e0:fc:09:bc:f9 68:8f:84:05:f5:92 0:1 ===
    [ 317.864581] am65-cpsw-nuss 8000000.ethernet: === cpsw_ale_match_addr: MAC=00:e0:fc:09:bc:f9 00:e0:fc:09:bc:f9 0:1 ===
    [ 317.865247] am65-cpsw-nuss 8000000.ethernet: === cpsw_fdb_del: MAC=00:e0:fc:09:bc:f9 check -2===
    [ 317.865281] am65-cpsw-nuss 8000000.ethernet eth1: cpsw_fdb_del: MAC=68:8f:84:05:f5:92 vid=0 flags=0/0 port=2 vlan_filtering=0 dev=eth1 br=br-lan
    [ 317.865299] am65-cpsw-nuss 8000000.ethernet: === cpsw_ale_match_addr: MAC=68:8f:84:05:f5:92 8c:08:79:73:c4:6f 0:1 ===
    [ 317.865309] am65-cpsw-nuss 8000000.ethernet: === cpsw_ale_match_addr: MAC=68:8f:84:05:f5:92 ff:ff:ff:ff:ff:ff 0:1 ===
    [ 317.865367] am65-cpsw-nuss 8000000.ethernet: === cpsw_ale_match_addr: MAC=68:8f:84:05:f5:92 68:8f:84:05:f5:92 0:1 ===
    [ 317.865396] am65-cpsw-nuss 8000000.ethernet: === cpsw_ale_match_addr: MAC=68:8f:84:05:f5:92 00:e0:fc:09:bc:f9 0:1 ===
    [ 317.865987] am65-cpsw-nuss 8000000.ethernet: === cpsw_fdb_del: MAC=68:8f:84:05:f5:92 check -2===

  •  I don't think you should disable ALE_VLAN_AWARE from driver. From your logs seems like ALE is always learning entry with vid=1

    I think the better fix should be while deleting dynamic entries,

    1. if vid=0 delete all entries irrespective of vid i.e match only on port and mac_addr.
    2. If vid=X delete only the entry with vid=x and matching the mac_addr

    Please try this patch /cfs-file/__key/communityserver-discussions-components-files/791/0001_2D00_net_2D00_ti_2D00_am65_2D00_cpsw_2D00_switchdev_2D00_flush_2D00_dynamic_2D00_FDB_2D00_entries.patch