Good day.
We are trying to implement the RSTP protocol on TIRTOS OS based on NDK using the CPSW ALE hardware filtering capabilities.
The ALE table is configured as follows:
Enabled VLAN_AWARE in ALE
ALE VLAN entry inserted (vid = 0, vlan_member_list = 0b111, untag = 0b111, reg_mcast = 0b111, unreg_mcast = 0b110)
MCAST entry inserted (mcast_addr = 01: 80: C2: 00: 00: 00, mcast_fwd_state = 0b01, super = 0b1, port_mask = 0b001)
For each of the ports (port 1 and port 2), entry inserted:
MCAST_VLAN (mcast_addr = FF: FF: FF: FF: FF: FF, vid = 0x0, mcast_fwd_state = 0b11, super = 0b0, port_mask = 0b001)
UCAST_VLAN (mcast_addr = Device MAC address (e.g. E8: EB: 11: E9: B5: 38), vid = 0x0, ucast_type = 0b00, block = 0, secure = 0, port_number = port_num (1 or 2), dlr_unicast = 0);
All ports have forwarding enabled.
This is how the CPSW is configured in the Linux driver, we’ve just rewrote some ideas from it.
With this configuration, we receive BPDUs from the switch (not TI), but our device cannot send BPDUs (even if packets are sent as directed (to_port_enable bit was set and the port number was set in the to_port field of the TX CPPI descriptor))
If in the ALE record for BPDUs (the second record) we set the field port_mask = 0b111, then our device sends and receives BPDUs, but it forwards received and sent BPDUs from port 1 to port 2 and vice versa. Also, with this configuration, a BPDU frame is sent with port 1 is sent to port 2 and vice versa.
To implement the RSTP, we need:
- Determine from which port the BPDU frame came (we’re defining it using the from_port field of the RX CPPI descriptor).
- Send BPDUs to a specific port (for this we set the to_port_enable bit and the port number in the to_port of the CPPI TX descriptor). However, with our settings, a frame directed to port 1 is sent to port 2 as well, and vice versa.
- A frame sent by an external switch should be received on port 0 (Host port), but should not be forwarded to ports 1 and 2. We can do this by setting port_mask = 0b001 to write the BPDU address, but then we lose the opportunity send BPDU frames to port 1 and 2, if we set port_mask == 0b111, we both receive and transmit BPDU frames, but BPDU frames are forwarded from port 1 to port 2.
Is it possible to implement RSTP only with hardware filtering (software BPDU processing tolerance)? If yes, please help in configuring CPSW to achieve the above requirements