mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: linmiaohe <linmiaohe@huawei.com>
To: David Ahern <dsa@cumulusnetworks.com>
Cc: Shrijeet Mukherjee <shrijeet@gmail.com>, <davem@davemloft.net>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Mingfangsen <mingfangsen@huawei.com>
Subject: Re: [PATCH net v2] net: vrf: Fix ping failed when vrf mtu is set to 0
Date: Mon, 8 Apr 2019 09:58:56 +0800	[thread overview]
Message-ID: <e5440a50-e3b1-ec6c-d120-3680ca48f2b8@huawei.com> (raw)
In-Reply-To: <18b082d4-cef9-bb39-0680-8187f6951bbc@cumulusnetworks.com>



On 2019/4/7 22:30, David Ahern wrote:
> On 4/6/19 11:46 PM, linmiaohe wrote:
>> diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
>> index 7c1430ed0244..4d35d37f225a 100644
>> --- a/drivers/net/vrf.c
>> +++ b/drivers/net/vrf.c
>> @@ -43,6 +43,12 @@
>>
>>  #define FIB_RULE_PREF  1000       /* default preference for FIB rules */
>>
>> +/* The MTU is really irrelevant for VRF except for odd cases, so limit it
>> + * to a reasonable range which both works for IPV4 and IPV6.
>> + */
>> +#define VRF_MIN_MTU	1280      /* same as IPV6_MIN_MTU */
>> +#define VRF_MAX_MTU	0xFFFFU   /* same as IP_MAX_MTU */
> 
> Since VRF does not care about MTU, there is no reason for VRF specific
> macros.
> 
>> +
>>  static unsigned int vrf_net_id;
>>
>>  struct net_vrf {
>> @@ -1274,8 +1280,8 @@ static void vrf_setup(struct net_device *dev)
>>  	/* default to no qdisc; user can add if desired */
>>  	dev->priv_flags |= IFF_NO_QUEUE;
>>
>> -	dev->min_mtu = 0;
>> -	dev->max_mtu = 0;
>> +	dev->min_mtu = VRF_MIN_MTU;
>> +	dev->max_mtu = VRF_MAX_MTU;
> 
> Set these to IPV6_MIN_MTU and ETH_MAX_MTU and add a comment that VRF
> devices do not care about MTU, but if the MTU is set too low then the
> ipv4 and ipv6 protocols are disabled which breaks networking.
> 
> 

Thanks a lot for your advice. I will send v3 latter.


      reply	other threads:[~2019-04-08  1:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-07  6:46 linmiaohe
2019-04-07 14:30 ` David Ahern
2019-04-08  1:58   ` linmiaohe [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=e5440a50-e3b1-ec6c-d120-3680ca48f2b8@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=davem@davemloft.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingfangsen@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=shrijeet@gmail.com \
    /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

all inboxes | Powered by JetHome®