numam-dpdk/drivers
Michael Baum 5b21f92556 net/mlx5: fix counter access for HWS
The HWS counter has 2 different identifiers:
1. Type "cnt_id_t" which represents the counter inside caches and in
   the flow structure. This index cannot be zero and is mostly called
   "cnt_id".
 2. Internal index, the index in counters array with type "uint32_t".
    mostly it is called "iidx".
The second ID is calculated from the first using "mlx5_hws_cnt_iidx()"
function.

When a direct counter is allocated, if the queue cache is not empty, the
counter represented by cnt_id is popped from the cache. This counter may
be invalid according to the query_gen field. Thus, the "iidx" is parsed
from cnt_id and if it is valid, it is used to update the fields of the
counter structure.
When this counter is invalid, all the cache is flashed and new counters
are fetched into the cache. After fetching, another counter represented
by cnt_id is taken from the cache.
Unfortunately, for updating fields like "in_used" or "age_idx", the
function wrongly may use the old "iidx" coming from an invalid cnt_id.

Update the "iidx" in case of an invalid counter popped from the cache.

Fixes: 4d368e1da3 ("net/mlx5: support flow counter action for HWS")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Xiaoyu Min <jackmin@nvidia.com>
2022-11-10 18:15:44 +01:00
..
baseband drivers: omit symbol map when unneeded 2022-11-14 15:22:46 +01:00
bus bus/auxiliary: prevent device from being probed again 2022-11-14 11:15:44 +01:00
common drivers: omit symbol map when unneeded 2022-11-14 15:22:46 +01:00
compress drivers: omit symbol map when unneeded 2022-11-14 15:22:46 +01:00
crypto drivers: omit symbol map when unneeded 2022-11-14 15:22:46 +01:00
dma drivers: omit symbol map when unneeded 2022-11-14 15:22:46 +01:00
event drivers: omit symbol map when unneeded 2022-11-14 15:22:46 +01:00
gpu drivers: omit symbol map when unneeded 2022-11-14 15:22:46 +01:00
mempool drivers: omit symbol map when unneeded 2022-11-14 15:22:46 +01:00
net net/mlx5: fix counter access for HWS 2022-11-10 18:15:44 +01:00
raw drivers: omit symbol map when unneeded 2022-11-14 15:22:46 +01:00
regex drivers: omit symbol map when unneeded 2022-11-14 15:22:46 +01:00
vdpa drivers: omit symbol map when unneeded 2022-11-14 15:22:46 +01:00
meson.build drivers: omit symbol map when unneeded 2022-11-14 15:22:46 +01:00