From patchwork Tue Jun 23 19:55:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 223143 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A83EC433E0 for ; Tue, 23 Jun 2020 21:27:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 07B1920781 for ; Tue, 23 Jun 2020 21:27:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592947678; bh=JGYZbt3nceRfGI9BpqzkvdqDJlrivEAnn0xqKv3ZT6E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=tG1hdJFSjaWc7+ukCXwZ5AYVAmrevJ2B0rO2hUWgAH9U1M0adznQnQJhSiMjcxcOW vM/hUzfYxZ28PJHpSHQ8CgJemmBAZxtNdHQf9J7lQ+iub0T/CM/sTMyDYjVH8S98ux Pf4edm1WuRP3f05Xz6DorG0vSi4QVdELP2v3J47M= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389198AbgFWV14 (ORCPT ); Tue, 23 Jun 2020 17:27:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:60100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389173AbgFWUQb (ORCPT ); Tue, 23 Jun 2020 16:16:31 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A080C20702; Tue, 23 Jun 2020 20:16:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592943391; bh=JGYZbt3nceRfGI9BpqzkvdqDJlrivEAnn0xqKv3ZT6E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ren+4gcBShWym/KVaXBhvSjU+90/d3Mf2chX8iPXNk+IpnUq4O1df1NlySwKBGh40 uuJROmASmNKVViy+Xw7Y2Wmuj/nORXR8Iaiy1vU5f/9kKbgA/M6FRL2OxsoIWVJXle c9FZtKQZLww7UCBEGagpwrXyy0Gqt9xDIlSWe6T0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Logan Gunthorpe , Allen Hubbe , Alexander Fomichev , Jon Mason , Sasha Levin Subject: [PATCH 5.7 343/477] NTB: perf: Dont require one more memory window than number of peers Date: Tue, 23 Jun 2020 21:55:40 +0200 Message-Id: <20200623195423.757468870@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195407.572062007@linuxfoundation.org> References: <20200623195407.572062007@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Logan Gunthorpe [ 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 Acked-by: Allen Hubbe Tested-by: Alexander Fomichev Signed-off-by: Jon Mason Signed-off-by: Sasha Levin --- drivers/ntb/test/ntb_perf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c index 1c93b9f5c73bc..21c8a3bac1e0a 100644 --- a/drivers/ntb/test/ntb_perf.c +++ b/drivers/ntb/test/ntb_perf.c @@ -654,7 +654,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; }