net/mlx4_en: Schedule napi when RX buffers allocation fails
authorIdo Shamay <idos@mellanox.com>
Thu, 30 Apr 2015 14:32:46 +0000 (17:32 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 May 2015 12:34:02 +0000 (05:34 -0700)
commit27bf80e8dcc3b082182ded6b481af9eb40bffbdb
treefb391c0f44ec5816f90e8944b0724788694d72ee
parentba16bd9d2c9fd82d6f90e2eb348bce6323eb353f
net/mlx4_en: Schedule napi when RX buffers allocation fails

[ Upstream commit 07841f9d94c11afe00c0498cf242edf4075729f4 ]

When system is out of memory, refilling of RX buffers fails while
the driver continue to pass the received packets to the kernel stack.
At some point, when all RX buffers deplete, driver may fall into a
sleep, and not recover when memory for new RX buffers is once again
availible. This is because hardware does not have valid descriptors,
so no interrupt will be generated for the driver to return to work
in napi context. Fix it by schedule the napi poll function from
stats_task delayed workqueue, as long as the allocations fail.

Signed-off-by: Ido Shamay <idos@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
drivers/net/ethernet/mellanox/mlx4/en_rx.c
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h