net/mlx5_core: Flow counters infrastructure
If a counter has the aging flag set when created, it is added to a list of counters that will be queried periodically from a workqueue. query result and last use timestamp are cached. add/del counter must be very efficient since thousands of such operations might be issued in a second. There is only a single reference to counters without aging, therefore no need for locks. But, counters with aging enabled are stored in a list. In order to make code as lockless as possible, all the list manipulation and access to hardware is done from a single context - the periodic counters query thread. The hardware supports multiple counters per FTE, however currently we are using one counter for each FTE. Signed-off-by:Amir Vadai <amirva@mellanox.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
Showing
- drivers/net/ethernet/mellanox/mlx5/core/Makefile 1 addition, 1 deletiondrivers/net/ethernet/mellanox/mlx5/core/Makefile
- drivers/net/ethernet/mellanox/mlx5/core/fs_core.c 6 additions, 1 deletiondrivers/net/ethernet/mellanox/mlx5/core/fs_core.c
- drivers/net/ethernet/mellanox/mlx5/core/fs_core.h 3 additions, 0 deletionsdrivers/net/ethernet/mellanox/mlx5/core/fs_core.h
- drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c 226 additions, 0 deletionsdrivers/net/ethernet/mellanox/mlx5/core/fs_counters.c
- include/linux/mlx5/driver.h 14 additions, 0 deletionsinclude/linux/mlx5/driver.h
- include/linux/mlx5/fs.h 5 additions, 0 deletionsinclude/linux/mlx5/fs.h
Loading
Please register or sign in to comment