[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250702180007.GK6278@unreal>
Date: Wed, 2 Jul 2025 21:00:07 +0300
From: Leon Romanovsky <leon@...nel.org>
To: Jason Gunthorpe <jgg@...pe.ca>
Cc: Abhijit Gangurde <abhijit.gangurde@....com>, shannon.nelson@....com,
brett.creeley@....com, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, corbet@....net,
andrew+netdev@...n.ch, allen.hubbe@....com, nikhil.agarwal@....com,
linux-rdma@...r.kernel.org, netdev@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
Andrew Boyer <andrew.boyer@....com>
Subject: Re: [PATCH v3 10/14] RDMA/ionic: Register device ops for control path
On Wed, Jul 02, 2025 at 10:18:03AM -0300, Jason Gunthorpe wrote:
> On Tue, Jul 01, 2025 at 01:38:44PM +0300, Leon Romanovsky wrote:
> > > +static void ionic_flush_qs(struct ionic_ibdev *dev)
> > > +{
> > > + struct ionic_qp *qp, *qp_tmp;
> > > + struct ionic_cq *cq, *cq_tmp;
> > > + LIST_HEAD(flush_list);
> > > + unsigned long index;
> > > +
> > > + /* Flush qp send and recv */
> > > + rcu_read_lock();
> > > + xa_for_each(&dev->qp_tbl, index, qp) {
> > > + kref_get(&qp->qp_kref);
> > > + list_add_tail(&qp->ibkill_flush_ent, &flush_list);
> > > + }
> > > + rcu_read_unlock();
> >
> > Same question as for CQ. What does RCU lock protect here?
>
> It should protect the kref_get against free of qp. The qp memory must
> be RCU freed.
I'm not sure that this was intension here. Let's wait for an answer from the author.
>
> But this pattern requires kref_get_unless_zero()
>
> Jason
Powered by blists - more mailing lists