mirror of https://github.com/ARMmbed/mbed-os.git
lwip - Change k64f emac layer to drop frames on buffer exhaustion
Previously, exhausting hardware buffers would begin blocking the lwip thread. This patch changes the emac layer to simply drop ethernet frames, leaving recovery up to a higher level protocol. This is consistent with the behaviour of the emac layer when unable to allocate dynamic memory.pull/3227/head
parent
14f9518709
commit
5c97ea9254
|
@ -522,9 +522,10 @@ static err_t k64f_low_level_output(struct netif *netif, struct pbuf *p)
|
||||||
dst += q->len;
|
dst += q->len;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wait until a descriptor is available for the transfer. */
|
/* Check if a descriptor is available for the transfer. */
|
||||||
/* THIS WILL BLOCK UNTIL THERE ARE A DESCRIPTOR AVAILABLE */
|
int32_t count = osSemaphoreWait(k64f_enet->xTXDCountSem.id, 0);
|
||||||
osSemaphoreWait(k64f_enet->xTXDCountSem.id, osWaitForever);
|
if (count < 1)
|
||||||
|
return ERR_BUF;
|
||||||
|
|
||||||
/* Get exclusive access */
|
/* Get exclusive access */
|
||||||
sys_mutex_lock(&k64f_enet->TXLockMutex);
|
sys_mutex_lock(&k64f_enet->TXLockMutex);
|
||||||
|
|
Loading…
Reference in New Issue