Skip to content

Commit bc240ee

Browse files
lsgunthjonmason
authored andcommitted
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 <[email protected]> Acked-by: Allen Hubbe <[email protected]> Signed-off-by: Jon Mason <[email protected]> Fixes: 443b9a1 ("NTB: Alter MW API to support multi-ports devices")
1 parent 5771a8c commit bc240ee

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/ntb/ntb_transport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ static int ntb_transport_probe(struct ntb_client *self, struct ntb_dev *ndev)
10591059
int node;
10601060
int rc, i;
10611061

1062-
mw_count = ntb_mw_count(ndev, PIDX);
1062+
mw_count = ntb_peer_mw_count(ndev);
10631063

10641064
if (!ndev->ops->mw_set_trans) {
10651065
dev_err(&ndev->dev, "Inbound MW based NTB API is required\n");

drivers/ntb/test/ntb_tool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ static int tool_probe(struct ntb_client *self, struct ntb_dev *ntb)
959959
tc->ntb = ntb;
960960
init_waitqueue_head(&tc->link_wq);
961961

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);
963963
for (i = 0; i < tc->mw_count; i++) {
964964
rc = tool_init_mw(tc, i);
965965
if (rc)

0 commit comments

Comments
 (0)