From: Tom Herbert <tom@herbertland.com>
To: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
Paolo Abeni <pabeni@redhat.com>,
David Miller <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Willem de Bruijn <willemb@google.com>
Subject: Re: [PATCH net-next] net: sock_rps_record_flow() is for connected sockets
Date: Thu, 8 Dec 2016 12:30:59 -0800 [thread overview]
Message-ID: <CALx6S37uPhDft_GkqyZ7K_E6hrR=c3e7BYA8duQb_O_tEy+_uA@mail.gmail.com> (raw)
In-Reply-To: <1481227516.1898563.813013233.52CC6646@webmail.messagingengine.com>
On Thu, Dec 8, 2016 at 12:05 PM, Hannes Frederic Sowa
<hannes@stressinduktion.org> wrote:
> Hello,
>
> On Thu, Dec 8, 2016, at 20:15, Tom Herbert wrote:
>> On Thu, Dec 8, 2016 at 10:02 AM, Eric Dumazet <eric.dumazet@gmail.com>
>> wrote:
>> > On Thu, 2016-12-08 at 09:49 -0800, Tom Herbert wrote:
>> >
>> >> Of course that would only help on systems where no one enable encaps,
>> >> ie. looks good in the the simple benchmarks but in real life if just
>> >> one socket enables encap everyone else takes the hit. Alternatively,
>> >> maybe we could do early demux when we do the lookup in GRO to
>> >> eliminate the extra lookup?
>> >
>> > Well, if you do the lookup in GRO, wont it be done for every incoming
>> > MSS, instead of once per GRO packet ?
>>
>> We should be able to avoid that. We already do the lookup for every
>> UDP packet going into GRO, would only need to take the refcnt once for
>> the whole GRO packet.
>>
>> >
>> > Anyway, the flooded UDP sockets out there are not normally connected
>>
>> We still should be able to use early demux in that case, just can't
>> avoid the route lookup. I wonder if we might be able to cache a soft
>> route maybe for the last local destination received to help the
>> unconnected sockets case...
>>
>> In any case, I can take a look at of doing early demux from with UDP GRO.
>
> Early demux already breaks ip rules: we might set up a rule so an
> incoming packet might depending on the rule not find an input route at
> all and would be forwarded. Same problem might occur with VRF, when you
> have multiple ip addresses in different "realms".
>
> That said, I don't see why we can't be more aggressive for GRO in the
> unconnected case: we simply must make sure that the current namespace
> holds the ip address, which is simply a hash lookup. After that we can
> even accept packets for a wildcard bounded socket.
>
> Probably we should disable this logic as soon as soon as vrf and/or
> rules are active to have correct semantics.
>
All this gets dicey in the presence of encapsulation. One problem is
that we can't tell when or if a packet crosses network namespace just
by parsing the packet. It's a subset of the general problem of
correctly identifying packets outside of the terminal protocol
processing (we've already talked about the incorrectness of devices
that identify UDP encapsulation based on port numbers). But even
without encapsulation there is still the problem as you point out with
vrf, IPvlan, etc. I think the answer thus far has been to hand wave
and rely on probability, for instance identifying UDP encapsulation by
port number in device probably works almost all of the time. Matching
an unconnected UDP socket in GRO and then accepting a route associated
with that probably would also work nearly all the time. Maybe if we
can quantify the dependencies that early parsing has in this area,
other mechanisms (vrf) might be able to do something intelligent to
ensure correctness-- does seem like a hard problem though!
Tom
> Bye,
> Hannes
next prev parent reply other threads:[~2016-12-08 20:31 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-05 2:43 [RFC] udp: some improvements on RX path Eric Dumazet
2016-12-05 13:22 ` Paolo Abeni
2016-12-05 14:28 ` Eric Dumazet
2016-12-05 15:37 ` Jesper Dangaard Brouer
2016-12-05 15:54 ` Eric Dumazet
2016-12-05 17:57 ` [PATCH] net/udp: do not touch skb->peeked unless really needed Eric Dumazet
2016-12-06 9:53 ` Paolo Abeni
2016-12-06 12:10 ` Paolo Abeni
2016-12-06 14:35 ` Eric Dumazet
2016-12-06 14:34 ` Eric Dumazet
2016-12-06 10:34 ` Paolo Abeni
2016-12-06 17:08 ` Paolo Abeni
2016-12-06 17:47 ` Eric Dumazet
2016-12-06 18:31 ` Paolo Abeni
2016-12-06 18:58 ` Eric Dumazet
2016-12-06 19:16 ` Paolo Abeni
2016-12-06 19:35 ` Eric Dumazet
2016-12-07 3:32 ` [PATCH net-next] net: sock_rps_record_flow() is for connected sockets Eric Dumazet
2016-12-07 6:47 ` Eric Dumazet
2016-12-07 7:57 ` Paolo Abeni
2016-12-07 14:26 ` Eric Dumazet
2016-12-08 17:49 ` Paolo Abeni
2016-12-07 14:29 ` Eric Dumazet
2016-12-07 15:59 ` Eric Dumazet
2016-12-08 18:50 ` Paolo Abeni
2016-12-08 19:32 ` Eric Dumazet
2016-12-08 19:20 ` Edward Cree
2016-12-08 17:49 ` Tom Herbert
2016-12-08 18:02 ` Eric Dumazet
2016-12-08 19:15 ` Tom Herbert
2016-12-08 20:05 ` Hannes Frederic Sowa
2016-12-08 20:30 ` Tom Herbert [this message]
2016-12-08 20:44 ` Tom Herbert
2016-12-08 18:07 ` Eric Dumazet
2016-12-07 7:59 ` Paolo Abeni
2016-12-07 13:58 ` Eric Dumazet
2016-12-07 15:47 ` David Miller
2016-12-07 17:09 ` [PATCH] net/udp: do not touch skb->peeked unless really needed David Laight
2016-12-07 17:32 ` Eric Dumazet
2016-12-07 17:37 ` Hannes Frederic Sowa
2016-12-07 17:52 ` Eric Dumazet
2016-12-07 17:55 ` Eric Dumazet
2016-12-06 15:42 ` David Miller
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='CALx6S37uPhDft_GkqyZ7K_E6hrR=c3e7BYA8duQb_O_tEy+_uA@mail.gmail.com' \
--to=tom@herbertland.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=hannes@stressinduktion.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--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;
as well as URLs for NNTP newsgroup(s).