On Wed, Nov 12, 2025 at 09:52:10AM -0800, Breno Leitao wrote:
The main reason why I opted for a helper in netpoll was to keep reference tracking for these devices strictly inside netpoll and have simmetry between setup and cleanup. Having said that, this might be an overkill and I'm fine with dropping the helper and taking your suggestion.
Right, that makes sense. Would we have other owners for that function?
I've looked at other drivers using netpoll and from what I could find all of them are using __netpoll_setup paired with __netpoll_free. They don't seem to rely on dev_tracker to track references, I'd need to look a bit more to be certain, but I think other callers are own the devices and track their lifecycle separately. So I don't think this would be useful for them.
Since we are moving netpoll_cleanup to netconsole in your patch below, I think I should drop the netpoll helper and keep it in netconsole. I wonder if we should consider moving do_netpoll_cleanup to netconsole as well, since it seems to be the only caller and then we would have the same symmetry I mentioned above.
So, to summarize, given your refactor patch I think it makes sense drop the previous patch and do the netdev_hold in netconsole as you suggested. Does that sound good?