On Wed, 11 Nov 2020 21:56:10 +0100 Heiner Kallweit wrote:
> Quite often certain resources (irq, bigger chunks of memory) are
> allocated not at probe time but in ndo_open. This requires to relaese
> such resources in the right order in ndo_stop(), and in ndo_open()
> error paths. Having said that the requirements are basically the same
> as for releasing probe-time allocated resources in remove callback
> and probe error paths.
> So why not use the same mechanism to faciliate this? We have a big
> number of device-managed resource allocation functions, so all we
> need is a device suited for managed ndo_open resource allocation.
> This RFC patch adds such a device to struct net_device. All we need
> is a dozen lines of code. Resources then can be allocated with e.g.
> 
> struct device *devm = &dev->devres_up;
> devm_kzalloc(devm, size, gfp);
> 
> Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com>

This will not work well with the best known practice on how to change
rings parameters at runtime (allocate new set, swap, free old set).

Personally I'm not a fan of the managed stuff, and I think neither is
Dave. It just makes code harder to prove correct.

Reply via email to