NTB: correct the spread of queues over mw's

The detection of an uneven number of queues on the given memory windows
was not correct. The mw_num is zero based and the mod should be
division to spread them evenly over the mw's.

Signed-off-by: Jon Mason <jon.mason@intel.com>

authored by

Jon Mason and committed by
Jon Mason
a1413cfb 2ce7598c

+2 -2
+2 -2
drivers/ntb/ntb_transport.c
··· 510 510 511 511 WARN_ON(nt->mw[mw_num].virt_addr == NULL); 512 512 513 - if (nt->max_qps % mw_max && mw_num < nt->max_qps % mw_max) 513 + if (nt->max_qps % mw_max && mw_num + 1 < nt->max_qps / mw_max) 514 514 num_qps_mw = nt->max_qps / mw_max + 1; 515 515 else 516 516 num_qps_mw = nt->max_qps / mw_max; ··· 856 856 qp->client_ready = NTB_LINK_DOWN; 857 857 qp->event_handler = NULL; 858 858 859 - if (nt->max_qps % mw_max && mw_num < nt->max_qps % mw_max) 859 + if (nt->max_qps % mw_max && mw_num + 1 < nt->max_qps / mw_max) 860 860 num_qps_mw = nt->max_qps / mw_max + 1; 861 861 else 862 862 num_qps_mw = nt->max_qps / mw_max;