Skip to content

Commit 769619e

Browse files
Tariq ToukanSaeed Mahameed
authored andcommitted
net/mlx5: WQ, Move short getters into header file
Move short Work Queue API getter functions into the WQ header file. Signed-off-by: Tariq Toukan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 130c7b4 commit 769619e

File tree

2 files changed

+20
-24
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

2 files changed

+20
-24
lines changed

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,6 @@
3434
#include "wq.h"
3535
#include "mlx5_core.h"
3636

37-
u32 mlx5_wq_cyc_get_size(struct mlx5_wq_cyc *wq)
38-
{
39-
return (u32)wq->fbc.sz_m1 + 1;
40-
}
41-
42-
u32 mlx5_cqwq_get_size(struct mlx5_cqwq *wq)
43-
{
44-
return wq->fbc.sz_m1 + 1;
45-
}
46-
47-
u8 mlx5_cqwq_get_log_stride_size(struct mlx5_cqwq *wq)
48-
{
49-
return wq->fbc.log_stride;
50-
}
51-
52-
u32 mlx5_wq_ll_get_size(struct mlx5_wq_ll *wq)
53-
{
54-
return (u32)wq->fbc.sz_m1 + 1;
55-
}
56-
5737
static u32 wq_get_byte_sz(u8 log_sz, u8 log_stride)
5838
{
5939
return ((u32)1 << log_sz) << log_stride;

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ int mlx5_wq_cyc_create(struct mlx5_core_dev *mdev, struct mlx5_wq_param *param,
8080
void *wqc, struct mlx5_wq_cyc *wq,
8181
struct mlx5_wq_ctrl *wq_ctrl);
8282
void mlx5_wq_cyc_wqe_dump(struct mlx5_wq_cyc *wq, u16 ix, u8 nstrides);
83-
u32 mlx5_wq_cyc_get_size(struct mlx5_wq_cyc *wq);
8483

8584
int mlx5_wq_qp_create(struct mlx5_core_dev *mdev, struct mlx5_wq_param *param,
8685
void *qpc, struct mlx5_wq_qp *wq,
@@ -89,16 +88,18 @@ int mlx5_wq_qp_create(struct mlx5_core_dev *mdev, struct mlx5_wq_param *param,
8988
int mlx5_cqwq_create(struct mlx5_core_dev *mdev, struct mlx5_wq_param *param,
9089
void *cqc, struct mlx5_cqwq *wq,
9190
struct mlx5_wq_ctrl *wq_ctrl);
92-
u32 mlx5_cqwq_get_size(struct mlx5_cqwq *wq);
93-
u8 mlx5_cqwq_get_log_stride_size(struct mlx5_cqwq *wq);
9491

9592
int mlx5_wq_ll_create(struct mlx5_core_dev *mdev, struct mlx5_wq_param *param,
9693
void *wqc, struct mlx5_wq_ll *wq,
9794
struct mlx5_wq_ctrl *wq_ctrl);
98-
u32 mlx5_wq_ll_get_size(struct mlx5_wq_ll *wq);
9995

10096
void mlx5_wq_destroy(struct mlx5_wq_ctrl *wq_ctrl);
10197

98+
static inline u32 mlx5_wq_cyc_get_size(struct mlx5_wq_cyc *wq)
99+
{
100+
return (u32)wq->fbc.sz_m1 + 1;
101+
}
102+
102103
static inline int mlx5_wq_cyc_is_full(struct mlx5_wq_cyc *wq)
103104
{
104105
return wq->cur_sz == wq->sz;
@@ -169,6 +170,16 @@ static inline int mlx5_wq_cyc_cc_bigger(u16 cc1, u16 cc2)
169170
return !equal && !smaller;
170171
}
171172

173+
static inline u32 mlx5_cqwq_get_size(struct mlx5_cqwq *wq)
174+
{
175+
return wq->fbc.sz_m1 + 1;
176+
}
177+
178+
static inline u8 mlx5_cqwq_get_log_stride_size(struct mlx5_cqwq *wq)
179+
{
180+
return wq->fbc.log_stride;
181+
}
182+
172183
static inline u32 mlx5_cqwq_ctr2ix(struct mlx5_cqwq *wq, u32 ctr)
173184
{
174185
return ctr & wq->fbc.sz_m1;
@@ -225,6 +236,11 @@ static inline struct mlx5_cqe64 *mlx5_cqwq_get_cqe(struct mlx5_cqwq *wq)
225236
return cqe;
226237
}
227238

239+
static inline u32 mlx5_wq_ll_get_size(struct mlx5_wq_ll *wq)
240+
{
241+
return (u32)wq->fbc.sz_m1 + 1;
242+
}
243+
228244
static inline int mlx5_wq_ll_is_full(struct mlx5_wq_ll *wq)
229245
{
230246
return wq->cur_sz == wq->fbc.sz_m1;

0 commit comments

Comments
 (0)