mlx5: count all link events
authorJakub Kicinski <kuba@kernel.org>
Wed, 19 May 2021 17:18:25 +0000 (10:18 -0700)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 3 Jun 2021 20:10:17 +0000 (13:10 -0700)
commit490dcecabbf93e705006af498fa6815251404a54
treef29ba97ace44c3e34c7f0950f730c2232ce16a81
parent270d47dc1fc4756a0158778084a236bc83c156d2
mlx5: count all link events

mlx5 devices were observed generating MLX5_PORT_CHANGE_SUBTYPE_ACTIVE
events without an intervening MLX5_PORT_CHANGE_SUBTYPE_DOWN. This
breaks link flap detection based on Linux carrier state transition
count as netif_carrier_on() does nothing if carrier is already on.
Make sure we count such events.

netif_carrier_event() increments the counters and fires the linkwatch
events. The latter is not necessary for the use case but seems like
the right thing to do.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
include/linux/netdevice.h
net/sched/sch_generic.c