]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
NTB: perf: Don't require one more memory window than number of peers
authorLogan Gunthorpe <logang@deltatee.com>
Wed, 9 Jan 2019 19:22:30 +0000 (12:22 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:50:40 +0000 (17:50 +0200)
[ Upstream commit a9c4211ac918ade1522aced6b5acfbe824722f7d ]

ntb_perf should not require more than one memory window per peer. This
was probably an off-by-one error.

Fixes: 5648e56d03fa ("NTB: ntb_perf: Add full multi-port NTB API support")
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Acked-by: Allen Hubbe <allenbh@gmail.com>
Tested-by: Alexander Fomichev <fomichev.ru@gmail.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/ntb/test/ntb_perf.c

index 52c29791fc02aee9e3ce2721639a0656678a47f4..3817eadab2cf97eab85a62fefe765b738eee1f4d 100644 (file)
@@ -653,7 +653,7 @@ static int perf_init_service(struct perf_ctx *perf)
 {
        u64 mask;
 
-       if (ntb_peer_mw_count(perf->ntb) < perf->pcnt + 1) {
+       if (ntb_peer_mw_count(perf->ntb) < perf->pcnt) {
                dev_err(&perf->ntb->dev, "Not enough memory windows\n");
                return -EINVAL;
        }