Skip to content

Commit be6cef6

Browse files
logostdavem330
authored andcommitted
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: 970a2e9 ("net: ethernet: aquantia: Vector operations") Signed-off-by: Igor Russkikh <[email protected]> Signed-off-by: Dmitry Bogdanov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5c47e3b commit be6cef6

File tree

1 file changed

+2
-1
lines changed
  • drivers/net/ethernet/aquantia/atlantic

1 file changed

+2
-1
lines changed

drivers/net/ethernet/aquantia/atlantic/aq_vec.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ static int aq_vec_poll(struct napi_struct *napi, int budget)
8686
}
8787
}
8888

89+
err_exit:
8990
if (!was_tx_cleaned)
9091
work_done = budget;
9192

@@ -95,7 +96,7 @@ static int aq_vec_poll(struct napi_struct *napi, int budget)
9596
1U << self->aq_ring_param.vec_idx);
9697
}
9798
}
98-
err_exit:
99+
99100
return work_done;
100101
}
101102

0 commit comments

Comments
 (0)