Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3921709pxj; Mon, 21 Jun 2021 09:25:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+mFayjH16QzNw/osXqhXbgVqhOhisQEiZf6XmU3W5YaSwGlFFJlHl93yOykYlcLu1LclS X-Received: by 2002:a17:906:f990:: with SMTP id li16mr3345605ejb.387.1624292723593; Mon, 21 Jun 2021 09:25:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624292723; cv=none; d=google.com; s=arc-20160816; b=Ta+2InLI5u4QJyWYE4VllwjKV1bVx6vSI2EgDo7NXnO/PzhULEA7MuAyzsIFJC7/03 0WHxPTrWWb0vBIu10OLeh6U+Yx3hi8sHixrOh/fz5fJKjAw593I48GBivZKg7Om+TP7M d5b/BxD37xes29JdZmpdGEkv4WApZ/9T1OClCJ43brSJfO4GhVBM+6i828iU8bJ0pg38 aKq6ent3i/jK1i6rs1kKaldt3viwx1ggbLJBWvlmsEicmbslYlRrDrQqMV/9a8Bav/ye bLbdhmsBT3ZDcDJf5DXHrgu186uqajbV59SWukObTTDEBkqFO6Usf7qtRM1gcaRlFN8U gvxQ== 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=UDG+daC6UhArAGi+pBjsmFTMKa3DYS54CUA/tO0K/PQ=; b=C7j0Bx7bSBTnjIMfMQp5UImY6ydxHhCiNt3fyLqhZILRoQHuxrkDpH6/E1/NnDHGpp QkunDk71kRHuhZTeSVXAw2S2pb85lDlcDMXvhpS3IsqPqLZSjAQnB3jphw4gcWmu8l39 xFUCLoCumTXfgnpZg2KbxElDITJJrYJmWKqB3JDQJ5SsF8tHTeKBMBOGasJPN6/a4vFQ lCUKqmHfGy+uQM4O0l3+BIqriENYvlmF3i0XnfFlbjNRUbh7X+vWx+k2VKsdc9UbEOz8 spj/dHpjyAW1kBFuoAT4XjmB75jVqXldc2Wny7ZJ45Y8WHNHE7tATQhqJno408R+xuEC PSJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VKvpClga; 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 19si10632255ejx.529.2021.06.21.09.25.01; Mon, 21 Jun 2021 09:25:23 -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=VKvpClga; 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 S231774AbhFUQ0Z (ORCPT + 99 others); Mon, 21 Jun 2021 12:26:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:41850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231135AbhFUQYx (ORCPT ); Mon, 21 Jun 2021 12:24:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DCA1361289; Mon, 21 Jun 2021 16:21:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292486; bh=qHyT2iI3pXf8sf6j5fNjziSWJSbSepwxWd3kmtKg2e8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VKvpClga2L1XkQgnHpZgc3G1QN4UB3yv1f9Cm7OJ7e2Os9eFrzq+L6LioAioR7rD4 Qa1ojfT5xsX7B9utPWDOxoMAijz9zAOqe6QqNBED5z1q+rnEDu+/ZroghAanmy1M0G dPpal1OiB0BYxnmjZlsFHShRWnVKShgUEj3uKV3U= 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.10 018/146] vrf: fix maximum MTU Date: Mon, 21 Jun 2021 18:14:08 +0200 Message-Id: <20210621154911.888581289@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154911.244649123@linuxfoundation.org> References: <20210621154911.244649123@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 b9b7e00b72a8..bc96ac0c5769 100644 --- a/drivers/net/vrf.c +++ b/drivers/net/vrf.c @@ -1184,9 +1184,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); @@ -1620,7 +1617,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