Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=56a8c8b6ac4d6edba5153d17730aaf96ba8f1f8c
Commit:     56a8c8b6ac4d6edba5153d17730aaf96ba8f1f8c
Parent:     2446304dd687488c054d0437f2aeef1ef2bfbd02
Author:     Roland Dreier <[EMAIL PROTECTED]>
AuthorDate: Sun May 20 20:19:24 2007 -0700
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Sun May 20 20:19:24 2007 -0700

    IB/mlx4: Check if SRQ is full when posting receive
    
    Make mlx4_post_srq_recv() fail if the SRQ is full (head == tail).
    
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/mlx4/srq.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/srq.c b/drivers/infiniband/hw/mlx4/srq.c
index 42ab4a8..12fac1c 100644
--- a/drivers/infiniband/hw/mlx4/srq.c
+++ b/drivers/infiniband/hw/mlx4/srq.c
@@ -297,6 +297,12 @@ int mlx4_ib_post_srq_recv(struct ib_srq *ibsrq, struct 
ib_recv_wr *wr,
                        break;
                }
 
+               if (unlikely(srq->head == srq->tail)) {
+                       err = -ENOMEM;
+                       *bad_wr = wr;
+                       break;
+               }
+
                srq->wrid[srq->head] = wr->wr_id;
 
                next      = get_wqe(srq, srq->head);
-
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