Subject: Re: [PATCH v5 net-next 02/12] net-shapers: implement NL get operation

From: Jakub Kicinski <[email-masked]>
Date: Thu, 29 Aug 2024 16:28:38 -0700

On Thu, 29 Aug 2024 17:16:55 +0200 Paolo Abeni wrote:
> +	xa_for_each_range(&data->shapers, index, shaper, ctx->start_index,
> +			  U32_MAX) {
> +		net_shaper_index_to_handle(index, &handle);
> +		ret = net_shaper_fill_one(skb, binding, &handle, shaper, info);
> +		if (ret)
> +			return ret;
> +
> +		ctx->start_index = index;

75% sure this should say index + 1, or the xa_for_each.. should use
start_index + 1. start position is inclusive.

XA iterators are hard to get right in netlink, I'd suggest using the
same form of iteration as for_each_netdev_dump()..