devlink: restart dump based on devlink instance ids (simple)
xarray gives each devlink instance an id and allows us to restart walk based on that id quite neatly. This is nice both from the perspective of code brevity and from the stability of the dump (devlink instances disappearing from before the resumption point will not cause inconsistent dumps). This patch takes care of simple cases where state->idx counts devlink instances only. Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -91,7 +91,7 @@ void devlink_put(struct devlink *devlink)
|
||||
call_rcu(&devlink->rcu, __devlink_put_rcu);
|
||||
}
|
||||
|
||||
static struct devlink *
|
||||
struct devlink *
|
||||
devlinks_xa_find_get(struct net *net, unsigned long *indexp,
|
||||
void * (*xa_find_fn)(struct xarray *, unsigned long *,
|
||||
unsigned long, xa_mark_t))
|
||||
|
||||
Reference in New Issue
Block a user