lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Throughput benchmark question - nasty ~1.5 second pause


From: Dave Nadler
Subject: Re: [lwip-users] Throughput benchmark question - nasty ~1.5 second pauses
Date: Thu, 14 Mar 2019 17:16:43 -0400
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3

A bit more info about where it stops. Any help where to look next appreciated!

I paused the application in the debugger during the extensive (~1.5 second) pause:
- tcp thread is waiting here:
    /* wait for a message, timeouts are processed while waiting */
    TCPIP_MBOX_FETCH(&tcpip_mbox, (void **)&msg);
  Inside tcpip_timeouts_mbox_fetch that's waiting with a 250msec timeout in:
  UNLOCK_TCPIP_CORE();
  res = sys_arch_mbox_fetch(mbox, msg, sleeptime);

- application thread is waiting inside lwip_netconn_do_write  at  sys_arch_sem_wait(LWIP_API_MSG_SEM(msg), 0);
  That's called by tcpip_send_msg_wait_sem here:
  LOCK_TCPIP_CORE();
  fn(apimsg);
- the ethernetif_input thread is waiting in  if (osSemaphoreWait( s_xSemaphore, TIME_WAITING_FOR_INPUT)==osOK)
  This is an ST-provided module that just waits for packets and dispatches them to netif->input

Thanks in advance for any pointers,
Best Regards, Dave

On 3/1/2019 3:43 PM, Dave Nadler wrote:
Hi UAZ - I'm using ST not NXP, so different driver and LwIP glue layer.
Can you tell *which* systick did not count (ie ARM core or some other timer)?
Can you see where in code its stuck?
I'm using sockets interface and TCP for my server.
I'll add an "LED blinky" thread to ensure other threads are running OK in my case.

If I could figure out how to breakpoint the code that's pausing I could probably sort this...

Thanks,
Best Regards, Dave

PS: Hope to work on this a bit more next week. Will stick with sockets API.
Raw API would make coding harder in my case.

On 2/28/2019 9:29 PM, uaz wrote:
Stuck in tcpip_thread() of tcpip.c file, or my own udp server thread.
I'm not sure if 'stuck' is the exact description, but it is spending too
much time in the above threads without switching or interrupts.
For now, I'm unable to find the exact location of the freezing.

If your other threads are able to run normally during the pause, it means
that our problem is not the same.

Below is my Segger trace for your reference:
<http://lwip.100.n7.nabble.com/file/t2097/sysview.png> 
During the pause, systick which is supposed to trigger every 1ms did not
trigger.

On 2/28/2019 6:44 PM, uaz wrote:
Hey Dave,

Your problem sounds quite similar to me except mine is completely stucked.
Have you checked your freeRTOS trace and determine where your application
stops sending packets or freezes in any thread?

I verified mine using Segger Systemview and can see clearly that it
pauses/freezes in certain thread for very long time without any systick or
ETH interrupt.
I'll be trying RAW API since I'm unable to debug this issue after spending
sometime. 

Btw, I'm using NXP mcu with their supplied lwip and freertos ports (Upgraded
to the latest version myself but the driver layer remains the same)

Regards,
UAZ
--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users

-- 
Dave Nadler, USA East Coast voice (978) 263-0097, address@hidden, Skype 
 Dave.Nadler1

reply via email to

[Prev in Thread] Current Thread [Next in Thread]