UDP packet dropping

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

User avatar
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

Post by Giovanni »

Please continue this discussion here: viewtopic.php?f=3&t=849

Giovanni
iggarpe
Posts: 129
Joined: Sun Sep 30, 2012 8:32 pm

Re: UDP packet dropping

Post 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.
User avatar
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

Post by Giovanni »

Please just add a list of changes, I am having an hard time coping with all the requests and alternate solutions.

Giovanni
Post Reply