Skip to content

Commit c75b942

Browse files
rleonSaeed Mahameed
authored andcommitted
net/mlx5e: Drop XFRM state lock when modifying flow steering
XFRM state which is changed to be XFRM_STATE_EXPIRED doesn't really need to hold lock while modifying flow steering rules to drop traffic. That state can be deleted only and as such mlx5e_ipsec_handle_tx_limit() work will be canceled anyway and won't run in parallel. Fixes: b2f7b01 ("net/mlx5e: Simulate missing IPsec TX limits hardware functionality") Signed-off-by: Leon Romanovsky <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent fef0667 commit c75b942

File tree

1 file changed

+8
-5
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en_accel

1 file changed

+8
-5
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,19 @@ static void mlx5e_ipsec_handle_tx_limit(struct work_struct *_work)
6161
struct mlx5e_ipsec_sa_entry *sa_entry = dwork->sa_entry;
6262
struct xfrm_state *x = sa_entry->x;
6363

64-
spin_lock(&x->lock);
64+
if (sa_entry->attrs.drop)
65+
return;
66+
67+
spin_lock_bh(&x->lock);
6568
xfrm_state_check_expire(x);
6669
if (x->km.state == XFRM_STATE_EXPIRED) {
6770
sa_entry->attrs.drop = true;
68-
mlx5e_accel_ipsec_fs_modify(sa_entry);
69-
}
70-
spin_unlock(&x->lock);
71+
spin_unlock_bh(&x->lock);
7172

72-
if (sa_entry->attrs.drop)
73+
mlx5e_accel_ipsec_fs_modify(sa_entry);
7374
return;
75+
}
76+
spin_unlock_bh(&x->lock);
7477

7578
queue_delayed_work(sa_entry->ipsec->wq, &dwork->dwork,
7679
MLX5_IPSEC_RESCHED);

0 commit comments

Comments
 (0)