Commit be6cef69 authored by Dmitry Bogdanov's avatar Dmitry Bogdanov Committed by David S. Miller
Browse files

net: aquantia: fix out of memory condition on rx side

On embedded environments with hard memory limits it is a normal although
rare case when skb can't be allocated on rx part under high traffic.

In such OOM cases napi_complete_done() was not called.
So the napi object became in an invalid state like it is "scheduled".
Kernel do not re-schedules the poll of that napi object.

Consequently, kernel can not remove that object the system hangs on
`ifconfig down` waiting for a poll.

We are fixing this by gracefully closing napi poll routine with correct
invocation of napi_complete_done.

This was reproduced with artificially failing the allocation of skb to
simulate an "out of memory" error case and check that traffic does
not get stuck.

Fixes: 970a2e98

 ("net: ethernet: aquantia: Vector operations")
Signed-off-by: default avatarIgor Russkikh <>
Signed-off-by: default avatarDmitry Bogdanov <>
Signed-off-by: default avatarDavid S. Miller <>
parent 5c47e3ba
......@@ -86,6 +86,7 @@ static int aq_vec_poll(struct napi_struct *napi, int budget)
if (!was_tx_cleaned)
work_done = budget;
......@@ -95,7 +96,7 @@ static int aq_vec_poll(struct napi_struct *napi, int budget)
1U << self->aq_ring_param.vec_idx);
return work_done;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment