Hi,

From: Bing Zhao <bi...@nvidia.com>
Sent: Wednesday, July 17, 2024 7:33 PM
To: Slava Ovsiienko; dev@dpdk.org; Raslan Darawsheh
Cc: Ori Kam; Dariusz Sosnowski; Suanming Mou; Matan Azrad
Subject: [PATCH] net/mlx5: fix end condition of reading xstats

The "mlx5_stats_n" in the "struct mlx5_xstats_ctrl" is the number of
device stats identified by PMD. Right now, the mapping of device
stats to the xstats is not compact. The "input index" of the device
stats would remain UINT16_MAX and be skipped when reading counters.

If some DPDK stats cannot be identified in the middle of the map, the
end condition should be bigger than the "mlx5_stats_n". Or else, some
counters would not be read and calculated.

Using the global const "xstats_n" as the end condition to traverse
the whole array in case some counters are missed. The "xstats_o_idx"
should be used instead of the iteration to check if the statistics
is an IB device counter.

In the meanwhile, adding another field to record the start index of
the IB counters to reduce the redundancy iterations.

Fixes: a687c3e658c2 ("net/mlx5: fix counters map in bonding mode")

Signed-off-by: Bing Zhao <bi...@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viachesl...@nvidia.com>


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

Reply via email to