eceb0b92551e9fc6f6932be913393938f5f9e6b7
[openwrt/staging/wigyori.git] /
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: "Jason A. Donenfeld" <Jason@zx2c4.com>
3 Date: Wed, 24 Jun 2020 16:06:03 -0600
4 Subject: [PATCH] wireguard: receive: account for napi_gro_receive never
5 returning GRO_DROP
6
7 commit df08126e3833e9dca19e2407db5f5860a7c194fb upstream.
8
9 The napi_gro_receive function no longer returns GRO_DROP ever, making
10 handling GRO_DROP dead code. This commit removes that dead code.
11 Further, it's not even clear that device drivers have any business in
12 taking action after passing off received packets; that's arguably out of
13 their hands.
14
15 Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
16 Fixes: 6570bc79c0df ("net: core: use listified Rx for GRO_NORMAL in napi_gro_receive()")
17 Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
18 Signed-off-by: David S. Miller <davem@davemloft.net>
19 Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
20 ---
21 drivers/net/wireguard/receive.c | 10 ++--------
22 1 file changed, 2 insertions(+), 8 deletions(-)
23
24 --- a/drivers/net/wireguard/receive.c
25 +++ b/drivers/net/wireguard/receive.c
26 @@ -414,14 +414,8 @@ static void wg_packet_consume_data_done(
27 if (unlikely(routed_peer != peer))
28 goto dishonest_packet_peer;
29
30 - if (unlikely(napi_gro_receive(&peer->napi, skb) == GRO_DROP)) {
31 - ++dev->stats.rx_dropped;
32 - net_dbg_ratelimited("%s: Failed to give packet to userspace from peer %llu (%pISpfsc)\n",
33 - dev->name, peer->internal_id,
34 - &peer->endpoint.addr);
35 - } else {
36 - update_rx_stats(peer, message_data_len(len_before_trim));
37 - }
38 + napi_gro_receive(&peer->napi, skb);
39 + update_rx_stats(peer, message_data_len(len_before_trim));
40 return;
41
42 dishonest_packet_peer: