Re: [PATCH net-next v2 3/5] devlink: create a special NDO for getting the devlink instance
From: Jakub Kicinski <hidden>
Date: 2019-02-22 20:10:00
From: Jakub Kicinski <hidden>
Date: 2019-02-22 20:10:00
On Fri, 22 Feb 2019 12:04:07 -0800, Florian Fainelli wrote:
On 2/22/19 11:54 AM, Jakub Kicinski wrote:quoted
Instead of iterating over all devlink ports add a NDO which will return the devlink instance from the driver. v2: add the netdev_to_devlink() helper (Michal) Suggested-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Jakub Kicinski <redacted> ---[snip]quoted
- mutex_unlock(&devlink_mutex); + devlink = netdev_to_devlink(dev); + if (!devlink || !devlink->ops->info_get) + return;AFAICT devlink_create() allows one to specify a NULL ops argument (not that this makes sense), so probably need to add a check against devlink->ops here as well, unless we want to change devlink_create() to refuse a NULL ops pointer.
Oh, you're right! devlink_nl_cmd_reload() seems to be missing that check as well. Let me respin quickly.
Other than that: Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Thanks!