aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLogan Gunthorpe <logang@deltatee.com>2017-06-26 15:50:41 -0400
committerJon Mason <jdmason@kudzu.us>2017-07-17 12:56:15 -0400
commitbc240eec4b074f5dc2753f295e980e66b72c90fb (patch)
treecffb7d4a2ac0b1b00f0ce483dad251c8ac9cd8c1
parent5771a8c08880cdca3bfb4a3fc6d309d6bba20877 (diff)
ntb: use correct mw_count function in ntb_tool and ntb_transport
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")
-rw-r--r--drivers/ntb/ntb_transport.c2
-rw-r--r--drivers/ntb/test/ntb_tool.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
index 9a03c5871efe..b29558ddfe95 100644
--- a/drivers/ntb/ntb_transport.c
+++ b/drivers/ntb/ntb_transport.c
@@ -1059,7 +1059,7 @@ static int ntb_transport_probe(struct ntb_client *self, struct ntb_dev *ndev)
1059 int node; 1059 int node;
1060 int rc, i; 1060 int rc, i;
1061 1061
1062 mw_count = ntb_mw_count(ndev, PIDX); 1062 mw_count = ntb_peer_mw_count(ndev);
1063 1063
1064 if (!ndev->ops->mw_set_trans) { 1064 if (!ndev->ops->mw_set_trans) {
1065 dev_err(&ndev->dev, "Inbound MW based NTB API is required\n"); 1065 dev_err(&ndev->dev, "Inbound MW based NTB API is required\n");
diff --git a/drivers/ntb/test/ntb_tool.c b/drivers/ntb/test/ntb_tool.c
index f002bf48a08d..a69815c45ce6 100644
--- a/drivers/ntb/test/ntb_tool.c
+++ b/drivers/ntb/test/ntb_tool.c
@@ -959,7 +959,7 @@ static int tool_probe(struct ntb_client *self, struct ntb_dev *ntb)
959 tc->ntb = ntb; 959 tc->ntb = ntb;
960 init_waitqueue_head(&tc->link_wq); 960 init_waitqueue_head(&tc->link_wq);
961 961
962 tc->mw_count = min(ntb_mw_count(tc->ntb, PIDX), MAX_MWS); 962 tc->mw_count = min(ntb_peer_mw_count(tc->ntb), MAX_MWS);
963 for (i = 0; i < tc->mw_count; i++) { 963 for (i = 0; i < tc->mw_count; i++) {
964 rc = tool_init_mw(tc, i); 964 rc = tool_init_mw(tc, i);
965 if (rc) 965 if (rc)