OSDN Git Service

IB/hfi1: Close VNIC sdma_progress sleep window
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Wed, 28 Nov 2018 18:32:48 +0000 (10:32 -0800)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 7 Dec 2018 03:15:36 +0000 (20:15 -0700)
commit18912c4524385dd6532c682cb9d4f6aa39ba8d47
tree6f6a9b3d270b88371744cd9a5e57258c732ff64d
parent5190f052a3654aa1120ea4f9ff3bfac430459893
IB/hfi1: Close VNIC sdma_progress sleep window

The call to sdma_progress() is called outside the wait lock.

In this case, there is a race condition where sdma_progress() can return
false and the sdma_engine can idle.  If that happens, there will be no
more sdma interrupts to cause the wakeup and the vnic_sdma xmit will hang.

Fix by moving the lock to enclose the sdma_progress() call.

Also, delete the tx_retry. The need for this was removed by:
commit bcad29137a97 ("IB/hfi1: Serve the most starved iowait entry first")

Fixes: 64551ede6cd1 ("IB/hfi1: VNIC SDMA support")
Reviewed-by: Gary Leshner <Gary.S.Leshner@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hfi1/vnic_sdma.c