All of lore.kernel.org
 help / color / mirror / Atom feed
* BUG: Incorrect MTU on GRE device if remote is unspecified
@ 2021-01-25 20:10 Slava Bacherikov
  2021-01-28  0:56 ` Jakub Kicinski
  0 siblings, 1 reply; 4+ messages in thread
From: Slava Bacherikov @ 2021-01-25 20:10 UTC (permalink / raw)
  To: xiyou.wangcong, willemb; +Cc: open list, netdev, kuba

Hi, I'd like to report a regression. Currently, if you create GRE
interface on the latest stable or LTS kernel (5.4 branch) with
unspecified remote destination it's MTU will be adjusted for header size
twice. For example:

$ ip link add name test type gre local 127.0.0.32
$ ip link show test | grep mtu
27: test@NONE: <NOARP> mtu 1452 qdisc noop state DOWN mode DEFAULT group
default qlen 1000

or with FOU

$ ip link add name test2   type gre local 127.0.0.32 encap fou
encap-sport auto encap-dport 6666
$ ip link show test2 | grep mtu
28: test2@NONE: <NOARP> mtu 1436 qdisc noop state DOWN mode DEFAULT
group default qlen 1000

The same happens with GUE too (MTU is 1428 instead of 1464).
As you can see that MTU in first case is 1452 (1500 - 24 - 24) and with
FOU it's 1436 (1500 - 32 - 32), GUE 1428 (1500 - 36 - 36). If remote
address is specified MTU is correct.

This regression caused by fdafed459998e2be0e877e6189b24cb7a0183224 commit.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BUG: Incorrect MTU on GRE device if remote is unspecified
  2021-01-25 20:10 BUG: Incorrect MTU on GRE device if remote is unspecified Slava Bacherikov
@ 2021-01-28  0:56 ` Jakub Kicinski
  2021-01-28  1:38   ` Cong Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2021-01-28  0:56 UTC (permalink / raw)
  To: xiyou.wangcong; +Cc: Slava Bacherikov, willemb, open list, netdev

On Mon, 25 Jan 2021 22:10:10 +0200 Slava Bacherikov wrote:
> Hi, I'd like to report a regression. Currently, if you create GRE
> interface on the latest stable or LTS kernel (5.4 branch) with
> unspecified remote destination it's MTU will be adjusted for header size
> twice. For example:
> 
> $ ip link add name test type gre local 127.0.0.32
> $ ip link show test | grep mtu
> 27: test@NONE: <NOARP> mtu 1452 qdisc noop state DOWN mode DEFAULT group
> default qlen 1000
> 
> or with FOU
> 
> $ ip link add name test2   type gre local 127.0.0.32 encap fou
> encap-sport auto encap-dport 6666
> $ ip link show test2 | grep mtu
> 28: test2@NONE: <NOARP> mtu 1436 qdisc noop state DOWN mode DEFAULT
> group default qlen 1000
> 
> The same happens with GUE too (MTU is 1428 instead of 1464).
> As you can see that MTU in first case is 1452 (1500 - 24 - 24) and with
> FOU it's 1436 (1500 - 32 - 32), GUE 1428 (1500 - 36 - 36). If remote
> address is specified MTU is correct.
> 
> This regression caused by fdafed459998e2be0e877e6189b24cb7a0183224 commit.

Cong is this one on your radar?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BUG: Incorrect MTU on GRE device if remote is unspecified
  2021-01-28  0:56 ` Jakub Kicinski
@ 2021-01-28  1:38   ` Cong Wang
  2021-01-28  2:12     ` Vadim Fedorenko
  0 siblings, 1 reply; 4+ messages in thread
From: Cong Wang @ 2021-01-28  1:38 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Slava Bacherikov, Willem de Bruijn, open list,
	Linux Kernel Network Developers, Xie He

