diff options
author | hayeswang <hayeswang@realtek.com> | 2017-06-09 09:11:47 (GMT) |
---|---|---|
committer | Xie Xiaobo <xiaobo.xie@nxp.com> | 2017-10-12 08:14:00 (GMT) |
commit | 50fd1a6d79d48a7c35890aecce5a5d6b872a461d (patch) | |
tree | 69419a5d3e2f440ee9dbc68b4ac7a8bddd7eb1d1 | |
parent | 445358482f0e9a1d30c8fd36c2eae581812e086d (diff) | |
download | linux-50fd1a6d79d48a7c35890aecce5a5d6b872a461d.tar.xz |
r8152: avoid rx queue more than 1000 packets
Stop queuing rx packets if it is more than 1000.
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/usb/r8152.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index afb953a..c9c8649 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -1812,6 +1812,10 @@ static int rx_bottom(struct r8152 *tp, int budget) unsigned int pkt_len; struct sk_buff *skb; + /* limite the skb numbers for rx_queue */ + if (unlikely(skb_queue_len(&tp->rx_queue) >= 1000)) + break; + pkt_len = le32_to_cpu(rx_desc->opts1) & RX_LEN_MASK; if (pkt_len < ETH_ZLEN) break; |