Skip to contentSkip to conversation

IB/hfi1: Fix another case where pq is left on waitlist

PATCH Applied Mike Marciniszyn 2 participants 2 messages May 4, 2020 – May 6, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IB/hfi1: Fix another case where pq is left on waitlist

The commit noted below fixed a case where a pq is left on the sdma wait list.

It however missed another case.

user_sdma_send_pkts() has two calls from hfi1_user_sdma_process_request().

If the first one fails as indicated by -EBUSY, the pq will be placed on the waitlist as by design.

If the second call then succeeds, the pq is still on the waitlist setting up a race with the interrupt handler if a subsequent request uses a different SDMA engine

Fix by deleting the first call.

The use of pcount and the intent to send a short burst of packets followed by the larger balance of packets was never correctly implemented, because the two calls always send pcount packets no matter what. A subsequent patch will correct that issue.

Fixes 9a293d1e21a6 ("IB/hfi1: Ensure pq is not left on waitlist")
---
 drivers/infiniband/hw/hfi1/user_sdma.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/infiniband/hw/hfi1/user_sdma.c +0 -4
index 13e4203..a92346e 100644
@@ -589,10 +589,6 @@ int hfi1_user_sdma_process_request(struct hfi1_filedata *fd,
 
 	set_comp_state(pq, cq, info.comp_idx, QUEUED, 0);
 	pq->state = SDMA_PKT_Q_ACTIVE;
-	/* Send the first N packets in the request to buy us some time */
-	ret = user_sdma_send_pkts(req, pcount);
-	if (unlikely(ret < 0 && ret != -EBUSY))
-		goto free_req;
 
 	/*
 	 * This is a somewhat blocking send implementation.
#1 lore raw
Quoted 21 lines · Mike Marciniszyn

The commit noted below fixed a case where a pq is left on the sdma wait list.

It however missed another case.

user_sdma_send_pkts() has two calls from hfi1_user_sdma_process_request().

If the first one fails as indicated by -EBUSY, the pq will be placed on the waitlist as by design.

If the second call then succeeds, the pq is still on the waitlist setting up a race with the interrupt handler if a subsequent request uses a different SDMA engine

Fix by deleting the first call.

The use of pcount and the intent to send a short burst of packets followed by the larger balance of packets was never correctly implemented, because the two calls always send pcount packets no matter what. A subsequent patch will correct that issue.

Quoted 7 lines
Fixes 9a293d1e21a6 ("IB/hfi1: Ensure pq is not left on waitlist")
---
 drivers/infiniband/hw/hfi1/user_sdma.c |    4 ----
 1 file changed, 4 deletions(-)

Applied to for-rc, thanks

Jason