lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] bug&patch: when an api_msg is lost tcp get stuck


From: Renzo Davoli
Subject: [lwip-users] bug&patch: when an api_msg is lost tcp get stuck
Date: Fri, 27 May 2005 20:35:42 +0200
User-agent: Mutt/1.3.28i

When I received heavy bursty data (10MB per burst) using TCP in LwIP
everything blocked.

The problem appears to be the following one:
when an api_msg gets lost (no more available elements in memp)
the window is not updated through tcp_recved (called by do_recv in api_msg.c).

Thus the tcp window reaches zero size and everything is blocked.

Here is my workaround for the tcpip.c file for delaying the
api msg instead of loosing it.

#define API_MSG_RETRY_DELAY 10
void
tcpip_apimsg(struct api_msg *apimsg)
{
  struct tcpip_msg *msg;
  msg = memp_malloc(MEMP_TCPIP_MSG);
  /*if (msg == NULL) {
    memp_free(MEMP_API_MSG, apimsg);
    return;
  }*/
  while (msg == NULL) {
    sys_msleep(API_MSG_RETRY_DELAY);
    msg = memp_malloc(MEMP_TCPIP_MSG);
  }
  msg->type = TCPIP_MSG_API;
  msg->msg.apimsg = apimsg;
  sys_mbox_post(mbox, msg);
}

renzo




reply via email to

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