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.

SRIO Srio_sockRecv() return 0

Hello.

We have two boards c6678 and connection board Dual EVM Breakout Card. We have two projects, a receiver and a transmitter, for testing SRIO modes type11 and type9. On the receiving side when calling the function Srio_sockRecv() returns 0. Projects attached.

Thank you.

  • Hi,

    The function is used to receive data from the SRIO socket. For blocking sockets this API will block and will only return once data is received for non-blocking sockets the API will return 0 if no data is available. If data is available on the socket; the receive API will pass back the data to the callee. For Raw Sockets data is passed up as a buffer descriptor while for normal sockets the data is passed as pointer to the data payload.

    The callee is responsible for cleaning the associated receive packet buffer.

    Thanks,
  • Hi,

    For test the type11 function is used

    Int32 consumer_type11(Srio_DrvHandle hSrioDrv)
    {
        Srio_SockHandle srioSocket;
        Srio_SockBindAddrInfo bindInfo;
        Int32 num_bytes;
        Srio_SockAddrInfo from;
        UInt8 *ptr_rxDataPayload;

        // Open SRIO Socket
        srioSocket =  Srio_sockOpen(hSrioDrv, Srio_SocketType_TYPE11, FALSE);
        if (srioSocket == NULL) {
            platform_write("Error: Unable to open socket\n");
            return -1;
        }

        // Populate the binding information.
        bindInfo.type11.tt       = FALSE;               // We are using 16 bit identifiers
        bindInfo.type11.id       = DEVICE_ID2_8BIT;     // Source Identifier to which the socket is bound
        bindInfo.type11.letter   = 3;                   // Letter Identifier
        bindInfo.type11.mbox     = 0;                   // Mailbox Number
        bindInfo.type11.segMap   = 0x0;                 // Single Segment

        // Bind the SRIO socket
        if (Srio_sockBind(srioSocket, &bindInfo) < 0) {
            platform_write("Error: Socket bind failed\n");
            return -1;
        }

        Task_sleep(10000);

        // Wait for the data to arrive
        while (1) {
            num_bytes = Srio_sockRecv(srioSocket, (Srio_DrvBuffer*)&ptr_rxDataPayload, &from);
            if (num_bytes > 0) {
                if (num_bytes != SRIO_TYPE11_MESSAGE_SIZE) {
                    platform_write("Error: Invalid data payload received\n");
                }
                // Cleanup the received data payload.
                Srio_freeRxDrvBuffer(srioSocket, (Srio_DrvBuffer)ptr_rxDataPayload);
            } else {
                platform_write("Error: num_bytes = %d\n", num_bytes);
            }
        }
    }

    For clear the buffer function is used Srio_freeRxDrvBuffer(), but it is not reached, as num_bytes is always 0.

  • Hi,

    Have you using customized test application for your testing? If yes, Please take a look at MCSDK SRIO Throughput test code. It support external type 9 and type 11 transfers.

    MCSDK Path: C:\ti\pdk_C6678_1_1_2_6\packages\ti\drv\exampleProjects\SRIO_TputBenchmarkingTestProject

    Refer SRIO_Benchmarking_Example_Code_Guide document for run the example with various mode.

    Doc Path: \ti\pdk_C6678_1_1_2_6\packages\ti\drv\srio\test\tput_benchmarking\docs\SRIO_Benchmarking_Example_Code_Guide.

    Thanks,
  • Hi,

    I have been studying this example, it only supports DIO and TYPE11. An important difference my example from SRIO_TputBenchmarkingTestProject, that the driver opens in Driver Managed Configuration (Normal socket), but not in the mode of Application Managed Configuration (RAW socket).

    Thanks