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.

TMS320C6678: Ethernet: ALE incoming packet filtering

Part Number: TMS320C6678

Hi,

I'm trying to use the ALE to filter the incoming packet not directed to my Ethernet MAC addresses (I use both the external ethernet port). When I connect only one port it seems to work, but when I connect two port the packet are forwarded from one port to the other.

Since both ports are connected to the same switch and are in the same subnet, the C6678 generate an "infinite loop", since a packet entering port1 in forwarded to port 2 and then back to port1 by the switch.

A configure the ALE as follows:

	  uint32_t ale_ctrl=
	      (1<<4) |   //no learn 
	      (3<<0);  //3=Forward, 2=learn, 1=block, 0=disable

	  hCpsw->ALE_PORT_CONTROL_REG[0]=ale_ctrl;
	  hCpsw->ALE_PORT_CONTROL_REG[1]=ale_ctrl;
	  hCpsw->ALE_PORT_CONTROL_REG[2]=ale_ctrl;


		CSL_CPSW_3GF_ALE_MCASTADDR_ENTRY mc;
		memset(mc.macAddress, 0x0FF, 6);
		mc.mcastFwdState=3;
		mc.portMask=1;
		mc.superEnable=0;
		CSL_CPSW_3GF_setAleMcastAddrEntry(0, &mc);

		CSL_CPSW_3GF_ALE_UNICASTADDR_ENTRY ucastAddrCfg;
	    ucastAddrCfg.ucastType      =      ALE_UCASTTYPE_UCAST_NOAGE;   // Add a permanent unicast address entryALE_UCASTTYPE_UCAST_NOAGE.
	    ucastAddrCfg.secureEnable   =      FALSE;
	    ucastAddrCfg.blockEnable    =      FALSE;
	    ucastAddrCfg.portNumber     =      0;   // Add the ALE entry for this port

	    memcpy(ucastAddrCfg.macAddress, &bsp_c66_eth_drv_mac_adressess[1].slices[0], 6);    // Set the MAC address 1
	    CSL_CPSW_3GF_setAleUnicastAddrEntry(1, &ucastAddrCfg);

	    ucastAddrCfg.portNumber     =      0;   // Add the ALE entry for this port
	    memcpy(ucastAddrCfg.macAddress, &bsp_c66_eth_drv_mac_adressess[2].slices[0], 6);    // Set the MAC address 2
	    CSL_CPSW_3GF_setAleUnicastAddrEntry(2, &ucastAddrCfg);

Any suggestion?

Thanks

  • Hi Alberto,

    The team is notified. They will post their feedback directly here.

    BR
    Tsvetolin Shulev
  • Can you please post which SDK Version are you using?

    Best Regards,
    Yordan
  • Hi,

    I'm using old pdk_C6678_1_0_0_12 (I checked against with pdk_C6678_1_1_2_6 and I see there are not difference).


    CGT 7.4.22
  • Any suggestion?

    Just as a remainder, I'm trying to use the ALE to filter all incoming MAC addresses but:
    - broadcast
    - MAC address of my Ethernet ports 1 and 2
    And I don't want the C6678 acting as a bridge, that is it has not to route incoming packets from a ports to the other (including broadcast), since my ports are both connected to the same sub-network, with the same external Ethernet switch.
  • Hi,

    Sorry for the late, we are still working on this and trying to update you in 1-2 days.

    Regards, Eric
  • Hi,

    We have some discussion here. The CPSW of C6678 is a 3-port switch (two EMAC and 1 host port), if you connect the two EMAC ports with end equipment, it should work. The switch is a layer 2 switch, it only care about the MAC address, regardless of the subnet. "Since both ports are connected to the same switch"===> do you mean the both ports are connected to an external switch?

    Regards, Eric
  • Hi,

    Yes, both EMACs are connected to the same external switch (that is also connected to a PC).

    In my understanding, with ALE in bypass, all incoming packets goes from EMACs to host port and then to the packet DMA and directly to my RX queue.

    With ALE enable, I setup:
    1. The broadcast address, with port mask =1 that it go to host port only (not route also to the other EMAC port )
    2. Unicast address for EMAC 1
    3. Unicast address for EMAC 2

    I correctly receive to my RX queue only broadcast and packet with MAC address matching EMAC 1 or EMAC 2 ALE entries. Apparently these packets are not replicated on the non-receiving port (say for instance, if the packet arrive to EMAC 1 it is not replicated to EMAC 2).

    When a non-matching MAC address is received, the packet it replicated on the non-receiving port, say for instance that a packet received on EMAC 1 will be replicated to EMAC 2. This is the unexpected and unwanted behavior.

    In the worst scenario, a MAC address not present on the network can generate an infinite loop. Example:
    - The DSP generate a packet with a non valid MAC, and emit it from EMAC 1
    - the external switch receive the packet on its port 1, and replicate it to all the other port
    - external switch port 2 is connected to DSP EMAC 2
    - The DSP receive the packet on EMAC 2 and since it does not match, it automatically replicate it on EMAC 1
    - The extern switch receive on its port 1 and... looping, since the switch never learn the to which port associate that MAC address
  • Hi,

    In the setup, two switches (C6678 CPSW, an external switch) are connected with two cables, this is not allowed in a network.

    Regards, Eric
  • Hi,
    I agree my configuration is uncommon (and I use it only in a special test setup), anyway in my operative configuration I cannot let the C6678 to duplicate the packets from one EMACS to the other. It the test configuration this is evident, but I suppose this append even if I use two external switches (well, in this case there is not the looop)

    With my ALE setup, the broadcast message are not duplicated and goes only to the host port. it appends, only to packets with a MAC address that does not match any of the MAC addresses I setup in the ALE.

    Where is a way to prevent this? There is a way to setup the ALE to simple drop the packets not matching my MAC addresses?
  • Hi,

    Any news?

    There is a way to setup the ALE to simple drop the packets not matching my MAC addresses and the broadcast address?

    There is a way to setup the ALE to never forward a packet from one EMACS to the other, but only to the HOST port when the incoming MAC address match my MACs (EMAC1 and EMAC2) and the broadcast addresses?

    Even if the response is "NO", a reply will be appreciated, so I can stop to try to find the good setup.

    Thanks
  • Hi,

    You may look at 2.3.6 Address Lookup Engine (ALE) Submodule Architecture of GbE user guide if any solution.

    Regards, Eric
  • Thanks but I have to admit that I find that documentation a bit hard to understand. The result of that reading is the setup I had posted and it does not work. That's why I ask for help here... hoping for an example (or at least a suggestion) to show me the right setup using CSL.