aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBharat Potnuri <bharat@chelsio.com>2016-08-23 10:57:33 -0400
committerDoug Ledford <dledford@redhat.com>2016-08-23 12:52:52 -0400
commitcff069b78c21559f427c3fefe9ef3294e3dec094 (patch)
tree293a179997afae57cfae0c2d809194e7b4c85413
parentfaa739fb5df56aadab96bcd2f6eb3486cc3a3aec (diff)
iw_cxgb4: Fix cxgb4 arm CQ logic w/IB_CQ_REPORT_MISSED_EVENTS
Current cxgb4 arm CQ logic ignores IB_CQ_REPORT_MISSED_EVENTS for request completion notification on a CQ. Due to this ib_poll_handler() assumes all events polled and avoids further iopoll scheduling. This patch adds logic to cxgb4 ib_req_notify_cq() handler to check if CQ is not empty and return accordingly. Based on the return value of ib_req_notify_cq() handler, ib_poll_handler() will schedule a run of iopoll handler. Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com> Reviewed-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/hw/cxgb4/cq.c10
-rw-r--r--drivers/infiniband/hw/cxgb4/t4.h5
2 files changed, 10 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c
index 812ab7278b8e..ac926c942fee 100644
--- a/drivers/infiniband/hw/cxgb4/cq.c
+++ b/drivers/infiniband/hw/cxgb4/cq.c
@@ -1016,15 +1016,15 @@ int c4iw_resize_cq(struct ib_cq *cq, int cqe, struct ib_udata *udata)
1016int c4iw_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags) 1016int c4iw_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
1017{ 1017{
1018 struct c4iw_cq *chp; 1018 struct c4iw_cq *chp;
1019 int ret; 1019 int ret = 0;
1020 unsigned long flag; 1020 unsigned long flag;
1021 1021
1022 chp = to_c4iw_cq(ibcq); 1022 chp = to_c4iw_cq(ibcq);
1023 spin_lock_irqsave(&chp->lock, flag); 1023 spin_lock_irqsave(&chp->lock, flag);
1024 ret = t4_arm_cq(&chp->cq, 1024 t4_arm_cq(&chp->cq,
1025 (flags & IB_CQ_SOLICITED_MASK) == IB_CQ_SOLICITED); 1025 (flags & IB_CQ_SOLICITED_MASK) == IB_CQ_SOLICITED);
1026 if (flags & IB_CQ_REPORT_MISSED_EVENTS)
1027 ret = t4_cq_notempty(&chp->cq);
1026 spin_unlock_irqrestore(&chp->lock, flag); 1028 spin_unlock_irqrestore(&chp->lock, flag);
1027 if (ret && !(flags & IB_CQ_REPORT_MISSED_EVENTS))
1028 ret = 0;
1029 return ret; 1029 return ret;
1030} 1030}
diff --git a/drivers/infiniband/hw/cxgb4/t4.h b/drivers/infiniband/hw/cxgb4/t4.h
index 6126bbe36095..02173f4315fa 100644
--- a/drivers/infiniband/hw/cxgb4/t4.h
+++ b/drivers/infiniband/hw/cxgb4/t4.h
@@ -634,6 +634,11 @@ static inline int t4_valid_cqe(struct t4_cq *cq, struct t4_cqe *cqe)
634 return (CQE_GENBIT(cqe) == cq->gen); 634 return (CQE_GENBIT(cqe) == cq->gen);
635} 635}
636 636
637static inline int t4_cq_notempty(struct t4_cq *cq)
638{
639 return cq->sw_in_use || t4_valid_cqe(cq, &cq->queue[cq->cidx]);
640}
641
637static inline int t4_next_hw_cqe(struct t4_cq *cq, struct t4_cqe **cqe) 642static inline int t4_next_hw_cqe(struct t4_cq *cq, struct t4_cqe **cqe)
638{ 643{
639 int ret; 644 int ret;