Skip to contentSkip to conversation

IB/ehca: Fix static rate if path faster than link

PATCH Applied Joachim Fenkes 2 participants 2 messages Nov 28, 2007 – Nov 29, 2007 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IB/ehca: Fix static rate if path faster than link

The formula would yield -1 for this, which is wrong in a bad way (max throttling). Clamp to 0, which is the correct value.

---

This fixes another regression introduced in rc3.
Please review and apply for 2.6.24-rc4. Thanks!

 drivers/infiniband/hw/ehca/ehca_av.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
drivers/infiniband/hw/ehca/ehca_av.c +6 -2
index 453eb99..f7782c8 100644
@@ -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;
 }
Signature · 1 line
1.5.2