Skip to content

Commit 2d1b69e

Browse files
Tariq ToukanSaeed Mahameed
authored andcommitted
net/mlx5: kTLS, Improve TLS params layout structures
Add explicit WQE segment structures for the TLS static and progress params. According to the HW spec, TISN is not part of the progress params context, take it out of it. Rename the control segment tisn field as it could hold either a TIS or a TIR number. Signed-off-by: Tariq Toukan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 188f0f9 commit 2d1b69e

File tree

7 files changed

+23
-13
lines changed

7 files changed

+23
-13
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ mlx5e_notify_hw(struct mlx5_wq_cyc *wq, u16 pc, void __iomem *uar_map,
182182

183183
static inline bool mlx5e_transport_inline_tx_wqe(struct mlx5_wqe_ctrl_seg *cseg)
184184
{
185-
return cseg && !!cseg->tisn;
185+
return cseg && !!cseg->tis_tir_num;
186186
}
187187

188188
static inline u8

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#define MLX5E_KTLS_PROGRESS_WQE_SZ \
2121
(offsetof(struct mlx5e_tx_wqe, tls_progress_params_ctx) + \
22-
MLX5_ST_SZ_BYTES(tls_progress_params))
22+
sizeof(struct mlx5_wqe_tls_progress_params_seg))
2323
#define MLX5E_KTLS_PROGRESS_WQEBBS \
2424
(DIV_ROUND_UP(MLX5E_KTLS_PROGRESS_WQE_SZ, MLX5_SEND_WQE_BB))
2525

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ build_static_params(struct mlx5e_umr_wqe *wqe, u16 pc, u32 sqn,
6464
cseg->qpn_ds = cpu_to_be32((sqn << MLX5_WQE_CTRL_QPN_SHIFT) |
6565
STATIC_PARAMS_DS_CNT);
6666
cseg->fm_ce_se = fence ? MLX5_FENCE_MODE_INITIATOR_SMALL : 0;
67-
cseg->tisn = cpu_to_be32(priv_tx->tisn << 8);
67+
cseg->tis_tir_num = cpu_to_be32(priv_tx->tisn << 8);
6868

6969
ucseg->flags = MLX5_UMR_INLINE;
7070
ucseg->bsf_octowords = cpu_to_be16(MLX5_ST_SZ_BYTES(tls_static_params) / 16);
@@ -75,10 +75,14 @@ build_static_params(struct mlx5e_umr_wqe *wqe, u16 pc, u32 sqn,
7575
static void
7676
fill_progress_params_ctx(void *ctx, struct mlx5e_ktls_offload_context_tx *priv_tx)
7777
{
78-
MLX5_SET(tls_progress_params, ctx, tisn, priv_tx->tisn);
79-
MLX5_SET(tls_progress_params, ctx, record_tracker_state,
78+
struct mlx5_wqe_tls_progress_params_seg *params;
79+
80+
params = ctx;
81+
82+
params->tis_tir_num = cpu_to_be32(priv_tx->tisn);
83+
MLX5_SET(tls_progress_params, params->ctx, record_tracker_state,
8084
MLX5E_TLS_PROGRESS_PARAMS_RECORD_TRACKER_STATE_START);
81-
MLX5_SET(tls_progress_params, ctx, auth_state,
85+
MLX5_SET(tls_progress_params, params->ctx, auth_state,
8286
MLX5E_TLS_PROGRESS_PARAMS_AUTH_STATE_NO_OFFLOAD);
8387
}
8488

@@ -284,7 +288,7 @@ tx_post_resync_dump(struct mlx5e_txqsq *sq, skb_frag_t *frag, u32 tisn, bool fir
284288

285289
cseg->opmod_idx_opcode = cpu_to_be32((sq->pc << 8) | MLX5_OPCODE_DUMP);
286290
cseg->qpn_ds = cpu_to_be32((sq->sqn << 8) | ds_cnt);
287-
cseg->tisn = cpu_to_be32(tisn << 8);
291+
cseg->tis_tir_num = cpu_to_be32(tisn << 8);
288292
cseg->fm_ce_se = first ? MLX5_FENCE_MODE_INITIATOR_SMALL : 0;
289293

290294
fsz = skb_frag_size(frag);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ bool mlx5e_tls_handle_tx_skb(struct net_device *netdev, struct mlx5e_txqsq *sq,
305305
void mlx5e_tls_handle_tx_wqe(struct mlx5e_txqsq *sq, struct mlx5_wqe_ctrl_seg *cseg,
306306
struct mlx5e_accel_tx_tls_state *state)
307307
{
308-
cseg->tisn = cpu_to_be32(state->tls_tisn << 8);
308+
cseg->tis_tir_num = cpu_to_be32(state->tls_tisn << 8);
309309
}
310310

311311
static int tls_update_resync_sn(struct net_device *netdev,

include/linux/mlx5/device.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,15 @@ enum {
458458
MLX5_OPC_MOD_TLS_TIR_PROGRESS_PARAMS = 0x2,
459459
};
460460

461+
struct mlx5_wqe_tls_static_params_seg {
462+
u8 ctx[MLX5_ST_SZ_BYTES(tls_static_params)];
463+
};
464+
465+
struct mlx5_wqe_tls_progress_params_seg {
466+
__be32 tis_tir_num;
467+
u8 ctx[MLX5_ST_SZ_BYTES(tls_progress_params)];
468+
};
469+
461470
enum {
462471
MLX5_SET_PORT_RESET_QKEY = 0,
463472
MLX5_SET_PORT_GUID0 = 16,

include/linux/mlx5/mlx5_ifc.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10638,16 +10638,13 @@ struct mlx5_ifc_tls_static_params_bits {
1063810638
};
1063910639

1064010640
struct mlx5_ifc_tls_progress_params_bits {
10641-
u8 reserved_at_0[0x8];
10642-
u8 tisn[0x18];
10643-
1064410641
u8 next_record_tcp_sn[0x20];
1064510642

1064610643
u8 hw_resync_tcp_sn[0x20];
1064710644

1064810645
u8 record_tracker_state[0x2];
1064910646
u8 auth_state[0x2];
10650-
u8 reserved_at_64[0x4];
10647+
u8 reserved_at_44[0x4];
1065110648
u8 hw_offset_record_number[0x18];
1065210649
};
1065310650

include/linux/mlx5/qp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ struct mlx5_wqe_ctrl_seg {
209209
__be32 general_id;
210210
__be32 imm;
211211
__be32 umr_mkey;
212-
__be32 tisn;
212+
__be32 tis_tir_num;
213213
};
214214
};
215215

0 commit comments

Comments
 (0)