]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: hns3: fix for changing MTU
authorFuyun Liang <liangfuyun1@huawei.com>
Fri, 5 Jan 2018 10:18:20 +0000 (18:18 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Apr 2018 10:31:09 +0000 (12:31 +0200)
[ Upstream commit 5bad95a1e55f4d5bb41e130db859d57eaf1b1549 ]

when changing MTU, The new MTU must need to be set to netdevice.

Fixes: a8e8b7ff3517 ("net: hns3: Add support to change MTU in HNS3 hardware")
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c

index 428ede16b10a96e7e072e97f1441c9f5720a6eaa..a685368ab25b1373a2f13b0aa3938786feeae336 100644 (file)
@@ -1324,6 +1324,8 @@ static int hns3_nic_change_mtu(struct net_device *netdev, int new_mtu)
                return ret;
        }
 
+       netdev->mtu = new_mtu;
+
        /* if the netdev was running earlier, bring it up again */
        if (if_running && hns3_nic_net_open(netdev))
                ret = -EINVAL;