linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] RDMA/cxgb3: fail get_dma_mr if the memory footprint can exceed 32b
@ 2015-07-22 19:14 Steve Wise
       [not found] ` <20150722191417.9306.17387.stgit-PBeJgSbIpn97NCTnQtmixQ@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Steve Wise @ 2015-07-22 19:14 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

T3 HW only supports MRs of length < 4GB.  If the system can have more
than that we need to fail dma mr allocation so we con't create a MR that
cannot span the entire possible memory space.

Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
---

 drivers/infiniband/hw/cxgb3/iwch_provider.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c
index b1b7323..bbbe018 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_provider.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c
@@ -736,6 +736,10 @@ static struct ib_mr *iwch_get_dma_mr(struct ib_pd *pd, int acc)
 	/*
 	 * T3 only supports 32 bits of size.
 	 */
+	if (sizeof(phys_addr_t) > 4) {
+		pr_warn_once(MOD "Cannot support dma_mrs on this platform.\n");
+		return ERR_PTR(-ENOTSUPP);
+	}
 	bl.size = 0xffffffff;
 	bl.addr = 0;
 	kva = 0;

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] RDMA/cxgb3: fail get_dma_mr if the memory footprint can exceed 32b
       [not found] ` <20150722191417.9306.17387.stgit-PBeJgSbIpn97NCTnQtmixQ@public.gmane.org>
@ 2015-07-23 21:32   ` Doug Ledford
       [not found]     ` <55B15D7D.3090601-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Doug Ledford @ 2015-07-23 21:32 UTC (permalink / raw)
  To: Steve Wise; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1486 bytes --]

On 07/22/2015 03:14 PM, Steve Wise wrote:
> T3 HW only supports MRs of length < 4GB.  If the system can have more
> than that we need to fail dma mr allocation so we con't create a MR that
> cannot span the entire possible memory space.
> 
> Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
> ---
> 
>  drivers/infiniband/hw/cxgb3/iwch_provider.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c
> index b1b7323..bbbe018 100644
> --- a/drivers/infiniband/hw/cxgb3/iwch_provider.c
> +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c
> @@ -736,6 +736,10 @@ static struct ib_mr *iwch_get_dma_mr(struct ib_pd *pd, int acc)
>  	/*
>  	 * T3 only supports 32 bits of size.
>  	 */
> +	if (sizeof(phys_addr_t) > 4) {
> +		pr_warn_once(MOD "Cannot support dma_mrs on this platform.\n");
> +		return ERR_PTR(-ENOTSUPP);
> +	}
>  	bl.size = 0xffffffff;
>  	bl.addr = 0;
>  	kva = 0;

Should this be a static check of the pointer size versus installed
memory?  Would it be possible to have this work for machines with less
than 4GB of physical memory even if they have 64bit pointers, or are you
concerned that hotplug memory could take us over the limit after
registration and cause problems?


-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

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

* RE: [PATCH] RDMA/cxgb3: fail get_dma_mr if the memory footprint can exceed 32b
       [not found]     ` <55B15D7D.3090601-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2015-07-23 22:47       ` Steve Wise
  2015-07-24 14:44         ` Doug Ledford
  0 siblings, 1 reply; 6+ messages in thread
From: Steve Wise @ 2015-07-23 22:47 UTC (permalink / raw)
  To: 'Doug Ledford'; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA



> -----Original Message-----
> From: Doug Ledford [mailto:dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org]
> Sent: Thursday, July 23, 2015 4:33 PM
> To: Steve Wise
> Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Subject: Re: [PATCH] RDMA/cxgb3: fail get_dma_mr if the memory footprint can exceed 32b
> 
> On 07/22/2015 03:14 PM, Steve Wise wrote:
> > T3 HW only supports MRs of length < 4GB.  If the system can have more
> > than that we need to fail dma mr allocation so we con't create a MR that
> > cannot span the entire possible memory space.
> >
> > Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
> > ---
> >
> >  drivers/infiniband/hw/cxgb3/iwch_provider.c |    4 ++++
> >  1 files changed, 4 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c
> > index b1b7323..bbbe018 100644
> > --- a/drivers/infiniband/hw/cxgb3/iwch_provider.c
> > +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c
> > @@ -736,6 +736,10 @@ static struct ib_mr *iwch_get_dma_mr(struct ib_pd *pd, int acc)
> >  	/*
> >  	 * T3 only supports 32 bits of size.
> >  	 */
> > +	if (sizeof(phys_addr_t) > 4) {
> > +		pr_warn_once(MOD "Cannot support dma_mrs on this platform.\n");
> > +		return ERR_PTR(-ENOTSUPP);
> > +	}
> >  	bl.size = 0xffffffff;
> >  	bl.addr = 0;
> >  	kva = 0;
> 
> Should this be a static check of the pointer size versus installed
> memory?  Would it be possible to have this work for machines with less
> than 4GB of physical memory even if they have 64bit pointers, or are you
> concerned that hotplug memory could take us over the limit after
> registration and cause problems?

NFSRDMA doesn't need dma-mrs for T3 since it has FRMR + local dma lkey support.  And since the deficiency really can cause problems on 64b systems if the memory grows > 4GB after dma-mr allocation, I decided to just not allow them for potential large memory systems.

Steve

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] RDMA/cxgb3: fail get_dma_mr if the memory footprint can exceed 32b
  2015-07-23 22:47       ` Steve Wise
