]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ntb: use correct mw_count function in ntb_tool and ntb_transport
authorLogan Gunthorpe <logang@deltatee.com>
Mon, 26 Jun 2017 19:50:41 +0000 (13:50 -0600)
committerJon Mason <jdmason@kudzu.us>
Mon, 17 Jul 2017 16:56:15 +0000 (12:56 -0400)
After converting to the new API, both ntb_tool and ntb_transport are
using ntb_mw_count to iterate through ntb_peer_get_addr when they
should be using ntb_peer_mw_count.

This probably isn't an issue with the Intel and AMD drivers but
this will matter for any future driver with asymetric memory window
counts.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Acked-by: Allen Hubbe <Allen.Hubbe@emc.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Fixes: 443b9a14ecbe ("NTB: Alter MW API to support multi-ports devices")
drivers/ntb/ntb_transport.c
drivers/ntb/test/ntb_tool.c

index 9a03c5871efe675015418e6f5e1ebd1745faaac0..b29558ddfe9523bf962147da23aef0bcabdfcaa1 100644 (file)
@@ -1059,7 +1059,7 @@ static int ntb_transport_probe(struct ntb_client *self, struct ntb_dev *ndev)
        int node;
        int rc, i;
 
-       mw_count = ntb_mw_count(ndev, PIDX);
+       mw_count = ntb_peer_mw_count(ndev);
 
        if (!ndev->ops->mw_set_trans) {
                dev_err(&ndev->dev, "Inbound MW based NTB API is required\n");
index f002bf48a08dbefd0602532bc6d2f1dbf4f68a3a..a69815c45ce6f2137d9f409bad0b8742fa530df4 100644 (file)
@@ -959,7 +959,7 @@ static int tool_probe(struct ntb_client *self, struct ntb_dev *ntb)
        tc->ntb = ntb;
        init_waitqueue_head(&tc->link_wq);
 
-       tc->mw_count = min(ntb_mw_count(tc->ntb, PIDX), MAX_MWS);
+       tc->mw_count = min(ntb_peer_mw_count(tc->ntb), MAX_MWS);
        for (i = 0; i < tc->mw_count; i++) {
                rc = tool_init_mw(tc, i);
                if (rc)