linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-rc] RDMA/usnic: Fix reported max_pkeys attribute
@ 2020-08-05 21:00 Kamal Heib
  2020-08-05 22:17 ` Jason Gunthorpe
  0 siblings, 1 reply; 5+ messages in thread
From: Kamal Heib @ 2020-08-05 21:00 UTC (permalink / raw)
  To: linux-rdma; +Cc: Doug Ledford, Jason Gunthorpe, Kamal Heib, Christian Benvenuti

Make sure to report the right max_pkeys attribute value to indicate the
maximum number of partitions supported by the usnic device.

Fixes: e3cf00d0a87f ("IB/usnic: Add Cisco VIC low-level hardware driver")
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Cc: Christian Benvenuti <benve@cisco.com>
---
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
index b8a77ce11590..0cb2a73d46ee 100644
--- a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
+++ b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
@@ -309,7 +309,7 @@ int usnic_ib_query_device(struct ib_device *ibdev,
 	props->max_pd = USNIC_UIOM_MAX_PD_CNT;
 	props->max_mr = USNIC_UIOM_MAX_MR_CNT;
 	props->local_ca_ack_delay = 0;
-	props->max_pkeys = 0;
+	props->max_pkeys = 1;
 	props->atomic_cap = IB_ATOMIC_NONE;
 	props->masked_atomic_cap = props->atomic_cap;
 	props->max_qp_rd_atom = 0;
-- 
2.25.4


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

* Re: [PATCH for-rc] RDMA/usnic: Fix reported max_pkeys attribute
  2020-08-05 21:00 [PATCH for-rc] RDMA/usnic: Fix reported max_pkeys attribute Kamal Heib
@ 2020-08-05 22:17 ` Jason Gunthorpe
  2020-08-10 20:19   ` Kamal Heib
  0 siblings, 1 reply; 5+ messages in thread
From: Jason Gunthorpe @ 2020-08-05 22:17 UTC (permalink / raw)
  To: Kamal Heib; +Cc: linux-rdma, Doug Ledford, Christian Benvenuti

On Thu, Aug 06, 2020 at 12:00:51AM +0300, Kamal Heib wrote:
> Make sure to report the right max_pkeys attribute value to indicate the
> maximum number of partitions supported by the usnic device.

Why does usnic support pkeys? This needs more explanation

Jason

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

* Re: [PATCH for-rc] RDMA/usnic: Fix reported max_pkeys attribute
  2020-08-05 22:17 ` Jason Gunthorpe
@ 2020-08-10 20:19   ` Kamal Heib
  2020-08-14 16:54     ` Jason Gunthorpe
  0 siblings, 1 reply; 5+ messages in thread
From: Kamal Heib @ 2020-08-10 20:19 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: linux-rdma, Doug Ledford, Christian Benvenuti

On Wed, Aug 05, 2020 at 07:17:42PM -0300, Jason Gunthorpe wrote:
> On Thu, Aug 06, 2020 at 12:00:51AM +0300, Kamal Heib wrote:
> > Make sure to report the right max_pkeys attribute value to indicate the
> > maximum number of partitions supported by the usnic device.
> 
> Why does usnic support pkeys? This needs more explanation
> 
> Jason

Looks like the usnic provider is acting like the RoCE providers by returning
the default pkey when calling the query_pkey() callback, Do you think that
this needs to removed like what was done for iWarp providers?

int usnic_ib_query_pkey(struct ib_device *ibdev, u8 port, u16 index,
                                u16 *pkey)
{
        if (index > 0)
                return -EINVAL;

        *pkey = 0xffff;
        return 0;
}

Thanks,
Kamal

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

* Re: [PATCH for-rc] RDMA/usnic: Fix reported max_pkeys attribute
  2020-08-10 20:19   ` Kamal Heib
@ 2020-08-14 16:54     ` Jason Gunthorpe
  2020-08-16 22:04       ` Kamal Heib
  0 siblings, 1 reply; 5+ messages in thread
From: Jason Gunthorpe @ 2020-08-14 16:54 UTC (permalink / raw)
  To: Kamal Heib; +Cc: linux-rdma, Doug Ledford, Christian Benvenuti

On Mon, Aug 10, 2020 at 11:19:18PM +0300, Kamal Heib wrote:
> On Wed, Aug 05, 2020 at 07:17:42PM -0300, Jason Gunthorpe wrote:
> > On Thu, Aug 06, 2020 at 12:00:51AM +0300, Kamal Heib wrote:
> > > Make sure to report the right max_pkeys attribute value to indicate the
> > > maximum number of partitions supported by the usnic device.
> > 
> > Why does usnic support pkeys? This needs more explanation
> > 
> > Jason
> 
> Looks like the usnic provider is acting like the RoCE providers by returning
> the default pkey when calling the query_pkey() callback, Do you think that
> this needs to removed like what was done for iWarp providers?
> 
> int usnic_ib_query_pkey(struct ib_device *ibdev, u8 port, u16 index,
>                                 u16 *pkey)
> {
>         if (index > 0)
>                 return -EINVAL;
> 
>         *pkey = 0xffff;
>         return 0;
> }

You'd have to check the libfabric provider to see if it cares or not

Jason

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

* Re: [PATCH for-rc] RDMA/usnic: Fix reported max_pkeys attribute
  2020-08-14 16:54     ` Jason Gunthorpe
@ 2020-08-16 22:04       ` Kamal Heib
  0 siblings, 0 replies; 5+ messages in thread
From: Kamal Heib @ 2020-08-16 22:04 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: linux-rdma, Doug Ledford, Christian Benvenuti

On Fri, Aug 14, 2020 at 01:54:08PM -0300, Jason Gunthorpe wrote:
> On Mon, Aug 10, 2020 at 11:19:18PM +0300, Kamal Heib wrote:
> > On Wed, Aug 05, 2020 at 07:17:42PM -0300, Jason Gunthorpe wrote:
> > > On Thu, Aug 06, 2020 at 12:00:51AM +0300, Kamal Heib wrote:
> > > > Make sure to report the right max_pkeys attribute value to indicate the
> > > > maximum number of partitions supported by the usnic device.
> > > 
> > > Why does usnic support pkeys? This needs more explanation
> > > 
> > > Jason
> > 
> > Looks like the usnic provider is acting like the RoCE providers by returning
> > the default pkey when calling the query_pkey() callback, Do you think that
> > this needs to removed like what was done for iWarp providers?
> > 
> > int usnic_ib_query_pkey(struct ib_device *ibdev, u8 port, u16 index,
> >                                 u16 *pkey)
> > {
> >         if (index > 0)
> >                 return -EINVAL;
> > 
> >         *pkey = 0xffff;
> >         return 0;
> > }
> 
> You'd have to check the libfabric provider to see if it cares or not
> 
> Jason

Looks like the usnic provider under libfabric doesn't care about
pkey/query_pkey, I'll prepare a patch that will remove the query_pkey()
callback.

 kheib   master  ~  git  upstream  libfabric  git grep -n query_pkey prov/usnic/
 kheib   master  ~  git  upstream  libfabric  git grep -n pkey prov/usnic/
 kheib   master  ~  git  upstream  libfabric 

Thanks,
Kamal 

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

end of thread, other threads:[~2020-08-16 22:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-05 21:00 [PATCH for-rc] RDMA/usnic: Fix reported max_pkeys attribute Kamal Heib
2020-08-05 22:17 ` Jason Gunthorpe
2020-08-10 20:19   ` Kamal Heib
2020-08-14 16:54     ` Jason Gunthorpe
2020-08-16 22:04       ` Kamal Heib

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