Skip to content

Commit 37badd1

Browse files
Tariq Toukandavem330
authored andcommitted
net/mlx5e: Introduce a fenced NOP WQE posting function
Similar to the existing mlx5e_post_nop(), but marks a fence in the WQE control segment. Added as a separate new function to not hurt the performance of the common case. To be used in a downstream patch of the series. Signed-off-by: Tariq Toukan <[email protected]> Reviewed-by: Boris Pismenny <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2b257a6 commit 37badd1

File tree

1 file changed

+18
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,24 @@ mlx5e_post_nop(struct mlx5_wq_cyc *wq, u32 sqn, u16 *pc)
5858
return wqe;
5959
}
6060

61+
static inline struct mlx5e_tx_wqe *
62+
mlx5e_post_nop_fence(struct mlx5_wq_cyc *wq, u32 sqn, u16 *pc)
63+
{
64+
u16 pi = mlx5_wq_cyc_ctr2ix(wq, *pc);
65+
struct mlx5e_tx_wqe *wqe = mlx5_wq_cyc_get_wqe(wq, pi);
66+
struct mlx5_wqe_ctrl_seg *cseg = &wqe->ctrl;
67+
68+
memset(cseg, 0, sizeof(*cseg));
69+
70+
cseg->opmod_idx_opcode = cpu_to_be32((*pc << 8) | MLX5_OPCODE_NOP);
71+
cseg->qpn_ds = cpu_to_be32((sqn << 8) | 0x01);
72+
cseg->fm_ce_se = MLX5_FENCE_MODE_INITIATOR_SMALL;
73+
74+
(*pc)++;
75+
76+
return wqe;
77+
}
78+
6179
static inline void
6280
mlx5e_fill_sq_frag_edge(struct mlx5e_txqsq *sq, struct mlx5_wq_cyc *wq,
6381
u16 pi, u16 nnops)

0 commit comments

Comments
 (0)