Message ID | 20221217011953.152487-11-kuba@kernel.org (mailing list archive) |
---|---|
State | RFC |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | devlink: remove the wait-for-references on unregister | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Clearly marked for net-next |
netdev/apply | fail | Patch does not apply to net-next |
Sat, Dec 17, 2022 at 02:19:53AM CET, kuba@kernel.org wrote: >Move the devlink instance registration up so that all the sub-object >manipulation happens on a valid instance. I wonder, why don't you squash patch 8 to this one and make 1 move, to the fina destination?
On Mon, 2 Jan 2023 14:34:42 +0100 Jiri Pirko wrote: > Sat, Dec 17, 2022 at 02:19:53AM CET, kuba@kernel.org wrote: > >Move the devlink instance registration up so that all the sub-object > >manipulation happens on a valid instance. > > I wonder, why don't you squash patch 8 to this one and make 1 move, to > the fina destination? I found the squashed version a lot harder to review.
Tue, Jan 03, 2023 at 12:25:46AM CET, kuba@kernel.org wrote: >On Mon, 2 Jan 2023 14:34:42 +0100 Jiri Pirko wrote: >> Sat, Dec 17, 2022 at 02:19:53AM CET, kuba@kernel.org wrote: >> >Move the devlink instance registration up so that all the sub-object >> >manipulation happens on a valid instance. >> >> I wonder, why don't you squash patch 8 to this one and make 1 move, to >> the fina destination? > >I found the squashed version a lot harder to review. I'm puzzled. Both patches move calls to devl_register/unregister(). The first one moves it, the second one moves it a bit more. What's making the squashed patch hard to review?
On Tue, 3 Jan 2023 10:51:14 +0100 Jiri Pirko wrote: > >> I wonder, why don't you squash patch 8 to this one and make 1 move, to > >> the fina destination? > > > >I found the squashed version a lot harder to review. > > I'm puzzled. Both patches move calls to devl_register/unregister(). > The first one moves it, the second one moves it a bit more. What's > making the squashed patch hard to review? Ah, I thought you meant patch 7, sorry. This one matters less, I'll squash.
diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c index c9952a34c39a..738784fda117 100644 --- a/drivers/net/netdevsim/dev.c +++ b/drivers/net/netdevsim/dev.c @@ -1556,23 +1556,23 @@ int nsim_drv_probe(struct nsim_bus_dev *nsim_bus_dev) goto err_devlink_unlock; } - err = nsim_dev_resources_register(devlink); + err = devl_register(devlink); if (err) goto err_vfc_free; + err = nsim_dev_resources_register(devlink); + if (err) + goto err_dl_unregister; + err = devlink_params_register(devlink, nsim_devlink_params, ARRAY_SIZE(nsim_devlink_params)); if (err) goto err_resource_unregister; nsim_devlink_set_params_init_values(nsim_dev, devlink); - err = devl_register(devlink); - if (err) - goto err_params_unregister; - err = nsim_dev_dummy_region_init(nsim_dev, devlink); if (err) - goto err_dl_unregister; + goto err_params_unregister; err = nsim_dev_traps_init(devlink); if (err) @@ -1629,13 +1629,13 @@ int nsim_drv_probe(struct nsim_bus_dev *nsim_bus_dev) nsim_dev_traps_exit(devlink); err_dummy_region_exit: nsim_dev_dummy_region_exit(nsim_dev); -err_dl_unregister: - devl_unregister(devlink); err_params_unregister: devlink_params_unregister(devlink, nsim_devlink_params, ARRAY_SIZE(nsim_devlink_params)); err_resource_unregister: devl_resources_unregister(devlink); +err_dl_unregister: + devl_unregister(devlink); err_vfc_free: kfree(nsim_dev->vfconfigs); err_devlink_unlock: @@ -1678,10 +1678,10 @@ void nsim_drv_remove(struct nsim_bus_dev *nsim_bus_dev) nsim_bpf_dev_exit(nsim_dev); nsim_dev_debugfs_exit(nsim_dev); - devl_unregister(devlink); devlink_params_unregister(devlink, nsim_devlink_params, ARRAY_SIZE(nsim_devlink_params)); devl_resources_unregister(devlink); + devl_unregister(devlink); kfree(nsim_dev->vfconfigs); kfree(nsim_dev->fa_cookie); devl_unlock(devlink);
Move the devlink instance registration up so that all the sub-object manipulation happens on a valid instance. Signed-off-by: Jakub Kicinski <kuba@kernel.org> --- drivers/net/netdevsim/dev.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)