Page 2 of 2
Re: UDP packet dropping
Posted: Sat Dec 22, 2012 11:17 am
by Giovanni
Please continue this discussion here:
viewtopic.php?f=3&t=849Giovanni
Re: UDP packet dropping
Posted: Fri Jan 04, 2013 2:59 pm
by iggarpe
As a followup to the previous post, if you are to set TCPIP_MBOX_SIZE to a large value, you should also set MEMP_NUM_TCPIP_MSG_INPKT.
TCPIP_MBOX_SIZE determines the number of elements (messages) that can be posted to the tcpip thread. Each message is a pointer.
MEMP_NUM_TCPIP_MSG_INPKT is the size of the POOL from which input packet MESSAGES are allocated.
When an incoming packet is received, a new message structure of type "input packet" is allocated from the pool, then the message is posted. So if you are to mage the size of the mailbox large to cope with a lot of incoming packets, you need to make the "input packet" message pool large too.
And, of course, instead of all that, I would just make the lwipthread priority lower than any of the internal lwIP threads. This way you ensure that as long as lwIP internal threads (in particular the tcpip thread) have work to do, the lwipthread won't have a chance to fill and possibly overflow the message mailboxes.
Re: UDP packet dropping
Posted: Fri Jan 04, 2013 3:06 pm
by Giovanni
Please just add a list of changes, I am having an hard time coping with all the requests and alternate solutions.
Giovanni