All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ntb: use correct mw_count function in ntb_tool and ntb_transport
@ 2017-06-26 19:50 Logan Gunthorpe
  2017-06-27 16:04   ` Allen Hubbe
  0 siblings, 1 reply; 8+ messages in thread
From: Logan Gunthorpe @ 2017-06-26 19:50 UTC (permalink / raw)
  To: linux-ntb, linux-kernel
  Cc: Logan Gunthorpe, Jon Mason, Dave Jiang, Allen Hubbe, Serge Semin

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>
---

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* RE: [PATCH] ntb: use correct mw_count function in ntb_tool and ntb_transport
  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
  0 siblings, 0 replies; 8+ messages in thread
From: Allen Hubbe @ 2017-06-27 16:04 UTC (permalink / raw)
  To: 'Logan Gunthorpe', linux-ntb, linux-kernel
  Cc: 'Jon Mason', 'Dave Jiang', 'Serge Semin'

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH] ntb: use correct mw_count function in ntb_tool and ntb_transport
@ 2017-06-27 16:04   ` Allen Hubbe
  0 siblings, 0 replies; 8+ messages in thread
From: Allen Hubbe @ 2017-06-27 16:04 UTC (permalink / raw)
  To: 'Logan Gunthorpe', linux-ntb, linux-kernel
  Cc: 'Jon Mason', 'Dave Jiang', 'Serge Semin'

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ntb: use correct mw_count function in ntb_tool and ntb_transport
  2017-06-27 16:04   ` Allen Hubbe
  (?)
@ 2017-07-17 15:16   ` Jon Mason
  2017-07-17 16:36     ` Logan Gunthorpe
  -1 siblings, 1 reply; 8+ messages in thread
From: Jon Mason @ 2017-07-17 15:16 UTC (permalink / raw)
  To: Allen Hubbe
  Cc: Logan Gunthorpe, linux-ntb, linux-kernel, Dave Jiang, Serge Semin

On Tue, Jun 27, 2017 at 12:04 PM, Allen Hubbe <Allen.Hubbe@dell.com> wrote:
> 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.

Per your request, this has been applied to my ntb-next branch.

Thanks,
Jon

>>
>> 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
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ntb: use correct mw_count function in ntb_tool and ntb_transport
  2017-07-17 15:16   ` Jon Mason
@ 2017-07-17 16:36     ` Logan Gunthorpe
  2017-07-17 16:46       ` Jon Mason
  0 siblings, 1 reply; 8+ messages in thread
From: Logan Gunthorpe @ 2017-07-17 16:36 UTC (permalink / raw)
  To: Jon Mason, Allen Hubbe; +Cc: linux-ntb, linux-kernel, Dave Jiang, Serge Semin

Hi John,


On 17/07/17 09:16 AM, Jon Mason wrote:
> Per your request, this has been applied to my ntb-next branch.

This isn't a huge issue but I meant for this patch to fix the mistake in
the new ntb_api before it hit 4.13.

On the other hand, seeing there's no way to actually trigger the issue
until the switchtec driver is merged I guess it's okay to leave it the
way you did it.

Thanks,

Logan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ntb: use correct mw_count function in ntb_tool and ntb_transport
  2017-07-17 16:36     ` Logan Gunthorpe
@ 2017-07-17 16:46       ` Jon Mason
  2017-07-17 16:50         ` Logan Gunthorpe
  0 siblings, 1 reply; 8+ messages in thread
From: Jon Mason @ 2017-07-17 16:46 UTC (permalink / raw)
  To: Logan Gunthorpe
  Cc: Allen Hubbe, linux-ntb, linux-kernel, Dave Jiang, Serge Semin

On Mon, Jul 17, 2017 at 12:36 PM, Logan Gunthorpe <logang@deltatee.com> wrote:
> Hi John,

s/John/Jon

>
>
> On 17/07/17 09:16 AM, Jon Mason wrote:
>> Per your request, this has been applied to my ntb-next branch.
>
> This isn't a huge issue but I meant for this patch to fix the mistake in
> the new ntb_api before it hit 4.13.

NP.  I'll add a "Fixes: ..." to it.  So, it'll get pulled into the
-stable trees.

Thanks,
Jon

>
> On the other hand, seeing there's no way to actually trigger the issue
> until the switchtec driver is merged I guess it's okay to leave it the
> way you did it.
>
> Thanks,
>
> Logan
>
> --
> You received this message because you are subscribed to the Google Groups "linux-ntb" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-ntb+unsubscribe@googlegroups.com.
> To post to this group, send email to linux-ntb@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/linux-ntb/296b3d42-ce65-a521-b2de-db3459ac543a%40deltatee.com.
> For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ntb: use correct mw_count function in ntb_tool and ntb_transport
  2017-07-17 16:46       ` Jon Mason
@ 2017-07-17 16:50         ` Logan Gunthorpe
  2017-07-17 16:52           ` Jon Mason
  0 siblings, 1 reply; 8+ messages in thread
From: Logan Gunthorpe @ 2017-07-17 16:50 UTC (permalink / raw)
  To: Jon Mason; +Cc: Allen Hubbe, linux-ntb, linux-kernel, Dave Jiang, Serge Semin



On 17/07/17 10:46 AM, Jon Mason wrote:
> s/John/Jon

Apologies. Monday morning -- not fully awake yet.

> NP.  I'll add a "Fixes: ..." to it.  So, it'll get pulled into the
> -stable trees.

Ok, thanks, but it's not really the stable trees that need to see it
seeing 4.13 isn't released yet, it would just need to get into a
subsequent rc....

Logan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] ntb: use correct mw_count function in ntb_tool and ntb_transport
  2017-07-17 16:50         ` Logan Gunthorpe
@ 2017-07-17 16:52           ` Jon Mason
  0 siblings, 0 replies; 8+ messages in thread
From: Jon Mason @ 2017-07-17 16:52 UTC (permalink / raw)
  To: Logan Gunthorpe
  Cc: Allen Hubbe, linux-ntb, linux-kernel, Dave Jiang, Serge Semin

On Mon, Jul 17, 2017 at 12:50 PM, Logan Gunthorpe <logang@deltatee.com> wrote:
>
>
> On 17/07/17 10:46 AM, Jon Mason wrote:
>> s/John/Jon
>
> Apologies. Monday morning -- not fully awake yet.
>
>> NP.  I'll add a "Fixes: ..." to it.  So, it'll get pulled into the
>> -stable trees.
>
> Ok, thanks, but it's not really the stable trees that need to see it
> seeing 4.13 isn't released yet, it would just need to get into a
> subsequent rc....

Yeah, I'm looking at this more now and I agree.  It should go in
v4.13-rcX.  I'll move this to my ntb branch for this purpose and wait
to see if any more bug fixes are coming in the next couple of weeks
(before I push it).

Thanks for the patch, and sorry about the confusion :)

Thanks,
Jon

> Logan
>
> --
> You received this message because you are subscribed to the Google Groups "linux-ntb" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-ntb+unsubscribe@googlegroups.com.
> To post to this group, send email to linux-ntb@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/linux-ntb/ce6f1995-0a1b-d0cc-4ef8-77fc1791f557%40deltatee.com.
> For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-07-17 16:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2017-06-27 16:04   ` Allen Hubbe
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.