All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Netdev <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	kuba@kernel.org, hannes@stressinduktion.org
Subject: Re: Routing loops & TTL tracking with tunnel devices
Date: Fri, 29 Apr 2022 02:37:29 +0200	[thread overview]
Message-ID: <YmszSXueTxYOC41G@zx2c4.com> (raw)
In-Reply-To: <CAHmME9oTU7HwP5=qo=aFWe0YXv5EPGoREpF2k-QY7qTmkDeXEA@mail.gmail.com>

Hey Eric,

On Tue, Nov 17, 2015 at 03:41:35AM +0100, Jason A. Donenfeld wrote:
> On Mon, Nov 16, 2015 at 11:28 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > There is very little chance we'll accept a new member in sk_buff, unless
> > proven needed.
> 
> I actually have no intention of doing this! I'm wondering if there
> already is a member in sk_buff that moonlights as my desired ttl
> counter, or if there's another mechanism for avoiding routing loops. I
> want to work with what's already there, rather than meddling with the
> innards of important and memory sensitive structures such as sk_buff.

Well, 7 years later... Maybe you have a better idea now of what I was
working on then. :)

As an update on this issue, it's still quasi problematic. To review, I
can't use the TTL value, because the outer packet always must get the
TTL of the route to the outer destination, not the inner packet minus
one. I can't rely on reaching MTU size, because people want this to work
with fragmentation (see [1] for my attempt to disallow fragmentation for
this issue, which resulted in hoots and hollers). I can't use the
per-cpu xmit_recursion variable, because I use threads.

What I can sort of use is taking advantage of what looks like a bug in
pskb expansion, such that it always allocates too much, and pretty
quickly fails allocations after a few loops. Only powerpc64 and s390x
don't appear to have this bug. See [2] for a description of this in
depth I wrote a few months ago to you.

Anyway, it'd be nice if there were a free u8 somewhere in sk_buff that I
could use for tracking times through the stack. Other kernels have this
but afaict Linux still does not. I looked into trying to overload some
existing fields -- tstamp/skb_mstamp_ns or queue_mapping -- which I was
thinking might be totally unused on TX?

Any ideas about this?

Thanks,
Jason

[1] https://lore.kernel.org/wireguard/CAHmME9rNnBiNvBstb7MPwK-7AmAN0sOfnhdR=eeLrowWcKxaaQ@mail.gmail.com/
[2] https://lore.kernel.org/netdev/CAHmME9pv1x6C4TNdL6648HydD8r+txpV4hTUXOBVkrapBXH4QQ@mail.gmail.com/

  reply	other threads:[~2022-04-29  0:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 20:14 Routing loops & TTL tracking with tunnel devices Jason A. Donenfeld
2015-11-16 20:37 ` Sowmini Varadhan
2015-11-16 20:55   ` Jason A. Donenfeld
2015-11-16 20:59     ` Sowmini Varadhan
2015-11-16 22:28     ` Eric Dumazet
2015-11-17  2:41       ` Jason A. Donenfeld
2022-04-29  0:37         ` Jason A. Donenfeld [this message]
2022-04-29 20:54           ` Eric Dumazet
2022-04-29 21:07             ` Jason A. Donenfeld
     [not found]               ` <d9854c74-c209-9ea5-6c76-8390e867521b@gmail.com>
2022-04-29 21:53                 ` Jason A. Donenfeld
2022-04-29 22:05                   ` Eric Dumazet
2022-04-29 22:09                     ` Jason A. Donenfeld
2022-04-29 22:46                       ` Eric Dumazet
2015-11-16 22:25 ` Hannes Frederic Sowa
2015-11-17  2:57   ` Jason A. Donenfeld

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=YmszSXueTxYOC41G@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=eric.dumazet@gmail.com \
    --cc=hannes@stressinduktion.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.