Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3934537pxj; Mon, 21 Jun 2021 09:41:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwl/71wOtldmkOkF8e1Z1xOEcHUpkYlhraaz7u5rDudtj3WrquP9y8u/195Jv4fxWrXfc1E X-Received: by 2002:a6b:f815:: with SMTP id o21mr20735743ioh.137.1624293713892; Mon, 21 Jun 2021 09:41:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624293713; cv=none; d=google.com; s=arc-20160816; b=P+DPkjOhEK+fL1eRxieGMoUn1WEEod7WuqhSfnyhtcJfkAIx8C15HInuTJ8NbZCb6r Mobl/cwDIaXHjV80+jQiRPPrz92DcoldsyJK4wXFLA1LOpwYkxsct1FxgXos+2KP6fCL EtsWTEb19vBuu7BKMqRpGVyctqenVGa4FmP4umf2zUjKquBAQcEU+XoWLwWXxgjPpsMz +NFU38rARmCCQV9NoIBhXKW2qBhsG96pDqI1maoHfGhBu/+X9pXAfNTPnfsykbfj6TGA S5D35oRqiuS+orn/N1T6pAbJ07rlGAvAxJ9UL+q+gr+rS2AxL5K5f5cJu6X8VGUUQ1iC fewA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vUte2coOExB4UsXLOvxQExDeyL3Lzj514gZQet1eAk4=; b=Kb7DTXHg9U7TKPLUEStnYfrvEG09JBBWPBIe1bojEirhDhkuTGadybvAqdCABtlIH3 pd078f9/PzRkvNSTqawRH062EK9Q94Nltl2dPXl4GF1FZ4R2S/qY/fIww+oSciiAgdWd WwHRTN2KFq/vBDgKjwtoGIikFJ76Oha9DAhWoqJMgUbM1vszd7kPDYfB53WnN30PVwt3 NEzlcu3ucsBkJ2H7x+aegFq5+m8G9Fd8qZOC9yDTPzg4n4eDCtf83145VPZrBrSQFxt+ ng8qZLLG5wFawGx6LIKvOiqHgTfOmDrcrn5tdb51/+9q1LL3tB++bnN9Fqnqg3W751wv 5GWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bXuwfGc4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y6si14771257ilu.110.2021.06.21.09.41.41; Mon, 21 Jun 2021 09:41:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bXuwfGc4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232730AbhFUQnQ (ORCPT + 99 others); Mon, 21 Jun 2021 12:43:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:33932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233324AbhFUQjo (ORCPT ); Mon, 21 Jun 2021 12:39:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 08F9B61436; Mon, 21 Jun 2021 16:30:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624293005; bh=2seRv+oWTq/eXrL599aTNntv1wxojapTE296o8mjVmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bXuwfGc4SdrwdOzcD3ao7bLwvgVhI+rBvn0WpcJ6YHRuUscoZF4E4K8PHMi9uqBlk LN9hY09tQfjqempIuWPxeMQim/H5/ASe2iTThfDbPbMLly9Lp9SfkVuiDCE1pjSXpl 33R/srZwDNDLu7eAkR7IlIl9JiWMjbqyJO92FzHE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaohe Lin , Nicolas Dichtel , David Ahern , "David S. Miller" , Sasha Levin Subject: [PATCH 5.12 020/178] vrf: fix maximum MTU Date: Mon, 21 Jun 2021 18:13:54 +0200 Message-Id: <20210621154922.384320994@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154921.212599475@linuxfoundation.org> References: <20210621154921.212599475@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicolas Dichtel [ Upstream commit 9bb392f62447d73cc7dd7562413a2cd9104c82f8 ] My initial goal was to fix the default MTU, which is set to 65536, ie above the maximum defined in the driver: 65535 (ETH_MAX_MTU). In fact, it's seems more consistent, wrt min_mtu, to set the max_mtu to IP6_MAX_MTU (65535 + sizeof(struct ipv6hdr)) and use it by default. Let's also, for consistency, set the mtu in vrf_setup(). This function calls ether_setup(), which set the mtu to 1500. Thus, the whole mtu config is done in the same function. Before the patch: $ ip link add blue type vrf table 1234 $ ip link list blue 9: blue: mtu 65536 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether fa:f5:27:70:24:2a brd ff:ff:ff:ff:ff:ff $ ip link set dev blue mtu 65535 $ ip link set dev blue mtu 65536 Error: mtu greater than device maximum. Fixes: 5055376a3b44 ("net: vrf: Fix ping failed when vrf mtu is set to 0") CC: Miaohe Lin Signed-off-by: Nicolas Dichtel Reviewed-by: David Ahern Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/vrf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c index 503e2fd7ce51..28a6c4cfe9b8 100644 --- a/drivers/net/vrf.c +++ b/drivers/net/vrf.c @@ -1183,9 +1183,6 @@ static int vrf_dev_init(struct net_device *dev) dev->flags = IFF_MASTER | IFF_NOARP; - /* MTU is irrelevant for VRF device; set to 64k similar to lo */ - dev->mtu = 64 * 1024; - /* similarly, oper state is irrelevant; set to up to avoid confusion */ dev->operstate = IF_OPER_UP; netdev_lockdep_set_classes(dev); @@ -1685,7 +1682,8 @@ static void vrf_setup(struct net_device *dev) * which breaks networking. */ dev->min_mtu = IPV6_MIN_MTU; - dev->max_mtu = ETH_MAX_MTU; + dev->max_mtu = IP6_MAX_MTU; + dev->mtu = dev->max_mtu; } static int vrf_validate(struct nlattr *tb[], struct nlattr *data[], -- 2.30.2