From: David Ahern <dsahern@gmail.com>
To: Lorenz Bauer <lmb@cloudflare.com>
Cc: bpf <bpf@vger.kernel.org>, Networking <netdev@vger.kernel.org>,
Martynas Pumputis <m@lambda.lt>,
kernel-team <kernel-team@cloudflare.com>
Subject: Re: "Forwarding" from TC classifier
Date: Mon, 18 May 2020 08:32:35 -0600 [thread overview]
Message-ID: <a2a496b1-59a7-87ce-75f4-c9b43e23ff6a@gmail.com> (raw)
In-Reply-To: <CACAyw9_cGqTs5JW2QyqnTm-M3khieMa7XwD3vqNiXWxRepmqMg@mail.gmail.com>
On 5/18/20 3:38 AM, Lorenz Bauer wrote:
> On Fri, 15 May 2020 at 15:24, David Ahern <dsahern@gmail.com> wrote:
>>
>> On 5/15/20 3:59 AM, Lorenz Bauer wrote:
>>>
>>> Yes, but that doesn't play well with changing the source address to
>>> the local machine's, since the upper part of the stack will drop the
>>> packet due to accept_local=0.
>>
>> Can you defer the source address swap to the Tx path? Let the packet go
>> up the stack and do the fib lookup again as an skb. neighbor entry does
>> not exist, so the packet is stashed, neighbor resolution done, once
>> resolved the packet goes out. tc program on the egress device can flip
>> the source address, and then subsequent packets take the XDP fast path.
>
> Hm, that's an interesting idea! I guess this means I have to mark the packet
> somehow, to make sure I can identify it on the TX path. Plus, in theory
> the packet could exit via any interface, so I'd have to attach classifiers to
> a bunch of places if I want to be on the safe side.
Shared blocks might save you some overhead. Create a filter block that
is shared across devices.
>
> Upside: this seems doable in current kernels. Downside: seems more fragile
> than I'd like.
>
> Thanks for the thought, I'll play around with it :)
>
>>
>> If the next host is on the same LAN I believe the stack will want to
>> generate an ICMP redirect, but that can be squashed.
>
next prev parent reply other threads:[~2020-05-18 14:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-13 16:40 "Forwarding" from TC classifier Lorenz Bauer
2020-05-13 17:48 ` David Ahern
2020-05-14 15:41 ` Lorenz Bauer
2020-05-14 18:54 ` David Ahern
2020-05-15 9:59 ` Lorenz Bauer
2020-05-15 14:24 ` David Ahern
2020-05-18 9:38 ` Lorenz Bauer
2020-05-18 14:32 ` David Ahern [this message]
2020-05-13 21:23 ` David Ahern
2020-05-14 15:41 ` Lorenz Bauer
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=a2a496b1-59a7-87ce-75f4-c9b43e23ff6a@gmail.com \
--to=dsahern@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=kernel-team@cloudflare.com \
--cc=lmb@cloudflare.com \
--cc=m@lambda.lt \
--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;
as well as URLs for NNTP newsgroup(s).