Message ID | 20230106142523.1234476-1-edumazet@google.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 7871f54e3deed68a27111dda162c4fe9b9c65f8f |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] gro: take care of DODGY packets | expand |
On 06.01.23 15:25, Eric Dumazet 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. > > In the meantime, make sure to detect and flush DODGY packets. > > Fixes: 5eddb24901ee ("gro: add support of (hw)gro packets to gro stack") > Signed-off-by: Eric Dumazet <edumazet@google.com> > Reported-and-bisected-by: Jaroslav Pulchart <jaroslav.pulchart@gooddata.com> 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.
Hello: This patch was applied to netdev/net.git (master) by David S. Miller <davem@davemloft.net>: 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!
diff --git a/net/core/gro.c b/net/core/gro.c index fd8c6a7e8d3e2e6b439109d0089f44a547c7347e..506f83d715f873c9bc3727e28ace71e00fa79d2f 100644 --- a/net/core/gro.c +++ b/net/core/gro.c @@ -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; }
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") Signed-off-by: Eric Dumazet <edumazet@google.com> Reported-and-bisected-by: Jaroslav Pulchart <jaroslav.pulchart@gooddata.com> Cc: Coco Li <lixiaoyan@google.com> Cc: Paolo Abeni <pabeni@redhat.com> --- net/core/gro.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)