Commit 829edbd8 authored by Jian Shen's avatar Jian Shen Committed by David S. Miller

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: 3b75c3df ("net: hns3: net: hns3: Add support for IFF_ALLMULTI flag")
Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7325523a
...@@ -71,6 +71,7 @@ struct hns3_link_mode_mapping { ...@@ -71,6 +71,7 @@ struct hns3_link_mode_mapping {
static int hns3_lp_setup(struct net_device *ndev, enum hnae3_loop loop, bool en) static int hns3_lp_setup(struct net_device *ndev, enum hnae3_loop loop, bool en)
{ {
struct hnae3_handle *h = hns3_get_handle(ndev); struct hnae3_handle *h = hns3_get_handle(ndev);
bool vlan_filter_enable;
int ret; int ret;
if (!h->ae_algo->ops->set_loopback || 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) ...@@ -91,7 +92,14 @@ static int hns3_lp_setup(struct net_device *ndev, enum hnae3_loop loop, bool en)
if (ret) if (ret)
return 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; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment