diff options
author | Jian Shen <shenjian15@huawei.com> | 2018-10-12 15:34:06 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-12 11:23:45 -0700 |
commit | 829edbd8d45e2f5c384a0b6c741cde46e0fa02a8 (patch) | |
tree | 09c6ab334ceef11a69ab46020e5f8b91dcf01018 /drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | |
parent | 7325523ab616791c418e2edc67d18e21958fb3ce (diff) | |
download | lwn-829edbd8d45e2f5c384a0b6c741cde46e0fa02a8.tar.gz lwn-829edbd8d45e2f5c384a0b6c741cde46e0fa02a8.zip |
net: hns3: Resume promisc mode and vlan filter status after loopback test
This patch resumes promisc mode and vlan filter status after
loopback test.
Fixes: 3b75c3df599d ("net: hns3: net: hns3: Add support for IFF_ALLMULTI flag")
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 'drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c index f1354f61084f..a4762c2b8ba1 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c @@ -71,6 +71,7 @@ struct hns3_link_mode_mapping { static int hns3_lp_setup(struct net_device *ndev, enum hnae3_loop loop, bool en) { struct hnae3_handle *h = hns3_get_handle(ndev); + bool vlan_filter_enable; int ret; if (!h->ae_algo->ops->set_loopback || @@ -91,7 +92,14 @@ static int hns3_lp_setup(struct net_device *ndev, enum hnae3_loop loop, bool en) if (ret) return ret; - h->ae_algo->ops->set_promisc_mode(h, en, en); + if (en) { + h->ae_algo->ops->set_promisc_mode(h, true, true); + } else { + /* recover promisc mode before loopback test */ + hns3_update_promisc_mode(ndev, h->netdev_flags); + vlan_filter_enable = ndev->flags & IFF_PROMISC ? false : true; + hns3_enable_vlan_filter(ndev, vlan_filter_enable); + } return ret; } |