2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-10 22:54:11 +08:00
linux-next/include/linux/mlx5
Gavi Teitz 558101f1b9 net/mlx5: Add flow counter pool
Add a pool of flow counters, based on flow counter bulks, removing the
need to allocate a new counter via a costly FW command during the flow
creation process. The time it takes to acquire/release a flow counter
is cut from ~50 [us] to ~50 [ns].

The pool is part of the mlx5 driver instance, and provides flow
counters for aging flows. mlx5_fc_create() was modified to provide
counters for aging flows from the pool by default, and
mlx5_destroy_fc() was modified to release counters back to the pool
for later reuse. If bulk allocation is not supported or fails, and for
non-aging flows, the fallback behavior is to allocate and free
individual counters.

The pool is comprised of three lists of flow counter bulks, one of
fully used bulks, one of partially used bulks, and one of unused
bulks. Counters are provided from the partially used bulks first, to
help limit bulk fragmentation.

The pool maintains a threshold, and strives to maintain the amount of
available counters below it. The pool is increased in size when a
counter acquisition request is made and there are no available
counters, and it is decreased in size when the last counter in a bulk
is released and there are more available counters than the threshold.
All pool size changes are done in the context of the
acquiring/releasing process.

The value of the threshold is directly correlated to the amount of
used counters the pool is providing, while constrained by a hard
maximum, and is recalculated every time a bulk is allocated/freed.
This ensures that the pool only consumes large amounts of memory for
available counters if the pool is being used heavily. When fully
populated and at the hard maximum, the buffer of available counters
consumes ~40 [MB].

Signed-off-by: Gavi Teitz <gavi@mellanox.com>
Reviewed-by: Vlad Buslov <vladbu@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
2019-08-01 12:33:30 -07:00
..
accel.h net/mlx5: Kconfig, Better organize compilation flags 2019-07-05 16:29:19 -07:00
cmd.h
cq.h net/mlx5: Report EQE data upon CQ completion 2019-07-03 21:00:20 +03:00
device.h Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux 2019-07-04 16:42:59 -04:00
doorbell.h net/mlx5: Remove spinlock support from mlx5_write64 2019-04-02 12:49:37 -07:00
driver.h net/mlx5: Add flow counter pool 2019-08-01 12:33:30 -07:00
eq.h net/mlx5: Use event mask based on device capabilities 2019-07-03 20:55:45 +03:00
eswitch.h Merge mlx5-next into rdma for-next 2019-07-05 10:16:19 -03:00
fs_helpers.h {net,IB}/mlx5: Add ipsec helper 2018-04-04 12:06:27 -06:00
fs.h net/mlx5e: reduce stack usage in mlx5_eswitch_termtbl_create 2019-06-28 16:03:59 -07:00
mlx5_ifc_fpga.h net/mlx5: Accel, add TLS rx offload routines 2018-07-16 00:13:11 -07:00
mlx5_ifc.h net/mlx5: E-Switch, Verify support QoS element type 2019-08-01 11:14:25 -07:00
port.h net/mlx5e: ethtool, Add support for EEPROM high pages query 2019-05-01 14:39:16 -07:00
qp.h IB/mlx5: Support set qp counter 2019-07-05 10:22:55 -03:00
transobj.h net/mlx5: Introduce new TIR creation core API 2019-04-24 12:33:37 -07:00
vport.h net/mlx5: Introduce and use mlx5_eswitch_get_total_vports() 2019-07-03 12:50:42 -07:00