Skip to contentSkip to conversation

gro: take care of DODGY packets

PATCH Applied Eric Dumazet 3 participants 3 messages Jan 6, 2023 – Jan 9, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gro: take care of DODGY packets

Jaroslav reported a recent throughput regression with virtio_net caused by blamed commit.

It is unclear if DODGY GSO packets coming from user space can be accepted by GRO engine in the future with minimal changes, and if there is any expected gain from it.

In the meantime, make sure to detect and flush DODGY packets.

Fixes 5eddb24901ee ("gro: add support of (hw)gro packets to gro stack")
Cc Coco Li <[email protected]>
Cc Paolo Abeni <[email protected]>
---
 net/core/gro.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
net/core/gro.c +3 -2
index fd8c6a7e8d3e2e6b439109d0089f44a547c7347e..506f83d715f873c9bc3727e28ace71e00fa79d2f 100644
@@ -505,8 +505,9 @@ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff
 	NAPI_GRO_CB(skb)->count = 1;
 	if (unlikely(skb_is_gso(skb))) {
 		NAPI_GRO_CB(skb)->count = skb_shinfo(skb)->gso_segs;
-		/* Only support TCP at the moment. */
-		if (!skb_is_gso_tcp(skb))
+		/* Only support TCP and non DODGY users. */
+		if (!skb_is_gso_tcp(skb) ||
+		    (skb_shinfo(skb)->gso_type & SKB_GSO_DODGY))
 			NAPI_GRO_CB(skb)->flush = 1;
 	}
 
Signature · 1 line
2.39.0.314.g84b9a713c41-goog
#1 lore raw
Quoted 7 lines · Eric Dumazet

Jaroslav reported a recent throughput regression with virtio_net caused by blamed commit.

It is unclear if DODGY GSO packets coming from user space can be accepted by GRO engine in the future with minimal changes, and if there is any expected gain from it.

Quoted 5 lines

In the meantime, make sure to detect and flush DODGY packets.

Fixes 5eddb24901ee ("gro: add support of (hw)gro packets to gro stack")

Many thx for taking care of this. There is one small thing to improve, please add the following tag here to make things easier for future code archaeologists:

Link:
https://lore.kernel.org/r/CAK8fFZ5pzMaw3U1KXgC_OK4shKGsN=HDcR62cfPOuL0umXE1Ww@mail.gmail.com/

To explain: Linus[1] and others considered proper link tags important in cases like this, as they allow anyone to look into the backstory of a commit weeks or years later. That's nothing new, the documentation[2] for some time says to place tags in cases like this. I care personally (and made it a bit more explicit in the docs a while ago), because these tags make my regression tracking efforts a whole lot easier, as they allow my tracking bot 'regzbot' to automatically connect reports with patches posted or committed to fix tracked regressions.

Apropos regzbot, let me tell regzbot to monitor this thread:

#regzbot ^backmonitor:
https://lore.kernel.org/r/CAK8fFZ5pzMaw3U1KXgC_OK4shKGsN=HDcR62cfPOuL0umXE1Ww@mail.gmail.com/

Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)

[1] for details, see:
https://lore.kernel.org/all/CAHk-=wjMmSZzMJ3Xnskdg4+GGz=5p5p+GSYyFBTh0f-DgvdBWg@mail.gmail.com/
https://lore.kernel.org/all/CAHk-=wgs38ZrfPvy=nOwVkVzjpM3VFU1zobP37Fwd_h9iAD5JQ@mail.gmail.com/
https://lore.kernel.org/all/CAHk-=wjxzafG-=J8oT30s7upn4RhBs6TX-uVFZ5rME+L5_DoJA@mail.gmail.com/

[2] see Documentation/process/submitting-patches.rst
(http://docs.kernel.org/process/submitting-patches.html) and Documentation/process/5.Posting.rst
(https://docs.kernel.org/process/5.Posting.html)

--
Everything you wanna know about Linux kernel regression tracking:
https://linux-regtracking.leemhuis.info/about/#tldr
If I did something stupid, please tell me, as explained on that page.

#2 lore raw
In reply to Eric Dumazet
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:

Quoted 8 lines · On Fri, 6 Jan 2023 14:25:23 +0000 you wrote:

Jaroslav reported a recent throughput regression with virtio_net caused by blamed commit.

It is unclear if DODGY GSO packets coming from user space can be accepted by GRO engine in the future with minimal changes, and if there is any expected gain from it.

[...]

Here is the summary with links:
- [net] gro: take care of DODGY packets

    https://git.kernel.org/netdev/net/c/7871f54e3dee

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html