IB/{hfi1, qib, rdmavt}: Put qp in error state when cq is full
When a completion queue is full, the associated queue pairs are not put into the error state. According to the IBTA specification, this is a violation. Quote from IBTA spec: C9-218: A Requester Class F error occurs when the CQ is inaccessible or full and an attempt is made to complete a WQE. The Affected QP shall be moved to the error state and affiliated asynchronous errors generated as described in 11.6.3.1 Affiliated Asynchronous Events on page 678. The current WQE and any subsequent WQEs are left in an unknown state. C11-37: The CI shall generate a CQ Error when a CQ overrun is detected. This condition will result in an Affiliated Asynchronous Error for any associated Work Queues when they attempt to use that CQ. Completions can no longer be added to the CQ. It is not guaranteed that completions present in the CQ at the time the error occurred can be retrieved. Possible causes include a CQ overrun or a CQ protection error. Put the qp in error state when cq is full. Implement a state called full to continue to put other associated QPs in error state. Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Signed-off-by: Kamenee Arumugam <kamenee.arumugam@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:

zatwierdzone przez
Jason Gunthorpe

rodzic
f592ae3c99
commit
5136bfea7e
@@ -60,8 +60,11 @@ static struct workqueue_struct *comp_vector_wq;
|
||||
* @solicited: true if @entry is solicited
|
||||
*
|
||||
* This may be called with qp->s_lock held.
|
||||
*
|
||||
* Return: return true on success, else return
|
||||
* false if cq is full.
|
||||
*/
|
||||
void rvt_cq_enter(struct rvt_cq *cq, struct ib_wc *entry, bool solicited)
|
||||
bool rvt_cq_enter(struct rvt_cq *cq, struct ib_wc *entry, bool solicited)
|
||||
{
|
||||
struct ib_uverbs_wc *uqueue = NULL;
|
||||
struct ib_wc *kqueue = NULL;
|
||||
@@ -97,7 +100,12 @@ void rvt_cq_enter(struct rvt_cq *cq, struct ib_wc *entry, bool solicited)
|
||||
next = head + 1;
|
||||
}
|
||||
|
||||
if (unlikely(next == tail)) {
|
||||
if (unlikely(next == tail || cq->cq_full)) {
|
||||
struct rvt_dev_info *rdi = cq->rdi;
|
||||
|
||||
if (!cq->cq_full)
|
||||
rvt_pr_err_ratelimited(rdi, "CQ is full!\n");
|
||||
cq->cq_full = true;
|
||||
spin_unlock_irqrestore(&cq->lock, flags);
|
||||
if (cq->ibcq.event_handler) {
|
||||
struct ib_event ev;
|
||||
@@ -107,7 +115,7 @@ void rvt_cq_enter(struct rvt_cq *cq, struct ib_wc *entry, bool solicited)
|
||||
ev.event = IB_EVENT_CQ_ERR;
|
||||
cq->ibcq.event_handler(&ev, cq->ibcq.cq_context);
|
||||
}
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
trace_rvt_cq_enter(cq, entry, head);
|
||||
if (uqueue) {
|
||||
@@ -146,6 +154,7 @@ void rvt_cq_enter(struct rvt_cq *cq, struct ib_wc *entry, bool solicited)
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&cq->lock, flags);
|
||||
return true;
|
||||
}
|
||||
EXPORT_SYMBOL(rvt_cq_enter);
|
||||
|
||||
|
@@ -3103,8 +3103,7 @@ do_write:
|
||||
wc.sl = rdma_ah_get_sl(&qp->remote_ah_attr);
|
||||
wc.port_num = 1;
|
||||
/* Signal completion event if the solicited bit is set. */
|
||||
rvt_cq_enter(ibcq_to_rvtcq(qp->ibqp.recv_cq), &wc,
|
||||
wqe->wr.send_flags & IB_SEND_SOLICITED);
|
||||
rvt_recv_cq(qp, &wc, wqe->wr.send_flags & IB_SEND_SOLICITED);
|
||||
|
||||
send_comp:
|
||||
spin_unlock_irqrestore(&qp->r_lock, flags);
|
||||
|
@@ -78,6 +78,12 @@
|
||||
fmt, \
|
||||
##__VA_ARGS__)
|
||||
|
||||
#define rvt_pr_err_ratelimited(rdi, fmt, ...) \
|
||||
__rvt_pr_err_ratelimited((rdi)->driver_f.get_pci_dev(rdi), \
|
||||
rvt_get_ibdev_name(rdi), \
|
||||
fmt, \
|
||||
##__VA_ARGS__)
|
||||
|
||||
#define __rvt_pr_info(pdev, name, fmt, ...) \
|
||||
dev_info(&pdev->dev, "%s: " fmt, name, ##__VA_ARGS__)
|
||||
|
||||
@@ -87,6 +93,9 @@
|
||||
#define __rvt_pr_err(pdev, name, fmt, ...) \
|
||||
dev_err(&pdev->dev, "%s: " fmt, name, ##__VA_ARGS__)
|
||||
|
||||
#define __rvt_pr_err_ratelimited(pdev, name, fmt, ...) \
|
||||
dev_err_ratelimited(&(pdev)->dev, "%s: " fmt, name, ##__VA_ARGS__)
|
||||
|
||||
static inline int ibport_num_to_idx(struct ib_device *ibdev, u8 port_num)
|
||||
{
|
||||
struct rvt_dev_info *rdi = ib_to_rvt(ibdev);
|
||||
|
Reference in New Issue
Block a user