Skip to content

Commit ecb4cd0

Browse files
pkitszelanguy11
authored andcommitted
iavf: simplify watchdog_task in terms of adminq task scheduling
Simplify the decision whether to schedule adminq task. The condition is the same, but it is executed in more scenarios. Note that movement of watchdog_done label makes this commit a bit surprising. (Hence not squashing it to anything bigger). Reviewed-by: Jacob Keller <[email protected]> Signed-off-by: Przemek Kitszel <[email protected]> Tested-by: Rafal Romanowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 099418d commit ecb4cd0

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2934,6 +2934,7 @@ static void iavf_watchdog_task(struct work_struct *work)
29342934
return;
29352935
}
29362936

2937+
msec_delay = 20;
29372938
goto restart_watchdog;
29382939
}
29392940

@@ -3053,26 +3054,20 @@ static void iavf_watchdog_task(struct work_struct *work)
30533054
adapter->current_op = VIRTCHNL_OP_UNKNOWN;
30543055
dev_err(&adapter->pdev->dev, "Hardware reset detected\n");
30553056
iavf_schedule_reset(adapter, IAVF_FLAG_RESET_PENDING);
3056-
msec_delay = 2000;
3057-
goto watchdog_done;
30583057
}
3058+
if (adapter->aq_required)
3059+
msec_delay = 20;
3060+
else
3061+
msec_delay = 2000;
30593062

3063+
watchdog_done:
30603064
mutex_unlock(&adapter->crit_lock);
30613065
restart_watchdog:
30623066
netdev_unlock(netdev);
30633067

30643068
/* note that we schedule a different task */
30653069
if (adapter->state >= __IAVF_DOWN)
30663070
queue_work(adapter->wq, &adapter->adminq_task);
3067-
if (adapter->aq_required)
3068-
msec_delay = 20;
3069-
else
3070-
msec_delay = 2000;
3071-
goto skip_unlock;
3072-
watchdog_done:
3073-
mutex_unlock(&adapter->crit_lock);
3074-
netdev_unlock(netdev);
3075-
skip_unlock:
30763071

30773072
if (msec_delay != IAVF_NO_RESCHED)
30783073
queue_delayed_work(adapter->wq, &adapter->watchdog_task,

0 commit comments

Comments
 (0)