]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: hns3: Add configure for mac minimal frame size
authorJian Shen <shenjian15@huawei.com>
Fri, 6 Jul 2018 10:28:00 +0000 (11:28 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 Jul 2018 02:13:06 +0000 (11:13 +0900)
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 <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

index d9aaa76c76eb40cf2e7e1991851f8b2abe299e7d..656c3e622ec8c4c42db779f437f4f0ab2a4835ba 100644 (file)
@@ -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 {
index dae1aa5c55fb731c6d0be3f8a763c69da61b3d0c..df6a7a10bb835e1028f5fadb188951a4f3216f7b 100644 (file)
@@ -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) {