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.

RTOS/PROCESSOR-SDK-AM335X: How to query the usage of the TCP buffer?

Part Number: PROCESSOR-SDK-AM335X
Other Parts Discussed in Thread: AM3359

Tool/software: TI-RTOS

Hello,

I was wondering if there's any chance that I could monitor the usage of the TCP buffer with CCS.

I'm currently developing a TCP server and having some trouble...

TCP server is running on AM3359 custom board with the latest pdk(pdk_am335x_1_0_12) and ndk(ndk_3_40_01_01).

I need this server to run as fast as it can so that it can handle the packets coming from the client as fast as 1ms.

It seems that the server dies(or freeze?) after two minutes or so...

So when I capture the ethernet packets with Wireshark, when the server die, the client(Windows PC) tries four times to re transmit the packet.

And after awhile, the server gives error code 60 which is defined as NDK_ETIMEDOUT.

I have changed tcp receive buffer size to 65536 and it seems that the server takes longer to die.(Tcp.receiveBufSize = 65536;)

I'm thinking that it might be the receive buffer or send buffer that is not properly handled(freed?) so that the server is freezing.

Thank you!

  • Hi,

    There is a global TCP statistics counter structure called: NDK_tcps (ti\ndk\inc\stack\inc\tcpif.h). You can see the contents in the CCS View---->Expressions window. Can you compare before failure and after failure, what TCP errors you have?

    Also, there is a global IP statistics counter structure called: NDK_ips (ti\ndk\inc\stack\inc\ipif.h). You can compare the same.

    Regards, Eric
  • Also, you may look at TI Network Developer's Kit (NDK) v2.25 User's Guide, Section 3.5 Application Debug and Troubleshooting, 3.5.6 Memory Management Reports for memory usage.

    Regards, Eric
  • Hi,

    Thank you for your reply!

    Here's the capture of NDK_tcps, NDK_ips before and after error.

    NDK_tcps before error.

    NDK_tcps after error.

    NDK_ips before error.

    NDK_ips after error.

    I see that with NDK_tcps

    RexmtTimeout

    SndRexmitPack

    SndRexmitByte

    RcvDupPack

    RcvDupByte

    are the ones that increased after failure.

    and with NDK_ips

    CacheHit is different.

  • So I've done _mmCheck() after accept and after failure and it seems fine.

    Take a look please.

    So the first results are right after accept function and the bottom results are after failure.

    The thing is that, the program fails around 126 seconds after first communication with client regardless of the socket buffer tx,rx size

  • Hi,

    Thanks for sharing the statistics! Is this test running on a TI EVM? What is the TCP server test application on AM3 side? Can this be shared (with source code and CCS project) so we can duplicate your results? And what this the TCP client program for this test? Thanks!

    Regards, Eric