Skip to content

Commit 5ad00de

Browse files
rleonSaeed Mahameed
authored andcommitted
net/mlx5e: Remove exposure of IPsec RX flow steering struct
After previous commit, which unified various IPsec creation modes, there is no need to have struct mlx5e_ipsec_rx exposed in global IPsec header. Move it to ipsec_fs.c to be placed together with already existing struct mlx5e_ipsec_tx. Fixes: 1762f13 ("net/mlx5e: Support IPsec packet offload for RX in switchdev mode") Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 94af50c commit 5ad00de

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -201,19 +201,6 @@ struct mlx5e_ipsec_miss {
201201
struct mlx5_flow_handle *rule;
202202
};
203203

204-
struct mlx5e_ipsec_rx {
205-
struct mlx5e_ipsec_ft ft;
206-
struct mlx5e_ipsec_miss pol;
207-
struct mlx5e_ipsec_miss sa;
208-
struct mlx5e_ipsec_rule status;
209-
struct mlx5e_ipsec_miss status_drop;
210-
struct mlx5_fc *status_drop_cnt;
211-
struct mlx5e_ipsec_fc *fc;
212-
struct mlx5_fs_chains *chains;
213-
u8 allow_tunnel_mode : 1;
214-
struct xarray ipsec_obj_id_map;
215-
};
216-
217204
struct mlx5e_ipsec_tx_create_attr {
218205
int prio;
219206
int pol_level;
@@ -248,6 +235,7 @@ struct mlx5e_ipsec {
248235
struct mlx5_ipsec_fs *roce;
249236
u8 is_uplink_rep: 1;
250237
struct mlx5e_ipsec_mpv_work mpv_work;
238+
struct xarray ipsec_obj_id_map;
251239
};
252240

253241
struct mlx5e_ipsec_esn_state {

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ struct mlx5e_ipsec_tx {
3232
u8 allow_tunnel_mode : 1;
3333
};
3434

35+
struct mlx5e_ipsec_rx {
36+
struct mlx5e_ipsec_ft ft;
37+
struct mlx5e_ipsec_miss pol;
38+
struct mlx5e_ipsec_miss sa;
39+
struct mlx5e_ipsec_rule status;
40+
struct mlx5e_ipsec_miss status_drop;
41+
struct mlx5_fc *status_drop_cnt;
42+
struct mlx5e_ipsec_fc *fc;
43+
struct mlx5_fs_chains *chains;
44+
u8 allow_tunnel_mode : 1;
45+
};
46+
3547
/* IPsec RX flow steering */
3648
static enum mlx5_traffic_types family2tt(u32 family)
3749
{
@@ -2052,7 +2064,7 @@ void mlx5e_accel_ipsec_fs_cleanup(struct mlx5e_ipsec *ipsec)
20522064
kfree(ipsec->rx_ipv6);
20532065

20542066
if (ipsec->is_uplink_rep) {
2055-
xa_destroy(&ipsec->rx_esw->ipsec_obj_id_map);
2067+
xa_destroy(&ipsec->ipsec_obj_id_map);
20562068

20572069
mutex_destroy(&ipsec->tx_esw->ft.mutex);
20582070
WARN_ON(ipsec->tx_esw->ft.refcnt);
@@ -2115,7 +2127,7 @@ int mlx5e_accel_ipsec_fs_init(struct mlx5e_ipsec *ipsec,
21152127
mutex_init(&ipsec->tx_esw->ft.mutex);
21162128
mutex_init(&ipsec->rx_esw->ft.mutex);
21172129
ipsec->tx_esw->ns = ns_esw;
2118-
xa_init_flags(&ipsec->rx_esw->ipsec_obj_id_map, XA_FLAGS_ALLOC1);
2130+
xa_init_flags(&ipsec->ipsec_obj_id_map, XA_FLAGS_ALLOC1);
21192131
} else if (mlx5_ipsec_device_caps(mdev) & MLX5_IPSEC_CAP_ROCE) {
21202132
ipsec->roce = mlx5_ipsec_fs_roce_init(mdev, devcom);
21212133
} else {

drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ int mlx5_esw_ipsec_rx_setup_modify_header(struct mlx5e_ipsec_sa_entry *sa_entry,
5050
u32 mapped_id;
5151
int err;
5252

53-
err = xa_alloc_bh(&ipsec->rx_esw->ipsec_obj_id_map, &mapped_id,
53+
err = xa_alloc_bh(&ipsec->ipsec_obj_id_map, &mapped_id,
5454
xa_mk_value(sa_entry->ipsec_obj_id),
5555
XA_LIMIT(1, ESW_IPSEC_RX_MAPPED_ID_MASK), 0);
5656
if (err)
@@ -81,7 +81,7 @@ int mlx5_esw_ipsec_rx_setup_modify_header(struct mlx5e_ipsec_sa_entry *sa_entry,
8181
return 0;
8282

8383
err_header_alloc:
84-
xa_erase_bh(&ipsec->rx_esw->ipsec_obj_id_map, mapped_id);
84+
xa_erase_bh(&ipsec->ipsec_obj_id_map, mapped_id);
8585
return err;
8686
}
8787

@@ -90,7 +90,7 @@ void mlx5_esw_ipsec_rx_id_mapping_remove(struct mlx5e_ipsec_sa_entry *sa_entry)
9090
struct mlx5e_ipsec *ipsec = sa_entry->ipsec;
9191

9292
if (sa_entry->rx_mapped_id)
93-
xa_erase_bh(&ipsec->rx_esw->ipsec_obj_id_map,
93+
xa_erase_bh(&ipsec->ipsec_obj_id_map,
9494
sa_entry->rx_mapped_id);
9595
}
9696

@@ -100,7 +100,7 @@ int mlx5_esw_ipsec_rx_ipsec_obj_id_search(struct mlx5e_priv *priv, u32 id,
100100
struct mlx5e_ipsec *ipsec = priv->ipsec;
101101
void *val;
102102

103-
val = xa_load(&ipsec->rx_esw->ipsec_obj_id_map, id);
103+
val = xa_load(&ipsec->ipsec_obj_id_map, id);
104104
if (!val)
105105
return -ENOENT;
106106

0 commit comments

Comments
 (0)