blob: 779491c8db0e1f535da6df8caab314bff5b2e352 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: "Jason A. Donenfeld" <Jason@zx2c4.com>
3Date: Thu, 2 Jan 2020 17:47:51 +0100
4Subject: [PATCH] wireguard: socket: mark skbs as not on list when receiving
5 via gro
6
7commit 736775d06bac60d7a353e405398b48b2bd8b1e54 upstream.
8
9Certain drivers will pass gro skbs to udp, at which point the udp driver
10simply iterates through them and passes them off to encap_rcv, which is
11where we pick up. At the moment, we're not attempting to coalesce these
12into bundles, but we also don't want to wind up having cascaded lists of
13skbs treated separately. The right behavior here, then, is to just mark
14each incoming one as not on a list. This can be seen in practice, for
15example, with Qualcomm's rmnet_perf driver.
16
17Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
18Tested-by: Yaroslav Furman <yaro330@gmail.com>
19Signed-off-by: David S. Miller <davem@davemloft.net>
20Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
21---
22 drivers/net/wireguard/socket.c | 1 +
23 1 file changed, 1 insertion(+)
24
25--- a/drivers/net/wireguard/socket.c
26+++ b/drivers/net/wireguard/socket.c
27@@ -333,6 +333,7 @@ static int wg_receive(struct sock *sk, s
28 wg = sk->sk_user_data;
29 if (unlikely(!wg))
30 goto err;
31+ skb_mark_not_on_list(skb);
32 wg_packet_receive(wg, skb);
33 return 0;
34