BPF List
 help / color / mirror / Atom feed
From: Lina Wang <lina.wang@mediatek.com>
To: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>
Cc: "Network Development" <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	bpf <bpf@vger.kernel.org>,
	"Maciej Żenczykowski" <maze@google.com>,
	"Willem de Bruijn" <willemb@google.com>,
	"Eric Dumazet" <edumazet@google.com>
Subject: Re: [PATCH v3] net: fix wrong network header length
Date: Thu, 17 Feb 2022 15:01:39 +0800	[thread overview]
Message-ID: <20220217070139.30028-1-lina.wang@mediatek.com> (raw)
In-Reply-To: <CAADnVQK78PN8N6c6u_O2BAxdyXwH_HVYMV_x3oGgyfT50a6ymg@mail.gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="y", Size: 1604 bytes --]

On Wed, 2022-02-16 at 19:05 -0800, Alexei Starovoitov wrote:
> On Tue, Feb 15, 2022 at 11:37 PM Lina Wang <lina.wang@mediatek.com>
> wrote:
> > 
> > When clatd starts with ebpf offloaing, and NETIF_F_GRO_FRAGLIST is
> > enable,
> > several skbs are gathered in skb_shinfo(skb)->frag_list. The first
> > skb's
> > ipv6 header will be changed to ipv4 after bpf_skb_proto_6_to_4,
> > network_header\transport_header\mac_header have been updated as
> > ipv4 acts,
> > but other skbs in frag_list didnot update anything, just ipv6
> > packets.
> 
> Please add a test that demonstrates the issue and verifies the fix.

I used iperf udp test to verify the patch, server peer enabled -d to debug
received packets.

192.0.0.4 is clatd interface ip, corresponding ipv6 addr is 
2000:1:1:1:afca:1b1f:1a9:b367, server peer ip is 1.1.1.1,
whose ipv6 is 2004:1:1:1::101:101.

Without the patch, when udp length 2840 packets received, iperf shows:
pcount 1 packet_count 0
pcount 27898727 packet_count 1
pcount 3 packet_count 27898727

pcount should be 2, but is 27898727(0x1a9b367) , which is 20 bytes put 
forward. 

12:08:02.680299	Unicast to us 2004:1:1:1::101:101   2000:1:1:1:afca:1b1f:1a9:b367 UDP 51196 → 5201 Len=2840
0000   20 00 00 01 00 01 00 01 af ca 1b 1f 01 a9 b3 67   ipv6 dst address
0000   c7 fc 14 51 0b 20 c7 ab                           udp header
0000   00 00 00 ab 00 0e f3 49 00 00 00 01 08 06 69 d2   00000001 is pcount
12:08:02.682084	Unicast to us	1.1.1.1	                 192.0.0.4 	 	  UDP 51196 → 5201 Len=2840

After applied the patch, there is no OOO, pcount acted in order.

Thanks!

  reply	other threads:[~2022-02-17  7:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-16  7:30 [PATCH v3] net: fix wrong network header length Lina Wang
2022-02-17  3:05 ` Alexei Starovoitov
2022-02-17  7:01   ` Lina Wang [this message]
2022-02-17  8:45     ` Paolo Abeni
2022-02-17 17:05       ` Alexei Starovoitov
2022-02-18  2:23         ` Lina Wang
2022-04-07  9:38         ` Lina Wang

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=20220217070139.30028-1-lina.wang@mediatek.com \
    --to=lina.wang@mediatek.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=maze@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=willemb@google.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