]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
NTB: correct the spread of queues over mw's
authorJon Mason <jon.mason@intel.com>
Thu, 19 Jun 2014 17:11:13 +0000 (10:11 -0700)
committerJon Mason <jdmason@kudzu.us>
Sun, 14 Sep 2014 04:10:38 +0000 (00:10 -0400)
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>
drivers/ntb/ntb_transport.c

index 9dd63b82202555e0ebdd46b3460a8ec1107f8f9f..611fef48bdc3c26cd9fadc6290719b79b53b335c 100644 (file)
@@ -510,7 +510,7 @@ static void ntb_transport_setup_qp_mw(struct ntb_transport *nt,
 
        WARN_ON(nt->mw[mw_num].virt_addr == NULL);
 
-       if (nt->max_qps % mw_max && mw_num < nt->max_qps % mw_max)
+       if (nt->max_qps % mw_max && mw_num + 1 < nt->max_qps / mw_max)
                num_qps_mw = nt->max_qps / mw_max + 1;
        else
                num_qps_mw = nt->max_qps / mw_max;
@@ -856,7 +856,7 @@ static int ntb_transport_init_queue(struct ntb_transport *nt,
        qp->client_ready = NTB_LINK_DOWN;
        qp->event_handler = NULL;
 
-       if (nt->max_qps % mw_max && mw_num < nt->max_qps % mw_max)
+       if (nt->max_qps % mw_max && mw_num + 1 < nt->max_qps / mw_max)
                num_qps_mw = nt->max_qps / mw_max + 1;
        else
                num_qps_mw = nt->max_qps / mw_max;