mlxsw: spectrum: Allow fetch-and-clear of flow counters
authorPetr Machata <petrm@nvidia.com>
Fri, 8 Mar 2024 12:59:49 +0000 (13:59 +0100)
committerJakub Kicinski <kuba@kernel.org>
Mon, 11 Mar 2024 21:14:08 +0000 (14:14 -0700)
commit6fb88aaf272a6aa58fd90a308cb0ef34f78aace4
tree796198faf813b92ee38d7f6442d388b44d1c66ae
parent8acb480e43c81bc72b528677084428cf2dc7a12c
mlxsw: spectrum: Allow fetch-and-clear of flow counters

For the report_delta-like interface like a previous patch has added for
collection of NH group statistics, it's easiest to read the counter and
have the HW clear it right away. Thus, change mlxsw_sp_flow_counter_get()
to take a bool indicating whether this should be done.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://lore.kernel.org/r/6a096ede8ee92d5041e3832242c3bbc137198aba.1709901020.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c