From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: lirongqing@baidu.com, netdev@vger.kernel.org
Subject: Re: [PATCH][net-next] net: slightly optimize eth_type_trans
Date: Sat, 17 Nov 2018 20:06:18 -0800 (PST) [thread overview]
Message-ID: <20181117.200618.1664143348881472089.davem@davemloft.net> (raw)
In-Reply-To: <4c39a882-2d58-f258-9bd2-df0b2540be41@gmail.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 17 Nov 2018 17:19:34 -0800
> I might have been not very clear.
>
> Issue is that with macvlan and GRO-friend traffic we can receive the following packets :
>
> P1-P2 with PACKET_OTHERHOST because eth_type_trans() detected the dst MAC is not the eth0 device mac address.
>
> P2 has been aggregated to P1, so the sk_buff has been put to napi->skb via napi_reuse_skb()
>
> Then we receive on same NAPI packet P3, for this host, reusing napi->skb that was saved (old P2 sk_buff).
> skb->pkt_type is PACKET_OTHERHOST.
>
> eth_type_trans() does not change skb->pkt_type because ethernet dst mac address is our ethernet mac address.
>
> -> We feed the upper stack with P3, with incorrect pkt_type.
>
> -> packet is dropped because pkt_type != PACKET_HOST, for example in tcp_v4_rcv()
Oh I see, it is about defaults when using skb freshly from cache for another new packet.
Yes, I completely agree with your suggested patch.
Thanks for explaining.
prev parent reply other threads:[~2018-11-18 14:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-13 1:34 [PATCH][net-next] net: slightly optimize eth_type_trans Li RongQing
2018-11-15 23:11 ` David Miller
2018-11-17 22:37 ` Eric Dumazet
2018-11-18 0:51 ` David Miller
2018-11-18 1:19 ` Eric Dumazet
2018-11-18 4:06 ` David Miller [this message]
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=20181117.200618.1664143348881472089.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=lirongqing@baidu.com \
--cc=netdev@vger.kernel.org \
/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