Files
linux/drivers
Logan Gunthorpe 471954c313 ntb_transport: fix bug calculating num_qps_mw
commit 8e8496e0e9 upstream.

A divide by zero error occurs if qp_count is less than mw_count because
num_qps_mw is calculated to be zero. The calculation appears to be
incorrect.

The requirement is for num_qps_mw to be set to qp_count / mw_count
with any remainder divided among the earlier mws.

For example, if mw_count is 5 and qp_count is 12 then mws 0 and 1
will have 3 qps per window and mws 2 through 4 will have 2 qps per window.
Thus, when mw_num < qp_count % mw_count, num_qps_mw is 1 higher
than when mw_num >= qp_count.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Fixes: e26a5843f7 ("NTB: Split ntb_hw_intel and ntb_transport drivers")
Acked-by: Allen Hubbe <Allen.Hubbe@dell.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-30 10:21:54 +02:00
..
2016-12-05 14:53:46 -05:00
2017-08-06 18:59:49 -07:00
2017-08-30 10:21:46 +02:00
2017-08-06 18:59:42 -07:00
2016-09-27 12:33:47 +02:00
2016-09-20 20:57:12 +10:00
2017-04-21 09:31:24 +02:00
2017-08-24 17:12:20 -07:00