]> git.baikalelectronics.ru Git - kernel.git/commit
net: ena: fix theoretical Rx hang on low memory systems
authorNetanel Belgazal <netanel@amazon.com>
Sun, 11 Jun 2017 12:42:48 +0000 (15:42 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 11 Jun 2017 20:36:46 +0000 (16:36 -0400)
commit22f4fb7181a6d0a11b62e664a46c5b55e8056048
treeeb7c182c442a68f6c11d4b675df977ceb134b240
parentac71038c6ac0cfbbf5ce20ec37a21df1f52a4881
net: ena: fix theoretical Rx hang on low memory systems

For the rare case where the device runs out of free rx buffer
descriptors (in case of pressure on kernel  memory),
and the napi handler continuously fail to refill new Rx descriptors
until device rx queue totally runs out of all free rx buffers
to post incoming packet, leading to a deadlock:
* The device won't send interrupts since all the new
Rx packets will be dropped.
* The napi handler won't try to allocate new Rx descriptors
since allocation is part of NAPI that's not being invoked any more

The fix involves detecting this scenario and rescheduling NAPI
(to refill buffers) by the keepalive/watchdog task.

Fixes: e59074db59c6 ("Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Netanel Belgazal <netanel@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amazon/ena/ena_ethtool.c
drivers/net/ethernet/amazon/ena/ena_netdev.c
drivers/net/ethernet/amazon/ena/ena_netdev.h