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.

NDK and gRxFlowHnd?

Hi All,

           In <PDK Installation directory>\packages\ti\transport\ndk\nimu\src\nimu_eth.c

what i see is gRxFlowHnd which tells the following

1. what is the RXQ onto which, the received descriptors are pushed/dumped.

2. which RXFDQ to pick up free descriptors for PKTDMA.

i see a rx flow Handle [gRxFlowHnd ] created in setupRx.

but when configuring the Add_MACAddress, what i see is 0, /* Flow ID 0 */

paRouteInfo_t routeInfo = { pa_DEST_HOST, /* Route a match to the host */
0, /* Flow ID 0 */
0, /* Destination queue */
-1, /* Multi route disabled */
0xaaaaaaaa, /* SwInfo 0 */
0, /* SwInfo 1 is dont care */
0, /* customType = pa_CUSTOM_TYPE_NONE */ \
0, /* customIndex: not used */ \
0, /* pkyType: for SRIO only */ \
NULL /* No commands */
};

what i understand is flow id should be given as (u8)Cppi_getFlowId(gRxFlowHnd);

 can any please explain me how PKTDMA is fetching descriptors from RXFDQ and pushing onto RXQ without gRxFlowHnd explicity being given to routeInfo. 

Thanks

RC Reddy

  • Hello,

    If you look into the setup of the RX flow

    rxFlowCfg.flowIdNum             =   CPPI_PARAM_NOT_SPECIFIED;

    Ans this is the only flow set in the example. With this setting, when we make a call to

    if ((gRxFlowHnd = Cppi_configureRxFlow (res_mgr_cppi_get_passhandle(), &rxFlowCfg, &isAllocated)) == NULL)

    Flow ID of 0 is picked and this is the reason why the example still works.

    Regards,

    Kishore.

  • Hi Kishore,

                       Thanks for reply. I agree that just because it is single flowId it might be working. 

    I have built a code built [with multiple flowids], wherein i am not specifying flowId in the routeInfo and it is still working [sorry, i cannot post the code here]. But in my code all along i have created many flowids and used CPPI_PARAM_NOT_SPECIFIED in rxFlowCfg.flowIdNum and all the PKTDMA's still work.

    Hence i formulate the theory like this [let me take an example]

    1. lets say i create a flow Handle gRxFlowHnd_1, gRxFlowHnd_2, gRxFlowHnd_3.

    2. within the same context, if i use rx Flow Configts rxFlowCfg_1.flowIdNum, rxFlowCfg_2.flowIdNum, rxFlowCfg_3.flowIdNum

    3. Below is a sample rough code. Is below result correct Can you please confirm this with your experts ???

    creation of gRxFlowHnd_1, 

    creation of gRxFlowHnd_2, 

    creation of gRxFlowHnd_3.

    rxFlowCfg_1.flowIdNum             =   CPPI_PARAM_NOT_SPECIFIED; This one will take gRxFlowHnd_3

    rxFlowCfg_2.flowIdNum             =   CPPI_PARAM_NOT_SPECIFIED; This one will take gRxFlowHnd_2

    rxFlowCfg_3.flowIdNum             =   CPPI_PARAM_NOT_SPECIFIED; This one will take gRxFlowHnd_1

    4. This one i am sure [my built example code is on this model]

    creation of gRxFlowHnd_1, 

    rxFlowCfg_1.flowIdNum             =   CPPI_PARAM_NOT_SPECIFIED; This one will take gRxFlowHnd_1

    creation of gRxFlowHnd_2, 

    rxFlowCfg_2.flowIdNum             =   CPPI_PARAM_NOT_SPECIFIED; This one will take gRxFlowHnd_2

    creation of gRxFlowHnd_3.

    rxFlowCfg_3.flowIdNum             =   CPPI_PARAM_NOT_SPECIFIED; This one will take gRxFlowHnd_3

    5. Also i think it is required to be documented [in UG] as what happens in point 3. how default flowid number [CPPI_PARAM_NOT_SPECIFIED] is taken in what context??

    Thanks

    RC Reddy

  • Hi, RC:

    It seems like that you mis-understood what Kishore meant. When you create a Rx Flow you can specify the flow Id or allow the LLD to pick a flow Id by setting flowIdNum        =   CPPI_PARAM_NOT_SPECIFIED.  Therefore, if you create three CPPI flows with flowId not specified in order, the flowId will be 0, 1 and 2 respectively.

    gRxFlowHnd_1 = Cppi_configureRxFlow (res_mgr_cppi_get_passhandle(), &rxFlowCfg_1, &isAllocated);   ==> flowId = 0

    gRxFlowHnd_2 = Cppi_configureRxFlow (res_mgr_cppi_get_passhandle(), &rxFlowCfg_2, &isAllocated); ==> flowId = 1

    gRxFlowHnd_3 = Cppi_configureRxFlow (res_mgr_cppi_get_passhandle(), &rxFlowCfg_3, &isAllocated); ==> flowId = 2

    Please note that this will work only if there were no Cppi_configureRxFlow() invoked before. If you want to use LLD-allocated flowId, call Cppi_getFlowId(gRxFlowHnd_x) to retrieve the flowId which should be specified at routeInfo.

    Besides, there is no way that you do not specify flowId at routeInfo, whatever the value which might be 0 at the paRouteInfo_t will be used by PASS.

    Best regards,

    Eric