* [PATCH 2.6.26 1/3] RDMA/cxgb3: QP flush fixes
@ 2008-05-02 16:17 Steve Wise
2008-05-02 16:17 ` [PATCH 2.6.26 2/3] RDMA/cxgb3: Silently ignore close reply after abort Steve Wise
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Steve Wise @ 2008-05-02 16:17 UTC (permalink / raw)
To: rdreier; +Cc: linux-kernel, netdev, general
- Flush the QP only after the HW disables the connection.
Currently we flush the QP when transitioning to CLOSING. This
exposes a race condition where the HW can complete a RECV WR,
for instance, -and- the SW can flush that same WR.
- Only call CQ event handlers on flush IFF we actually flushed
anything.
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
drivers/infiniband/hw/cxgb3/cxio_hal.c | 13 ++++++++++---
drivers/infiniband/hw/cxgb3/cxio_hal.h | 4 ++--
drivers/infiniband/hw/cxgb3/iwch_qp.c | 13 ++++++++-----
3 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.c b/drivers/infiniband/hw/cxgb3/cxio_hal.c
index 3de0fbf..8a86960 100644
--- a/drivers/infiniband/hw/cxgb3/cxio_hal.c
+++ b/drivers/infiniband/hw/cxgb3/cxio_hal.c
@@ -359,9 +359,10 @@ static void insert_recv_cqe(struct t3_wq *wq, struct t3_cq *cq)
cq->sw_wptr++;
}
-void cxio_flush_rq(struct t3_wq *wq, struct t3_cq *cq, int count)
+int cxio_flush_rq(struct t3_wq *wq, struct t3_cq *cq, int count)
{
u32 ptr;
+ int flushed = 0;
PDBG("%s wq %p cq %p\n", __FUNCTION__, wq, cq);
@@ -369,8 +370,11 @@ void cxio_flush_rq(struct t3_wq *wq, struct t3_cq *cq, int count)
PDBG("%s rq_rptr %u rq_wptr %u skip count %u\n", __FUNCTION__,
wq->rq_rptr, wq->rq_wptr, count);
ptr = wq->rq_rptr + count;
- while (ptr++ != wq->rq_wptr)
+ while (ptr++ != wq->rq_wptr) {
insert_recv_cqe(wq, cq);
+ flushed++;
+ }
+ return flushed;
}
static void insert_sq_cqe(struct t3_wq *wq, struct t3_cq *cq,
@@ -394,9 +398,10 @@ static void insert_sq_cqe(struct t3_wq *wq, struct t3_cq *cq,
cq->sw_wptr++;
}
-void cxio_flush_sq(struct t3_wq *wq, struct t3_cq *cq, int count)
+int cxio_flush_sq(struct t3_wq *wq, struct t3_cq *cq, int count)
{
__u32 ptr;
+ int flushed = 0;
struct t3_swsq *sqp = wq->sq + Q_PTR2IDX(wq->sq_rptr, wq->sq_size_log2);
ptr = wq->sq_rptr + count;
@@ -405,7 +410,9 @@ void cxio_flush_sq(struct t3_wq *wq, struct t3_cq *cq, int count)
insert_sq_cqe(wq, cq, sqp);
sqp++;
ptr++;
+ flushed++;
}
+ return flushed;
}
/*
diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.h b/drivers/infiniband/hw/cxgb3/cxio_hal.h
index 2bcff7f..69ab08e 100644
--- a/drivers/infiniband/hw/cxgb3/cxio_hal.h
+++ b/drivers/infiniband/hw/cxgb3/cxio_hal.h
@@ -173,8 +173,8 @@ u32 cxio_hal_get_pdid(struct cxio_hal_resource *rscp);
void cxio_hal_put_pdid(struct cxio_hal_resource *rscp, u32 pdid);
int __init cxio_hal_init(void);
void __exit cxio_hal_exit(void);
-void cxio_flush_rq(struct t3_wq *wq, struct t3_cq *cq, int count);
-void cxio_flush_sq(struct t3_wq *wq, struct t3_cq *cq, int count);
+int cxio_flush_rq(struct t3_wq *wq, struct t3_cq *cq, int count);
+int cxio_flush_sq(struct t3_wq *wq, struct t3_cq *cq, int count);
void cxio_count_rcqes(struct t3_cq *cq, struct t3_wq *wq, int *count);
void cxio_count_scqes(struct t3_cq *cq, struct t3_wq *wq, int *count);
void cxio_flush_hw_cq(struct t3_cq *cq);
diff --git a/drivers/infiniband/hw/cxgb3/iwch_qp.c b/drivers/infiniband/hw/cxgb3/iwch_qp.c
index b0e5aea..353fbb3 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_qp.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_qp.c
@@ -655,6 +655,7 @@ static void __flush_qp(struct iwch_qp *qhp, unsigned long *flag)
{
struct iwch_cq *rchp, *schp;
int count;
+ int flushed;
rchp = get_chp(qhp->rhp, qhp->attr.rcq);
schp = get_chp(qhp->rhp, qhp->attr.scq);
@@ -669,20 +670,22 @@ static void __flush_qp(struct iwch_qp *qhp, unsigned long *flag)
spin_lock(&qhp->lock);
cxio_flush_hw_cq(&rchp->cq);
cxio_count_rcqes(&rchp->cq, &qhp->wq, &count);
- cxio_flush_rq(&qhp->wq, &rchp->cq, count);
+ flushed = cxio_flush_rq(&qhp->wq, &rchp->cq, count);
spin_unlock(&qhp->lock);
spin_unlock_irqrestore(&rchp->lock, *flag);
- (*rchp->ibcq.comp_handler)(&rchp->ibcq, rchp->ibcq.cq_context);
+ if (flushed)
+ (*rchp->ibcq.comp_handler)(&rchp->ibcq, rchp->ibcq.cq_context);
/* locking heirarchy: cq lock first, then qp lock. */
spin_lock_irqsave(&schp->lock, *flag);
spin_lock(&qhp->lock);
cxio_flush_hw_cq(&schp->cq);
cxio_count_scqes(&schp->cq, &qhp->wq, &count);
- cxio_flush_sq(&qhp->wq, &schp->cq, count);
+ flushed = cxio_flush_sq(&qhp->wq, &schp->cq, count);
spin_unlock(&qhp->lock);
spin_unlock_irqrestore(&schp->lock, *flag);
- (*schp->ibcq.comp_handler)(&schp->ibcq, schp->ibcq.cq_context);
+ if (flushed)
+ (*schp->ibcq.comp_handler)(&schp->ibcq, schp->ibcq.cq_context);
/* deref */
if (atomic_dec_and_test(&qhp->refcnt))
@@ -880,7 +883,6 @@ int iwch_modify_qp(struct iwch_dev *rhp, struct iwch_qp *qhp,
ep = qhp->ep;
get_ep(&ep->com);
}
- flush_qp(qhp, &flag);
break;
case IWCH_QP_STATE_TERMINATE:
qhp->attr.state = IWCH_QP_STATE_TERMINATE;
@@ -911,6 +913,7 @@ int iwch_modify_qp(struct iwch_dev *rhp, struct iwch_qp *qhp,
}
switch (attrs->next_state) {
case IWCH_QP_STATE_IDLE:
+ flush_qp(qhp, &flag);
qhp->attr.state = IWCH_QP_STATE_IDLE;
qhp->attr.llp_stream_handle = NULL;
put_ep(&qhp->ep->com);
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2.6.26 2/3] RDMA/cxgb3: Silently ignore close reply after abort.
2008-05-02 16:17 [PATCH 2.6.26 1/3] RDMA/cxgb3: QP flush fixes Steve Wise
@ 2008-05-02 16:17 ` Steve Wise
2008-05-02 16:17 ` [PATCH 2.6.26 3/3] RDMA/cxgb3: Bump up the mpa connection setup timeout Steve Wise
2008-05-02 17:58 ` [PATCH 2.6.26 1/3] RDMA/cxgb3: QP flush fixes Roland Dreier
2 siblings, 0 replies; 5+ messages in thread
From: Steve Wise @ 2008-05-02 16:17 UTC (permalink / raw)
To: rdreier; +Cc: linux-kernel, netdev, general
Remove bad BUG_ON() in close_con_rpl(). It is possible to get a close_rpl
message on a dead connection. The sequence is:
host refs ep for close exchange
host posts close_req
hw posts PEER_ABORT from incoming RST
host marks ep DEAD
host posts ABORT_RPL and releases ep resources
hw posts CLOSE_RPL
host derefs ep and ep freed.
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
drivers/infiniband/hw/cxgb3/iwch_cm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index f4f3c9e..b2db0a9 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -1650,8 +1650,8 @@ static int close_con_rpl(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
release = 1;
break;
case ABORTING:
- break;
case DEAD:
+ break;
default:
BUG_ON(1);
break;
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2.6.26 3/3] RDMA/cxgb3: Bump up the mpa connection setup timeout.
2008-05-02 16:17 [PATCH 2.6.26 1/3] RDMA/cxgb3: QP flush fixes Steve Wise
2008-05-02 16:17 ` [PATCH 2.6.26 2/3] RDMA/cxgb3: Silently ignore close reply after abort Steve Wise
@ 2008-05-02 16:17 ` Steve Wise
2008-05-02 17:58 ` [PATCH 2.6.26 1/3] RDMA/cxgb3: QP flush fixes Roland Dreier
2 siblings, 0 replies; 5+ messages in thread
From: Steve Wise @ 2008-05-02 16:17 UTC (permalink / raw)
To: rdreier; +Cc: linux-kernel, netdev, general
Testing on large clusters shows its way too short at 10 secs.
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
drivers/infiniband/hw/cxgb3/iwch_cm.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index b2db0a9..9ea3a07 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -67,10 +67,10 @@ int peer2peer = 0;
module_param(peer2peer, int, 0644);
MODULE_PARM_DESC(peer2peer, "Support peer2peer ULPs (default=0)");
-static int ep_timeout_secs = 10;
+static int ep_timeout_secs = 60;
module_param(ep_timeout_secs, int, 0644);
MODULE_PARM_DESC(ep_timeout_secs, "CM Endpoint operation timeout "
- "in seconds (default=10)");
+ "in seconds (default=60)");
static int mpa_rev = 1;
module_param(mpa_rev, int, 0644);
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2.6.26 1/3] RDMA/cxgb3: QP flush fixes
2008-05-02 16:17 [PATCH 2.6.26 1/3] RDMA/cxgb3: QP flush fixes Steve Wise
2008-05-02 16:17 ` [PATCH 2.6.26 2/3] RDMA/cxgb3: Silently ignore close reply after abort Steve Wise
2008-05-02 16:17 ` [PATCH 2.6.26 3/3] RDMA/cxgb3: Bump up the mpa connection setup timeout Steve Wise
@ 2008-05-02 17:58 ` Roland Dreier
2008-05-02 20:16 ` [ofa-general] " Steve Wise
2 siblings, 1 reply; 5+ messages in thread
From: Roland Dreier @ 2008-05-02 17:58 UTC (permalink / raw)
To: Steve Wise; +Cc: linux-kernel, netdev, general
thanks, applied all 3... (1/3 was against a slightly old tree, so I had
to fix up __FUNCTION__ -> __func__ in the context of the diffs)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ofa-general] Re: [PATCH 2.6.26 1/3] RDMA/cxgb3: QP flush fixes
2008-05-02 17:58 ` [PATCH 2.6.26 1/3] RDMA/cxgb3: QP flush fixes Roland Dreier
@ 2008-05-02 20:16 ` Steve Wise
0 siblings, 0 replies; 5+ messages in thread
From: Steve Wise @ 2008-05-02 20:16 UTC (permalink / raw)
To: Roland Dreier; +Cc: netdev, linux-kernel, general
Roland Dreier wrote:
> thanks, applied all 3... (1/3 was against a slightly old tree, so I had
> to fix up __FUNCTION__ -> __func__ in the context of the diffs)
>
Sorry about that. Someday I'll learn __func__.
;-)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-05-02 20:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-02 16:17 [PATCH 2.6.26 1/3] RDMA/cxgb3: QP flush fixes Steve Wise
2008-05-02 16:17 ` [PATCH 2.6.26 2/3] RDMA/cxgb3: Silently ignore close reply after abort Steve Wise
2008-05-02 16:17 ` [PATCH 2.6.26 3/3] RDMA/cxgb3: Bump up the mpa connection setup timeout Steve Wise
2008-05-02 17:58 ` [PATCH 2.6.26 1/3] RDMA/cxgb3: QP flush fixes Roland Dreier
2008-05-02 20:16 ` [ofa-general] " Steve Wise
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).