WSL2-Linux-Kernel/include/linux/mlx5
Ariel Levkovich 90bb769291 net/mlx5e: Prevent encap flow counter update async to user query
This patch prevents a race between user invoked cached counters
query and a neighbor last usage updater.

The cached flow counter stats can be queried by calling
"mlx5_fc_query_cached" which provides the number of bytes and
packets that passed via this flow since the last time this counter
was queried.
It does so by reducting the last saved stats from the current, cached
stats and then updating the last saved stats with the cached stats.
It also provide the lastuse value for that flow.

Since "mlx5e_tc_update_neigh_used_value" needs to retrieve the
last usage time of encapsulation flows, it calls the flow counter
query method periodically and async to user queries of the flow counter
using cls_flower.
This call is causing the driver to update the last reported bytes and
packets from the cache and therefore, future user queries of the flow
stats will return lower than expected number for bytes and packets
since the last saved stats in the driver was updated async to the last
saved stats in cls_flower.

This causes wrong stats presentation of encapsulation flows to user.

Since the neighbor usage updater only needs the lastuse stats from the
cached counter, the fix is to use a dedicated lastuse query call that
returns the lastuse value without synching between the cached stats and
the last saved stats.

Fixes: f6dfb4c3f2 ("net/mlx5e: Update neighbour 'used' state using HW flow rules counters")
Signed-off-by: Ariel Levkovich <lariel@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
2019-07-25 13:31:00 -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 Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux 2019-07-04 16:42:59 -04: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.h net/mlx5e: Prevent encap flow counter update async to user query 2019-07-25 13:31:00 -07:00
fs_helpers.h {net,IB}/mlx5: Add ipsec helper 2018-04-04 12:06:27 -06:00
mlx5_ifc.h net/mlx5: Fix modify_cq_in alignment 2019-07-25 13:30:59 -07:00
mlx5_ifc_fpga.h net/mlx5: Accel, add TLS rx offload routines 2018-07-16 00:13:11 -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