Skip to content

Commit 82229c4

Browse files
Jie Wangkuba-moo
authored andcommitted
net: hns3: fix incorrect components info of ethtool --reset command
Currently, HNS3 driver doesn't clear the reset flags of components after successfully executing reset, it causes userspace info of "Components reset" and "Components not reset" is incorrect. So fix this problem by clear corresponding reset flag after reset process. Fixes: ddccc5e ("net: hns3: add support for triggering reset by ethtool") Signed-off-by: Jie Wang <[email protected]> Signed-off-by: Guangbin Huang <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 9c14791 commit 82229c4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,7 @@ static int hns3_set_reset(struct net_device *netdev, u32 *flags)
987987
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
988988
const struct hnae3_ae_ops *ops = h->ae_algo->ops;
989989
const struct hns3_reset_type_map *rst_type_map;
990+
enum ethtool_reset_flags rst_flags;
990991
u32 i, size;
991992

992993
if (ops->ae_dev_resetting && ops->ae_dev_resetting(h))
@@ -1006,6 +1007,7 @@ static int hns3_set_reset(struct net_device *netdev, u32 *flags)
10061007
for (i = 0; i < size; i++) {
10071008
if (rst_type_map[i].rst_flags == *flags) {
10081009
rst_type = rst_type_map[i].rst_type;
1010+
rst_flags = rst_type_map[i].rst_flags;
10091011
break;
10101012
}
10111013
}
@@ -1021,6 +1023,8 @@ static int hns3_set_reset(struct net_device *netdev, u32 *flags)
10211023

10221024
ops->reset_event(h->pdev, h);
10231025

1026+
*flags &= ~rst_flags;
1027+
10241028
return 0;
10251029
}
10261030

0 commit comments

Comments
 (0)