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.

QMSS: Unable to receive descriptor in rx queue

Hi,

I am struggling with at receiving the packet in rx queue. I am able to push the descriptor in Txqueue.

but at the rx side I am not receiving any descriptor. when I use Qmss_queueDivert (txQueHnd, rxQueHnd, Qmss_Location_TAIL);

then things works fine. but whenever I use Qmss_queuePushDescSize (txQueHnd, hostDescPtr, SIZE_HOST_DESC) on Rx side I didn't receive anything.

I am stuck where to put destination address in the descriptor.

Please look into the issue. I'll appreciate it.

BR

Rohan

  • Welcome to the TI E2E forum. I hope you will find many good answers here and in the TI.com documents and in the TI Wiki Pages (for processor issues). Be sure to search those for helpful information and to browse for the questions others may have asked on similar topics (e2e.ti.com).

    We will get back to you shortly on the above query.
  • Hi,

    Thanks for your post.

    I think, if you use Qmss_queuePushDescSize() API function, the memory address of the host descriptor "hostDescPtr" should be a global address, sothat, you could have probability to receive on the Rx. side and also the size of the descriptor which should be atleast 16 bytes minimum and 256 bytes maximum. Also, there is a precondition that "Qmss_queueOpen function()" should be called before calling this function.

    I think, for more info. on the API functions, you could see the QMSS LLD API function html doc. from the below installation path:

    ~\ti\Keystone_MCSDK_02_01\pdk_C667x_1_1_2_6\packages\ti\drv\qmss\docs\doxygen\html\group___q_m_s_s___l_l_d___f_u_n_c_t_i_o_n.html

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question

    -------------------------------------------------------------------------------------------------------

  • Hi Sivaraj K,

    Thanks for your response. I have used the global descriptors.

    Can you explain how channel mapping is done for tx as well as rx side.

    and where in the descriptor destination address should be written?

    BR

    Rohan

  • Hi,

    Thanks for your update.

    Please refer section 5.4 for packet DMA channel mapping on Rx. and Tx. channels and refer section 3.1 for host packet descriptor info. from the keystone multicore navigator user guide as below:

    http://www.ti.com/lit/ug/sprugr9h/sprugr9h.pdf

    Also, please check for SPRP812 literature doc. for KeyStone Multicore Navigator.pptx in google search engine which would provide you better understanding on QMSS system architecture, functional overview, usecases, QMSS descriptors & its memory regions, host descriptors structure, queue mapping, implementation example etc.

    The literature doc. shared above was very useful in understanding QMSS descriptors, packet DMA topology etc. Kindly check the same.

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question

    -------------------------------------------------------------------------------------------------------

  • Hi

    While debugging I find out I am not sending any data to Rx queue.
    this is my transfer function look like.
    Int32 test_transfer(Uint8 *dataBuff)
    {
    Int32 result;

    Cppi_Desc *hostDescPtr;
    Qmss_Queue queInfo;
    Cppi_DescTag cppiTagCfg;
    Uint32 rxflow;

    hostDescPtr = (Cppi_Desc *) Qmss_queuePop (txFreeQueHnd);
    result = Qmss_getQueueEntryCount (txFreeQueHnd);
    System_printf ("Transmit Queue %d Entry Count : %d \n", txFreeQueHnd, result);
    if(NULL == hostDescPtr)
    return -1;

    queInfo = Qmss_getQueueNumber (txFreeQueHnd);
    Cppi_setReturnQueue (Cppi_DescType_HOST, hostDescPtr, queInfo);
    /* Add data buffer */
    Cppi_setData (Cppi_DescType_HOST, hostDescPtr, (UInt8 *) l2_global_address ((UInt32) dataBuff), SIZE_DATA_BUFFER);

    /* Save original buffer information */
    Cppi_setOriginalBufInfo (Cppi_DescType_HOST, hostDescPtr, (UInt8 *) l2_global_address ((UInt32) dataBuff), SIZE_DATA_BUFFER);

    /* Set packet length */
    Cppi_setPacketLen (Cppi_DescType_HOST, hostDescPtr, SIZE_DATA_BUFFER);

    /* Fill in some data */
    srcData[0] = 0xAB;
    srcData[1] = 0xCD;
    srcData[2] = 0xEF;
    srcData[3] = 0xDC;

    /* Add PS data */
    Cppi_setPSData (Cppi_DescType_HOST, hostDescPtr, (UInt8 *) srcData, 4);


    /*Setting the rxFlow*/
    rxflow = Cppi_getFlowId(rxFlowHnd);

    cppiTagCfg.srcTagHi = 0;
    cppiTagCfg.srcTagLo = (rxflow & 0x00FF);
    //cppiTagCfg.destTagHi = ((destnTagInfo & 0xFF00) >> 8) ;
    //cppiTagCfg.destTagLo = (destnTagInfo & 0x00FF);
    Cppi_setTag (Cppi_DescType_HOST, hostDescPtr, &cppiTagCfg);


    /* Push descriptor to Tx queue */
    Qmss_queuePushDescSize (txQueHnd, hostDescPtr, SIZE_HOST_DESC);

    result = Qmss_getQueueEntryCount (txQueHnd);
    System_printf ("Transmit Queue %d Entry Count : %d Tx descriptor 0x%p\n", txQueHnd, result, hostDescPtr);
    Task_sleep(1);
    /* Here the packets are diverted to the destination queue.
    * Can also configure flow to transfer packets to destination queue.
    * */

    //Qmss_queueDivert (txQueHnd, rxQueHnd, Qmss_Location_TAIL);
    //Qmss_queuePushDesc (freeQueHnd, hostDescPtr);
    //System_printf ("restoring_queue : %d \n", freeQueHnd);
    //result = Qmss_getQueueEntryCount (txFreeQueHnd);
    //System_printf ("Transmit Queue %d Entry Count : %d \n", txFreeQueHnd, result);
    return 1;

    }

    Can you look into it and share what is being missed here?

    Thanks and Regards
    Rohan
  • Hi,

    Thanks for your update.

    I think, to test the data transfer using host descriptor, you have a good baseline spurce code to refer and to validate the same, which ensures sending data to Rx. queue. Please look at the below source file path from MCSDK_02_01 installation below:

    ~\ti\Keystone_MCSDK_02_01\pdk_C6678_1_1_2_6\packages\ti\drv\cppi\test\test_host_mode.c

    Also, you could refer the QMSS infrastructure mode example code. Runs both in polling and accumulator mode which uses both host and monolithic descriptors for data transfer. Please check the below path:

    ~\ti\Keystone_MCSDK_02_01\pdk_C6670_1_1_2_6\packages\ti\drv\qmss\example\InfrastructureMode\infrastructure_mode.c

    You could also check the CPPI Low Level Driver example file from the below path:

    ~\ti\Keystone_MCSDK_02_01\pdk_C6678_1_1_2_6\packages\ti\drv\cppi\example\sample\sample.c

    I think, the code snippet below you could find from the sample.c source file should be the appropriate one for sending data to Rx. queue:

    /* Get a free descriptor */

       while ((hostDescPtr = (Cppi_Desc *) Qmss_queuePop (freeQueHnd)) != NULL)

       {

           /* Add data buffer */

           Cppi_setData (Cppi_DescType_HOST, hostDescPtr, (UInt8 *) l2_global_address ((UInt32) dataBuff), SIZE_DATA_BUFFER);

           /* Save original buffer information */

           Cppi_setOriginalBufInfo (Cppi_DescType_HOST, hostDescPtr, (UInt8 *) l2_global_address ((UInt32) dataBuff), SIZE_DATA_BUFFER);

           /* Set packet length */

           Cppi_setPacketLen (Cppi_DescType_HOST, hostDescPtr, SIZE_DATA_BUFFER);

           /* Fill in some data */

           srcData[0] = 0xAB;

           srcData[1] = 0xCD;

           srcData[2] = 0xEF;

           srcData[3] = 0xDC;

           /* Add PS data */

           Cppi_setPSData (Cppi_DescType_HOST, hostDescPtr, (UInt8 *) srcData, 4);

           /* Push descriptor to Tx queue */

           Qmss_queuePushDescSize (txQueHnd, (Ptr) hostDescPtr, SIZE_HOST_DESC);

           result = Qmss_getQueueEntryCount (txQueHnd);

           System_printf ("Transmit Queue %d Entry Count : %d Tx descriptor 0x%p\n", txQueHnd, result, hostDescPtr);

           /* Here the packets are diverted to the destination queue.

            * Can also configure flow to transfer packets to destination queue.

            * */

           Qmss_queueDivert (txQueHnd, rxQueHnd, Qmss_Location_TAIL);

           result = Qmss_getQueueEntryCount (rxQueHnd);

           /* Wait for receive packet */

           while (Qmss_getQueueEntryCount (rxQueHnd) == 0);

           /* Get the rx packet */

           if ((rxPkt = (Cppi_Desc *) Qmss_queuePop (rxQueHnd)) == NULL)

           {

               System_printf ("Error Core %d : pop failed\n", corenum);

               errorCounter++;

               goto end;

           }

           /* The lower 4 bits of the descriptor address contain the size of the descriptor

           that was specified during the queue push operation. Clear it */

           rxPkt = (Cppi_Desc *) QMSS_DESC_PTR (rxPkt);

           System_printf ("Receive Queue %d Entry Count : %d Rx descriptor 0x%p\n", rxQueHnd, result, rxPkt);

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question

    -------------------------------------------------------------------------------------------------------

  • Hi Sivaraj,

    Thanks for your reply. I really appreciate it.

    I have one small doubt. Do I really need to configure  DSP firmwares and accumulators for transmitting using HW queue?

    qmssInitConfig.pdspFirmware[0].pdspId = Qmss_PdspId_PDSP1;

    qmssInitConfig.pdspFirmware[0].firmware = &acc48_le;

    qmssInitConfig.pdspFirmware[0].size = sizeof (acc48_le);

    BR

    Rohan

  • Hi,

    I don't think, it is really required.

    Thanks & regards,
    Sivaraj K
  • Thanks for the reply.

    I have one more query:
    what is the purpose of Infrastructure queues at TX side,when replacing INFRASTRUCTURE with general purpose,I am not able transmit data.
    Qmss_QueueType_INFRASTRUCTURE_QUEUE
    Qmss_QueueType_GENERAL_PURPOSE_QUEUE

    BR
    Rohan