Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9ba6d5529dd919b442eedf5bef1dd28aca2ee9fe
Commit:     9ba6d5529dd919b442eedf5bef1dd28aca2ee9fe
Parent:     c3af664adbe06803931dbc7a3c8588982d72fac1
Author:     Michael S. Tsirkin <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 12 18:10:25 2007 +0300
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Mon Apr 30 17:30:28 2007 -0700

    IB/mthca: Work around kernel QP starvation
    
    With mthca, RC QPs can starve each other and even UD QPs on the same
    hardware schedule queue.  As a result, userspace MPI can starve
    e.g. IPoIB traffic, with netdev watchdog warnings getting printed out,
    and TCP connections getting stuck or failing.
    
    Reduce the chance of this happening by using three separate hardware
    schedule queues: one for userspace RC QPs, one for kernel RC QPs, and
    one for all other QPs.
    
    Signed-off-by: Michael S. Tsirkin <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/mthca/mthca_qp.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c 
b/drivers/infiniband/hw/mthca/mthca_qp.c
index 8fe6fee..fee60c8 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -701,6 +701,19 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr 
*attr, int attr_mask,
                qp_param->opt_param_mask |= 
cpu_to_be32(MTHCA_QP_OPTPAR_PRIMARY_ADDR_PATH);
        }
 
+       if (ibqp->qp_type == IB_QPT_RC &&
+           cur_state == IB_QPS_INIT && new_state == IB_QPS_RTR) {
+               u8 sched_queue = ibqp->uobject ? 0x2 : 0x1;
+
+               if (mthca_is_memfree(dev))
+                       qp_context->rlkey_arbel_sched_queue |= sched_queue;
+               else
+                       qp_context->tavor_sched_queue |= 
cpu_to_be32(sched_queue);
+
+               qp_param->opt_param_mask |=
+                       cpu_to_be32(MTHCA_QP_OPTPAR_SCHED_QUEUE);
+       }
+
        if (attr_mask & IB_QP_TIMEOUT) {
                qp_context->pri_path.ackto = attr->timeout << 3;
                qp_param->opt_param_mask |= 
cpu_to_be32(MTHCA_QP_OPTPAR_ACK_TIMEOUT);
-
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