AM2432: HSR and PRP storm prevention

Part Number: AM2432

Hi

I am using AM2432 with the Industrial SDK 11.00.00.08.

Our product uses the HSR and PRP stack. We are conducting Storm Tests to verify the robustness of our device (such as ARP Storm Requests).


At first, during storm requests this error appeared:

[LWIPIF_LWIP]ERROR: Rx Pbuf_alloc() in LWIPIF_LWIP_INPUT failure.!
                                                                  pbuf_free: p->ref > 0ASSERT: 85.697915s: C:/am243x-mcu-plus-sdk/mcu_plus_sdk/source/networking/lwip/lwip-stack/src/core/pbuf.c:pbuf_free:755: 0 failed !!!

I suppose it was because there wasn't any more memory left to allocate to the packets.

 

I noticed, however, that the Profinet demo enabled storm prevention, so I added the function:

{
...
    if(status == SystemP_SUCCESS)
    {
        RedProtocolStart(&hsrPrphandle, prusshandle);
        /*Load the default PCP to Queue mapping*/
        hsrprp_loadPCPtoQueueMap(emachandle, default_pcp_2_queue_map);
        hsrprp_enableBroadcastStormPrevention(emachandle);
    }
...
}

static int32_t hsrprp_enableBroadcastStormPrevention(ICSS_EMAC_Handle emacHandle)
{
    ICSS_EMAC_IoctlCmd ioctlParams;
    ICSS_EMAC_StormPrevention *stormPrevention;
    int32_t status;

    ioctlParams.command = ICSS_EMAC_STORM_PREV_CTRL_INIT_BC;
    ioctlParams.ioctlVal = NULL;

    status = ICSS_EMAC_ioctl(emacHandle, ICSS_EMAC_IOCTL_STORM_PREV_CTRL, ICSS_EMAC_PORT_1, &ioctlParams);

    status &= ICSS_EMAC_ioctl(emacHandle, ICSS_EMAC_IOCTL_STORM_PREV_CTRL, ICSS_EMAC_PORT_2, &ioctlParams);

    if (status == SystemP_SUCCESS)
    {
        stormPrevention = (ICSS_EMAC_StormPrevention *)((ICSS_EMAC_Object *)emacHandle->object)->stormPrev;
        stormPrevention[0].creditsBC = 100U;
        stormPrevention[1].creditsBC = 100U;

        ioctlParams.command = ICSS_EMAC_STORM_PREV_CTRL_RESET_BC;
        status = ICSS_EMAC_ioctl(emacHandle, ICSS_EMAC_IOCTL_STORM_PREV_CTRL, ICSS_EMAC_PORT_0, &ioctlParams);
    }

    if (status == SystemP_SUCCESS)
    {
        ioctlParams.command = ICSS_EMAC_STORM_PREV_CTRL_INIT_UC;
        status = ICSS_EMAC_ioctl(emacHandle, ICSS_EMAC_IOCTL_STORM_PREV_CTRL, ICSS_EMAC_PORT_1, &ioctlParams);
        status &= ICSS_EMAC_ioctl(emacHandle, ICSS_EMAC_IOCTL_STORM_PREV_CTRL, ICSS_EMAC_PORT_2, &ioctlParams);
    }

    if (status == SystemP_SUCCESS)
    {
        stormPrevention[0].creditsUC = 100U;
        stormPrevention[1].creditsUC = 100U;

        ioctlParams.command = ICSS_EMAC_STORM_PREV_CTRL_RESET_UC;
        status = ICSS_EMAC_ioctl(emacHandle, ICSS_EMAC_IOCTL_STORM_PREV_CTRL, ICSS_EMAC_PORT_0, &ioctlParams);
    }

    if (status != SystemP_SUCCESS)
    {
        DebugP_log("Failed to enable ICSS EMAC broadcast storm prevention\r\n");
    }

    return status;
}

I didn't add the credit refresh part that's in the specific Profinet task PN_background_task, because I saw that it's already handled in Lwip2Emac_periodicFxn().

In this way the failed assert no longer occurs. However, I noticed that it still doesn't reply to ping during the storms, whereas with Profinet it was able to respond even during a storm. 

How can I investigate this further? What am I missing?

 

Thank you, 

Best Regards,

Andrea

  • Hi,

    I'm adding more details since I cannot edit the post:

    In this way the failed assert no longer occurs. However, I noticed that it still doesn't reply to ping during the storms, whereas with Profinet it was able to respond even during a storm. 

    For HSR and PRP, I've noticed that from the beginning to the end of the storm, it never seems to respond to pings, whereas with Profinet it was able to respond occasionally (many requests failed, but some were successful).

    Is there a way to set up storm prevention with a filter specifying which types of packets to discard and which to keep?

    Thank you,

    Best Regards,

    Andrea

  • Hello Andrea,


    I am trying to reproduce this issue on my end. Meanwhile, could you please share more information about your test setup?

      1. What traffic generator are you using? (Linux, RTOS?)
      2. Are you sending ARP storms from both HSR/PRP ports simultaneously?
      3. What frame rate / packet size?

    Also, could you share a PCAP capture of the storm traffic so I can match the exact frame structure?

    Best regards,
    Rishi Kumar
    ICSS India

  • Hi Rishi,

    thank you for your reply.

    We're using a custom tool with Windows, testing one port at a time, with test speeds up to 100 Mbps, but it seems to give the error above even at just 30 Mbps and lower (without the storm prevention fix).

    I've attached the Wireshark trace, in which:

    - 192.168.2.4 with ac:d3:64:00:b5:c3 is the DUT

    - 192.168.2.2 with a8:2b:dd:35:67:b8 is the PC with the testing tool

    Thank you,

    Best Regards,

    Andrea

    hsrprp.zip

  • Hello Andrea,


    Thank you for your reply, 

    Are you using 100M/FD port configuration? Can you please provide me with the link speed and duplexity information that you are using? 

    Best regards,
    Rishi Kumar
    ICSS India

  • Hello Rishi,

    yes I am using 100Mbps in full duplex.

    Thank you,

    Best Regards,

    Andrea

  • Hello Andrea,

    Could you please mention which application you are using for this setup? If you can also provide the path, it will make things much clearer for me.

    Best regards,
    Rishi Kumar
    ICSS India

  • Hello Rishi,

    Unfortunately, I can't provide the tool because it was developed in-house.

    We might be able to accept these results, but I have two questions:

    1) Is it possible to tell whether unicast and broadcast storm prevention is actually implemented for HSR and PRP? For example, in this post I read that Ethernet/IP supports broadcast and multicast storm prevention but not unicast, could the same be true for HSR and PRP?

    2) Is there a way to configure storm prevention using a filter that specifies which types of packets to discard and which to keep (perhaps based on ethertype or other fields)? Or would I have to implement this myself via firmware?

    Thank you,

    Best Regards,

    Andrea

  • Hi Andrea, 

    ICSSM 100M EMAC HSR/PRP is deprecated. Please upgrade to the latest ICSDK 1G ENET-based HSR/PRP solution this should support upto 1G.

    BR
    JC

  • Hi Jayachandran,

    thank you for your reply.

    We'll be switching to the new stack soon. Could you still answer to those two questions, both with SDK 11 and with the new SDK using HSR PRP 1G?

    Thank you,

    Best Regards,

    Andrea

  • You can use the rate limiter option in 1G.

    BR
    JC