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.
Unified · Split
| @@ -510,7 +510,7 @@ static void ntb_transport_setup_qp_mw(struct ntb_transport *nt, · 509 unmodified lines | ||
| 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,7 +856,7 @@ static int ntb_transport_init_queue(struct ntb_transport *nt, · 339 unmodified lines | ||
| 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; |