]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/infiniband/hw/ehca/ehca_av.c
Merge branch 'task_killable' of git://git.kernel.org/pub/scm/linux/kernel/git/willy...
[linux-2.6-omap-h63xx.git] / drivers / infiniband / hw / ehca / ehca_av.c
index 453eb995c1d47b59255e46d4fcad70147d83c9e5..194c1c30cf63c4d2fd16a75619e6d4ec2aac4dc1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  IBM eServer eHCA Infiniband device driver for Linux on POWER
  *
- *  adress vector functions
+ *  address vector functions
  *
  *  Authors: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
  *           Khadija Souissi <souissik@de.ibm.com>
@@ -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;
 }