Netdev Archive on
help / color / mirror / Atom feed
From: Xie He <>
To: Willem de Bruijn <>
Cc: "David S. Miller" <>,
	Jakub Kicinski <>,
	Network Development <>,
	linux-kernel <>,
	Linux X25 <>,
	Martin Schiller <>
Subject: Re: [PATCH net] drivers/net/wan/lapbether: Added needed_tailroom
Date: Mon, 10 Aug 2020 11:13:46 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Mon, Aug 10, 2020 at 12:32 AM Willem de Bruijn
<> wrote:
> What happens when a tunnel device passes a packet to these devices?
> That will also not have allocated the extra tailroom. Does that cause
> a bug?

I looked at the code in net/ipv4/ip_tunnel.c. It indeed appeared to me
that it didn't take needed_tailroom into consideration. However it
does take needed_headroom into consideration through the macro
LL_RESERVED_SPACE. I think it would be better for it to take
needed_tailroom into consideration, too.

However, looking at the comment of needed_tailroom in
include/linux/netdevice.h, it says "Extra tailroom the hardware may
need, but not in all cases can this be guaranteed". So if we take this
comment as the spec, we can consider this to be not a bug. The reason
the author of this comment said so, might be that he wanted to add
needed_tailroom to solve some problems, but he was not able to change
all code to take needed_tailroom into consideration, so he wrote in
the comment saying that it was not necessary to always guarantee

If we take this comment as the spec, to prevent bugs, any driver that
sets needed_tailroom must always check (and re-allocate if necessary)
before using the tailroom.

However, I still think it would be better to always take into
consideration needed_tailroom (and needed_headroom, too), so that
eventually we can remove the words of "but not in all cases can this
be guaranteed" from the comment. That would make the code more logical
and consistent.

Thank you for raising this important question about needed_tailroom!

  reply	other threads:[~2020-08-10 18:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-08 17:52 Xie He
2020-08-09  8:48 ` Willem de Bruijn
2020-08-09 17:11   ` Xie He
2020-08-10  7:31     ` Willem de Bruijn
2020-08-10 18:13       ` Xie He [this message]
2020-08-16  2:28         ` Xie He
2020-08-19  0:17 ` Xie He
2020-08-19 22:11 ` Xie He

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='' \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH net] drivers/net/wan/lapbether: Added needed_tailroom' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).