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.

PA + NDK clash in sending packet to external world [c6670]

Hi Ti Folks,

                     PA + NDK clash in sending packet to externalw world. Hi All, i have initiated NDK on core0 and using PA directly on core1. So, from bootup,
core1 is sending ethernet packets consistently and periodically, due to some unknown reasons ARP request is sent to DSP and DSP responds back with ARP Response[please note this happens on core0 and NDK is doing the job] and suddenly periodic packet send has stopped completely. In other words, the moment NDK replies [sending arp reply packet to external world] on core0, core1 [though qmss queue push is happening periodically and consistently], i am not able to see packets.

Few questions on the above situation
1. Can independent PA application on coreX [X is not equal to 0] co-exist with NDK running on core0. what are the considerations [in terms of hardware semaphore,critical section..etc] to be taken care in such situations.
2. Kindly let me know if i am missing any obvious points/steps, when doing such experimentation/approach.


Thanks
RC Reddy

  • Hi, RC:

    It is not recommended to mix NDK and PA LLD at keystone devices since NDK is designed to handle all network traffic. The current implementation of NDK NIMU(nimu_eth.c under packages\ti\transport\ndk\nimu\src) will add two entries at the L2 LUT table, one for broadcast packet (0xFFFFFFFFFFFF) and one for device MAC address. I believe that it can be enhanced to add desired multicast address as well.  Therefore, all boradcast and unicast MAC packets with the device MAC address will be delivered by PASS to NDK through NDK queue.

    It is possible to use NDK for most of traffic and use PA LLD with your own network software for selected fast-path traffic. In this case, you need to find out all resources, such as CPPI flows, CPPI descriptors, and LUT entires used by NDK and reserve them for NDK. You do not need to updtae NDK or NDK NIMU if your desired fast-path traffic use a different MAC address. Otherwise, you will need to modify the NDK NIMU code to allow the traffic with the device MAC address to be forwarded to next LUT engine for further classification. if there is no match, it should be delivered to NDK and if there is match of your fast-path rules, it should be delivered to your network stack.

     

    Add_MACAddress
    (
        paEthInfo_t         *ethInfo,
        paRouteInfo_t       *routeInfo
    )
    {
        int32_t              j;
        uint16_t   cmdSize;
        Qmss_Queue          cmdReplyQInfo;

        paRouteInfo_t       nFailInfo =     {   pa_DEST_DISCARD,                            /* Toss the packet  */
                                                        0,                                          /* Flow Id = dont care */
                                                        0,                                          /* queue = dont care */
                                                        0,                                          /* mutli route = dont care */
                                                        0,                                          /* swinfo0 = dont care */
                                                        0,                                          /* swinfo1 = dont care */
                                                        0,                                          /* customType = pa_CUSTOM_TYPE_NONE */         \
                                                        0,                                          /* customIndex: not used */        \
                                                        0,                                          /* pkyType: for SRIO only */       \
                                                        NULL                                        /* No commands */
                                                    };
        paCmdReply_t        cmdReplyInfo =  {   pa_DEST_HOST,                               /* Replies go to the host */
                                                        0,                                          /* User chosen ID to go to swinfo0 */
                                                        0,                                          /* Destination queue */
                                                        0                                           /* Flow ID */
                                                    };

    ==>

    paRouteInfo_t       nRouteInfo1 =     {  pa_DEST_CONTINUE_PARSE_LUT1,                            /* Toss the packet  */
                                                        0,                                          /* Flow Id = dont care */
                                                        0,                                          /* queue = dont care */
                                                        0,                                          /* mutli route = dont care */
                                                        0,                                          /* swinfo0 = dont care */
                                                        0,                                          /* swinfo1 = dont care */
                                                        0,                                          /* customType = pa_CUSTOM_TYPE_NONE */         \
                                                        0,                                          /* customIndex: not used */        \
                                                        0,                                          /* pkyType: for SRIO only */       \
                                                        NULL                                        /* No commands */
                                                    };

    ...

    memcpy(&nFailInfo, routeInfo, sizeof(paRouteInfo_t));

        retVal  =   Pa_addMac  (res_mgr_get_painstance(),
                                pa_LUT1_INDEX_NOT_SPECIFIED,
                                ethInfo,
                                &routeInfo1,
                                &nFailInfo,
                                &gPaL2Handles[0],
                                (paCmd_t) pHostDesc->buffPtr,
                                &cmdSize,
                                &cmdReplyInfo,
                                &cmdDest);

    Please note that this is just a sample code to show you the idea. You may need to update nmiu_eth.c differently based on your specific use case.

    Best regards,

    Eric

     

  • Hi Eric,

                mmm.probably my question is not clear. I am talking about PA and NDK sending packets to external world [i mean to-network direction]. 

    1.core0 is using NDK and trying to send using sock_send()

     2. core1 is using PA and trying to push qmss_queue push to 648. [please note core1 is just doing send in "to-network" direction]

    in the above scenario, what considerations has to be taken care in terms of resources sharing PA_HW_SEM, CPPI, QMSS and others.

    on an another note, i was able to solve my problem with explicit ARP command being issued, that is STOPPING THE ARP send and ARP REPLY, so the "stuck/hang/race condition" is avoided. so far, it works good. but still, i would like to root the issue as what needs to be taken care when both PA and NDK are trying to send to external world [to-network direction].

    Thanks

    RC Reddy

  • Hi, RC:

    I still do not understand what are you trying to do. Do you plan to use NDK to process all from-network traffic? But you want to send some packets from core1 to queue 648 without invoking socket_send()? I am not aware of any restrictions for this type of operation. You should ba able to push packets into queue 648 from multiple cores. I will let you know if I find more information.

    Best regards,

    Eric

     

     

     

     

  • Hi,

       Thanks for quick reply. Yes, now this time you are able to get my question "Do you plan to use NDK to process all from-network traffic? But you want to send some packets from core1 to queue 648 without invoking socket_send()?", This is what i am trying to achieve.

    1. In that ARP send situtation, there is some clash between NDK and PA, as i put earlier. For time being, i am able to get on with manual arp configuration, i still need to get to root of the issue.

    once i get the root cause, will post back to this same thread.

    Thanks

    RC Reddy