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.

Linux/PROCESSOR-SDK-AM437X: Ethernet bridge configuration issue

Part Number: PROCESSOR-SDK-AM437X

Tool/software: Linux

Hello,

We are using the TI AM437x Industrial Development Kit to prototype Ethernet configurations of our custom hardware design. Our custom hardware design has two Ethernet interfaces, one from the PRUETH1 MII interface and the other on the CPSW RMII1 interface. So for prototyping purposes on the AM437x IDK, the Gigabit Interface from the CPSW was used (eth0 in Linux) and PRUETH1 (eth2 in Linux) is used.

We are looking to setup a network bridge between the two interfaces to allow traffic to flow through the IDK two Ethernet ports. The setup of the IDK with two devices connected on either side is as follows:

+---------+      +-------------------------------+       +----------+
|         |      | CPSW Gigabit          PRUETH1 |       |          |
|         |      +--------+             +--------+       |          |
|         |      |        |   +-----+   |        |       |          |
|         +------+  eth0  +---+ br0 +---+  eth2  +-------+          |
|         |      |        |   +-----+   |        |       |          |
|         |      +--------+             +--------+       |          |
|         |      |                               |       |          |
+---------+      +-------------------------------+       +----------+
 Device #1               TI AM437x IDK                    Device #2

 The commands we run in order to setup the network bridge are:

brctl addbr br0
brctl addif br0 eth0
brctl addif br0 eth2
ifconfig eth0 up
ifconfig eth2 up
ifconfig br0 192.168.10.100 netmask 255.255.255.0

The bridged interface (br0) comes up correctly and we are able to successfully ping/etc between devices #1 and #2. Our network setup is going to include VLAN traffic going between Device #1 and #2. However, we are unable to communicate between Device #1 or #2 if any of the traffic is tagged with a VLAN ID.  In the scenario where traffic is going from Device #2 to Device #1, tcpdump shows that traffic is coming in eth2 and that it goes out eth0. In reality though, the traffic will never be received by Device #1.

Is there a known limitation with the CPSW interface that doesn’t allow VLAN tagged traffic to pass through the CPSW Gigabit interface?

I have tried setting up this same scenario with PRUETH0 and PRUETH1 as the bridged interfaces and we are able to successfully pass VLAN tagged traffic between devices. This is why I believe there is an issue or limitation with the CPSW Gigabit interface.

The kernel that we are running is TI Linux tag ti2018.00

  • Hi,

    The only known limitation to my knowledge on the CPSW concerning VLANs is the ids used. The ALE of the CPSW uses VLANs to represent the MAC interfaces in dual mac mode. Which VLAN IDs are you using?

    Best Regards,

    Schuyler

  • Hi,

    In our design, we plan on using VLAN IDs of 2 and 3. However, during my testing I tried VLAN IDs up to 10.

    Thanks,
    -Ryan

  • Hi,

    Can you describe how you know device 1 is not receiving the packets? Are you tapping the line inbetween eth0 and device 1 to capture what is on the line and using something like wireshark?

    I aplogize for not mentioning this earlier but the 2018.00 was not a production release for a TI SDK. Are you cloning the TI tree and are what you are using for a kernel defconfig? Is it possible to use to retry your tests using the pre-builts from the current TI SDK on the EVM?

    Best Regards,
    Schuyler
  • Hi,

    Devices #1 and #2 are other development boards running Linux so I'm able to run tcpdump on Device #1 to see if there are any packets being received.

    We use buildroot to build our embedded system images so we are pulling in the TI Linux kernel source to get support for the PRU Ethernet interface and the TI2018.00 was the latest tag that was available. I have downloaded the TI PROCESSOR SDK v04.03 and have flash the SD Card for my TI AM437x IDK with the pre-built images from the SDK. With v04.03 of the Processor SDK I'm able to reproduce the same issue as described in my original post - no VLAN traffic is allowed through the bridge when created with CPSW Gigabit and PRUETH1. However, as with before, a bridge created with PRUETH0 and PRUETH1 allows vlan traffic through.

    Thanks,
    -Ryan

  • Hi Ryan,

    I am setting up a test to match what you describe. Since you have an IDK setup,  could you please run switch-config -d which is in the TI file system. This will dump the configuration of the ALE.

    Best Regards,

    Schuyler

  • Hi Schuyler,

    Here is the output of the 'switch-config -d' command:

    root@am437x-evm:~# switch-config -d
    cpsw hw version 1.15 (0)
    0   : type: ucast, addr = 9c:1d:58:7c:95:dc, ucast_type = persistant, port_num = 0x0
    1   : type: mcast, addr = ff:ff:ff:ff:ff:ff, mcast_state = f, no super, port_mask = 0x3
    2   : type: vlan , vid = 0, untag_force = 0x7, reg_mcast = 0x7, unreg_mcast = 0x7, member_list = 0x7
    

    Thanks,
    -Ryan

  • Hi Ryan,
    After a discussion with the driver maintainer there may need to be an ALE entry added using the switch-config tool to support VLANs being passed through eth0 in your setup. I will be looking at possible filters tomorrow and report what I find.

    Best Regards,
    Schuyler
  • Hi Ryan,

    As mentioned in the previous post there needs to be a ALE entry added using the switch-config utility to allow VLANs to be passed through switch. Here is the entry I added and after the VLAN tagged packets exited the switch that were coming from the PRU eth port:

    switch-config -i 100 -n 3 -K 0 -M 3 -N 3

    This command is adding a filter for VLAN 100, and for ports 0 (host) and 1 (external port 1), so for these ports the -n is the port mask, -K is the force untag on egress which is not wanted for this VLAN, -M is registered multi-cast and -N is for unregistered multi-cast.

    Best Regards,
    Schuyler
  • Hi Schuyler,

    This has resolved my issue with the VLAN not working with the bridge. Where is the source code for this switch-config tool located?

    We utilize Buildroot to build our filesytem images so I would like to be able to pull this tool into our filesystem image.

    Thanks,
    -Ryan
  • Hi Ryan,

    Here is the link to the source tree for the switch-config utility. Glad to hear the filter resolved the issue you were facing.

    git.ti.com/.../

    Best Regards,
    Schuyler