Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4187b915a0f7eaa69707715e80d9fc253ff6167a
Commit:     4187b915a0f7eaa69707715e80d9fc253ff6167a
Parent:     14de986a0ba560b54340fd277a3579e95a2d3838
Author:     Ralph Campbell <[EMAIL PROTECTED]>
AuthorDate: Wed Nov 14 13:34:14 2007 -0800
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Tue Nov 20 11:05:42 2007 -0800

    IB/ipath: Normalize error return codes for posting work requests
    
    The error codes for ib_post_send(), ib_post_recv(), and ib_post_srq_recv()
    were inconsistent. Use EINVAL for too many SGEs and ENOMEM for too many
    WRs.
    
    Signed-off-by: Ralph Campbell <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/ipath/ipath_srq.c   |    2 +-
 drivers/infiniband/hw/ipath/ipath_verbs.c |    8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/ipath/ipath_srq.c 
b/drivers/infiniband/hw/ipath/ipath_srq.c
index 434da62..2fef36f 100644
--- a/drivers/infiniband/hw/ipath/ipath_srq.c
+++ b/drivers/infiniband/hw/ipath/ipath_srq.c
@@ -59,7 +59,7 @@ int ipath_post_srq_receive(struct ib_srq *ibsrq, struct 
ib_recv_wr *wr,
 
                if ((unsigned) wr->num_sge > srq->rq.max_sge) {
                        *bad_wr = wr;
-                       ret = -ENOMEM;
+                       ret = -EINVAL;
                        goto bail;
                }
 
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c 
b/drivers/infiniband/hw/ipath/ipath_verbs.c
index 74f77e7..c4c9984 100644
--- a/drivers/infiniband/hw/ipath/ipath_verbs.c
+++ b/drivers/infiniband/hw/ipath/ipath_verbs.c
@@ -302,8 +302,10 @@ static int ipath_post_one_send(struct ipath_qp *qp, struct 
ib_send_wr *wr)
        next = qp->s_head + 1;
        if (next >= qp->s_size)
                next = 0;
-       if (next == qp->s_last)
-               goto bail_inval;
+       if (next == qp->s_last) {
+               ret = -ENOMEM;
+               goto bail;
+       }
 
        wqe = get_swqe_ptr(qp, qp->s_head);
        wqe->wr = *wr;
@@ -404,7 +406,7 @@ static int ipath_post_receive(struct ib_qp *ibqp, struct 
ib_recv_wr *wr,
 
                if ((unsigned) wr->num_sge > qp->r_rq.max_sge) {
                        *bad_wr = wr;
-                       ret = -ENOMEM;
+                       ret = -EINVAL;
                        goto bail;
                }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to