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.

TDA4VM: issue about configuring ALE to disable special ARP anouncement broadcast message to special port.

Part Number: TDA4VM

Hi TI expert,

My project use sdk8.2 with QNX+RTOS environment, the connection of ethernet is as following:

I'm having problems with how to use the ALE feature As I know, there exists a MAC/IP address on R5F 2_0 /RTOS in SDK, which is used for PTP and so on. So at startup, there will be an ARP announcement broadcast message out from R5F 2_0 to LAN. But this IP address is not allowed appeared outside of TDA4. In my project, not allowed foward to port3.

I think maybe ALE is the best solution. Via configure ALE rule to disable this special message pass to PORT3 to outside, but allow it pass to PORT1 for debug. And not affect other ARP broadcast message pass to PORT3 at the same time.

I still don't deeply understand about ALE, although I have seen the following docs. https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1011237/faq-tda4vm-how-to-configure-cpsw-5g-9g-ale

1, I see in SDK, some just write an enter, and some write enter and policer. Could you please tell me, what is an enter? and what is a policer? What's the relationship of this two part?

2, For this issue, I see that, there already is an enter&&policer for ARP broadcast in SDK, that is ARP broadcast package will be forwarded to all port. And there also already an enter about R5F core MAC address to host port.

>>>>ALE entries:

[MCU2_0]    186.152860 s:      7: Address: ffffffffffff, Member:1ff Su=0 FWDSTLVL=0 IGNMBITS=0
... ..
[MCU2_0]    186.154004 s:     12: Address: 70ff761d92c2, Port: 000 Se=1 Bl=0 TOUCH=0 AGE=0 TRUNK=0		#this is R5F MAC
[MCU2_0]    186.154166 s:     13: EtherType: 0806
...


>>>>ALE policer:
[MCU2_0]    186.161416 s:     0: POLICER_DST_MAC,ALE Index: 7
[MCU2_0]    186.161467 s:     0: POLICER_ETHERTYPE,ALE Index: 13
[MCU2_0]    186.161519 s:     0: POLICER_THREAD,THREAD ID:3
[MCU2_0]    186.161580 s:     0: POLICER_STATS: Hit: 1, RedHit: 0, YellowHit: 0
...

I don't know how change or add ALE. when I write an enter, it is always covered by above SDK enter. so Do I just add an policer? but the dest MAC address already exist. Could you please help me. give me an example or some advice ?

