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

From: Jens Axboe
Date: Wed Oct 02 2024 - 14:38:42 EST


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.

--
Jens Axboe