diff options
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c index 4a0890f98b70..c31506514e5d 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c | |||
@@ -2865,7 +2865,7 @@ static int hns3_client_setup_tc(struct hnae3_handle *handle, u8 tc) | |||
2865 | { | 2865 | { |
2866 | struct hnae3_knic_private_info *kinfo = &handle->kinfo; | 2866 | struct hnae3_knic_private_info *kinfo = &handle->kinfo; |
2867 | struct net_device *ndev = kinfo->netdev; | 2867 | struct net_device *ndev = kinfo->netdev; |
2868 | bool if_running = netif_running(ndev); | 2868 | bool if_running; |
2869 | int ret; | 2869 | int ret; |
2870 | u8 i; | 2870 | u8 i; |
2871 | 2871 | ||
@@ -2875,6 +2875,8 @@ static int hns3_client_setup_tc(struct hnae3_handle *handle, u8 tc) | |||
2875 | if (!ndev) | 2875 | if (!ndev) |
2876 | return -ENODEV; | 2876 | return -ENODEV; |
2877 | 2877 | ||
2878 | if_running = netif_running(ndev); | ||
2879 | |||
2878 | ret = netdev_set_num_tc(ndev, tc); | 2880 | ret = netdev_set_num_tc(ndev, tc); |
2879 | if (ret) | 2881 | if (ret) |
2880 | return ret; | 2882 | return ret; |