From patchwork Wed Jun 10 09:08:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Hubbe X-Patchwork-Id: 482674 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id D453C14029D for ; Thu, 11 Jun 2015 00:09:15 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=emc.com header.i=@emc.com header.b=r42dhalP; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965300AbbFJOJN (ORCPT ); Wed, 10 Jun 2015 10:09:13 -0400 Received: from mailuogwhop.emc.com ([168.159.213.141]:36023 "EHLO mailuogwhop.emc.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964926AbbFJOJD (ORCPT ); Wed, 10 Jun 2015 10:09:03 -0400 Received: from maildlpprd02.lss.emc.com (maildlpprd02.lss.emc.com [10.253.24.34]) by mailuogwprd04.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id t5AE8wVq009447 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 10 Jun 2015 10:09:00 -0400 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd04.lss.emc.com t5AE8wVq009447 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=emc.com; s=jan2013; t=1433945340; bh=MiqlmvzMBChYL2JJqQ2ROTsY6ek=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: In-Reply-To:References; b=r42dhalPmHIuGz8b/7xdJk5Qi3ershZ+PYVliDrJepQciGCLTEYTgwd5mrLQ1hH1v KfXAhpn2T81GUmWc9155zGfA6bJWh+P6pPm90JfNOG7A5VJtc43Oe6Z4yZCewymmRL nNrbsrDgj1bIP8ci0jF0sZcJ9Qixc4WVa+LnXLOs= X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd04.lss.emc.com t5AE8wVq009447 Received: from mailsyshubprd56.lss.emc.com (mailhub.lss.emc.com [10.106.48.138]) by maildlpprd02.lss.emc.com (RSA Interceptor); Wed, 10 Jun 2015 10:08:48 -0400 Received: from HY-R1012-SPA.usd.lab.emc.com.com (hy-r1012-spa.rtp.lab.emc.com [10.6.71.221]) by mailsyshubprd56.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id t5AE8iKM021690; Wed, 10 Jun 2015 10:08:48 -0400 From: Allen Hubbe To: linux-ntb@googlegroups.com Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Jon Mason , Dave Jiang , Allen Hubbe Subject: [PATCH v4 04/19] NTB: Read peer info from local SPAD in transport Date: Wed, 10 Jun 2015 05:08:09 -0400 Message-Id: X-Mailer: git-send-email 2.4.0.rc0.44.g244209c.dirty In-Reply-To: References: In-Reply-To: References: X-RSA-Classifications: public X-Sentrion-Hostname: mailuogwprd04.lss.emc.com Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Dave Jiang The transport was writing and then reading the peer scratch pad, essentially reading what it just wrote instead of exchanging any information with the peer. The transport expects the peer values to be the same as the local values, so this issue was not obvious. Signed-off-by: Dave Jiang --- drivers/ntb/ntb_transport.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c index 9faf1c6029af..d9538e911df6 100644 --- a/drivers/ntb/ntb_transport.c +++ b/drivers/ntb/ntb_transport.c @@ -761,17 +761,17 @@ static void ntb_transport_link_work(struct work_struct *work) ntb_peer_spad_write(ndev, VERSION, NTB_TRANSPORT_VERSION); /* Query the remote side for its info */ - val = ntb_peer_spad_read(ndev, VERSION); + val = ntb_spad_read(ndev, VERSION); dev_dbg(&pdev->dev, "Remote version = %d\n", val); if (val != NTB_TRANSPORT_VERSION) goto out; - val = ntb_peer_spad_read(ndev, NUM_QPS); + val = ntb_spad_read(ndev, NUM_QPS); dev_dbg(&pdev->dev, "Remote max number of qps = %d\n", val); if (val != nt->qp_count) goto out; - val = ntb_peer_spad_read(ndev, NUM_MWS); + val = ntb_spad_read(ndev, NUM_MWS); dev_dbg(&pdev->dev, "Remote number of mws = %d\n", val); if (val != nt->mw_count) goto out; @@ -779,10 +779,10 @@ static void ntb_transport_link_work(struct work_struct *work) for (i = 0; i < nt->mw_count; i++) { u64 val64; - val = ntb_peer_spad_read(ndev, MW0_SZ_HIGH + (i * 2)); + val = ntb_spad_read(ndev, MW0_SZ_HIGH + (i * 2)); val64 = (u64)val << 32; - val = ntb_peer_spad_read(ndev, MW0_SZ_LOW + (i * 2)); + val = ntb_spad_read(ndev, MW0_SZ_LOW + (i * 2)); val64 |= val; dev_dbg(&pdev->dev, "Remote MW%d size = %#llx\n", i, val64);