]> git.baikalelectronics.ru Git - kernel.git/commit
cxgb4: Fix race between loopback and normal Tx path
authorGanji Aravind <ganji.aravind@chelsio.com>
Tue, 18 Aug 2020 15:40:58 +0000 (21:10 +0530)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Aug 2020 20:02:51 +0000 (13:02 -0700)
commitc521dc75f977107f7a0fa3bda88d63ee98448d89
tree18b6a4c5eb0c1d56c13c0705f5e3115bd163d4e6
parentdd4bf5bd465348455d720f5eb0bd5cb6d36a93cd
cxgb4: Fix race between loopback and normal Tx path

Even after Tx queues are marked stopped, there exists a
small window where the current packet in the normal Tx
path is still being sent out and loopback selftest ends
up corrupting the same Tx ring. So, ensure selftest takes
the Tx lock to synchronize access the Tx ring.

Fixes: 3a88160fe6bc ("cxgb4: add loopback ethtool self-test")
Signed-off-by: Ganji Aravind <ganji.aravind@chelsio.com>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/sge.c