From patchwork Fri Jul 6 10:28:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 141289 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2945791ljj; Fri, 6 Jul 2018 03:30:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdAsTo3tOJ7sZ7T0PJWsbnwT9lOQybRHIdRYxEwmmIgsdr2PciLDRy6BhwhmH+zX5WrdZZB X-Received: by 2002:a17:902:8ecb:: with SMTP id x11-v6mr9995756plo.308.1530873015724; Fri, 06 Jul 2018 03:30:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530873015; cv=none; d=google.com; s=arc-20160816; b=DVcKQfg7ebxLcjSvEHUzjTuaV3NJO8Z06fXfO00BqpipTC9s31vjmFSY4qOEa70F1W q7X9ag4wIfjlgag7ouqZtWx49QBHPNtx/6MJJTZjw8ckjV1MHip0BhxGqEVgfWIOZEWs A+0y+H4cost6YoVcGy7qpe06gOj5nc1LqBVGfgR5atdYtiRxm2Tm/IVDEOiTf6ZMYScH 3lMTOujeiN7tkoWprZXVgeJrcU18iPWQHmO3OVumVfqABN7I3hqbZ6ze7Z+mOweqZtEg nKS/K/6vtDE2+LWUnbWYoc+9sEuc4MG9ibIpDRgdAdiNJehBALPVQzywCH4Miej7DUR7 YIFQ== 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:arc-authentication-results; bh=6n5pFZMPY+YYZ/PQcR2ERxfkLdwq16C/iIC5oavsgtw=; b=TBPI+q+NDktljIgc0TJBIG7/+chYK7+R4Dw6gVgtJDTwTpTnnwsi7dvhPkQgXl9DOZ i8jl4g4nKWOZohsJ998/QdQKuLgACPuNYTlKkvXSb0oaqriK/UNSlDS7tYqCXMzcVlud Z1FWvr3ZkJnzb1oJ1TObkVi3XJmSutHMiw1DpcZQA5xkHCkT51MxhByBzu2uBUpALIgY vXNhrhYF+bgCWH/HTAVsfFF+ptAwk/kg0NjpFKmxd98AwwT0g602RyVG+DR11bMfGghJ H05Jtu3+zR4gP9TGUT4tAzSxAjJsaYHY+TUsEjUUvwsMgui04FXxURw8mKyCUEf99wjY I9xw== 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 k18-v6si7460857pgl.364.2018.07.06.03.30.15; Fri, 06 Jul 2018 03:30:15 -0700 (PDT) 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 S932767AbeGFK32 (ORCPT + 30 others); Fri, 6 Jul 2018 06:29:28 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9162 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932310AbeGFK3Y (ORCPT ); Fri, 6 Jul 2018 06:29:24 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 9A8A450F31356; Fri, 6 Jul 2018 18:29:10 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.382.0; Fri, 6 Jul 2018 18:29:04 +0800 From: Salil Mehta To: CC: , , , , , , , Jian Shen Subject: [PATCH net-next 06/10] net: hns3: Add configure for mac minimal frame size Date: Fri, 6 Jul 2018 11:28:00 +0100 Message-ID: <20180706102804.196-7-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180706102804.196-1-salil.mehta@huawei.com> References: <20180706102804.196-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen When change the mtu, the minimal frame size of mac will be set to zero, it is incorrect. This patch fixes it by set it to the default value. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 3 ++- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h index d9aaa76..656c3e6 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h @@ -571,7 +571,8 @@ struct hclge_config_auto_neg_cmd { struct hclge_config_max_frm_size_cmd { __le16 max_frm_size; - u8 rsv[22]; + u8 min_frm_size; + u8 rsv[21]; }; enum hclge_mac_vlan_tbl_opcode { diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index dae1aa5..df6a7a1 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -4987,6 +4987,7 @@ static int hclge_set_mac_mtu(struct hclge_dev *hdev, int new_mtu) req = (struct hclge_config_max_frm_size_cmd *)desc.data; req->max_frm_size = cpu_to_le16(max_frm_size); + req->min_frm_size = HCLGE_MAC_MIN_FRAME; ret = hclge_cmd_send(&hdev->hw, &desc, 1); if (ret) {