All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Long Li <longli@microsoft.com>
Cc: Ajay Sharma <sharmaajay@microsoft.com>,
	"sharmaajay@linuxonhyperv.com" <sharmaajay@linuxonhyperv.com>,
	Leon Romanovsky <leon@kernel.org>,
	Dexuan Cui <decui@microsoft.com>, Wei Liu <wei.liu@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [EXTERNAL] Re: [Patch v7 5/5] RDMA/mana_ib: Send event to qp
Date: Mon, 30 Oct 2023 09:42:00 -0300	[thread overview]
Message-ID: <20231030124200.GF691768@ziepe.ca> (raw)
In-Reply-To: <MN0PR21MB32641E489F378F0C5B357795CEDCA@MN0PR21MB3264.namprd21.prod.outlook.com>

On Fri, Oct 27, 2023 at 09:35:05PM +0000, Long Li wrote:
> > Subject: RE: [EXTERNAL] Re: [Patch v7 5/5] RDMA/mana_ib: Send event to qp
> > 
> > 
> > > -----Original Message-----
> > > From: Jason Gunthorpe <jgg@ziepe.ca>
> > > Sent: Monday, October 23, 2023 11:24 AM
> > > To: sharmaajay@linuxonhyperv.com
> > > Cc: Long Li <longli@microsoft.com>; Leon Romanovsky <leon@kernel.org>;
> > > Dexuan Cui <decui@microsoft.com>; Wei Liu <wei.liu@kernel.org>; David S.
> > > Miller <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>;
> > > Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>;
> > > linux- rdma@vger.kernel.org; linux-hyperv@vger.kernel.org;
> > > netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Ajay Sharma
> > > <sharmaajay@microsoft.com>
> > > Subject: [EXTERNAL] Re: [Patch v7 5/5] RDMA/mana_ib: Send event to qp
> > >
> > > On Mon, Oct 16, 2023 at 03:12:02PM -0700,
> > sharmaajay@linuxonhyperv.com
> > > wrote:
> > >
> > > > diff --git a/drivers/infiniband/hw/mana/qp.c
> > > > b/drivers/infiniband/hw/mana/qp.c index ef3275ac92a0..19fae28985c3
> > > > 100644
> > > > --- a/drivers/infiniband/hw/mana/qp.c
> > > > +++ b/drivers/infiniband/hw/mana/qp.c
> > > > @@ -210,6 +210,8 @@ static int mana_ib_create_qp_rss(struct ib_qp
> > > *ibqp, struct ib_pd *pd,
> > > >  		wq->id = wq_spec.queue_index;
> > > >  		cq->id = cq_spec.queue_index;
> > > >
> > > > +		xa_store(&mib_dev->rq_to_qp_lookup_table, wq->id, qp,
> > > GFP_KERNEL);
> > > > +
> > >
> > > A store with no erase?
> > >
> > > A load with no locking?
> > >
> > > This can't be right
> > >
> > > Jason
> > 
> > This wq->id is assigned from the HW and is guaranteed to be unique. May be I
> > am not following why do we need a lock here. Can you please explain ?
> > Ajay
> 
> I think we need to check the return value of xa_store(), and call xa_erase() in mana_ib_destroy_qp().
> 
> wq->id is generated by the hardware. If we believe in hardware
> always behaves in good manner, we don't need a lock.

It has nothing to do with how the ID is created, you need to explain
how the missing erase can't race with any loads, in a comment above
the unlocked xa_load.

Jason

      reply	other threads:[~2023-10-30 12:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16 22:11 [Patch v7 0/5] RDMA/mana_ib sharmaajay
2023-10-16 22:11 ` [Patch v7 1/5] RDMA/mana_ib: Rename all mana_ib_dev type variables to mib_dev sharmaajay
2023-10-23 18:14   ` Jason Gunthorpe
2023-10-27 22:00     ` Long Li
2023-10-16 22:11 ` [Patch v7 2/5] RDMA/mana_ib: Register Mana IB device with Management SW sharmaajay
2023-10-23 18:19   ` Jason Gunthorpe
2023-10-27 21:59     ` Long Li
2023-10-16 22:12 ` [Patch v7 3/5] RDMA/mana_ib: Create adapter and Add error eq sharmaajay
2023-10-23 18:21   ` Jason Gunthorpe
2023-10-16 22:12 ` [Patch v7 4/5] RDMA/mana_ib: Query adapter capabilities sharmaajay
2023-10-17  4:31   ` Kalesh Anakkur Purayil
     [not found]     ` <87330A78-CDF0-4B49-8192-DBDF006DB8A7@microsoft.com>
2023-10-18  4:10       ` [EXTERNAL] " Kalesh Anakkur Purayil
     [not found]         ` <MN0PR21MB360603822A844951D3400C1AD6D5A@MN0PR21MB3606.namprd21.prod.outlook.com>
2023-10-18 17:25           ` Kalesh Anakkur Purayil
2023-10-16 22:12 ` [Patch v7 5/5] RDMA/mana_ib: Send event to qp sharmaajay
2023-10-23 18:23   ` Jason Gunthorpe
2023-10-25 19:59     ` [EXTERNAL] " Ajay Sharma
2023-10-27 21:35       ` Long Li
2023-10-30 12:42         ` Jason Gunthorpe [this message]

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=20231030124200.GF691768@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sharmaajay@linuxonhyperv.com \
    --cc=sharmaajay@microsoft.com \
    --cc=wei.liu@kernel.org \
    /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 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.