Re: [RFC PATCH 1/2] aoe: add reference count in aoeif for tracking the using of net_device

From: joeyli
Date: Fri Oct 04 2024 - 06:41:12 EST


Hi Jens,

On Wed, Oct 02, 2024 at 12:38:30PM -0600, Jens Axboe wrote:
> On 10/1/24 10:06 PM, Chun-Yi Lee wrote:
> > This is a patch for debugging. For tracking the reference count of using
> > net_device in aoeif, this patch adds a nd_pcpu_refcnt field in aoeif
> > structure. Two wrappers, nd_dev_hold() and nd_dev_put() are used to
> > call dev_hold(nd)/dev_put(nd) and maintain ifp->nd_pcpu_refcnt at the
> > same time.
>
> There's no parallel universe in which using a percpu reference over just
> a refcount_t for something like aoe is warranted.
>

Thanks for your review! I will use refcount_t in next version.

Joey Lee