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.

[FAQ] AM2634: Issues in receiving/sending multicast frames on AM26x devices

Part Number: AM2634

Hi experts,

  • I send a multicast frame from the AM26x device but it is not visible on wireshark
  • I send a multicast frame to the AM26x device but my application does not receive it.

Is there an issue in the CPSW hardware or the Ethernet driver with handling multicast frames? How can I check for drops and fix the transmit/receive issue?

  • Hi,

    When receiving the multicast packets on AM26x devices the issue mostly occurs when the multicast ALE entry is not present in the ALE table or the entry has an incorrect portMask. If the multicast address is not known to the CPSW ALE, the packet will be processed based on UnknownMcastMembership list and it might be dropped even before handing it to the ethernet driver. If this is the case, then the CPSW stats will show the ALE drops count incrementing.

    To check CPSW stats, you can use the gel files via CCS:

    1. Connect the R5F core after you launch your target configuration
    2. Load and run your application.
    3. Halt the core when you want to run the gel scripts
    4. Go to Scripts → CPSW Statistics print → cpsw_3g_statsprint_nonzero

      Here, check for ALE DROPs (should be zero in ideal case). 
      To read more about the CPSW stats, refer TRM section "CPSW Network Statistics"

    To check the ALE table, you can use the gel files via CCS:

    1. Connect the R5F core after you launch your target configuration
    2. Load and run your application.
    3. Halt the core when you want to run the gel scripts
    4. Go to Scripts → CPSW Statistics print → cpsw_print_ale_table_3g

    The issues mostly occur because the Multicast entry is missing from the ALE table. So the packet will be dropped by the CPSW ALE.  To avoid this issue, you can add your multicast address to the ALE table as follows:

    MCU_PLUS_SDK (enet-cpsw)

    Use the Enet IOCTL command to add the MAC address to the table

    CpswAle_SetMcastEntryInArgs setMcastInArgs;
    uint8_t mcastMacAddr[] = {0x01, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA};
    Enet_IoctlPrms prms;
    uint32_t setMcastOutArgs;
    int32_t status = ENET_SOK;
    memset(&setMcastInArgs, 0, sizeof(setMcastInArgs));
    memcpy(&(setMcastInArgs.addr.addr[0U]), &(mcastMacAddr[0U]), sizeof(setMcastInArgs.addr.addr));
    setMcastInArgs.info.super = false;
    setMcastInArgs.info.numIgnBits = 0U;
    setMcastInArgs.info.fwdState = CPSW_ALE_FWDSTLVL_FWD;
    setMcastInArgs.info.portMask = CPSW_ALE_ALL_PORTS_MASK;
    ENET_IOCTL_SET_INOUT_ARGS(&prms, &setMcastInArgs, &setMcastOutArgs);
    ENET_IOCTL(hEnet, EnetSoc_getCoreId(), CPSW_ALE_IOCTL_ADD_MCAST, &prms, status);
    if (status != ENET_SOK)
    {
       EnetAppUtils_print("failed to add a new mcast entry to ALE table: %d\n", status);
    }

    MCAL SDK (MCAL Eth)

    Use the Eth_UpdatePhysAddrFilter() API to add the MAC address to the table.

    Std_ReturnType      retVal    = (Std_ReturnType) E_NOT_OK;
    uint8_t mcastMacAddr[] = {0x01, 0x00, 0x5E, 0xAA, 0xAA, 0xAA};
    retVal = Eth_UpdatePhysAddrFilter(pEthConfigPtr->ctrlIdx,
                                           gTestMacAddr,
                                           ETH_ADD_TO_FILTER);

    After adding the above steps, rebuild your example and load and run again. Run the ALE gel script to get the dump of the ALE table and check if the Multicast MAC address is now present in the table.

    When sending packets from the AM26x device, if the packets are not visible on the wire:

    1. Make sure that both MAC ports and the HOST ports are members of the Multicast address group.
    2. The same code snippet shared above can be used to add the Multicast address to the ALE table.
    3. Check the portMask is set appropriately to route the packet to correct MAC and host ports.

    Regards,
    Shaunak