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.

Am335x Dual EMAC Ethernet - Fails when both ports are up

Other Parts Discussed in Thread: AM3354

We have a custom board with an AM3354 processor. We recently upgraded to a 3.2 kernel (based upon the TI PSP 11) that supports Dual EMAC mode. Our hardware has three Ethernet ports, eth0 on an external MAC/PHY, and eth1 and eth2 on the Dual EMAC ports of the AM335x. The system comes up with ipconfig showing all three ports, and I can ping all three from an external machine. All three ports are on different subnets.

We have a test application that uses iptables, ip route and arp to force traffic from eth0 to eth1 or eth2 to go over the external lines, rather than be routed internally. It is based on this example:

http://serverfault.com/questions/127636/force-local-ip-traffic-to-an-external-interface/128680#128680

The test program works from eth0 to eth1, as long as the eth2 link is not up. If I connect both eth1 and eth2 to a switch, ping from eth0 to eth1 will fail.

Similarly, the test passes from eth0 to eth2, but only if the eth1 link is down.

Any ideas about what's going on?

I think I need to look at what the CPSW driver does in the success and failure cases. What can I look at to see those internals?

thanks,

  • Hi,
    Able to access both eth1 and eth2 when you down the eth0 ?
  • Thanks for the reply. I think disabling eth0 misses the point, since eth0 is the device that is external to the Am335x device, therefore not involved with the cpsw internals.

    I have continued looking into this. I attempted to use the SIOCSWITCHCONFIG ioctl commands to display the CPSW internals. This fails because in /drivers/net/ethernet/ti/cpsw.c all the ioctl commands provided by cpsw_switch_config_ioctl() are only included if CONFIG_TI_CPSW_DUAL_EMAC is not defined.

    What is the recommended technique for debugging a potential CPSW issue when using Dual EMAC? 

  • The issue was that a dual-EMAC Ethernet ports must NEVER see traffic from the other port.

    They are not really two ports, but one port with an internal switch. If the internal switch sees traffic originating from the one port be present at the other, it builds an internal routing rule that prevents either port from working.

    I used a managed switch with VLANs that allows a third port to communicate with either of the dual emac ports, but prevents any traffic from one dual emac port to the other.

    It makes some sense that the ports cannot be both connected to a simple switch because there is no obvious case where a processor needs two connections to the same network.

    For debugging, I simply changed /drivers/net/ethernet/ti/cpsw.c to allow the SIOCSWITCHCONFIG ioctl command, which appears to work fine in dual-EMAC mode. I can't see why it was removed.