diff options
| author | Cosmin Ratiu <cratiu@nvidia.com> | 2026-11-05 23:16:34 +0200 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-11-10 15:33:09 -0800 |
| commit | d9e4ac08ea892da54c5aa7ae4a368f2d09db589c (patch) | |
| tree | bcf8539fb37419345bde685340711bf1d5306046 /tools/perf/scripts/python/bin | |
| parent | 5b310ae1eff7531030b123bfcb192b0176d73075 (diff) | |
net/mlx5e: Block E-Switch mode changes during IPsec policy creation
Eswitch mode changes can tear down the IPsec context while policy
creation is accessing it. The mode-blocking reference acquired when
creating a flow table comes too late: the table lookup already accesses
the IPsec context before taking that reference.
Take a temporary mode-blocking reference before checking the IPsec
context and validating the policy. This gets dropped after successful
setup, when the flow table holds its own reference.
The temporary reservation must allow reuse of existing IPsec tables.
For example:
1. An offloaded inbound IPsec policy is added on the uplink.
2. A TC flower rule is added on a VF representor.
3. Another uplink policy is added using the same RX tables.
The third policy reuses the first policy's tables, so it must not be
rejected merely because esw->user_count is nonzero. Add a check_users
argument to mlx5_eswitch_block_mode(). Pass false for temporary policy
reservations and true when creating the first table (rx_get()/tx_get()).
Temporary reservations take mode_lock and check operation ownership
without requiring eswitch user_count to be zero.
mlx5e_xfrm_add_state() needs the same early mode reservation and is
handled in the next patch.
This was found by Sashiko, during review of the last patch in the
series. No reproduction attempted, as it seems quite a tricky race to
successfully trigger.
Fixes: a5b8ca9471d3 ("net/mlx5e: Add XFRM policy offload logic")
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261105211637.1083978-7-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
