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/AM5728: Bridging between GMAC and PRU-Ethenet not working

Part Number: AM5728

Tool/software: Linux

Hello

I'm running SDK4.0, 802.1d Ethernet bridging is active in Kernel. Otherwise it's all standard for IDK5728

Setup:

- PC attached to eth0, 192.168.0.3

- PC attached to eth2, 192.168.0.4

- IDK5728

I entered on serial console:

ifconfig eth0 0.0.0.0

ifconfig eth2 0.0.0.0

brctl addbr mybridge

brctl addif mybridge eth0

brctl addif mybridge eth2

ifconfig mybridge up

Test 1 result: Pinging between PCs does not work!

Then I assigned an IP address to the bridge:

ifconfig mybridge down

ifconfig mybridge 192.168.0.20 netmask 255.255.255.0

Test 2 result: Pinging between PCs does not work! However I can ping PCs from Sitara and I can ping bridge address from PC.

What wrong? Is there anything missing in the kernel?

Thanks for help, Chris

  • We're looking into this. Feedback will be posted here.

    Best Regards,
    Yordan
  • Hi Christian,

    The bridge will not become operational until it is brought into the ‘up’ state. This can be done for all three of these devices (eth0, eth2, mybridge):

    ifconfig mybridge eth0
    ifconfig mybridge eth2
    ifconfig mybridge up

    The bridge should now be ready for use, however there may be a delay before traffic starts to flow (typically about 30 seconds if STP is enabled or half that if not).

    BR
    Tsvetolin Shulev
  • Hi Tsvetolin

    As I wrote initially, I did a "ifconfig mybrige up". Here the output when I also did "ifconfig mybridge eth0,  ifconfig mybridge eth2".

    Ping still does not work.

    root@am57xx-evm:~# ifconfig eth0 0.0.0.0

    root@am57xx-evm:~# ifconfig eth2 0.0.0.0

    root@am57xx-evm:~# brctl addbr mybridge

    root@am57xx-evm:~# brctl addif mybridge eth0

    [   35.851952] mybridge: port 1(eth0) entered blocking state

    [   35.857922] mybridge: port 1(eth0) entered disabled state

    [   35.872327] device eth0 entered promiscuous mode

    root@am57xx-evm:~# brctl addif mybridge eth2

    [   35.911605] mybridge: port 2(eth2) entered blocking state

    [   35.917054] mybridge: port 2(eth2) entered disabled state

    [   35.922989] device eth2 entered promiscuous mode

    root@am57xx-evm:~#

    root@am57xx-evm:~# ifconfig mybridge eth0

    ifconfig: bad address 'eth0'

    root@am57xx-evm:~# ifconfig mybridge eth2

    ifconfig: bad address 'eth2'

    root@am57xx-evm:~# ifconfig mybridge up

    [   36.111355] mybridge: port 2(eth2) entered blocking state

    [   36.116787] mybridge: port 2(eth2) entered forwarding state

    [   36.122477] mybridge: port 1(eth0) entered blocking state

    [   36.127909] mybridge: port 1(eth0) entered forwarding state

    root@am57xx-evm:~#

    root@am57xx-evm:~# ifconfig

    eth0      Link encap:Ethernet  HWaddr FC:0F:4B:9C:12:A0

             inet6 addr: fe80::fe0f:4bff:fe9c:12a0%763860/64 Scope:Link

             UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

             RX packets:186 errors:0 dropped:0 overruns:0 frame:0

             TX packets:42 errors:0 dropped:0 overruns:0 carrier:0

             collisions:0 txqueuelen:1000

             RX bytes:18232 (17.8 KiB)  TX bytes:6372 (6.2 KiB)

             Interrupt:93

    eth2      Link encap:Ethernet  HWaddr 70:FF:76:1C:11:01

             inet6 addr: fe80::72ff:76ff:fe1c:1101%763860/64 Scope:Link

             UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

             RX packets:0 errors:0 dropped:0 overruns:0 frame:0

             TX packets:2 errors:0 dropped:0 overruns:0 carrier:0

             collisions:0 txqueuelen:1000

             RX bytes:0 (0.0 B)  TX bytes:180 (180.0 B)

    lo        Link encap:Local Loopback

             inet addr:127.0.0.1  Mask:255.0.0.0

             inet6 addr: ::1%763860/128 Scope:Host

             UP LOOPBACK RUNNING  MTU:65536  Metric:1

             RX packets:166 errors:0 dropped:0 overruns:0 frame:0

             TX packets:166 errors:0 dropped:0 overruns:0 carrier:0

             collisions:0 txqueuelen:1

             RX bytes:12688 (12.3 KiB)  TX bytes:12688 (12.3 KiB)

    mybridge  Link encap:Ethernet  HWaddr 70:FF:76:1C:11:01

             inet6 addr: fe80::72ff:76ff:fe1c:1101%763860/64 Scope:Link

             UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

             RX packets:0 errors:0 dropped:0 overruns:0 frame:0

             TX packets:1 errors:0 dropped:0 overruns:0 carrier:0

             collisions:0 txqueuelen:1000

             RX bytes:0 (0.0 B)  TX bytes:90 (90.0 B)

    root@am57xx-evm:~# brctl show

    bridge name     bridge id               STP enabled     interfaces

    mybridge                8000.70ff761c1101       no              eth0

                                                           eth2

  • Hello

    Hi

    I updated to SDK 4.1. Bridging between eth0 and eth2 is now working.

    However between eth0 and hsr0 (made from eth2 and eth3) is NOT working. 

    Setup:

    - PC attached to eth0, 192.168.0.3

    - PC attached to eth2/3 via Redbox, 192.168.0.4

    - IDK5728

    Test  result: Pinging between PCs does not work!  However I can ping PCs from Sitara and I can ping bridge address from PC.

    Here's how I configured and what the command line output is 

    ifconfig eth0 0.0.0.0

    ifconfig eth2 0.0.0.0 down

    ifconfig eth3 0.0.0.0 down
    ifconfig eth2 hw ether 70:FF:76:1C:11:01
    ifconfig eth3 hw ether 70:FF:76:1C:11:01
    ethtool -K eth2 hsr-rx-offload on
    ethtool -K eth3 hsr-rx-offload on
    ifconfig eth2 up
    ifconfig eth3 up
    ip link add name hsr0 type hsr slave1 eth2 slave2 eth3 supervision 45 version 1

    ifconfig hsr0 0.0.0.0 up

    brctl addbr mybridge

    brctl addif mybridge eth0

    brctl addif mybridge hsr0

     ifconfig mybridge up

     Command line output:

    root@am57xx-evm:~# ifconfig eth0 0.0.0.0

    root@am57xx-evm:~# [   28.486524] cpsw 48484000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx

    [   28.494691] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

     

    root@am57xx-evm:~# ifconfig eth2 0.0.0.0 down

    [   35.211938] remoteproc remoteproc6: powering up 4b2b4000.pru0

    [   35.222743] remoteproc remoteproc6: Booting fw image ti-pruss/am57xx-pru0-pruhsr-fw.elf, size 9220

    [   35.231904] ti-pruss 4b280000.pruss: configured system_events = 0x0000060000500000 intr_channels = 0x00000095 host_intr = 0x00000115

    [   35.246069] remoteproc remoteproc6: remote processor 4b2b4000.pru0 is now up

    [   35.254174] remoteproc remoteproc7: powering up 4b2b8000.pru1

    [   35.262152] remoteproc remoteproc7: Booting fw image ti-pruss/am57xx-pru1-pruhsr-fw.elf, size 9672

    [   35.271292] ti-pruss 4b280000.pruss: configured system_events = 0x0060000000a00000 intr_channels = 0x0000012a host_intr = 0x0000022a

    [   35.283260] remoteproc remoteproc7: remote processor 4b2b8000.pru1 is now up

    [   35.291529] prueth pruss2_eth eth2: Link is Up - 100Mbps/Full - flow control off

    [   35.297899] net eth2: started

    [   35.348531] ti-pruss 4b280000.pruss: unconfigured system_events = 0x0000060000500000 host_intr = 0x00000115

    [   35.358322] remoteproc remoteproc6: stopped remote processor 4b2b4000.pru0

    [   35.365314] ti-pruss 4b280000.pruss: unconfigured system_events = 0x0060000000a00000 host_intr = 0x0000022a

    [   35.375103] remoteproc remoteproc7: stopped remote processor 4b2b8000.pru1

    [   35.382016] net eth2: stopped

    root@am57xx-evm:~# ifconfig eth3 0.0.0.0 down

    [   35.411741] remoteproc remoteproc6: powering up 4b2b4000.pru0

    [   35.417609] remoteproc remoteproc6: Booting fw image ti-pruss/am57xx-pru0-pruhsr-fw.elf, size 9220

    [   35.426819] ti-pruss 4b280000.pruss: configured system_events = 0x0000060000500000 intr_channels = 0x00000095 host_intr = 0x00000115

    [   35.438796] remoteproc remoteproc6: remote processor 4b2b4000.pru0 is now up

    [   35.445892] remoteproc remoteproc7: powering up 4b2b8000.pru1

    [   35.451745] remoteproc remoteproc7: Booting fw image ti-pruss/am57xx-pru1-pruhsr-fw.elf, size 9672

    [   35.460895] ti-pruss 4b280000.pruss: configured system_events = 0x0060000000a00000 intr_channels = 0x0000012a host_intr = 0x0000022a

    [   35.472862] remoteproc remoteproc7: remote processor 4b2b8000.pru1 is now up

    [   35.481133] prueth pruss2_eth eth3: Link is Up - 100Mbps/Full - flow control off

    [   35.487933] net eth3: started

    [   35.528498] ti-pruss 4b280000.pruss: unconfigured system_events = 0x0000060000500000 host_intr = 0x00000115

    [   35.538287] remoteproc remoteproc6: stopped remote processor 4b2b4000.pru0

    [   35.545280] ti-pruss 4b280000.pruss: unconfigured system_events = 0x0060000000a00000 host_intr = 0x0000022a

    [   35.555068] remoteproc remoteproc7: stopped remote processor 4b2b8000.pru1

    [   35.561981] net eth3: stopped

    root@am57xx-evm:~# ifconfig eth2 hw ether 70:FF:76:1C:11:01

    root@am57xx-evm:~# ifconfig eth3 hw ether 70:FF:76:1C:11:01

    root@am57xx-evm:~# ethtool -K eth2 hsr-rx-offload on

    root@am57xx-evm:~# ethtool -K eth3 hsr-rx-offload on

    root@am57xx-evm:~# ifconfig eth2 up

    [   70.951663] remoteproc remoteproc6: powering up 4b2b4000.pru0

    [   70.957536] remoteproc remoteproc6: Booting fw image ti-pruss/am57xx-pru0-pruhsr-fw.elf, size 9220

    [   70.966752] ti-pruss 4b280000.pruss: configured system_events = 0x0000060000500000 intr_channels = 0x00000095 host_intr = 0x00000115

    [   70.978722] remoteproc remoteproc6: remote processor 4b2b4000.pru0 is now up

    [   70.985815] remoteproc remoteproc7: powering up 4b2b8000.pru1

    [   70.991665] remoteproc remoteproc7: Booting fw image ti-pruss/am57xx-pru1-pruhsr-fw.elf, size 9672

    [   71.000799] ti-pruss 4b280000.pruss: configured system_events = 0x0060000000a00000 intr_channels = 0x0000012a host_intr = 0x0000022a

    [   71.012767] remoteproc remoteproc7: remote processor 4b2b8000.pru1 is now up

    [   71.021273] net eth2: started

    root@am57xx-evm:~# ifconfig eth3 up

    [   71.052864] net eth3: started

    root@am57xx-evm:~# ip link add name hsr0 type hsr slave1 eth2 slave2 eth3 supervision 45 version 1

    [  119.038850] device eth2 entered promiscuous mode

    [  119.078053] device eth3 entered promiscuous mode

    root@am57xx-evm:~# ifconfig hsr0 up

    [  132.021383] IPv6: ADDRCONF(NETDEV_UP): hsr0: link is not ready

    [  132.027440] IPv6: ADDRCONF(NETDEV_CHANGE): hsr0: link becomes ready

    root@am57xx-evm:~# brctl addbr mybridge

    root@am57xx-evm:~# brctl addif mybridge eth0

    [  142.351223] mybridge: port 1(eth0) entered blocking state

    [  142.357776] mybridge: port 1(eth0) entered disabled state

    [  142.377198] device eth0 entered promiscuous mode

    root@am57xx-evm:~# brctl addif mybridge hsr0

    [  142.411155] mybridge: port 2(hsr0) entered blocking state

    [  142.416610] mybridge: port 2(hsr0) entered disabled state

    [  142.422566] device hsr0 entered promiscuous mode

    root@am57xx-evm:~# ifconfig mybridge 192.168.0.20 up

    [  155.231364] mybridge: port 2(hsr0) entered blocking state

    [  155.236798] mybridge: port 2(hsr0) entered forwarding state

    [  155.242587] mybridge: port 1(eth0) entered blocking state

    [  155.248060] mybridge: port 1(eth0) entered forwarding state

    root@am57xx-evm:~# ifconfig

    eth0      Link encap:Ethernet  HWaddr FC:0F:4B:9C:12:A0

              inet6 addr: fe80::fe0f:4bff:fe9c:12a0%763860/64 Scope:Link

              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

              RX packets:431 errors:0 dropped:0 overruns:0 frame:0

              TX packets:45 errors:0 dropped:0 overruns:0 carrier:0

              collisions:0 txqueuelen:1000

              RX bytes:37496 (36.6 KiB)  TX bytes:3534 (3.4 KiB)

              Interrupt:93

     

    eth2      Link encap:Ethernet  HWaddr 70:FF:76:1C:11:01

              inet6 addr: fe80::72ff:76ff:fe1c:1101%763860/64 Scope:Link

              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

              RX packets:159 errors:0 dropped:83 overruns:0 frame:0

              TX packets:75 errors:0 dropped:0 overruns:0 carrier:0

              collisions:0 txqueuelen:1000

              RX bytes:10670 (10.4 KiB)  TX bytes:6238 (6.0 KiB)

     

    eth3      Link encap:Ethernet  HWaddr 70:FF:76:1C:11:01

              inet6 addr: fe80::72ff:76ff:fe1c:1101%763860/64 Scope:Link

              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

              RX packets:120 errors:0 dropped:57 overruns:0 frame:0

              TX packets:77 errors:0 dropped:0 overruns:0 carrier:0

              collisions:0 txqueuelen:1000

              RX bytes:8416 (8.2 KiB)  TX bytes:6418 (6.2 KiB)

     

    hsr0      Link encap:Ethernet  HWaddr 70:FF:76:1C:11:01

              inet6 addr: fe80::72ff:76ff:fe1c:1101%763860/64 Scope:Link

              UP BROADCAST RUNNING MULTICAST  MTU:1494  Metric:1

              RX packets:87 errors:0 dropped:107 overruns:0 frame:0

              TX packets:49 errors:0 dropped:0 overruns:0 carrier:0

              collisions:0 txqueuelen:1000

              RX bytes:4962 (4.8 KiB)  TX bytes:4100 (4.0 KiB)

     

    lo        Link encap:Local Loopback

              inet addr:127.0.0.1  Mask:255.0.0.0

              inet6 addr: ::1%763860/128 Scope:Host

              UP LOOPBACK RUNNING  MTU:65536  Metric:1

              RX packets:0 errors:0 dropped:0 overruns:0 frame:0

              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

              collisions:0 txqueuelen:1

              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

     

    mybridge  Link encap:Ethernet  HWaddr 70:FF:76:1C:11:01

              inet addr:192.168.0.20  Bcast:192.168.0.255  Mask:255.255.255.0

              inet6 addr: fe80::72ff:76ff:fe1c:1101%763860/64 Scope:Link

              UP BROADCAST RUNNING MULTICAST  MTU:1494  Metric:1

              RX packets:61 errors:0 dropped:0 overruns:0 frame:0

              TX packets:7 errors:0 dropped:0 overruns:0 carrier:0

              collisions:0 txqueuelen:1000

              RX bytes:4118 (4.0 KiB)  TX bytes:578 (578.0 B)

     

    root@am57xx-evm:~# brctl show

    bridge name     bridge id               STP enabled     interfaces

    mybridge                8000.70ff761c1101       no              eth0

                                                            hsr0

  • Christian,

    The issue needs deeper investigation with PSDK team but seems still there is some limitation.

    BR
    Tsvetolin Shulev
  • Hello Chris,

    Could you tell what is your use case? Are you trying to mimic a Redbox? From your description it appears to be a use case for Redbox where traditional devices such as a PC connected to GMAC interface (eth0 or eth1) wants to communicate with devices on the hsr network. Bridging over HSR will beat the purpose of PRU hw offload of HSR (duplicate detection and drop, node table update etc). This is because a bridge will configure all of the interface underneath it in promiscuous mode. i.e hsr0 and slaves devices under it (eth2 and eth3 for example). This means the PRU firmware now has to operate in promiscuous mode and will have to forward all of the unicast/multicast packets seen at the physical Ethernet ports (eth2/eth3) to the PRU Ethernet device bypassing the cut-through switch. The right way to handle this use case is to implement a Redbox to hook up the eth0 (CPSW) to the hsr interface.

    Redbox support is currently not available and is in the plan for future.

    Murali

  • Issue was taken offline but it was confirmed that IP routing is working for hsr0 interface.

    Best regards,

    Frank