Subject: Re: [PATCH net-next v2 10/15] devlink: restart dump based on devlink instance ids (simple)

From: Jiri Pirko <[email-masked]>
Date: Thu, 5 Jan 2023 10:22:27 +0100

Thu, Jan 05, 2023 at 05:05:26AM CET, [email-masked] 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 <[email-masked]>
>Signed-off-by: Jakub Kicinski <[email-masked]>

[...]

>+#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 <[email-masked]>