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 enable jumbo frames

Hi all,

I'm using the NDK 2.0.0 and I'm trying to enable jumbo frames in the client.pjt example.  I am linking against the hal_eth_c6455_jumbo.lib, netctrl_jumbo.lib, nettool_jumbo.lib, and os_jumbo.lib libraries and I also added "_INCLUDE_JUMBOFRAME_SUPPORT" to the preprocessor pre-defined symbol section.

I can successfully build the application but when I run I get this error "Error: Unable to register the EMAC".  The client.pjt application works fine with the non-jumbo frame libraries.  Is there something I am missing to get jumbo frames working?

For reference I am using:

Code Composer Studio V3.3.38.2 with Code Generation Tools v7.0.3

DSP BIOS v5.33.06

C6455 DSP

Any help would be much appreciated. Thanks,

Nick

  • Nick,

    I will move this post to the BIOS forum, as they are more knowledgeable about NDK.

    Just for your reference, did you take a look at the entries 8 and 9 of the NDK FAQ? They contain information about the Jumbo Frames support in NDK 2.0.0

    Regards,

    Rafael

  • Rafael,

    Thanks for moving the post to the appropriate forum, I wasn't sure which forum was best for NDK related questions.

    I did look at those two NDK FAQ entries which is where I got the information to link against the jumbo libraries and include the jumbo preprocessor define. 

    -Nick

  • Hi Nick,

    The error message you are seeing is coming from the Ethernet driver code, in file nimu_eth.c:

        /* Register the device with NIMU */
        if (NIMURegister (ptr_device) < 0)
        {
            printf ("Error: Unable to register the EMAC\n");
            return -1;
        }


    The function NIMURegister() is in the stack code, and so it's returning an error.

    Can you try stepping through the NIMURegister() function to see where it's failing?

    A trick you can do in order to allow you to step through it is to add the following file (that contains the function) to your project:

    ndk_2_0_0\packages\ti\ndk\src\stack\nimu\nimu.c

    Then rebuild your project for debug mode.  Then once you load it, you can put a break point at NIMURegister() and once it hits you'll be able to step through.

    Looking at the function, there are several possible places for failure so the next step is to try to pinpoint which one is hitting.

    Steve

  • Hi Steve,

    I took your advice about debugging the library code and I have some more info.

    The NIMURegister function is failing the line which calls the device start function:

         /* The device can now be opened and initialized. */
         if (ptr_netif_device->start (ptr_netif_device) < 0)
              return -1;

    Digging further, the start function pointer is pointing to "static int EmacStart (NETIF_DEVICE* ptr_net_device)" in nimu_eth.c.  That function is failing due to:

         /* Call low-level open function */
         if (HwPktOpen(&ptr_pvt_data->pdi) == 0)
         { ... }

    HwPktOpen bails out on the 17th attempt to call this line:

    hPkt = PBM_alloc(ecfg.PktMTU);

    which is inside a loop that iterates PKT_MAX (64) times.

    I'm continuing to dig through the PBM and jumbo PBM code to see why the memory allocation is failing but any additional insight would be much appreciated.

    Nick

  • Nick,

    It seems like the PBM buffers are not large enough to handle all of these allocations.  You can make these buffers bigger, however it will require you to rebuild the stack source.  You can probably get away with adding the sources (pbm.c, jumbo_pbm.c) into your project, though.

    Also, you may want to add a call to the memory dump function

    void _mmCheck( uint CallMode, int (*pPrn)(const char *,...) )

    It will print out memory stats (similar to the 'mem' command that can be run from within the client example's telnet window.

    The buffers you probably need to be concerned about are:

    pbm.c:

    //
    // Data space for packet buffers
    //
    #pragma DATA_ALIGN(pBufMem, 128);
    #pragma DATA_SECTION(pBufMem, ".far:NDK_PACKETMEM");
    static UINT8 pBufMem[PKT_NUM_FRAMEBUF*PKT_SIZE_FRAMEBUF];

    #pragma DATA_ALIGN(pHdrMem, 128);
    #pragma DATA_SECTION(pHdrMem, ".far:NDK_PACKETMEM");
    static UINT8 pHdrMem[PKT_NUM_FRAMEBUF*sizeof(PBM_Pkt)];

    and in jumbo_pbm.c:

    /* P.I.T */
    #pragma DATA_SECTION(jumbo_pit, ".far:NDK_JMMBUFFER");
    JUMBO_PITENTRY jumbo_pit[JUMBO_RAW_PAGE_COUNT];
    #pragma DATA_SECTION(jumbo_pitBuffer, ".far:NDK_JMMBUFFER");
    UINT8    jumbo_pitBuffer[JUMBO_RAW_PAGE_SIZE*JUMBO_RAW_PAGE_COUNT];

    Steve