Bug fix: SRQ availability counter is no longer decremented when ib_post_send() fails.

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1388 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2009-12-13 17:59:44 +00:00
parent a03c2176a8
commit 9e72c9bade

View File

@@ -781,7 +781,6 @@ static int srpt_post_send(struct srpt_rdma_ch *ch, struct srpt_ioctx *ioctx,
ret = -ENOMEM;
if (atomic_dec_return(&ch->qp_wr_avail) < 0) {
atomic_inc(&ch->qp_wr_avail);
PRINT_ERROR("%s[%d]: SRQ full", __func__, __LINE__);
goto out;
}
@@ -803,6 +802,8 @@ static int srpt_post_send(struct srpt_rdma_ch *ch, struct srpt_ioctx *ioctx,
ret = ib_post_send(ch->qp, &wr, &bad_wr);
out:
if (ret < 0)
atomic_inc(&ch->qp_wr_avail);
return ret;
}