On Wed, Jan 27, 2021 at 4:56 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Mon, 25 Jan 2021 22:10:10 +0200 Slava Bacherikov wrote:
> > Hi, I'd like to report a regression. Currently, if you create GRE
> > interface on the latest stable or LTS kernel (5.4 branch) with
> > unspecified remote destination it's MTU will be adjusted for header size
> > twice. For example:
> >
> > $ ip link add name test type gre local 127.0.0.32
> > $ ip link show test | grep mtu
> > 27: test@NONE: <NOARP> mtu 1452 qdisc noop state DOWN mode DEFAULT group
> > default qlen 1000
> >
> > or with FOU
> >
> > $ ip link add name test2   type gre local 127.0.0.32 encap fou
> > encap-sport auto encap-dport 6666
> > $ ip link show test2 | grep mtu
> > 28: test2@NONE: <NOARP> mtu 1436 qdisc noop state DOWN mode DEFAULT
> > group default qlen 1000
> >
> > The same happens with GUE too (MTU is 1428 instead of 1464).
> > As you can see that MTU in first case is 1452 (1500 - 24 - 24) and with
> > FOU it's 1436 (1500 - 32 - 32), GUE 1428 (1500 - 36 - 36). If remote
> > address is specified MTU is correct.
> >
> > This regression caused by fdafed459998e2be0e877e6189b24cb7a0183224 commit.
>
> Cong is this one on your radar?

Yeah, I guess ipgre_link_update() somehow gets called twice,
but I will need to look into it.

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BUG: Incorrect MTU on GRE device if remote is unspecified
  2021-01-28  1:38   ` Cong Wang
@ 2021-01-28  2:12     ` Vadim Fedorenko
  0 siblings, 0 replies; 4+ messages in thread
From: Vadim Fedorenko @ 2021-01-28  2:12 UTC (permalink / raw)
  To: Cong Wang, Jakub Kicinski
  Cc: Slava Bacherikov, Willem de Bruijn, open list,
	Linux Kernel Network Developers, Xie He

On 28.01.2021 01:38, Cong Wang wrote:
> On Wed, Jan 27, 2021 at 4:56 PM Jakub Kicinski <kuba@kernel.org> wrote:
>>
>> On Mon, 25 Jan 2021 22:10:10 +0200 Slava Bacherikov wrote:
>>> Hi, I'd like to report a regression. Currently, if you create GRE
>>> interface on the latest stable or LTS kernel (5.4 branch) with
>>> unspecified remote destination it's MTU will be adjusted for header size
>>> twice. For example:
>>>
>>> $ ip link add name test type gre local 127.0.0.32
>>> $ ip link show test | grep mtu
>>> 27: test@NONE: <NOARP> mtu 1452 qdisc noop state DOWN mode DEFAULT group
>>> default qlen 1000
>>>
>>> or with FOU
>>>
>>> $ ip link add name test2   type gre local 127.0.0.32 encap fou
>>> encap-sport auto encap-dport 6666
>>> $ ip link show test2 | grep mtu
>>> 28: test2@NONE: <NOARP> mtu 1436 qdisc noop state DOWN mode DEFAULT
>>> group default qlen 1000
>>>
>>> The same happens with GUE too (MTU is 1428 instead of 1464).
>>> As you can see that MTU in first case is 1452 (1500 - 24 - 24) and with
>>> FOU it's 1436 (1500 - 32 - 32), GUE 1428 (1500 - 36 - 36). If remote
>>> address is specified MTU is correct.
>>>
>>> This regression caused by fdafed459998e2be0e877e6189b24cb7a0183224 commit.
>>
>> Cong is this one on your radar?
> 
> Yeah, I guess ipgre_link_update() somehow gets called twice,
> but I will need to look into it.
> 
> Thanks.
> 

Hi!
The problem is in ip_tunnel_bind_dev() where mtu is set for tunnel device.

   	if (tdev) {
		hlen = tdev->hard_header_len + tdev->needed_headroom;
		mtu = min(tdev->mtu, IP_MAX_MTU);
	}

	dev->needed_headroom = t_hlen + hlen;
	mtu -= (dev->hard_header_len + t_hlen);

ipgre_tunnel_init sets hard_header_len to tunnel->hlen + sizeof(*iph) and
ip_tunnel_bind_dev adds header overhead once again.

I'll post a patch a bit later but I need someone with extended tests.

Thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-28  2:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25 20:10 BUG: Incorrect MTU on GRE device if remote is unspecified Slava Bacherikov
2021-01-28  0:56 ` Jakub Kicinski
2021-01-28  1:38   ` Cong Wang
2021-01-28  2:12     ` Vadim Fedorenko

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.