netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenz Bauer <lmb@cloudflare.com>
To: David Ahern <dsahern@gmail.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 10:38:26 +0100	[thread overview]
Message-ID: <CACAyw9_cGqTs5JW2QyqnTm-M3khieMa7XwD3vqNiXWxRepmqMg@mail.gmail.com> (raw)
In-Reply-To: <b212a92c-7684-8c47-1b63-75762c326a24@gmail.com>

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.

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.

-- 
Lorenz Bauer  |  Systems Engineer
6th Floor, County Hall/The Riverside Building, SE1 7PB, UK

www.cloudflare.com

  reply	other threads:[~2020-05-18  9:38 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 [this message]
2020-05-18 14:32             ` David Ahern
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=CACAyw9_cGqTs5JW2QyqnTm-M3khieMa7XwD3vqNiXWxRepmqMg@mail.gmail.com \
    --to=lmb@cloudflare.com \
    --cc=bpf@vger.kernel.org \
    --cc=dsahern@gmail.com \
    --cc=kernel-team@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).