diff options
| author | Jon Mason <jon.mason@intel.com> | 2014-06-19 13:11:13 -0400 |
|---|---|---|
| committer | Jon Mason <jdmason@kudzu.us> | 2014-09-14 00:10:38 -0400 |
| commit | a1413cfbcb9f56fca59043ef3c19369327e61b49 (patch) | |
| tree | d74ee70d01d1fd19213b934fa497d006a5cd0421 | |
| parent | 2ce7598c9a453e0acd0e07be7be3f5eb39608ebd (diff) | |
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>
| -rw-r--r-- | drivers/ntb/ntb_transport.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c index 9dd63b822025..611fef48bdc3 100644 --- a/drivers/ntb/ntb_transport.c +++ b/drivers/ntb/ntb_transport.c | |||
| @@ -510,7 +510,7 @@ static void ntb_transport_setup_qp_mw(struct ntb_transport *nt, | |||
| 510 | 510 | ||
| 511 | WARN_ON(nt->mw[mw_num].virt_addr == NULL); | 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 | num_qps_mw = nt->max_qps / mw_max + 1; | 514 | num_qps_mw = nt->max_qps / mw_max + 1; |
| 515 | else | 515 | else |
| 516 | num_qps_mw = nt->max_qps / mw_max; | 516 | num_qps_mw = nt->max_qps / mw_max; |
| @@ -856,7 +856,7 @@ static int ntb_transport_init_queue(struct ntb_transport *nt, | |||
| 856 | qp->client_ready = NTB_LINK_DOWN; | 856 | qp->client_ready = NTB_LINK_DOWN; |
| 857 | qp->event_handler = NULL; | 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 | num_qps_mw = nt->max_qps / mw_max + 1; | 860 | num_qps_mw = nt->max_qps / mw_max + 1; |
| 861 | else | 861 | else |
| 862 | num_qps_mw = nt->max_qps / mw_max; | 862 | num_qps_mw = nt->max_qps / mw_max; |
