On Tue, May 09, 2023 at 07:40:13PM -0700, Jakub Kicinski wrote: > On Tue, 9 May 2023 08:06:32 +0200 Louis Peens wrote: > > +static inline > > +struct net_device *nfp_app_dev_get_locked(struct nfp_app *app, u32 id, > > _locked() in what way? RCU functions typically use an _rcu suffix, no? We were discussing the naming during internal review, for some reason didn't think about using _rcu, will update if there is a v2. > > > + bool *redir_egress) > > +{ > > + struct net_device *dev; > > + > > + if (unlikely(!app || !app->type->dev_get)) > > + return NULL; > > + > > + rcu_read_lock(); > > + dev = app->type->dev_get(app, id, redir_egress); > > + rcu_read_unlock(); > > + > > + return dev; > > this looks very suspicious, RCU takes care primarily of the lifetime of > objects, in this case dev. Returning it after dropping the lock seems > wrong. > > If the context is safe maybe it's a better idea to change the > condition in rcu_dereference_check() to include rcu_read_lock_bh_held()? Thanks, will take a closer look at this. > -- > pw-bot: cr >