Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2077085ybp; Thu, 10 Oct 2019 01:46:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdOLwfUeqvvSxG54RrU/UtzQdbFx8/Ak+g/GzVbaJVMssQv13UJ96ryvWGd8DCtNfRlUU8 X-Received: by 2002:a17:906:b74f:: with SMTP id fx15mr6943666ejb.69.1570697190606; Thu, 10 Oct 2019 01:46:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570697190; cv=none; d=google.com; s=arc-20160816; b=FkNiHJL1ceFbpAZYMBXlCI12lMDqokCB6mWHSFEq/An/DQa3/Ne8lsWcmyplFV+X1t W1QphgMF1DLioj8EAd4Wx1bPR15aFgMIUcx/A/+aa8IZSPPFpC7RUltKJujG2nEzw7UC ssVFsFMTI044t6j956DvqKeREeQyjLv1hgG5iYpuPckgtbH884JBvaoLHFWAD+yX1HCv 3HYZUdx8CYb1QBP096ajzBqh3WcOutSnCRF1ZP2o4XC3/sQ2C52hSnUgWcWxY6y1sFgn osR+PNuOPkfpjmHIgCAvPFKA8FWCzCpGvaporvof9fc/zmsTEqIyf+bbkdXh8haU8aof ZH+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=P7XZ1s4BDB9pDstkNDPJ+ipvn6923n/YNd60F+r2wAc=; b=oErgFg/E51pPiNRIkNYMb0xCIEoKtutJwgddiu8PLPWQujWcC0nTrCq1JnP+2w7JHB PupRmmPtz5H+E1fn2ghzr8RidzepsLIPIiqkl1wlY8DVDBj3zCr0pHKgN90js8FhoWrP ZQcuNxXP09e08jMLN6HYfhMSaJ4LefKTIesorjTC+R6AICWFWeTOSj9pNRaObOW5ruum PeH9QtbY12xL+uLLeof/AZ3kP36w3cykGwupP7tb95rPYm+bu63vr/X7G8mqC00dngqR O5b+V+6EpIkXgODZupPkQR8JFKyAVURt+Lssm+UuoBeeBPxEvWw4hYGZWQh+nupfXXc3 7lrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vcJwTZFA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f45si3265562eda.345.2019.10.10.01.46.07; Thu, 10 Oct 2019 01:46:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vcJwTZFA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388575AbfJJImf (ORCPT + 99 others); Thu, 10 Oct 2019 04:42:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:47168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388553AbfJJImd (ORCPT ); Thu, 10 Oct 2019 04:42:33 -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 706942190F; Thu, 10 Oct 2019 08:42:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570696952; bh=Ew1a+as8Mr/trFi0bQpDJF/OruLxmHhgczpHLE3bCZs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vcJwTZFAjfP05R7dmZO97GdUImKAQpygmen3sJIhclCY9YyY8zeGOBXhgAy2J7o8R 7jaIYGHCyyqT5I9N2i9V3OGcERA3/oUp1XniedXFH1pwxgVP+KdR8uK4I1ejmUjDYc znD0Cue3FpkFK3vLGxRkMjH9RhYvn1nWDkI4/Jxw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sanjay R Mehta , Jon Mason , Sasha Levin Subject: [PATCH 5.3 112/148] ntb: point to right memory window index Date: Thu, 10 Oct 2019 10:36:13 +0200 Message-Id: <20191010083617.913798261@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010083609.660878383@linuxfoundation.org> References: <20191010083609.660878383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sanjay R Mehta [ Upstream commit ae89339b08f3fe02457ec9edd512ddc3d246d0f8 ] second parameter of ntb_peer_mw_get_addr is pointing to wrong memory window index by passing "peer gidx" instead of "local gidx". For ex, "local gidx" value is '0' and "peer gidx" value is '1', then on peer side ntb_mw_set_trans() api is used as below with gidx pointing to local side gidx which is '0', so memroy window '0' is chosen and XLAT '0' will be programmed by peer side. ntb_mw_set_trans(perf->ntb, peer->pidx, peer->gidx, peer->inbuf_xlat, peer->inbuf_size); Now, on local side ntb_peer_mw_get_addr() is been used as below with gidx pointing to "peer gidx" which is '1', so pointing to memory window '1' instead of memory window '0'. ntb_peer_mw_get_addr(perf->ntb, peer->gidx, &phys_addr, &peer->outbuf_size); So this patch pass "local gidx" as parameter to ntb_peer_mw_get_addr(). Signed-off-by: Sanjay R Mehta 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 d028331558ea7..e9b7c2dfc7301 100644 --- a/drivers/ntb/test/ntb_perf.c +++ b/drivers/ntb/test/ntb_perf.c @@ -1378,7 +1378,7 @@ static int perf_setup_peer_mw(struct perf_peer *peer) int ret; /* Get outbound MW parameters and map it */ - ret = ntb_peer_mw_get_addr(perf->ntb, peer->gidx, &phys_addr, + ret = ntb_peer_mw_get_addr(perf->ntb, perf->gidx, &phys_addr, &peer->outbuf_size); if (ret) return ret; -- 2.20.1