@ 2015-07-24 14:44         ` Doug Ledford
       [not found]           ` <55B24F65.5040103-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Doug Ledford @ 2015-07-24 14:44 UTC (permalink / raw)
  To: Steve Wise; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 859 bytes --]

On 07/23/2015 06:47 PM, Steve Wise wrote:
>> -----Original Message----- From: Doug Ledford
>> Should this be a static check of the pointer size versus installed 
>> memory?  Would it be possible to have this work for machines with
>> less than 4GB of physical memory even if they have 64bit pointers,
>> or are you concerned that hotplug memory could take us over the
>> limit after registration and cause problems?
> 
> NFSRDMA doesn't need dma-mrs for T3 since it has FRMR + local dma
> lkey support.  And since the deficiency really can cause problems on
> 64b systems if the memory grows > 4GB after dma-mr allocation, I
> decided to just not allow them for potential large memory systems.

Ok.  I've pulled this for 4.2-rc then.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

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

* RE: [PATCH] RDMA/cxgb3: fail get_dma_mr if the memory footprint can exceed 32b
       [not found]           ` <55B24F65.5040103-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2015-07-24 14:50             ` Steve Wise
  2015-07-24 14:55               ` Doug Ledford
  0 siblings, 1 reply; 6+ messages in thread
From: Steve Wise @ 2015-07-24 14:50 UTC (permalink / raw)
  To: 'Doug Ledford'; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA



> -----Original Message-----
> From: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [mailto:linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Doug Ledford
> Sent: Friday, July 24, 2015 9:45 AM
> To: Steve Wise
> Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Subject: Re: [PATCH] RDMA/cxgb3: fail get_dma_mr if the memory footprint can exceed 32b
> 
> On 07/23/2015 06:47 PM, Steve Wise wrote:
> >> -----Original Message----- From: Doug Ledford
> >> Should this be a static check of the pointer size versus installed
> >> memory?  Would it be possible to have this work for machines with
> >> less than 4GB of physical memory even if they have 64bit pointers,
> >> or are you concerned that hotplug memory could take us over the
> >> limit after registration and cause problems?
> >
> > NFSRDMA doesn't need dma-mrs for T3 since it has FRMR + local dma
> > lkey support.  And since the deficiency really can cause problems on
> > 64b systems if the memory grows > 4GB after dma-mr allocation, I
> > decided to just not allow them for potential large memory systems.
> 
> Ok.  I've pulled this for 4.2-rc then.
> 

The problem has been there since day one, so it doesn't represent a regression.  It is your call, but I think 4.3 is fine.

Thanks,

Steve.


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] RDMA/cxgb3: fail get_dma_mr if the memory footprint can exceed 32b
  2015-07-24 14:50             ` Steve Wise
@ 2015-07-24 14:55               ` Doug Ledford
  0 siblings, 0 replies; 6+ messages in thread
From: Doug Ledford @ 2015-07-24 14:55 UTC (permalink / raw)
  To: Steve Wise; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1667 bytes --]

On 07/24/2015 10:50 AM, Steve Wise wrote:
> 
> 
>> -----Original Message-----
>> From: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [mailto:linux-rdma-owner@vger.kernel.org] On Behalf Of Doug Ledford
>> Sent: Friday, July 24, 2015 9:45 AM
>> To: Steve Wise
>> Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> Subject: Re: [PATCH] RDMA/cxgb3: fail get_dma_mr if the memory footprint can exceed 32b
>>
>> On 07/23/2015 06:47 PM, Steve Wise wrote:
>>>> -----Original Message----- From: Doug Ledford
>>>> Should this be a static check of the pointer size versus installed
>>>> memory?  Would it be possible to have this work for machines with
>>>> less than 4GB of physical memory even if they have 64bit pointers,
>>>> or are you concerned that hotplug memory could take us over the
>>>> limit after registration and cause problems?
>>>
>>> NFSRDMA doesn't need dma-mrs for T3 since it has FRMR + local dma
>>> lkey support.  And since the deficiency really can cause problems on
>>> 64b systems if the memory grows > 4GB after dma-mr allocation, I
>>> decided to just not allow them for potential large memory systems.
>>
>> Ok.  I've pulled this for 4.2-rc then.
>>
> 
> The problem has been there since day one, so it doesn't represent a regression.  It is your call, but I think 4.3 is fine.

It's a long standing problem, but it's a potential memory wrap issue, so
might as well fix it (especially given the simple nature of the fix).
I've got a few other things heading in for 4.2-rc, so no biggie.


-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

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

end of thread, other threads:[~2015-07-24 14:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-22 19:14 [PATCH] RDMA/cxgb3: fail get_dma_mr if the memory footprint can exceed 32b Steve Wise
     [not found] ` <20150722191417.9306.17387.stgit-PBeJgSbIpn97NCTnQtmixQ@public.gmane.org>
2015-07-23 21:32   ` Doug Ledford
     [not found]     ` <55B15D7D.3090601-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-07-23 22:47       ` Steve Wise
2015-07-24 14:44         ` Doug Ledford
     [not found]           ` <55B24F65.5040103-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-07-24 14:50             ` Steve Wise
2015-07-24 14:55               ` Doug Ledford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).