All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Gushchin <klamm@yandex-team.ru>
To: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: David Miller <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] net: sysctl for RA default route MTU
Date: Wed, 08 Apr 2015 22:03:56 +0300	[thread overview]
Message-ID: <211371428519836@webcorp02f.yandex-team.ru> (raw)
In-Reply-To: <1428422310.2928.8.camel@stressinduktion.org>

07.04.2015, 18:58, "Hannes Frederic Sowa" <hannes@stressinduktion.org>:
>  On Do, 2015-04-02 at 21:08 +0300, Roman Gushchin wrote:
>>>>    The next question I have is about the behavior of the new setting
>>>>    in the presence of an RA MTU option.  It seems like the sysctl
>>>>    doesn't override that RA MTU option, but rather just clamps it.
>>>>
>>>>    And then if it's in range, this controls only whether the default
>>>>    route has it's MTU adjusted.
>>>>
>>>>    That doesn't make any sense to me if we then go and do the
>>>>    rt6_mtu_change() call unconditionally.  The route metric update
>>>>    and the rt6_mtu_change() go hand in hand.
>>>   Agreed but that gets interesting:
>>>
>>>   I guess during testing the cnf.mtu6 value was equal to the newly
>>>   announced mtu value, so the rt6_mtu_change call does not happen. We
>>>   update cnf.mtu6 so a second RA packet would actually bring the system
>>>   into the desired state but we have a moment where the default route
>>>   carries a too big MTU. That's not good.
>>   Agreed.
>>>   Easiest solution is to reorder those calls but that also leaves us with
>>>   a time frame where we carry the incorrect MTU on the default route.
>>>   Otherwise we must conditionally filter out the default routes.
>>>   Roman, any ideas?
>>   I think, such approach will work on practise, but looks not very beatiful.
>>
>>   May be, a better idea is to serarate per-route and per-device MTU,
>>   so an updating of per-device MTU will not affect per-route MTU.
>>   Actual MTU can always been calculated as min(route_mtu, device_mtu),
>>   but we wouldn't need to update mtu on each route on receiving RA MTU option,
>>   for instance.
>>
>>   Do you see any problems with such approach?
>  If I understood you correct this actually seems to be quite an intrusive
>  change? :/ Can you show me some code how to do this?

Too intrusive, really)

>  I would also dislike adding a filtering capability to the route mtu
>  updates. Currently I don't have a god idea, sorry.

Hmm, I thought a bit more about this issue... And It seems to me now, that there is no issue at all.
If RA MTU is larger than ra_default_route_mtu, rt6_mtu_change() will not update it,
because dst_mtu(&rt->dst) != idev->cnf.mtu6 :
	if (rt->dst.dev == arg->dev &&
	    !dst_metric_locked(&rt->dst, RTAX_MTU) &&
	    (dst_mtu(&rt->dst) >= arg->mtu ||
	     (dst_mtu(&rt->dst) < arg->mtu &&
	      dst_mtu(&rt->dst) == idev->cnf.mtu6))) {
		dst_metric_set(&rt->dst, RTAX_MTU, arg->mtu);
	}
So, it's ok.

Otherwise, if RA MTU is lower than ra_default_route_mtu, rt6_mtu_change() will lower default route mtu, and it's ok too. There is a short period of time, when a newly created default route has too large MTU, but it's not scary. And it's exactly as it works now if new RA advertise MTU smaller than previous.

Do I miss something?

Thanks!

Regards,
Roman

      reply	other threads:[~2015-04-08 19:04 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 18:03 [PATCH] net: sysctl for RA default route MTU Roman Gushchin
2015-03-24 19:27 ` David Miller
2015-03-25  9:49   ` Roman Gushchin
2015-03-25 11:07   ` [PATCH v2] " Roman Gushchin
2015-03-25 12:34     ` Denis Kirjanov
2015-03-25 15:52     ` Hannes Frederic Sowa
     [not found]       ` <39171427301187@webcorp02f.yandex-team.ru>
2015-03-25 18:14         ` Hannes Frederic Sowa
2015-03-26 11:49           ` [PATCH v3] " Roman Gushchin
2015-03-26 14:49             ` Hannes Frederic Sowa
2015-03-29 19:42             ` David Miller
2015-03-30 12:30               ` Roman Gushchin
2015-03-31 20:05                 ` David Miller
2015-03-31 20:35                   ` Hannes Frederic Sowa
2015-03-31 20:49                     ` David Miller
2015-04-01  9:58                       ` Roman Gushchin
2015-04-01 17:55                         ` David Miller
2015-04-01 19:27                           ` Hannes Frederic Sowa
2015-04-02 18:08                             ` Roman Gushchin
2015-04-07 15:58                               ` Hannes Frederic Sowa
2015-04-08 19:03                                 ` Roman Gushchin [this message]

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=211371428519836@webcorp02f.yandex-team.ru \
    --to=klamm@yandex-team.ru \
    --cc=davem@davemloft.net \
    --cc=hannes@stressinduktion.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.