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


_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to