linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Abhijit Gangurde <abhijit.gangurde@amd.com>
Cc: shannon.nelson@amd.com, brett.creeley@amd.com,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, corbet@lwn.net, leon@kernel.org,
	andrew+netdev@lunn.ch, allen.hubbe@amd.com,
	nikhil.agarwal@amd.com, linux-rdma@vger.kernel.org,
	netdev@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 00/14] Introduce AMD Pensando RDMA driver
Date: Mon, 26 May 2025 10:19:38 -0300	[thread overview]
Message-ID: <20250526131938.GB9786@nvidia.com> (raw)
In-Reply-To: <6bc6fb63-2a31-808d-91f3-eb07a681e631@amd.com>

On Thu, May 22, 2025 at 04:58:19PM +0530, Abhijit Gangurde wrote:
> > @@ -1231,6 +1257,7 @@ void ionic_destroy_rdma_admin(struct ionic_ibdev *dev)
> >   	}
> >   	if (dev->eq_vec) {
> > +		// Locking? Add a lockdep assertion if caller is holding the lock
> >   		while (dev->lif_cfg.eq_count > 0) {
> >   			eq = dev->eq_vec[--dev->lif_cfg.eq_count];
> >   			ionic_destroy_eq(eq);
> I don't think there is a need for the lock here because the device is
> unregistered and the queues are all stopped.

Add a comment then

> > @@ -887,6 +893,8 @@ static struct ib_mr *ionic_get_dma_mr(struct ib_pd *ibpd, int access)
> >   	if (!mr)
> >   		return ERR_PTR(-ENOMEM);
> > +	// This seems strange, shouldn't this do something? If you don't support an all address MR then don't define this op.
> > +
> >   	return &mr->ibmr;
> >   }
> From hardware lkey zero is reserved as a local dma lkey for all address MR. 
> I would make it more explicit as mr.ibmr.lkey = IONIC_DMA_LKEY (same for
> RKEY) with that defined to be zero.

Yeah, that's a lot clearer

> > @@ -1454,11 +1466,15 @@ static int ionic_destroy_cq(struct ib_cq *ibcq, struct ib_udata *udata)
> >   static bool pd_local_privileged(struct ib_pd *pd)
> >   {
> > +	/* That isn't how it works, only the lkey get_dma_mr() returns is
> > +	special and must be used on any WRs that require it. WRs refering to any
> > +	other lkeys must behave normally. */
> >   	return !pd->uobject;
> >   }
> >   static bool pd_remote_privileged(struct ib_pd *pd)
> >   {
> > +	/* Same comment, except about rkeys now. */
> >   	return pd->flags & IB_PD_UNSAFE_GLOBAL_RKEY;
> >   }
> This is how we allow the qp to use the dma lkey.  If the qp is a kernel
> space qp (its pd has no uobject) then we allow use of the dma lkey by that
> qp.  We do not allow use of dma lkey by user qps.  If the pd flags has the
> unsafe rkey flag, then we also allow the qp use it for remote access.

OK, so this is just about permissions because you don't attach the 0
l/rkey to a PD? Add a comment in the ionic_get_dma_mr() that the QP
needs special flags to be allowed to use the 0 l/rkey.

Jason

  reply	other threads:[~2025-05-26 13:19 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-08  4:59 [PATCH v2 00/14] Introduce AMD Pensando RDMA driver Abhijit Gangurde
2025-05-08  4:59 ` [PATCH v2 01/14] net: ionic: Create an auxiliary device for rdma driver Abhijit Gangurde
2025-05-09 20:30   ` Simon Horman
2025-05-12  5:49     ` Abhijit Gangurde
2025-05-08  4:59 ` [PATCH v2 02/14] net: ionic: Update LIF identity with additional RDMA capabilities Abhijit Gangurde
2025-05-08  4:59 ` [PATCH v2 03/14] net: ionic: Export the APIs from net driver to support device commands Abhijit Gangurde
2025-05-08  4:59 ` [PATCH v2 04/14] net: ionic: Provide RDMA reset support for the RDMA driver Abhijit Gangurde
2025-05-08  4:59 ` [PATCH v2 05/14] net: ionic: Provide interrupt allocation " Abhijit Gangurde
2025-05-08  4:59 ` [PATCH v2 06/14] net: ionic: Provide doorbell and CMB region information Abhijit Gangurde
2025-05-08  4:59 ` [PATCH v2 07/14] RDMA: Add IONIC to rdma_driver_id definition Abhijit Gangurde
2025-05-08  4:59 ` [PATCH v2 08/14] RDMA/ionic: Register auxiliary module for ionic ethernet adapter Abhijit Gangurde
2025-05-08  7:36   ` Kalesh Anakkur Purayil
2025-05-08  9:23     ` Abhijit Gangurde
2025-05-08  4:59 ` [PATCH v2 09/14] RDMA/ionic: Create device queues to support admin operations Abhijit Gangurde
2025-05-08  4:59 ` [PATCH v2 10/14] RDMA/ionic: Register device ops for control path Abhijit Gangurde
2025-05-08  4:59 ` [PATCH v2 11/14] RDMA/ionic: Register device ops for datapath Abhijit Gangurde
2025-05-08  4:59 ` [PATCH v2 12/14] RDMA/ionic: Register device ops for miscellaneous functionality Abhijit Gangurde
2025-05-08  4:59 ` [PATCH v2 13/14] RDMA/ionic: Implement device stats ops Abhijit Gangurde
2025-05-08  4:59 ` [PATCH v2 14/14] RDMA/ionic: Add Makefile/Kconfig to kernel build environment Abhijit Gangurde
2025-05-09 20:33   ` Simon Horman
2025-05-12  5:54     ` Abhijit Gangurde
2025-05-19 22:37 ` [PATCH v2 00/14] Introduce AMD Pensando RDMA driver Jason Gunthorpe
2025-05-22 11:28   ` Abhijit Gangurde
2025-05-26 13:19     ` Jason Gunthorpe [this message]
2025-05-26 15:41       ` Jason Gunthorpe
2025-05-28 15:12         ` Abhijit Gangurde

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=20250526131938.GB9786@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=abhijit.gangurde@amd.com \
    --cc=allen.hubbe@amd.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=brett.creeley@amd.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nikhil.agarwal@amd.com \
    --cc=pabeni@redhat.com \
    --cc=shannon.nelson@amd.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;
as well as URLs for NNTP newsgroup(s).