LKML Archive mirror
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Richard Gobert <richardbgobert@gmail.com>,
	 Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	 davem@davemloft.net,  edumazet@google.com,  kuba@kernel.org,
	 pabeni@redhat.com,  dsahern@kernel.org,  alobakin@pm.me,
	 netdev@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v3 1/2] net: gro: fix udp bad offset in socket lookup by adding {inner_}network_offset to napi_gro_cb
Date: Thu, 25 Apr 2024 09:56:50 -0400	[thread overview]
Message-ID: <662a6122eacff_1de39b29444@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <b330dfad-1ba6-4172-a76b-b965221b15f6@gmail.com>

> >> --- a/net/ipv6/tcpv6_offload.c
> >> +++ b/net/ipv6/tcpv6_offload.c
> >> @@ -29,7 +29,8 @@ struct sk_buff *tcp6_gro_receive(struct list_head *head, struct sk_buff *skb)
> >>  
> >>  INDIRECT_CALLABLE_SCOPE int tcp6_gro_complete(struct sk_buff *skb, int thoff)
> >>  {
> >> -	const struct ipv6hdr *iph = ipv6_hdr(skb);
> >> +	const u16 offset = NAPI_GRO_CB(skb)->network_offsets[skb->encapsulation];
> >> +	const struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + offset);
> >>  	struct tcphdr *th = tcp_hdr(skb);
> >>  
> > 
> > Only udp code is affected, as only that can be used as tunnel.
> > 
> > For bug fixes, let's try to avoid touching other code. Also that vlan.
> > 
> > As a minimal patch all that is needed is the following, right?
> > 
> > - add the fields
> > - store in inet_gro_receive + ipv6_gro_receive
> > - read in udp[46]_gro_complete and udp[46]_lib_lookup_skb
> > 
> 
> This approach is smaller, thanks for writing it down.
> 
> What do you think about doing this and still writing to
> inner_network_offset exclusively in {inet,ipv6}_gro_receive? I still
> prefer it for reasons discussed in the previous series. The code line
> in vlan_gro_receive will still be there, but that will be the only
> addition to your snippet.

That sounds fine, thanks.

  reply	other threads:[~2024-04-25 13:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24 16:30 [PATCH net v3 0/2] net: gro: add flush/flush_id checks and fix wrong offset in udp Richard Gobert
2024-04-24 16:30 ` [PATCH net v3 1/2] net: gro: fix udp bad offset in socket lookup by adding {inner_}network_offset to napi_gro_cb Richard Gobert
2024-04-25  2:15   ` Willem de Bruijn
2024-04-25 11:59     ` Richard Gobert
2024-04-25 13:56       ` Willem de Bruijn [this message]
2024-04-24 16:30 ` [PATCH net v3 2/2] net: gro: add flush check in udp_gro_receive_segment Richard Gobert
2024-04-25  2:45   ` Willem de Bruijn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=662a6122eacff_1de39b29444@willemb.c.googlers.com.notmuch \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=alobakin@pm.me \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardbgobert@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).