]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit - drivers/net/ethernet/mellanox/mlx5/core/en_main.c
net/mlx5e: Move all TX timeout logic to be under state lock
authorEran Ben Elisha <eranbe@mellanox.com>
Tue, 16 Jan 2018 15:25:06 +0000 (17:25 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Wed, 28 Mar 2018 00:17:27 +0000 (17:17 -0700)
commitbfc647d52e67dc756c605e9a50d45b71054c2533
tree7b924b7b877f6bd1cfab9efea1be380f56c1346e
parentc4554fbccaa3306f65954ed0f1dab7abce7889f8
net/mlx5e: Move all TX timeout logic to be under state lock

Driver callback for handling TX timeout should access some internal
resources (SQ, CQ) in order to decide if the tx timeout work should be
scheduled.  These resources might be unavailable if channels are closed
in parallel (ifdown for example).

The state lock is the mechanism to protect from such races.
Move all TX timeout logic to be in the work under a state lock.

In addition, Move the work from the global WQ to mlx5e WQ to make sure
this work is flushed when device is detached..

Also, move the mlx5e_tx_timeout_work code to be next to the TX timeout
NDO for better code locality.

Fixes: 3947ca185999 ("net/mlx5e: Implement ndo_tx_timeout callback")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c