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: How does CPSW9G discard ARP packets?

Part Number: TDA4VM

Tool/software:

SDK8.6 , how do I discard ARP packets that pass through all CPSW9G ports?
ARP etherType policer is now added, I
can see that EtherType: 0806 was added successfully in the ALE log.
However, ARP packets are still sent. How do I discard ARP packets?

polInArgs.policerMatch.policerMatchEnMask |= CPSW_ALE_POLICER_MATCH_ETHERTYPE;
polInArgs.policerMatch.dstMacAddrInfo.portNum = CPSW_ALE_MACPORT_TO_ALEPORT(ENET_MAC_PORT_x);
polInArgs.policerMatch.etherType = 0x0806;  /*ARP*/
polInArgs.threadIdEn = true;
polInArgs.threadId = flowId;
polInArgs.peakRateInBitsPerSec = 0;
polInArgs.commitRateInBitsPerSec = 0;
ENET_IOCTL_SET_INOUT_ARGS(&prms, &polInArgs, &polOutArgs);
Enet_ioctl(hEnet, gEthAppObj.coreId, CPSW_ALE_IOCTL_SET_POLICER, &prms);

[MCU2_0]     27.948199 s:     19: EtherType: 0806
[MCU2_0]     27.948239 s:  RAW:[1 200000
[MCU2_0]     27.948279 s: 00 00000806]

[MCU2_0]     27.952373 s:    10: POLICER_ETHERTYPE,ALE Index: 19
[MCU2_0]     27.952412 s:    10: POLICER_THREAD,THREAD ID:0
[MCU2_0]     27.952455 s:    10: POLICER_STATS: Hit: 1, RedHit: 0, YellowHit: 0

  • I need:
    Packets are discarded if EtherType is 0x0806

  • Hi,

    ARP packets are Broadcast packets.

    If any broadcast packet is seen, it will be sent to all the Ports by default.

    can see that EtherType: 0806 was added successfully in the ALE log.

    ARP Ethertype is added because Ethfw will respond for the ARP requests on behalf of client cores.
    The response for ARP request will also be ARP type bu with unicast MAC of EthFw.

    If you don't want broadcast to be sent to all ports, we need to remove Broadcast ALE entry.
    It will stop all broadcast packets not only ARP.

    Best Regards,
    Sudheer

  • How to remove Broadcast ALE entry?
    I understand that adding POLICER is equivalent to whitelisting. If I zeroed out the port that I do not want to receive ARP packets and assigned the value to dstMacAddrInfo.portNum,
    Is the corresponding port unable to receive ARP broadcasts?

  • Hi,

    How to remove Broadcast ALE entry?

    You can comment  below from ethfw.c file.

    I understand that adding POLICER is equivalent to whitelisting.

    Yes, Also policer will manage the flow to whom it has to forward.
    It will not allow the packets inside from Host Port when no policer match. But, forwarding to external ports will be based on ALE entry.

    Also, default no policer match is forwarded to default flow which is Ethfw flow. If no policer match for the packet at Host Port, it will be sent to Host Port.

    Is the corresponding port unable to receive ARP broadcasts?

    No.
    Port from policer will be used to add ALE entry if entry not available for that MAC address. This is for forwarding the packet to Host Port.
    If Port is zero, and address is not added in ALE then Policer request will add ALE with Host Port default. To receive the packet to Host Port. If not packet will be dropped by ALE.

    Best Regards,
    Sudheer

  • we need to remove Broadcast ALE entry

    I turned off the broadcast on some ports through portMask.
    The port cannot send broadcasts but can receive broadcasts.
    How do I discard broadcast packets received by CPSW9G?

  • Hi,

    We can't stop packets receiving. 

    Once packet is received and no ALE match then packet can be dropped. But, we have Broadcast ALE entry so as per port mask packet will be sent out on other ports.


    Best Regards,
    Sudheer