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.

How to use Packet Accelerator and SRIO together?

Other Parts Discussed in Thread: SYSBIOS

Hello. I want to join NDK client and SRIO_multicore_loopback example applications. I plan to use single (same) .out file for all cores (4 cores). That's what i did:

1) ipc_start on all cores

2) on core0 initialize QMSS;

3) on core0 insert memory region for PA;

4) on core0 insert memory region for SRIO (number and size of descriptors I got from respective example applications);

5) on core0 initialize CPPI;

6) on core0 initialize SRIO;

7) wait for SRIO to be initialized on other cores;

8) start BIOS on all cores;

9) after that executing Srio_start() on all cores failed.

What I have done wrong?

How to correctly initialize PA and SRIO together?

How to correctly locate linker sections in memories (MSMCSRAM and L2SRAM)?

I suppose that my problem is because of system_heap section is located in MSMCSRAM (it doesn't fit to L2SRAM) and all dynamically created variables (including pointers, descriptors) are allocated at the same addresses for all cores.

  • I don't see you doing PA initialization step in the description above. What you mean by cores failed. Can you elaborate?

     

    Thanks,

    Arun.

  • Sorry, i forgot to describe PA initialization. It is done directly before NDK configuration and launching. So, LAN network works correctly (I can ping my EVMc6678l board). Now order of my actions is:   ipc_start, bios_start, then the same as was.

    Here is console log:

    [C66xx_2] Debug(Core 2): Waiting for SRIO to be initialized.
    [C66xx_3] Debug(Core 3): Waiting for SRIO to be initialized.
    [C66xx_0] Debug(Core 0): Host Region PA 0xc2fbb80
    [C66xx_1] Debug(Core 1): Waiting for SRIO to be initialized.
    [C66xx_0] Debug(Core 0): Host Region SRIO 0xc304b80
    [C66xx_0] QMSS successfully initialized
    [C66xx_0] CPPI successfully initialized
    [C66xx_0] Debug(Core 0): SRIO Driver has been initialized
    [C66xx_0] Error: Receive Queue Configuration Failed
    [C66xx_0] Error(Core 0): SRIO Driver failed to start
    [C66xx_0] PA successfully initialized
    [C66xx_0] PASS successfully initialized
    [C66xx_0] Ethernet subsystem successfully initialized
    [C66xx_0] Ethernet eventId : 48 and vectId (Interrupt) : 7
    [C66xx_0] Verify_Init: Expected 0 entry count for Queue number = 897, found 128 entries
    [C66xx_0] Registration of the EMAC Successful, waiting for link up ..
    [C66xx_1] Debug(Core 1): QMSS started
    [C66xx_2] Debug(Core 2): QMSS started
    [C66xx_3] Debug(Core 3): QMSS started
    [C66xx_1] Debug(Core 1): SRIO can now be used.
    [C66xx_2] Debug(Core 2): SRIO can now be used.
    [C66xx_3] Debug(Core 3): SRIO can now be used.
    [C66xx_1] Error: Receive Queue Configuration Failed
    [C66xx_1] Error(Core 1): SRIO Driver failed to start
    [C66xx_0] Network Added: If-1:192.168.2.100
    [C66xx_2] Error: Receive Queue Configuration Failed
    [C66xx_2] Error(Core 2): SRIO Driver failed to start
    [C66xx_3] Error: Receive Queue Configuration Failed
    [C66xx_3] Error(Core 3): SRIO Driver failed to start

  • A piece of source-code is:

    int main()
    {
    Ipc_start(); /* Initialize the heap in shared memory. Using IPC module to do that */
    BIOS_start (); /* Start the BIOS 6 Scheduler */
    return(0);
    }

    //
    // Main Thread
    //
    int StackTest()
    {
    int i;
    coreNum = CSL_chipReadReg (CSL_CHIP_DNUM); /* Get the core number. */

    ... platform init (uart etc...)

    /* Initialize the components required to run this application:
    * (1) QMSS
    * (2) CPPI
    * (3) Packet Accelerator
    */
    if (platform_get_coreid() == 0)
    {
    CORE_0_INIT();
    }
    else
    {
    CORE_OTHERS_INIT();
    }
    return(0);
    }

    void CORE_0_INIT(void)
    {
    int rc;
    // int i;
    HANDLE hCfg;
    QMSS_CFG_T qmss_cfg;
    CPPI_CFG_T cppi_cfg;
    qmss_cfg.master_core = 1;
    cppi_cfg.master_core = 1;
    /* Initialize QMSS */
    if (res_mgr_init_qmss (&qmss_cfg, coreNum) != 0)
    {
    platform_write ("Failed to initialize the QMSS subsystem \n");
    goto main_exit;
    }
    else
    {
    platform_write ("QMSS successfully initialized \n");
    }

    /* Initialize CPPI */
    cppi_cfg.dma_num = Cppi_CpDma_PASS_CPDMA;
    cppi_cfg.num_tx_queues = NUM_PA_TX_QUEUES;
    cppi_cfg.num_rx_channels = NUM_PA_RX_CHANNELS;
    if (res_mgr_init_cppi (&cppi_cfg) != 0)
    {
    platform_write ("Failed to initialize CPPI subsystem \n");
    goto main_exit;
    }
    else
    {
    platform_write ("CPPI successfully initialized \n");
    }

    /* Power on SRIO peripheral before using it */
    if (enable_srio () < 0)
    {
    System_printf ("Error: SRIO PSC Initialization Failed\n");
    goto main_exit;
    }

    /* Device Specific SRIO Initializations: This should always be called before
    * initializing the SRIO Driver. */
    if (SrioDevice_init() < 0)
    goto main_exit;

    /* Initialize the SRIO Driver */
    if (Srio_init () < 0)
    {
    System_printf ("Error: SRIO Driver Initialization Failed\n");
    goto main_exit;
    }

    /* SRIO Driver is operational at this time. */
    System_printf ("Debug(Core %d): SRIO Driver has been initialized\n", coreNum);
    /* Write to the SHARED memory location at this point in time. The other cores cannot execute
    * till the SRIO Driver is up and running. */
    isSRIOInitialized = 1;

    /* The SRIO IP block has been initialized. We need to writeback the cache here because it will
    * ensure that the rest of the cores which are waiting for SRIO to be initialized would now be
    * woken up. */
    CACHE_wbL1d ((void *) &isSRIOInitialized, 128, CACHE_WAIT);

    PreSrioDriverInit();


    if (res_mgr_init_pass()!= 0) {
    platform_write ("Failed to initialize the Packet Accelerator \n");
    goto main_exit;
    }
    else
    {
    platform_write ("PA successfully initialized \n");
    }

    ... NDK configuration and start ...
    }

    void CORE_OTHERS_INIT(void)
    {
    // QMSS_CFG_T qmss_cfg;
    // CPPI_CFG_T cppi_cfg;
    // qmss_cfg.master_core = 0;
    // cppi_cfg.master_core = 0;
    /* All other cores need to wait for the SRIO to be initialized before they proceed with the test. */
    System_printf ("Debug(Core %d): Waiting for SRIO to be initialized.\n", coreNum);

    /* All other cores loop around forever till the SRIO is up and running.
    * We need to invalidate the cache so that we always read this from the memory. */
    while (isSRIOInitialized == 0)
    CACHE_invL1d ((void *) &isSRIOInitialized, 128, CACHE_WAIT);

    /* Start the QMSS. */
    if (Qmss_start() != QMSS_SOK)
    {
    System_printf ("Error: Unable to start the QMSS\n");
    return;
    }
    System_printf ("Debug(Core %d): QMSS started\n", coreNum);
    System_printf ("Debug(Core %d): SRIO can now be used.\n", coreNum);
    PreSrioDriverInit();

    }

    void PreSrioDriverInit(void)
    {
    Srio_DrvConfig drvCfg;
    UInt8 isAllocated;

    memset ((Void *)&drvCfg, 0, sizeof(Srio_DrvConfig)); /* Initialize the SRIO Driver Configuration. */

    if (Osal_dataBufferInitMemory(SRIO_MAX_MTU) < 0) /* Initialize the OSAL */
    {
    System_printf ("Error: Unable to initialize the OSAL. \n");
    return;
    }

    /********************************************************************************
    * The SRIO Driver Instance is going to be created with the following properties:
    * - Driver Managed
    * - Interrupt Support (Pass the Rx Completion Queue as NULL)
    ********************************************************************************/

    /* Setup the SRIO Driver Managed Configuration. */
    drvCfg.bAppManagedConfig = FALSE;

    /* Driver Managed: Receive Configuration */
    drvCfg.u.drvManagedCfg.bIsRxCfgValid = 1;
    drvCfg.u.drvManagedCfg.rxCfg.rxMemRegion = Qmss_MemRegion_MEMORY_REGION0;
    drvCfg.u.drvManagedCfg.rxCfg.numRxBuffers = 4;
    drvCfg.u.drvManagedCfg.rxCfg.rxMTU = SRIO_MAX_MTU;

    /* Accumulator Configuration. */
    {
    int32_t coreToQueueSelector[4];

    /* This is the table which maps the core to a specific receive queue. */
    coreToQueueSelector[0] = 704;
    coreToQueueSelector[1] = 705;
    coreToQueueSelector[2] = 706;
    coreToQueueSelector[3] = 707;

    /* Since we are programming the accumulator we want this queue to be a HIGH PRIORITY Queue */
    drvCfg.u.drvManagedCfg.rxCfg.rxCompletionQueue = Qmss_queueOpen (Qmss_QueueType_HIGH_PRIORITY_QUEUE,
    coreToQueueSelector[coreNum], &isAllocated);
    if (drvCfg.u.drvManagedCfg.rxCfg.rxCompletionQueue < 0)
    {
    System_printf ("Error: Unable to open the SRIO Receive Completion Queue\n");
    return;
    }

    /* Accumulator Configuration is VALID. */
    drvCfg.u.drvManagedCfg.rxCfg.bIsAccumlatorCfgValid = 1;

    /* Accumulator Configuration. */
    drvCfg.u.drvManagedCfg.rxCfg.accCfg.channel = coreNum;
    drvCfg.u.drvManagedCfg.rxCfg.accCfg.command = Qmss_AccCmd_ENABLE_CHANNEL;
    drvCfg.u.drvManagedCfg.rxCfg.accCfg.queueEnMask = 0;
    drvCfg.u.drvManagedCfg.rxCfg.accCfg.queMgrIndex = coreToQueueSelector[coreNum];
    drvCfg.u.drvManagedCfg.rxCfg.accCfg.maxPageEntries = 2;
    drvCfg.u.drvManagedCfg.rxCfg.accCfg.timerLoadCount = 0;
    drvCfg.u.drvManagedCfg.rxCfg.accCfg.interruptPacingMode = Qmss_AccPacingMode_LAST_INTERRUPT;
    drvCfg.u.drvManagedCfg.rxCfg.accCfg.listEntrySize = Qmss_AccEntrySize_REG_D;
    drvCfg.u.drvManagedCfg.rxCfg.accCfg.listCountMode = Qmss_AccCountMode_ENTRY_COUNT;
    drvCfg.u.drvManagedCfg.rxCfg.accCfg.multiQueueMode = Qmss_AccQueueMode_SINGLE_QUEUE;

    /* Initialize the accumulator list memory */
    memset ((Void *)&gHiPriAccumList_SRIO[0], 0, sizeof(gHiPriAccumList_SRIO));
    drvCfg.u.drvManagedCfg.rxCfg.accCfg.listAddress = l2_global_address((UInt32)&gHiPriAccumList_SRIO[0]);
    }

    /* Driver Managed: Transmit Configuration */
    drvCfg.u.drvManagedCfg.bIsTxCfgValid = 1;
    drvCfg.u.drvManagedCfg.txCfg.txMemRegion = Qmss_MemRegion_MEMORY_REGION0;
    drvCfg.u.drvManagedCfg.txCfg.numTxBuffers = 4;
    drvCfg.u.drvManagedCfg.txCfg.txMTU = SRIO_MAX_MTU;

    /* Start the Driver Managed SRIO Driver. */
    hDrvManagedSrioDrv = Srio_start(&drvCfg); //this functions fails
    if (hDrvManagedSrioDrv == NULL)
    {
    System_printf ("Error(Core %d): SRIO Driver failed to start\n", coreNum);
    return;
    }

    System_printf ("Debug(Core %d): SRIO Driver started successfully\n", coreNum);

    /* Hook up the SRIO interrupts with the core. */
    EventCombiner_dispatchPlug (48, (ti_sysbios_family_c64p_EventCombiner_FuncPtr)Srio_rxCompletionIsr, (UArg)hDrvManagedSrioDrv, TRUE);
    ti_sysbios_family_c64p_EventCombiner_enableEvent(48);
    }

  • Hi Vladimir,

    I have same issue you described earlier, in  attempt  to join NDK and SRIO example. I failed to start SRIO driver with message "SRIO driver failed to start"

    Did you find solution for this?

    Thanks in advance.

  • I am also working on this.  Hopefully TI will chime in again.

    One thing I notice in Vladimir's code is that the Ethernet is using event 48 and the SRIO is using event 48.  I needed to switch mine to event 49 and also change the "coreToQueueSelector" array to match event 49 instead.

    Now my application will run but if the as soon as I send a udp packet, the doorbell ISRs stop coming, so I think there must be some interaction still.

    Brandy

  • Hi Brandy,

    in your case did the ping works?

    Valdimir,

    Is it possible for you to zip the project and send. I can try it out in my system.

    Thanks,

    Arun.

  • Hello Arun,

    Yes, my ping will work and I see the first "gratiutious arp" but then I never see my udp packet that I sent using sendto and then I also never get any more doorbells. 

    I am going to work through it more today.  It is slow going becuase there is alot of steps to get the emulator to work correctly when using the ndk and I find that if I don't do the process precisely (for instance, load program, system reset, global default setup, load program, go or something similar) then either SRIO or Ethernet does not work and I haven't master exactly what will work.

    Thanks,

    Brandy

  • Hello,

    Just to close this out, I got it to work, my fire wall was blocking all traffic.  How irritating.

  • hi  

    I meet the same problem.Can you help me?

    Can you send me the code for reference 

    thanks! my mail:jiadecun1111@126.com

  • Hello Jia,

    I can send you the code via a private message.  Friend me and I will send the code there.

     

    BrandyJ