Please continue this discussion here: viewtopic.php?f=3&t=849
Giovanni
UDP packet dropping
Moderators: RoccoMarco, lbednarz, tfAteba
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: UDP packet dropping
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.
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.
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: UDP packet dropping
Please just add a list of changes, I am having an hard time coping with all the requests and alternate solutions.
Giovanni
Giovanni