Skip to content
Commit fdcf7765 authored by Ma JieYue's avatar Ma JieYue Committed by David S. Miller
Browse files

xen-netfront: fix missing rx_refill_timer when allocate memory failed



There was a bug in xennet_alloc_rx_buffers, when allocating page or
sk_buff failed, and at the same time rx_batch queue not empty,
the rx_refill_timer timer won't be scheduled. If finally the remaining
request buffers in rx ring less than what backend driver expected,
the backend driver would think of rx ring as full and start dropping packets.
In such situation, there is no way for the netfront driver to recover
automatically, so that the device can not work properly.

The patch fixes the problem by always scheduling rx_refill_timer timer when
alloc_page or __netdev_alloc_skb fails, no matter whether rx_batch queue is
empty or not. It ensures that the rx ring request buffers will finally meet
the backend needs.

Signed-off-by: default avatarMa JieYue <jieyue.majy@alibaba-inc.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 018c5bba
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment