]> git.baikalelectronics.ru Git - kernel.git/commit
ionic: wait on queue start until after IFF_UP
authorShannon Nelson <snelson@pensando.io>
Tue, 9 Jun 2020 03:41:43 +0000 (20:41 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Jun 2020 20:19:27 +0000 (13:19 -0700)
commite454c21b86a24977523ea418d1d1f2c2495fde21
tree5bb4fc79ffbe96eb585f120f6ac659836d167645
parentb081146d560b0ac870bd97cb05db6293fa58a37e
ionic: wait on queue start until after IFF_UP

The netif_running() test looks at __LINK_STATE_START which
gets set before ndo_open() is called, there is a window of
time between that and when the queues are actually ready to
be run.  If ionic_check_link_status() notices that the link is
up very soon after netif_running() becomes true, it might try
to run the queues before they are ready, causing all manner of
potential issues.  Since the netdev->flags IFF_UP isn't set
until after ndo_open() returns, we can wait for that before
we allow ionic_check_link_status() to start the queues.

On the way back to close, __LINK_STATE_START is cleared before
calling ndo_stop(), and IFF_UP is cleared after.  Both of
these need to be true in order to safely stop the queues
from ionic_check_link_status().

Fixes: 887ed044aabb ("ionic: disable the queues on link down")
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/pensando/ionic/ionic_lif.c