diff options
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 453eb995c1d4..f7782c882ab4 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, | |||
76 | 76 | ||
77 | link = ib_width_enum_to_int(pa.active_width) * pa.active_speed; | 77 | link = ib_width_enum_to_int(pa.active_width) * pa.active_speed; |
78 | 78 | ||
79 | /* IPD = round((link / path) - 1) */ | 79 | if (path >= link) |
80 | *ipd = ((link + (path >> 1)) / path) - 1; | 80 | /* no need to throttle if path faster than link */ |
81 | *ipd = 0; | ||
82 | else | ||
83 | /* IPD = round((link / path) - 1) */ | ||
84 | *ipd = ((link + (path >> 1)) / path) - 1; | ||
81 | 85 | ||
82 | return 0; | 86 | return 0; |
83 | } | 87 | } |