Skip to content

Commit 625dff2

Browse files
dtatuleaSaeed Mahameed
authored andcommitted
net/mlx5e: RX, Change wqe last_in_page field from bool to bit flags
Change the bool flag to a bitfield as we'll use it in a downstream patch in the series to add signaling about skipping a fragment release. Signed-off-by: Dragos Tatulea <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 4c2a132 commit 625dff2

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,13 +605,17 @@ struct mlx5e_frag_page {
605605
u16 frags;
606606
};
607607

608+
enum mlx5e_wqe_frag_flag {
609+
MLX5E_WQE_FRAG_LAST_IN_PAGE,
610+
};
611+
608612
struct mlx5e_wqe_frag_info {
609613
union {
610614
struct mlx5e_frag_page *frag_page;
611615
struct xdp_buff **xskp;
612616
};
613617
u32 offset;
614-
bool last_in_page;
618+
u8 flags;
615619
};
616620

617621
union mlx5e_alloc_units {

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ static void mlx5e_init_frags_partition(struct mlx5e_rq *rq)
532532
next_frag.frag_page++;
533533
next_frag.offset = 0;
534534
if (prev)
535-
prev->last_in_page = true;
535+
prev->flags |= BIT(MLX5E_WQE_FRAG_LAST_IN_PAGE);
536536
}
537537
*frag = next_frag;
538538

@@ -543,7 +543,7 @@ static void mlx5e_init_frags_partition(struct mlx5e_rq *rq)
543543
}
544544

545545
if (prev)
546-
prev->last_in_page = true;
546+
prev->flags |= BIT(MLX5E_WQE_FRAG_LAST_IN_PAGE);
547547
}
548548

549549
static void mlx5e_init_xsk_buffs(struct mlx5e_rq *rq)

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ static inline void mlx5e_put_rx_frag(struct mlx5e_rq *rq,
323323
struct mlx5e_wqe_frag_info *frag,
324324
bool recycle)
325325
{
326-
if (frag->last_in_page)
326+
if (frag->flags & BIT(MLX5E_WQE_FRAG_LAST_IN_PAGE))
327327
mlx5e_page_release_fragmented(rq, frag->frag_page, recycle);
328328
}
329329

0 commit comments

Comments
 (0)