* [PATCH] IB/ehca: Fix static rate if path faster than link
@ 2007-11-28 13:46 Joachim Fenkes
2007-11-29 3:42 ` Roland Dreier
0 siblings, 1 reply; 2+ messages in thread
From: Joachim Fenkes @ 2007-11-28 13:46 UTC (permalink / raw)
To: LinuxPPC-Dev, LKML, OF-General, Roland Dreier, OF-EWG
Cc: Stefan Roscher, Christoph Raisch, Marcus Eder
The formula would yield -1 for this, which is wrong in a bad way (max
throttling). Clamp to 0, which is the correct value.
Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
---
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(-)
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;
}
--
1.5.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] IB/ehca: Fix static rate if path faster than link
2007-11-28 13:46 [PATCH] IB/ehca: Fix static rate if path faster than link Joachim Fenkes
@ 2007-11-29 3:42 ` Roland Dreier
0 siblings, 0 replies; 2+ messages in thread
From: Roland Dreier @ 2007-11-29 3:42 UTC (permalink / raw)
To: Joachim Fenkes
Cc: LKML, OF-EWG, LinuxPPC-Dev, Christoph Raisch, Marcus Eder,
OF-General, Stefan Roscher
thanks, applied
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-11-29 3:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-28 13:46 [PATCH] IB/ehca: Fix static rate if path faster than link Joachim Fenkes
2007-11-29 3:42 ` Roland Dreier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).