Altera_Forum
Honored Contributor
19 years agoDelayed ethernet packet processing (bug?)
As reported to bugzilla:
If the priority of the ethernet driver thread is lower (higher# ) than the FreeBSD Network Thread, then the Network Thread can get prematurely woken up to process an incoming ethernet pkt before the packet is fully enqued. Specifically: if_ethersubr:ether_demux() calls schednetisr() (which wakes up network thread) prior to the pkt being enqued with that call to IF_ENQUEUE(). This might not be obvious because a subsequent incoming packet can (partially) process the queue. One solution is to make sure the thread priority of the ethernet driver Handler_RxEvent() is higher (lower# ) than the FreeBSD Network Thread (default 7). A kludge option is to call both: schednetisr(2/*or NETISR_IP*/); schednetisr(18/* or NETISR_ARP*/); after each recv packet is processed by the Handler_RxEvent() call.