Thanks.

 

  • Hi,

    1, I see in SDK, some just write an enter, and some write enter and policer. Could you please tell me, what is an enter? and what is a policer? What's the relationship of this two part?

    Entry means it could be ALE (Address lookup engine) or an Policer rule.
    CPSW9G in TDA4VM supports 1024ALE entries (which stores MAC Address/ VLAN Info/ Ether type/ OUI Type/ IP Address...etc) and also defines the port forwarding rules based on packet fields match.
    Also, 96 Policer rules supported to route the packets from ports to Server(Ethernet Firmware) or Client cores (MCU2_1, A72..).

     Default ALE entry for Broadcast MAC address added by Ethernet Firmware with Port Mask in ALE entry as all Ports of CPSW9G. Which means if any packet found with Broadcast address as destination MAC address it will be forwarded to all ports other than the receiving port.

    If you want you can remove ALE entry and add customized ALE entry please refer to below FAQs.

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1210631/faq-tda4vm-how-to-forward-broadcast-frames-to-hlos-qnx-running-on-a72-by-default
    (Follow step-1 to suppress ALE entry from Ethernet Firmware)

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1011237/faq-tda4vm-how-to-configure-cpsw-5g-9g-ale
    For addition of ALE entries and Policer rules.

    Best Regards,
    Sudheer

  • Thank you very much for your reply.

    I have the following questions.

    1, There is a mcu2-0 entry function: EnetAppUtils_addHostPortEntry(), which the function I think is to match dstMAC(mcu2-0 MAC) and forward to hostport(MAC2-0).

     [MCU2_0]:  12: Address: 70ff761d92c2, Port: 000 Se=1 Bl=0 TOUCH=0 AGE=0 TRUNK=0

    In the function, it configure setUcastInArgs.info.secure = true. The meaning of secure I see from header file as following.

    This means that if the mcu2-0 MAC address is as source address, it will be dropped if receive port is not eque entry port: hostport(mcu2-0).

    But I can grub the ARP announcement message which the source address is MUC2-0 MAC address from port1 and port 3. Why does this message not dropped ?

    Is it because the ARP message is also belong to another policer in function: EthFwCallbacks_setupArpRoute()? Priority ? The dump info as follows:

     [MCU2_0]    374.040675 s:      7: Address: ffffffffffff, Member:1ff Su=0 FWDSTLVL=0 IGNMBITS=0
     [MCU2_0]    374.041743 s:     12: Address: 70ff761d92c2, Port: 000 Se=1 Bl=0 TOUCH=0 AGE=0 TRUNK=0
     [MCU2_0]    374.041910 s:     13: EtherType: 0806
     ...
     [MCU2_0]    374.046623 s:     0: POLICER_DST_MAC,ALE Index: 7
     [MCU2_0]    374.046677 s:     0: POLICER_ETHERTYPE,ALE Index: 13
     [MCU2_0]    374.046729 s:     0: POLICER_THREAD,THREAD ID:3
     [MCU2_0]    374.046792 s:     0: POLICER_STATS: Hit: 1, RedHit: 0, YellowHit: 0

    2, I want add a rule to current ALE: If the src-MAC address match MCU2-0 MAC, and dst-MAC match broadcast, then is should be dropped at PORT3(othert port should forward normally).
    I find that the above two MAC address has already be used at TI SDK, and I need to reserve original rule in my project :
        (1). If the dst-MAC address match MCU2-0 MAC, then forward to hostport(mcu2-0 core). realized at entry function: EnetAppUtils_addHostPortEntry().
        (2). If the dst-MAC address match broadcast, and ethernet type match ARP, then forward to all port. realized at entry functon: EthFw_setAleBcastEntry() and policer function: EthFwCallbacks_setupArpRoute().

    Can this requirement of mine be realized ?  I find that if I add new entry of mcu2-0 for my need. it will cover original rule of above (1). Can you give me some advise ?

    Thanks.

  • Hi,

    But I can grub the ARP announcement message which the source address is MUC2-0 MAC address from port1 and port 3. Why does this message not dropped ?

    MCU2-0 or any other core transmission will be Rx of Host Port.
    In above case Source MAC address is mapped with Host Port and secure was set. As it is valid scenario because Host Port only receiving the packet with source address added in ALE.

    If you send packet same packet from External network to any of external port then that packet will be dropped, as packet Rx port is Not the Host Port.

    [MCU2_0]    374.040675 s:      7: Address: ffffffffffff, Member:1ff Su=0 FWDSTLVL=0 IGNMBITS=0

    In above ALE entry for Broadcast added such that Port Mask as 0x1ff (Masking all ports bit fields), which means if broadcast is identified forward it to all ports.

    2, I want add a rule to current ALE: If the src-MAC address match MCU2-0 MAC, and dst-MAC match broadcast, then is should be dropped at PORT3(othert port should forward normally).

    You can Un-Mask Port-3 bit filed in above (0x1f7), so Broadcast packets will not be forwarded to Port-3.

    Best Regards,
    Sudheer

  • Hi Sudheer,

    You can Un-Mask Port-3 bit filed in above (0x1f7), so Broadcast packets will not be forwarded to Port-3.

    Yes, followig your set, I have test  and verified that broadcast packets will not be forwarded to Port3. 

    But also, this will block all broadcast packets from A72 besides MCU2-0 via hostport. 
    In my project, Most network applications run on the A72 core. And required to communicate with the outside world via port3. 
    So, I just need the broadcast packets from MCU2-0 not be forwarded to Port3. not include A72 core.
    Is there any solution ?

    Best Regards,
    Jingang

  • Hi Sudheer,

    I have do the following test:
    I add a MACSRC matching followed MACDST and ethernet TYPE. and set the src MAC address is A72 core.
    The result is that I still can get MCU2-0 ARP announcement message from Port3.


    Dumping the related entry and policer:

    MCU2_0]     17.794137 s:      7: Address: ffffffffffff, Member:01b Su=0 FWDSTLVL=0 IGNMBITS=0
    [MCU2_0]     17.795340 s:     13: EtherType: 0806
    [MCU2_0]     17.795528 s:     14: Address: 02df53000002, Port: 000 Se=1 Bl=0 TOUCH=0 AGE=0 TRUNK=0
    ...
    [MCU2_0]     17.799926 s:     0: POLICER_DST_MAC,ALE Index: 7
    [MCU2_0]     17.800009 s:     0: POLICER_SRC_MAC,ALE Index: 14
    [MCU2_0]     17.800062 s:     0: POLICER_ETHERTYPE,ALE Index: 13
    [MCU2_0]     17.800113 s:     0: POLICER_THREAD,THREAD ID:3
    [MCU2_0]     17.800175 s:     0: POLICER_STATS: Hit: 0, RedHit: 0, YellowHit: 0

    Getting MCU2-0 ARP announcement message from Port3 via wireshark:

    I think it should work, but actually not. I don't know why. Can you help to figure out the reason?

    Best Regards,
    Jingang

  • Hi,

    But also, this will block all broadcast packets from A72 besides MCU2-0 via hostport.

    Yes, ALE rule such that it will not forward Broadcast packet to Port-3 as we removed Port-3 Mask from entry.

    So, I just need the broadcast packets from MCU2-0 not be forwarded to Port3. not include A72 core.
    Is there any solution ?

    It is not to block packet forwarding based on client/application core specific from ALE. ALE Rules applies only on Ports of Ethernet Switch.

    Best Regards,
    Sudheer

  • Hi Sudheer,

    It is not to block packet forwarding based on client/application core specific from ALE. ALE Rules applies only on Ports of Ethernet Switch.

    Sorry, I still do not understand the ALE deeply.
    Can I interpret it as iptables in linux ? it check some conditions and make an action.
    In my case, Conditions are packets from Port0 to Port3, SRC MAC is MCU2-0's, DST MAC is broadcast.
    And the action is Drop When these conditions are met.
    Can't this case be implemented with ALE?

    Best Regards,
    Jingang

  • Hi,

    Sorry, I still do not understand the ALE deeply.

    In case of Multicast/Broadcast packets ALE will decide on what and all ports these packets has to be forwarded. It is based on Port Mask in ALE entry.
    If set Port with all ports, If any packet identified with matching Multicast/Broadcast address based on ALE entry then ALE will forward it in all Ports.

    As ALE is forwarding the above Multicast/Broadcast packet all ports, Packet visible on all external Ports. In case of Host Port based on policer rules it will be forwarded to specific client (like A72/Ethfw).

    In my case, Conditions are packets from Port0 to Port3, SRC MAC is MCU2-0's, DST MAC is broadcast

    Here, SRC MAC and DST MAC policer rules apply only when packet is at Host Port (Internal port for consumption of packet by any application) and how to proceed further.
    It will not be applicable on External Ports.

    Can't this case be implemented with ALE?

    Your use-case may not be possible with ALE, as when ALE identified Broadcast packet it will forward to all ports as per Port Mask. If Port-3 mask is set then it will forward to Port-3 so, packet will be visible on external device connected to Port-3.

    Best Regards,
    Sudheer