Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b1812582ba94b5f377d5d3cec7646cc17d84e733
Commit:     b1812582ba94b5f377d5d3cec7646cc17d84e733
Parent:     1401b53acc0328d96bacb2a3393d2852699df96b
Author:     Joachim Fenkes <[EMAIL PROTECTED]>
AuthorDate: Fri Nov 30 16:19:41 2007 -0800
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Fri Nov 30 16:19:41 2007 -0800

    IB/ehca: Fix static rate if path faster than link
    
    The formula would yield -1 if the path is faster than the link, which
    is wrong in a bad way (max throttling).  Clamp to 0, which is the
    correct value.
    
    Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/ehca/ehca_av.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_av.c 
b/drivers/infiniband/hw/ehca/ehca_av.c
index 453eb99..f7782c8 100644
--- a/drivers/infiniband/hw/ehca/ehca_av.c
+++ b/drivers/infiniband/hw/ehca/ehca_av.c
@@ -76,8 +76,12 @@ int ehca_calc_ipd(struct ehca_shca *shca, int port,
 
        link = ib_width_enum_to_int(pa.active_width) * pa.active_speed;
 
-       /* IPD = round((link / path) - 1) */
-       *ipd = ((link + (path >> 1)) / path) - 1;
+       if (path >= link)
+               /* no need to throttle if path faster than link */
+               *ipd = 0;
+       else
+               /* IPD = round((link / path) - 1) */
+               *ipd = ((link + (path >> 1)) / path) - 1;
 
        return 0;
 }
-
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