Skip to content

Commit 283847e

Browse files
IronShendavem330
authored andcommitted
net: hns3: don't push link state to VF if unalive
It's unnecessary to push link state to unalive VF, and the VF will query link state from PF when it being start works. Fixes: 18b6e31 ("net: hns3: PF add support for pushing link status to VFs") Signed-off-by: Jian Shen <[email protected]> Signed-off-by: Guangbin Huang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9eda7d8 commit 283847e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3376,6 +3376,12 @@ static int hclge_set_vf_link_state(struct hnae3_handle *handle, int vf,
33763376
link_state_old = vport->vf_info.link_state;
33773377
vport->vf_info.link_state = link_state;
33783378

3379+
/* return success directly if the VF is unalive, VF will
3380+
* query link state itself when it starts work.
3381+
*/
3382+
if (!test_bit(HCLGE_VPORT_STATE_ALIVE, &vport->state))
3383+
return 0;
3384+
33793385
ret = hclge_push_vf_link_status(vport);
33803386
if (ret) {
33813387
vport->vf_info.link_state = link_state_old;

0 commit comments

Comments
 (0)