On 07/22/2011 01:47 PM, Bernard Metzler wrote:
> +int siw_post_receive(struct ib_qp *ofa_qp, struct ib_recv_wr *wr,
> +                  struct ib_recv_wr **bad_wr)
> +{
> +     struct siw_wqe  *wqe = NULL;
> +     struct siw_qp   *qp = siw_qp_ofa2siw(ofa_qp);
> +     unsigned long   flags;
> +     int rv = 0;
> +
> +     dprint(DBG_WR|DBG_TX, "(QP%d): state=%d\n", QP_ID(qp),
> +             qp->attrs.state);
> +
> +     if (qp->srq)
> +             return -EOPNOTSUPP; /* what else from errno.h? */

bad_wr is not set.

> +     /*
> +      * Try to acquire QP state lock. Must be non-blocking
> +      * to accommodate kernel clients needs.
> +      */
> +     if (!down_read_trylock(&qp->state_lock)) {
> +             *bad_wr = wr;
> +             return -ENOTCONN;
> +     }
> +
> +     if (qp->attrs.state > SIW_QP_STATE_RTS) {
> +             up_read(&qp->state_lock);
> +             dprint(DBG_ON, " (QP%d): state=%d\n", QP_ID(qp),
> +                     qp->attrs.state);
> +             return -EINVAL;

ditto.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to