diff options
author | Yunsheng Lin <linyunsheng@huawei.com> | 2018-11-18 03:19:13 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-17 21:57:29 -0800 |
commit | 818f167587f402aedcf406ba57d0caff739dcad8 (patch) | |
tree | 33351e1c75a44ea5c272c7e0d5fa1511c4570c29 /drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | |
parent | net: hns3: Add vport alive state checking support (diff) | |
download | linux-dev-818f167587f402aedcf406ba57d0caff739dcad8.tar.xz linux-dev-818f167587f402aedcf406ba57d0caff739dcad8.zip |
net: hns3: Add mtu setting support for vf
The patch adds mtu setting support for vf, currently
vf and pf share the same hardware mtu setting. Mtu set
by vf must be less than or equal to pf' mtu, and mtu
set by pf must be greater than or equal to vf' mtu.
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index cdaa7e4207ea..efec1b7a6a64 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -1081,6 +1081,14 @@ static int hclgevf_reset_tqp(struct hnae3_handle *handle, u16 queue_id) 2, true, NULL, 0); } +static int hclgevf_set_mtu(struct hnae3_handle *handle, int new_mtu) +{ + struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); + + return hclgevf_send_mbx_msg(hdev, HCLGE_MBX_SET_MTU, 0, (u8 *)&new_mtu, + sizeof(new_mtu), true, NULL, 0); +} + static int hclgevf_notify_client(struct hclgevf_dev *hdev, enum hnae3_reset_notify_type type) { @@ -2513,6 +2521,7 @@ static const struct hnae3_ae_ops hclgevf_ops = { .ae_dev_resetting = hclgevf_ae_dev_resetting, .ae_dev_reset_cnt = hclgevf_ae_dev_reset_cnt, .set_gro_en = hclgevf_gro_en, + .set_mtu = hclgevf_set_mtu, }; static struct hnae3_ae_algo ae_algovf = { |