OSDN Git Service

net/mlx5e: Change inline mode correctly when changing trust state
authorMaxim Mikityanskiy <maximmi@mellanox.com>
Thu, 14 Nov 2019 11:06:16 +0000 (13:06 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Wed, 26 Feb 2020 01:06:04 +0000 (17:06 -0800)
commit6e0504c69811ae9df7e7e1284950befbe3e6f496
treed0c1fe4e11034908ad245e427d84e595b8838e56
parentb9ab5d0ecf426a1bf16d706e7c284e00998d00be
net/mlx5e: Change inline mode correctly when changing trust state

The current steps that are performed when the trust state changes, if
the channels are active:

1. The trust state is changed in hardware.

2. The new inline mode is calculated.

3. If the new inline mode is different, the channels are recreated using
the new inline mode.

This approach has some issues:

1. There is a time gap between changing trust state in hardware and
starting sending enough inline headers (the latter happens after
recreation of channels). It leads to failed transmissions and error
CQEs.

2. If the new channels fail to open, we'll be left with the old ones,
but the hardware will be configured for the new trust state, so the
interval when we can see TX errors never ends.

This patch fixes the issues above by moving the trust state change into
the preactivate hook that runs during the recreation of the channels
when no channels are active, so it eliminates the gap of partially
applied configuration. If the inline mode doesn't change with the change
of the trust state, the channels won't be recreated, just like before
this patch.

Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c