From patchwork Sun Nov 18 03:19:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 151426 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1140984ljp; Sat, 17 Nov 2018 19:20:46 -0800 (PST) X-Google-Smtp-Source: AJdET5ckORPDzOmiXUqfcN6UgbtyP4RSnPmI78KsGu40qo182qHRvBYZ/9zLCNp/16Kk0MvrKXob X-Received: by 2002:a63:e84c:: with SMTP id a12mr15360332pgk.241.1542511246503; Sat, 17 Nov 2018 19:20:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542511246; cv=none; d=google.com; s=arc-20160816; b=ExDJFKf+O42VQc6QFQXDVmxJ4HZJOq99Ud8QtzmlizisXO3UHeZDJY+HC7RrfARLXq dbIERRMMqHZ3ojtpGlKcC7/YUsmzwK3ZGPrU4Dwsk1Xnkh6VQ4KA2ovngsCdmxPyPlea Ncs/I/3Yx1MkOcsuaGJPTqsViSpRVvw1e6I0riSkUFdqV14jPxGPTczg5cWekpMP9Tz6 vDjpmiiLiDLTLSHj33LZkI3XBwS6GqYMIF5sOnN2nK1aLZZ1MldEKpEga0ggyjdJz768 zQXjF8kDVp/4CQ5XKUoT+5lsLMa4EDZApVUCqxib4AgmiTf7WGuwMVrfjzIaL1fWnh1A wSjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=EnyNUhGlf3JDfCInw6kJfEJhnsIaCWVUB7Gk50h/Yw8=; b=S0epdheBtLc5v9dR11tFMyU16pqjOy0yZK1gJUHSIUM+3qyVJRQbyMtURByCFlNIlb TaBI98O2Una5huUEUmZMYzd/1qhCowP9D8yB1Kw464Co7p4YY4xD6mlOBz6mKqL23xOv 3iUtMSE+NhhOROYh1gjD4Y9op3UmbL4BAzWAXI3d5avVIgVM1S+vSpVEEzmIdKFIGB/a Xi1bXi8Joj6S7b6J0jWM1/Oqd2allcCdQy5nNLCSQ36384QgaixGoq5Tk6MTJGFrgR2t sSU9X5dkrEqmYOYEQuhideDQDxyHewyUpTEEoJvulRMoJXGoDw7Wp4htfZIzaBhIIDsV R2Yw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i72-v6si31358016pfj.276.2018.11.17.19.20.46; Sat, 17 Nov 2018 19:20:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726908AbeKRNj1 (ORCPT + 32 others); Sun, 18 Nov 2018 08:39:27 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:48617 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725831AbeKRNj1 (ORCPT ); Sun, 18 Nov 2018 08:39:27 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 694775BCD9977; Sun, 18 Nov 2018 11:20:33 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.47.88.178) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.408.0; Sun, 18 Nov 2018 11:20:24 +0800 From: Salil Mehta To: CC: , , , , , , , Yunsheng Lin , Jian Shen Subject: [PATCH net-next 1/5] net: hns3: Support two vlan header when setting mtu Date: Sun, 18 Nov 2018 03:19:10 +0000 Message-ID: <20181118031914.23892-2-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20181118031914.23892-1-salil.mehta@huawei.com> References: <20181118031914.23892-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.47.88.178] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yunsheng Lin This patch adds supports for two vlan header when setting mtu. Signed-off-by: Yunsheng Lin Signed-off-by: Jian Shen Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 5 +++-- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 22220af92aa9..c944090d3adf 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -3609,8 +3609,9 @@ static int hns3_client_init(struct hnae3_handle *handle) hns3_dcbnl_setup(handle); - /* MTU range: (ETH_MIN_MTU(kernel default) - 9706) */ - netdev->max_mtu = HNS3_MAX_MTU - (ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN); + /* MTU range: (ETH_MIN_MTU(kernel default) - 9702) */ + netdev->max_mtu = + HNS3_MAX_MTU - (ETH_HLEN + ETH_FCS_LEN + 2 * VLAN_HLEN); set_bit(HNS3_NIC_STATE_INITED, &priv->state); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 33885a7529fc..019f747e486a 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -6364,7 +6364,7 @@ static int hclge_set_mac_mtu(struct hclge_dev *hdev, int new_mtu) int max_frm_size; int ret; - max_frm_size = new_mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN; + max_frm_size = new_mtu + ETH_HLEN + ETH_FCS_LEN + 2 * VLAN_HLEN; if (max_frm_size < HCLGE_MAC_MIN_FRAME || max_frm_size > HCLGE_MAC_MAX_FRAME) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h index ca90b662e33b..279661764910 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h @@ -120,7 +120,7 @@ enum HLCGE_PORT_TYPE { #define HCLGE_VECTOR0_IMP_RESET_INT_B 1 #define HCLGE_MAC_DEFAULT_FRAME \ - (ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN + ETH_DATA_LEN) + (ETH_HLEN + ETH_FCS_LEN + 2 * VLAN_HLEN + ETH_DATA_LEN) #define HCLGE_MAC_MIN_FRAME 64 #define HCLGE_MAC_MAX_FRAME 9728