Commit 18d3451c authored by Bart Van Assche's avatar Bart Van Assche Committed by Doug Ledford

IB/rxe: Generate a completion for all failed work requests

Change do_complete() such that an error completion is not only
generated if a QP is in the error state but also if a work request
failed.
Signed-off-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: default avatarAndrew Boyer <andrew.boyer@dell.com>
Cc: Moni Shoua <monis@mellanox.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 723ec9ae
...@@ -412,13 +412,21 @@ static void make_send_cqe(struct rxe_qp *qp, struct rxe_send_wqe *wqe, ...@@ -412,13 +412,21 @@ static void make_send_cqe(struct rxe_qp *qp, struct rxe_send_wqe *wqe,
} }
} }
/*
* IBA Spec. Section 10.7.3.1 SIGNALED COMPLETIONS
* ---------8<---------8<-------------
* ...Note that if a completion error occurs, a Work Completion
* will always be generated, even if the signaling
* indicator requests an Unsignaled Completion.
* ---------8<---------8<-------------
*/
static void do_complete(struct rxe_qp *qp, struct rxe_send_wqe *wqe) static void do_complete(struct rxe_qp *qp, struct rxe_send_wqe *wqe)
{ {
struct rxe_cqe cqe; struct rxe_cqe cqe;
if ((qp->sq_sig_type == IB_SIGNAL_ALL_WR) || if ((qp->sq_sig_type == IB_SIGNAL_ALL_WR) ||
(wqe->wr.send_flags & IB_SEND_SIGNALED) || (wqe->wr.send_flags & IB_SEND_SIGNALED) ||
(qp->req.state == QP_STATE_ERROR)) { wqe->status != IB_WC_SUCCESS) {
make_send_cqe(qp, wqe, &cqe); make_send_cqe(qp, wqe, &cqe);
advance_consumer(qp->sq.queue); advance_consumer(qp->sq.queue);
rxe_cq_post(qp->scq, &cqe, 0); rxe_cq_post(qp->scq, &cqe, 0);
...@@ -709,6 +717,7 @@ int rxe_completer(void *arg) ...@@ -709,6 +717,7 @@ int rxe_completer(void *arg)
break; break;
case COMPST_ERROR: case COMPST_ERROR:
WARN_ON_ONCE(wqe->status == IB_WC_SUCCESS);
do_complete(qp, wqe); do_complete(qp, wqe);
rxe_qp_error(qp); rxe_qp_error(qp);
......
...@@ -225,6 +225,7 @@ extern struct ib_dma_mapping_ops rxe_dma_mapping_ops; ...@@ -225,6 +225,7 @@ extern struct ib_dma_mapping_ops rxe_dma_mapping_ops;
void rxe_release(struct kref *kref); void rxe_release(struct kref *kref);
void rxe_drain_req_pkts(struct rxe_qp *qp, bool notify);
int rxe_completer(void *arg); int rxe_completer(void *arg);
int rxe_requester(void *arg); int rxe_requester(void *arg);
int rxe_responder(void *arg); int rxe_responder(void *arg);
......
...@@ -594,9 +594,14 @@ int rxe_requester(void *arg) ...@@ -594,9 +594,14 @@ int rxe_requester(void *arg)
rxe_add_ref(qp); rxe_add_ref(qp);
next_wqe: next_wqe:
if (unlikely(!qp->valid || qp->req.state == QP_STATE_ERROR)) if (unlikely(!qp->valid))
goto exit; goto exit;
if (unlikely(qp->req.state == QP_STATE_ERROR)) {
rxe_drain_req_pkts(qp, true);
goto exit;
}
if (unlikely(qp->req.state == QP_STATE_RESET)) { if (unlikely(qp->req.state == QP_STATE_RESET)) {
qp->req.wqe_index = consumer_index(qp->sq.queue); qp->req.wqe_index = consumer_index(qp->sq.queue);
qp->req.opcode = -1; qp->req.opcode = -1;
...@@ -743,17 +748,8 @@ int rxe_requester(void *arg) ...@@ -743,17 +748,8 @@ int rxe_requester(void *arg)
kfree_skb(skb); kfree_skb(skb);
wqe->status = IB_WC_LOC_PROT_ERR; wqe->status = IB_WC_LOC_PROT_ERR;
wqe->state = wqe_state_error; wqe->state = wqe_state_error;
/*
* IBA Spec. Section 10.7.3.1 SIGNALED COMPLETIONS
* ---------8<---------8<-------------
* ...Note that if a completion error occurs, a Work Completion
* will always be generated, even if the signaling
* indicator requests an Unsignaled Completion.
* ---------8<---------8<-------------
*/
wqe->wr.send_flags |= IB_SEND_SIGNALED;
__rxe_do_task(&qp->comp.task); __rxe_do_task(&qp->comp.task);
exit: exit:
rxe_drop_ref(qp); rxe_drop_ref(qp);
return -EAGAIN; return -EAGAIN;
......
...@@ -1207,7 +1207,7 @@ static enum resp_states do_class_d1e_error(struct rxe_qp *qp) ...@@ -1207,7 +1207,7 @@ static enum resp_states do_class_d1e_error(struct rxe_qp *qp)
} }
} }
static void rxe_drain_req_pkts(struct rxe_qp *qp) void rxe_drain_req_pkts(struct rxe_qp *qp, bool notify)
{ {
struct sk_buff *skb; struct sk_buff *skb;
...@@ -1388,7 +1388,7 @@ int rxe_responder(void *arg) ...@@ -1388,7 +1388,7 @@ int rxe_responder(void *arg)
goto exit; goto exit;
case RESPST_RESET: case RESPST_RESET:
rxe_drain_req_pkts(qp); rxe_drain_req_pkts(qp, false);
qp->resp.wqe = NULL; qp->resp.wqe = NULL;
goto exit; goto exit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment