lkml.org 
[lkml]   [2024]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH net-next 5/5] gve: Add flow steering ethtool support
From
>> …
>>> +++ b/drivers/net/ethernet/google/gve/gve_ethtool.c
>> …
>>> +static int gve_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd, u32 *rule_locs)
>>> +{
>>> + struct gve_priv *priv = netdev_priv(netdev);
>>> + int err = 0;
>>> +
>>> + dev_hold(netdev);
>>> + rtnl_unlock();
>> …
>>> +out:
>>> + rtnl_lock();
>>> + dev_put(netdev);
>>> + return err;
>>> +}
>> …
>>
>> How do you think about to increase the application of scope-based resource management
>> at such source code places?
>>
> Is the suggestion to combine dev_hold(netdev) together with
> rtnl_unlock()? If so, I think there might be different usages for
> using rtnl_unlock. For example, some drivers will call rtnl_unlock
> after dev_close(netdev). Please correct me if I'm wrong.

How much collateral evolution did you notice according to information from
an article like “Scope-based resource management for the kernel”
by Jonathan Corbet (from 2023-06-15)?
https://lwn.net/Articles/934679/

Would you become interested to extend the usage of resource guards accordingly?
https://elixir.bootlin.com/linux/v6.9-rc7/source/include/linux/cleanup.h#L124

Regards,
Markus

\
 
 \ /
  Last update: 2024-05-27 18:23    [W:0.191 / U:0.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site