diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-30 20:07:54 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-30 20:07:54 -0800 |
commit | 92d499d991ec4f5cbd00d6f33967eab9d3ee8d6c (patch) | |
tree | 7b6da4d31ab802a4d8feddea39d5cac9edfe3c1c /drivers/infiniband/hw/ehca/ehca_av.c | |
parent | 1811534a80697b34add31cff53a321cfc291ddfe (diff) | |
parent | b1812582ba94b5f377d5d3cec7646cc17d84e733 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
IB/ehca: Fix static rate if path faster than link
IPoIB: Fix oops if xmit is called when priv->broadcast is NULL
Diffstat (limited to 'drivers/infiniband/hw/ehca/ehca_av.c')
-rw-r--r-- | 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 453eb995c1d..f7782c882ab 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; } |