Linux PCI Non-Transparent Bridge framework and drivers
 help / color / mirror / Atom feed
From: "Allen Hubbe" <Allen.Hubbe@dell.com>
To: 'Logan Gunthorpe' <logang@deltatee.com>,
	linux-ntb@googlegroups.com, linux-kernel@vger.kernel.org
Cc: 'Jon Mason' <jdmason@kudzu.us>,
	'Dave Jiang' <dave.jiang@intel.com>,
	'Serge Semin' <fancer.lancer@gmail.com>
Subject: RE: [PATCH] ntb: use correct mw_count function in ntb_tool and ntb_transport
Date: Tue, 27 Jun 2017 12:04:54 -0400	[thread overview]
Message-ID: <000001d2ef5f$1ed1e750$5c75b5f0$@dell.com> (raw)
In-Reply-To: <20170626195041.6190-1-logang@deltatee.com>

From: Logan Gunthorpe
> 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 <logang@deltatee.com>
> Cc: Jon Mason <jdmason@kudzu.us>
> Cc: Dave Jiang <dave.jiang@intel.com>
> Cc: Allen Hubbe <Allen.Hubbe@emc.com>
> Cc: Serge Semin <fancer.lancer@gmail.com>

Acked-by: Allen Hubbe <Allen.Hubbe@dell.com>

> ---
> 
> Hi Guys,
> 
> I caught this issue while finishing up the switchtec rebase. (Which is
> now working again and I'll send the updated series after doing a bit more
> testing.)
> 
> However, seeing this is a bug in the new api patches I feel it should
> be applied to ntb-next tree before it's merged upstream.
> 
> Thanks,
> 
> Logan
> 
>  drivers/ntb/ntb_transport.c | 2 +-
>  drivers/ntb/test/ntb_tool.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
> index 9a03c5871efe..b29558ddfe95 100644
> --- a/drivers/ntb/ntb_transport.c
> +++ b/drivers/ntb/ntb_transport.c
> @@ -1059,7 +1059,7 @@ static int ntb_transport_probe(struct ntb_client *self, struct ntb_dev *ndev)
>  	int node;
>  	int rc, i;
> 
> -	mw_count = ntb_mw_count(ndev, PIDX);
> +	mw_count = ntb_peer_mw_count(ndev);
> 
>  	if (!ndev->ops->mw_set_trans) {
>  		dev_err(&ndev->dev, "Inbound MW based NTB API is required\n");
> diff --git a/drivers/ntb/test/ntb_tool.c b/drivers/ntb/test/ntb_tool.c
> index f002bf48a08d..a69815c45ce6 100644
> --- a/drivers/ntb/test/ntb_tool.c
> +++ b/drivers/ntb/test/ntb_tool.c
> @@ -959,7 +959,7 @@ static int tool_probe(struct ntb_client *self, struct ntb_dev *ntb)
>  	tc->ntb = ntb;
>  	init_waitqueue_head(&tc->link_wq);
> 
> -	tc->mw_count = min(ntb_mw_count(tc->ntb, PIDX), MAX_MWS);
> +	tc->mw_count = min(ntb_peer_mw_count(tc->ntb), MAX_MWS);
>  	for (i = 0; i < tc->mw_count; i++) {
>  		rc = tool_init_mw(tc, i);
>  		if (rc)
> --
> 2.11.0


  reply	other threads:[~2017-06-27 16:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26 19:50 [PATCH] ntb: use correct mw_count function in ntb_tool and ntb_transport Logan Gunthorpe
2017-06-27 16:04 ` Allen Hubbe [this message]
2017-07-17 15:16   ` Jon Mason
2017-07-17 16:36     ` Logan Gunthorpe
2017-07-17 16:46       ` Jon Mason
2017-07-17 16:50         ` Logan Gunthorpe
2017-07-17 16:52           ` Jon Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000001d2ef5f$1ed1e750$5c75b5f0$@dell.com' \
    --to=allen.hubbe@dell.com \
    --cc=dave.jiang@intel.com \
    --cc=fancer.lancer@gmail.com \
    --cc=jdmason@kudzu.us \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ntb@googlegroups.com \
    --cc=logang@deltatee.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox