Thu, Jan 05, 2023 at 05:05:26AM CET, kuba@kernel.org wrote:
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>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[...]
quoted hunk ↗ jump to hunk
+#define devlink_dump_for_each_instance_get(msg, state, devlink) \
+ for (; (devlink = devlinks_xa_find_get(sock_net(msg->sk), \
+ &state->instance, xa_find)); \
+ state->instance++)
I'm still not happy about this to be honest, but I don't think it
matters now as it is cosmetical. I can try to address it in the
follow-up patch/set.
Reviewed-by: Jiri Pirko <redacted>