Skip to content

Commit 77bed87

Browse files
rleonSaeed Mahameed
authored andcommitted
net/mlx5e: Delete obsolete IPsec code
After addition of HW managed counters and implementation drop in flow steering logic, the code in driver which checks syndrome is not reachable anymore. Let's delete it. Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 6fb7f94 commit 77bed87

File tree

4 files changed

+2
-26
lines changed

4 files changed

+2
-26
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ struct mlx5e_ipsec_hw_stats {
137137
struct mlx5e_ipsec_sw_stats {
138138
atomic64_t ipsec_rx_drop_sp_alloc;
139139
atomic64_t ipsec_rx_drop_sadb_miss;
140-
atomic64_t ipsec_rx_drop_syndrome;
141140
atomic64_t ipsec_tx_drop_bundle;
142141
atomic64_t ipsec_tx_drop_no_state;
143142
atomic64_t ipsec_tx_drop_not_ip;

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

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,6 @@ bool mlx5e_ipsec_handle_tx_skb(struct net_device *netdev,
304304
return false;
305305
}
306306

307-
enum {
308-
MLX5E_IPSEC_OFFLOAD_RX_SYNDROME_DECRYPTED,
309-
MLX5E_IPSEC_OFFLOAD_RX_SYNDROME_AUTH_FAILED,
310-
MLX5E_IPSEC_OFFLOAD_RX_SYNDROME_BAD_TRAILER,
311-
};
312-
313307
void mlx5e_ipsec_offload_handle_rx_skb(struct net_device *netdev,
314308
struct sk_buff *skb,
315309
u32 ipsec_meta_data)
@@ -343,20 +337,7 @@ void mlx5e_ipsec_offload_handle_rx_skb(struct net_device *netdev,
343337

344338
xo = xfrm_offload(skb);
345339
xo->flags = CRYPTO_DONE;
346-
347-
switch (MLX5_IPSEC_METADATA_SYNDROM(ipsec_meta_data)) {
348-
case MLX5E_IPSEC_OFFLOAD_RX_SYNDROME_DECRYPTED:
349-
xo->status = CRYPTO_SUCCESS;
350-
break;
351-
case MLX5E_IPSEC_OFFLOAD_RX_SYNDROME_AUTH_FAILED:
352-
xo->status = CRYPTO_TUNNEL_ESP_AUTH_FAILED;
353-
break;
354-
case MLX5E_IPSEC_OFFLOAD_RX_SYNDROME_BAD_TRAILER:
355-
xo->status = CRYPTO_INVALID_PACKET_SYNTAX;
356-
break;
357-
default:
358-
atomic64_inc(&ipsec->sw_stats.ipsec_rx_drop_syndrome);
359-
}
340+
xo->status = CRYPTO_SUCCESS;
360341
}
361342

362343
int mlx5_esw_ipsec_rx_make_metadata(struct mlx5e_priv *priv, u32 id, u32 *metadata)
@@ -374,8 +355,6 @@ int mlx5_esw_ipsec_rx_make_metadata(struct mlx5e_priv *priv, u32 id, u32 *metada
374355
return err;
375356
}
376357

377-
*metadata = MLX5_IPSEC_METADATA_CREATE(ipsec_obj_id,
378-
MLX5E_IPSEC_OFFLOAD_RX_SYNDROME_DECRYPTED);
379-
358+
*metadata = ipsec_obj_id;
380359
return 0;
381360
}

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#define MLX5_IPSEC_METADATA_MARKER(metadata) (((metadata) >> 31) & 0x1)
4444
#define MLX5_IPSEC_METADATA_SYNDROM(metadata) (((metadata) >> 24) & GENMASK(5, 0))
4545
#define MLX5_IPSEC_METADATA_HANDLE(metadata) ((metadata) & GENMASK(23, 0))
46-
#define MLX5_IPSEC_METADATA_CREATE(id, syndrome) ((id) | ((syndrome) << 24))
4746

4847
struct mlx5e_accel_tx_ipsec_state {
4948
struct xfrm_offload *xo;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ static const struct counter_desc mlx5e_ipsec_hw_stats_desc[] = {
5151
static const struct counter_desc mlx5e_ipsec_sw_stats_desc[] = {
5252
{ MLX5E_DECLARE_STAT(struct mlx5e_ipsec_sw_stats, ipsec_rx_drop_sp_alloc) },
5353
{ MLX5E_DECLARE_STAT(struct mlx5e_ipsec_sw_stats, ipsec_rx_drop_sadb_miss) },
54-
{ MLX5E_DECLARE_STAT(struct mlx5e_ipsec_sw_stats, ipsec_rx_drop_syndrome) },
5554
{ MLX5E_DECLARE_STAT(struct mlx5e_ipsec_sw_stats, ipsec_tx_drop_bundle) },
5655
{ MLX5E_DECLARE_STAT(struct mlx5e_ipsec_sw_stats, ipsec_tx_drop_no_state) },
5756
{ MLX5E_DECLARE_STAT(struct mlx5e_ipsec_sw_stats, ipsec_tx_drop_not_ip) },

0 commit comments

Comments
 (0)