mbox series

[for-rc,v1,0/4] RDMA/providers: Set max_pkey attribute

Message ID 20200706091119.367697-1-kamalheib1@gmail.com (mailing list archive)
Headers show
Series RDMA/providers: Set max_pkey attribute | expand

Message

Kamal Heib July 6, 2020, 9:11 a.m. UTC
This patch set makes sure to set the max_pkeys attribute to the providers
that aren't setting it or not setting it correctly.

v1: Drop the efa patch and target for-rc.

Kamal Heib (4):
  RDMA/siw: Set max_pkeys attribute
  RDMA/cxgb4: Set max_pkeys attribute
  RDMA/i40iw: Set max_pkeys attribute
  RDMA/usnic: Fix reported max_pkeys attribute

 drivers/infiniband/hw/cxgb4/provider.c       | 1 +
 drivers/infiniband/hw/i40iw/i40iw_verbs.c    | 1 +
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 2 +-
 drivers/infiniband/sw/siw/siw_verbs.c        | 1 +
 4 files changed, 4 insertions(+), 1 deletion(-)

Comments

Jason Gunthorpe July 7, 2020, 4:12 p.m. UTC | #1
On Mon, Jul 06, 2020 at 12:11:15PM +0300, Kamal Heib wrote:
> This patch set makes sure to set the max_pkeys attribute to the providers
> that aren't setting it or not setting it correctly.
> 
> v1: Drop the efa patch and target for-rc.
> 
> Kamal Heib (4):
>   RDMA/siw: Set max_pkeys attribute
>   RDMA/cxgb4: Set max_pkeys attribute
>   RDMA/i40iw: Set max_pkeys attribute
>   RDMA/usnic: Fix reported max_pkeys attribute

Why should iwarp have a 1 pkey value?

Jason
Kamal Heib July 7, 2020, 7:13 p.m. UTC | #2
On Tue, Jul 07, 2020 at 01:12:47PM -0300, Jason Gunthorpe wrote:
> On Mon, Jul 06, 2020 at 12:11:15PM +0300, Kamal Heib wrote:
> > This patch set makes sure to set the max_pkeys attribute to the providers
> > that aren't setting it or not setting it correctly.
> > 
> > v1: Drop the efa patch and target for-rc.
> > 
> > Kamal Heib (4):
> >   RDMA/siw: Set max_pkeys attribute
> >   RDMA/cxgb4: Set max_pkeys attribute
> >   RDMA/i40iw: Set max_pkeys attribute
> >   RDMA/usnic: Fix reported max_pkeys attribute
> 
> Why should iwarp have a 1 pkey value?
> 
> Jason

That is a good question :-)

My Idea in this patchset was to match between the reported pkey_tbl_len and
the max_pkeys attribute that the providers expose.

But after taking a deeper look now, I see that the RDMA core requires
from all providers to implement the query_pkey() callback, which before
[1] commit that will cause the provider driver not to load. For IB
providers the requirement make sense, also for RoCE providers, because
there is a requirement by the RoCE Spec to support the default PKey, For
iwarp providers, This doesn't make sense and I think that they decided to
do the same as RoCE and to avoid the driver load failure.

Probably, The requirement from the RDMA core needs to be changed and
the query_pkey() callback needs to be removed from the iwarp providers,
Thoughts?

------>8------
git grep -n IB_MANDATORY_FUNC drivers/infiniband/ | grep pkey
drivers/infiniband/core/device.c:275:		IB_MANDATORY_FUNC(query_pkey),
------>8------

[1] - 6780c4fa9d6e ("RDMA: Add indication for in kernel API support to IB device")

Thanks,
Kamal
Jason Gunthorpe July 8, 2020, 11:28 p.m. UTC | #3
On Tue, Jul 07, 2020 at 10:13:24PM +0300, Kamal Heib wrote:
> On Tue, Jul 07, 2020 at 01:12:47PM -0300, Jason Gunthorpe wrote:
> > On Mon, Jul 06, 2020 at 12:11:15PM +0300, Kamal Heib wrote:
> > > This patch set makes sure to set the max_pkeys attribute to the providers
> > > that aren't setting it or not setting it correctly.
> > > 
> > > v1: Drop the efa patch and target for-rc.
> > > 
> > > Kamal Heib (4):
> > >   RDMA/siw: Set max_pkeys attribute
> > >   RDMA/cxgb4: Set max_pkeys attribute
> > >   RDMA/i40iw: Set max_pkeys attribute
> > >   RDMA/usnic: Fix reported max_pkeys attribute
> > 
> > Why should iwarp have a 1 pkey value?
> > 
> > Jason
> 
> That is a good question :-)
> 
> My Idea in this patchset was to match between the reported pkey_tbl_len and
> the max_pkeys attribute that the providers expose.
> 
> But after taking a deeper look now, I see that the RDMA core requires
> from all providers to implement the query_pkey() callback, which before
> [1] commit that will cause the provider driver not to load. For IB
> providers the requirement make sense, also for RoCE providers, because
> there is a requirement by the RoCE Spec to support the default PKey, For
> iwarp providers, This doesn't make sense and I think that they decided to
> do the same as RoCE and to avoid the driver load failure.
> 
> Probably, The requirement from the RDMA core needs to be changed and
> the query_pkey() callback needs to be removed from the iwarp providers,
> Thoughts?

Sure

But then the pkey table size is 0 right?

Jason
Kamal Heib July 13, 2020, 8:22 a.m. UTC | #4
On Wed, Jul 08, 2020 at 08:28:15PM -0300, Jason Gunthorpe wrote:
> On Tue, Jul 07, 2020 at 10:13:24PM +0300, Kamal Heib wrote:
> > On Tue, Jul 07, 2020 at 01:12:47PM -0300, Jason Gunthorpe wrote:
> > > On Mon, Jul 06, 2020 at 12:11:15PM +0300, Kamal Heib wrote:
> > > > This patch set makes sure to set the max_pkeys attribute to the providers
> > > > that aren't setting it or not setting it correctly.
> > > > 
> > > > v1: Drop the efa patch and target for-rc.
> > > > 
> > > > Kamal Heib (4):
> > > >   RDMA/siw: Set max_pkeys attribute
> > > >   RDMA/cxgb4: Set max_pkeys attribute
> > > >   RDMA/i40iw: Set max_pkeys attribute
> > > >   RDMA/usnic: Fix reported max_pkeys attribute
> > > 
> > > Why should iwarp have a 1 pkey value?
> > > 
> > > Jason
> > 
> > That is a good question :-)
> > 
> > My Idea in this patchset was to match between the reported pkey_tbl_len and
> > the max_pkeys attribute that the providers expose.
> > 
> > But after taking a deeper look now, I see that the RDMA core requires
> > from all providers to implement the query_pkey() callback, which before
> > [1] commit that will cause the provider driver not to load. For IB
> > providers the requirement make sense, also for RoCE providers, because
> > there is a requirement by the RoCE Spec to support the default PKey, For
> > iwarp providers, This doesn't make sense and I think that they decided to
> > do the same as RoCE and to avoid the driver load failure.
> > 
> > Probably, The requirement from the RDMA core needs to be changed and
> > the query_pkey() callback needs to be removed from the iwarp providers,
> > Thoughts?
> 
> Sure
> 
> But then the pkey table size is 0 right?
>

Correct, also there are required changes in the RDMA core:
1- Avoid exposing the pkeys sysfs entries for the iwarp providers.
2- Avoid allocating the pkey cache for the iwarp providers.

I've started this work and I hope to post patches in the upcoming days.

Thanks,
Kamal

> Jason