diff options
author | Kejian Yan <yankejian@huawei.com> | 2016-09-29 20:09:13 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-10-03 18:40:57 +0300 |
commit | ea870bf93c5cd3635a07a0570cb7fe61436b0c3d (patch) | |
tree | e202e384d8ba6c4e076a2e8441c11a8db4222c82 /drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | |
parent | 34447271dc10302a9aaee273a3ed354aefeaef7c (diff) | |
download | linux-ea870bf93c5cd3635a07a0570cb7fe61436b0c3d.tar.xz |
net: hns: fix port not available after testing loopback
After running command "ethtool -t eth0", eth0 can not be connected to
network. It is caused by the changing the inner loopback register and
this register cannot be changed when hns connected to network. The
routine of setting this register needs to be removed and using promisc
mode to let the packet looped back pass by dsaf mode.
Reported-by: Jun He <hjat2005@huawei.com>
Signed-off-by: Kejian Yan <yankejian@huawei.com>
Reviewed-by: Yisen Zhaung <yisen.zhuang@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns/hns_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c index ab33487a5321..fa91ce32199e 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c @@ -342,6 +342,13 @@ static int __lb_setup(struct net_device *ndev, break; } + if (!ret) { + if (loop == MAC_LOOP_NONE) + h->dev->ops->set_promisc_mode( + h, ndev->flags & IFF_PROMISC); + else + h->dev->ops->set_promisc_mode(h, 1); + } return ret; } |