mirror of https://github.com/ARMmbed/mbed-os.git
Revert "net: Only process 1 packet per ethernet RX interrupt"
This reverts commit acb35785c9
.
It turns out that this commit actually causes problems if an ethernet
interrupt is dropped because a higher privilege task is running, such
as LocalFileSystem accesses. If this happens, the semaphore count isn't
incremented enough times and the packet_rx() thread will fall behind and
end up running as though it had only one ethernet receive buffer. This
causes even more lost packets.
I plan to fix this by switching the semaphore to be a signal so that
the syncronization object is more boolean. It simply indicates if an
interrupt has arrived since the last time packet_rx() was awaken to
process inbound packets.
pull/46/head
parent
de8161fde1
commit
2bed996462
|
@ -812,8 +812,9 @@ static void packet_rx(void* pvParameters) {
|
|||
/* Wait for receive task to wakeup */
|
||||
sys_arch_sem_wait(&lpc_enetif->RxSem, 0);
|
||||
|
||||
/* Process packet for this semaphore signal */
|
||||
lpc_enetif_input(lpc_enetif->netif);
|
||||
/* Process packets until all empty */
|
||||
while (LPC_EMAC->RxConsumeIndex != LPC_EMAC->RxProduceIndex)
|
||||
lpc_enetif_input(lpc_enetif->netif);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue