Commit 3853194c authored by Roland Dreier's avatar Roland Dreier

[PATCH] IB/mthca: Fix posting work requests to shared receive queues

The error handling paths in mthca_tavor_post_srq_recv() and
mthca_arbel_post_srq_recv() are quite bogus, the result of a
screwed up merge.  Fix them so they work as intended.

Pointed out by Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent c915033f
...@@ -409,7 +409,7 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr, ...@@ -409,7 +409,7 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
mthca_err(dev, "SRQ %06x full\n", srq->srqn); mthca_err(dev, "SRQ %06x full\n", srq->srqn);
err = -ENOMEM; err = -ENOMEM;
*bad_wr = wr; *bad_wr = wr;
return nreq; break;
} }
wqe = get_wqe(srq, ind); wqe = get_wqe(srq, ind);
...@@ -427,7 +427,7 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr, ...@@ -427,7 +427,7 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
err = -EINVAL; err = -EINVAL;
*bad_wr = wr; *bad_wr = wr;
srq->last = prev_wqe; srq->last = prev_wqe;
return nreq; break;
} }
for (i = 0; i < wr->num_sge; ++i) { for (i = 0; i < wr->num_sge; ++i) {
...@@ -456,8 +456,6 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr, ...@@ -456,8 +456,6 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
srq->first_free = next_ind; srq->first_free = next_ind;
} }
return nreq;
if (likely(nreq)) { if (likely(nreq)) {
__be32 doorbell[2]; __be32 doorbell[2];
...@@ -501,7 +499,7 @@ int mthca_arbel_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr, ...@@ -501,7 +499,7 @@ int mthca_arbel_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
mthca_err(dev, "SRQ %06x full\n", srq->srqn); mthca_err(dev, "SRQ %06x full\n", srq->srqn);
err = -ENOMEM; err = -ENOMEM;
*bad_wr = wr; *bad_wr = wr;
return nreq; break;
} }
wqe = get_wqe(srq, ind); wqe = get_wqe(srq, ind);
...@@ -517,7 +515,7 @@ int mthca_arbel_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr, ...@@ -517,7 +515,7 @@ int mthca_arbel_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
if (unlikely(wr->num_sge > srq->max_gs)) { if (unlikely(wr->num_sge > srq->max_gs)) {
err = -EINVAL; err = -EINVAL;
*bad_wr = wr; *bad_wr = wr;
return nreq; break;
} }
for (i = 0; i < wr->num_sge; ++i) { for (i = 0; i < wr->num_sge; ++i) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment