Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cc65edcf0c174eff4367cfbc594a2f33c0d477fa
Commit:     cc65edcf0c174eff4367cfbc594a2f33c0d477fa
Parent:     e57d62a14775c9d37195debe837431c75168ef69
Author:     Ralph Campbell <[EMAIL PROTECTED]>
AuthorDate: Fri Dec 14 19:22:34 2007 -0800
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Fri Jan 25 14:15:34 2008 -0800

    IB/ipath: Fix RNR NAK handling
    
    This patch fixes a couple of minor problems with RNR NAK handling:
     - The insertion sort was causing extra delay when inserting ahead
       vs. behind an existing entry on the list.
     - A resend of a first packet of a message which is still not ready,
       needs another RNR NAK (i.e., it was suppressed when it shouldn't).
     - Also, the resend tasklet doesn't need to be woken up unless the
       ACK/NAK actually indicates progress has been made.
    
    Signed-off-by: Ralph Campbell <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/ipath/ipath_rc.c  |   18 +++++++-----------
 drivers/infiniband/hw/ipath/ipath_ruc.c |    6 +++++-
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/infiniband/hw/ipath/ipath_rc.c 
b/drivers/infiniband/hw/ipath/ipath_rc.c
index 120a61b..459e46e 100644
--- a/drivers/infiniband/hw/ipath/ipath_rc.c
+++ b/drivers/infiniband/hw/ipath/ipath_rc.c
@@ -647,6 +647,7 @@ static void send_rc_ack(struct ipath_qp *qp)
 
 queue_ack:
        spin_lock_irqsave(&qp->s_lock, flags);
+       dev->n_rc_qacks++;
        qp->s_flags |= IPATH_S_ACK_PENDING;
        qp->s_nak_state = qp->r_nak_state;
        qp->s_ack_psn = qp->r_ack_psn;
@@ -798,11 +799,13 @@ bail:
 
 static inline void update_last_psn(struct ipath_qp *qp, u32 psn)
 {
-       if (qp->s_wait_credit) {
-               qp->s_wait_credit = 0;
-               tasklet_hi_schedule(&qp->s_task);
+       if (qp->s_last_psn != psn) {
+               qp->s_last_psn = psn;
+               if (qp->s_wait_credit) {
+                       qp->s_wait_credit = 0;
+                       tasklet_hi_schedule(&qp->s_task);
+               }
        }
-       qp->s_last_psn = psn;
 }
 
 /**
@@ -1653,13 +1656,6 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct 
ipath_ib_header *hdr,
        case OP(SEND_FIRST):
                if (!ipath_get_rwqe(qp, 0)) {
                rnr_nak:
-                       /*
-                        * A RNR NAK will ACK earlier sends and RDMA writes.
-                        * Don't queue the NAK if a RDMA read or atomic
-                        * is pending though.
-                        */
-                       if (qp->r_nak_state)
-                               goto done;
                        qp->r_nak_state = IB_RNR_NAK | qp->r_min_rnr_timer;
                        qp->r_ack_psn = qp->r_psn;
                        goto send_ack;
diff --git a/drivers/infiniband/hw/ipath/ipath_ruc.c 
b/drivers/infiniband/hw/ipath/ipath_ruc.c
index 1b4f7e1..a59bdbd 100644
--- a/drivers/infiniband/hw/ipath/ipath_ruc.c
+++ b/drivers/infiniband/hw/ipath/ipath_ruc.c
@@ -98,11 +98,15 @@ void ipath_insert_rnr_queue(struct ipath_qp *qp)
                while (qp->s_rnr_timeout >= nqp->s_rnr_timeout) {
                        qp->s_rnr_timeout -= nqp->s_rnr_timeout;
                        l = l->next;
-                       if (l->next == &dev->rnrwait)
+                       if (l->next == &dev->rnrwait) {
+                               nqp = NULL;
                                break;
+                       }
                        nqp = list_entry(l->next, struct ipath_qp,
                                         timerwait);
                }
+               if (nqp)
+                       nqp->s_rnr_timeout -= qp->s_rnr_timeout;
                list_add(&qp->timerwait, l);
        }
        spin_unlock_irqrestore(&dev->pending_lock, flags);
-
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