Re: [PATCH net-next V4 4/6] devlink: Apply eswitch mode boot defaults
From: Jiri Pirko <jiri@resnulli.us>
Date: 2026-07-01 09:48:14
Also in:
linux-doc, linux-rdma
From: Jiri Pirko <jiri@resnulli.us>
Date: 2026-07-01 09:48:14
Also in:
linux-doc, linux-rdma
Mon, Jun 29, 2026 at 08:20:59PM +0200, mbloch@nvidia.com wrote:
Apply parsed devlink_eswitch_mode= defaults after devlink registration and after successful reload. devl_register() may still be called before the device is ready for an
How so? I would assume that driver calls devl_register only after everything is up and running and ready. If not, isn't it a bug?
eswitch mode change, so keep a per-devlink delayed work item and pending flag for the registration path. Registration queues the work, and the worker tries to take the devlink instance lock. If the lock is busy, the worker requeues itself with a delay. For successful reloads that performed DRIVER_REINIT, devlink_reload() already holds the devlink instance lock and the driver has completed reload_up(). Clear pending work and apply the default directly from the reload path instead of queueing work. If a user sets eswitch mode through netlink before the pending registration work runs, clear the pending flag so the queued default does not override that user request. Cancel pending default apply work when freeing the devlink instance.
These AI generated code descriptive messages are generally not very useful :(