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.

LLIAddStaticEntry usage

I'm trying to the following steps:

1) Setup and start the network via NDK (no issues here)
2) afterwards, have a process outside of the NDK to add a static entry via LLIAddStaticEntry().

However, when I make the call, the DSP seems to hang up / crash. I have tried adding the llEnter and llExit function calls too but that didn't change the behavior. It works if I call LLIAddStaticEntry from the NetworkOpen function in NC_NetStart. How can I modify the ARP table entries externally?

Thanks,
Raj

  • Hi Raj,

    You don't need to enter kernel mode (llEnter) before calling LLIAddStaticEntry().

    There is an example of this in the NDK Telnet code.  The command looks like this:

    >lli

    [lli Command]

    Called to print, add, or delete static LLI (ARP) entries.
    IP Addresses must be used in the traditional x.x.x.x format.


    MAC Addresses can be used in either of xx-xx-xx-xx-xx-xx / xx:xx:xx:xx:xx:xx formats.

    lli print                    - Print out all the static LLI entries configured in the system.
    lli add IpAddr MacAddr       - Create new static LLI entry
    lli delete IpAddr            - Delete static LLI entry

    >

      This code is found in the NDK, in the folder "ti\ndk\tools\console".  The code for the lli command calls LLIAddStaticEntry() and is found in the function ConCmdLLI()

    If you like, you can also experiment with the Telnet console by adding it to your configuration (you must specify the handle to the ConsoleOpen() function).  Then you can run the rlli command to add an ARP entry/mapping.

    Steve

  • Hi Steve,

    I was able to follow the example and include the right headers to have the LLIAddStaticEntry() function exectue successfully. However, there appears to be some unintended consequences of using this command.


    I have a test where I loopback packets between two devices- 192.168.0.1 (the TI 6670 DSP) and 192.168.0.3 (an external device). The test runs fine normally. When I call LLIAddStaticEntry() to add an entry to some other non-existent device (say 192.168.0.5), I don't receive any packets and the test fails. It's almost like the call to LLIAddStaticEntry() regardless of the contents is deleting all of my dynamic entries.

    Is there any way to obtain the entire active ARP table (static and dynamic entries)?

    Do you have any ideas as to why this might be happening?

    Thanks,
    Raj

  • When running with the debugger, I saw a message that said the network on the DSP was terminated some time after processing the LLIAddStaticEntry() command. This would explain why the loopback test doesn't work.


    What can cause the network session to go down abruptly like that?

  • Can you check the return value of your call to LLIAddStaticEntry()?  Is it returning failure?

    Also, it may be useful to print out the route table both before and after this problem is happening.

    You can find an example of dumping the route table in another Telnet console command file - ti/ndk/tools/console/conroute.c:

        static void DumpRouteTable()

    The code should be easy to port into your application.  You will need to change the "console prints" to use printf() or DbgPrintf() functions.

    Steve

  • The LLIAddStaticEntry function is returning a 0 indicating no errors. I am able to print out the route table using LLIGetStaticARPTable and there is only one entry in there after I call LLIAddStaticEntry, which is the one I attempted to add. 

    I can see if there are any in there before I make the call, but I suspect it will be empty.

    Raj

  • It appears to be working properly if I remove the calls to llEnter / llExit from inside the LLIAddStaticEntry() function.

    When I call those functions I get an error reported in the console window:

    00007.419 Illegal priority call to llEnter()
    00007.421 Illegal call to llExit()


    Is it safe to remove the calls if I don't need them or is there some other reason why I'm getting these errors?

    Raj

  • Raj,

    The LLIGetStaticARPTable function only prints out static entries.  Looking at the code, you can see that the majority of that function is contained within the following if block:

            /* Check if this is a Static Host Route */
            if( (wFlags & FLG_RTE_HOST) && (wFlags & FLG_RTE_STATIC))

    Else (i.e. for dynamic entries) it skips to the next route.

    I think you should try to use the DumpRouteTable() code as described previously.

    Steve

  • Rajan Patel said:

    When I call those functions I get an error reported in the console window:

    00007.419 Illegal priority call to llEnter()
    00007.421 Illegal call to llExit()

    What functions are you calling that are resulting in these errors?  Do you mean when you call llEnter()/llExit() yourself?

    Or, are you talking about when you call some other function, then you see those errors?

    Rajan Patel said:
    It appears to be working properly if I remove the calls to llEnter / llExit from inside the LLIAddStaticEntry() function.

    Or, did you see the errors as a result of doing this?

    Steve

  • I am calling LLIAddStaticEntry() from my process. LLIAddStaticEntry() contains the calls to llEnter()/llExit() inside the function. I was able to step into LLIAddStaticEntry() and saw that when I step over llEnter(), I get "00007.419 Illegal priority call to llEnter()". I continue to step through the function and when I step over llExit(), I get "00007.421 Illegal call to llExit()".

    If I remove the calls to llEnter() / llExit(), the processing appears to work as expected.