Lines Matching refs:wq

80 		       void *wqc, struct mlx5_wq_cyc *wq,
82 void mlx5_wq_cyc_wqe_dump(struct mlx5_wq_cyc *wq, u16 ix, u8 nstrides);
83 void mlx5_wq_cyc_reset(struct mlx5_wq_cyc *wq);
86 void *qpc, struct mlx5_wq_qp *wq,
90 void *cqc, struct mlx5_cqwq *wq,
94 void *wqc, struct mlx5_wq_ll *wq,
96 void mlx5_wq_ll_reset(struct mlx5_wq_ll *wq);
100 static inline u32 mlx5_wq_cyc_get_size(struct mlx5_wq_cyc *wq)
102 return (u32)wq->fbc.sz_m1 + 1;
105 static inline int mlx5_wq_cyc_is_full(struct mlx5_wq_cyc *wq)
107 return wq->cur_sz == wq->sz;
110 static inline int mlx5_wq_cyc_missing(struct mlx5_wq_cyc *wq)
112 return wq->sz - wq->cur_sz;
115 static inline int mlx5_wq_cyc_is_empty(struct mlx5_wq_cyc *wq)
117 return !wq->cur_sz;
120 static inline void mlx5_wq_cyc_push(struct mlx5_wq_cyc *wq)
122 wq->wqe_ctr++;
123 wq->cur_sz++;
126 static inline void mlx5_wq_cyc_push_n(struct mlx5_wq_cyc *wq, u16 n)
128 wq->wqe_ctr += n;
129 wq->cur_sz += n;
132 static inline void mlx5_wq_cyc_pop(struct mlx5_wq_cyc *wq)
134 wq->cur_sz--;
137 static inline void mlx5_wq_cyc_update_db_record(struct mlx5_wq_cyc *wq)
139 *wq->db = cpu_to_be32(wq->wqe_ctr);
142 static inline u16 mlx5_wq_cyc_ctr2ix(struct mlx5_wq_cyc *wq, u16 ctr)
144 return ctr & wq->fbc.sz_m1;
147 static inline u16 mlx5_wq_cyc_get_head(struct mlx5_wq_cyc *wq)
149 return mlx5_wq_cyc_ctr2ix(wq, wq->wqe_ctr);
152 static inline u16 mlx5_wq_cyc_get_tail(struct mlx5_wq_cyc *wq)
154 return mlx5_wq_cyc_ctr2ix(wq, wq->wqe_ctr - wq->cur_sz);
157 static inline void *mlx5_wq_cyc_get_wqe(struct mlx5_wq_cyc *wq, u16 ix)
159 return mlx5_frag_buf_get_wqe(&wq->fbc, ix);
162 static inline u16 mlx5_wq_cyc_get_contig_wqebbs(struct mlx5_wq_cyc *wq, u16 ix)
164 return mlx5_frag_buf_get_idx_last_contig_stride(&wq->fbc, ix) - ix + 1;
175 static inline u16 mlx5_wq_cyc_get_counter(struct mlx5_wq_cyc *wq)
177 return wq->wqe_ctr;
180 static inline u32 mlx5_cqwq_get_size(struct mlx5_cqwq *wq)
182 return wq->fbc.sz_m1 + 1;
185 static inline u8 mlx5_cqwq_get_log_stride_size(struct mlx5_cqwq *wq)
187 return wq->fbc.log_stride;
190 static inline u32 mlx5_cqwq_ctr2ix(struct mlx5_cqwq *wq, u32 ctr)
192 return ctr & wq->fbc.sz_m1;
195 static inline u32 mlx5_cqwq_get_ci(struct mlx5_cqwq *wq)
197 return mlx5_cqwq_ctr2ix(wq, wq->cc);
200 static inline struct mlx5_cqe64 *mlx5_cqwq_get_wqe(struct mlx5_cqwq *wq, u32 ix)
202 struct mlx5_cqe64 *cqe = mlx5_frag_buf_get_wqe(&wq->fbc, ix);
205 cqe += wq->fbc.log_stride == 7;
210 static inline u32 mlx5_cqwq_get_ctr_wrap_cnt(struct mlx5_cqwq *wq, u32 ctr)
212 return ctr >> wq->fbc.log_sz;
215 static inline u32 mlx5_cqwq_get_wrap_cnt(struct mlx5_cqwq *wq)
217 return mlx5_cqwq_get_ctr_wrap_cnt(wq, wq->cc);
220 static inline void mlx5_cqwq_pop(struct mlx5_cqwq *wq)
222 wq->cc++;
225 static inline void mlx5_cqwq_update_db_record(struct mlx5_cqwq *wq)
227 *wq->db = cpu_to_be32(wq->cc & 0xffffff);
230 static inline struct mlx5_cqe64 *mlx5_cqwq_get_cqe(struct mlx5_cqwq *wq)
232 u32 ci = mlx5_cqwq_get_ci(wq);
233 struct mlx5_cqe64 *cqe = mlx5_cqwq_get_wqe(wq, ci);
235 u8 sw_ownership_val = mlx5_cqwq_get_wrap_cnt(wq) & 1;
247 struct mlx5_cqe64 *mlx5_cqwq_get_cqe_enahnced_comp(struct mlx5_cqwq *wq)
249 u8 sw_validity_iteration_count = mlx5_cqwq_get_wrap_cnt(wq) & 0xff;
250 u32 ci = mlx5_cqwq_get_ci(wq);
253 cqe = mlx5_cqwq_get_wqe(wq, ci);
263 static inline u32 mlx5_wq_ll_get_size(struct mlx5_wq_ll *wq)
265 return (u32)wq->fbc.sz_m1 + 1;
268 static inline int mlx5_wq_ll_is_full(struct mlx5_wq_ll *wq)
270 return wq->cur_sz == wq->fbc.sz_m1;
273 static inline int mlx5_wq_ll_is_empty(struct mlx5_wq_ll *wq)
275 return !wq->cur_sz;
278 static inline int mlx5_wq_ll_missing(struct mlx5_wq_ll *wq)
280 return wq->fbc.sz_m1 - wq->cur_sz;
283 static inline void *mlx5_wq_ll_get_wqe(struct mlx5_wq_ll *wq, u16 ix)
285 return mlx5_frag_buf_get_wqe(&wq->fbc, ix);
288 static inline u16 mlx5_wq_ll_get_wqe_next_ix(struct mlx5_wq_ll *wq, u16 ix)
290 struct mlx5_wqe_srq_next_seg *wqe = mlx5_wq_ll_get_wqe(wq, ix);
295 static inline void mlx5_wq_ll_push(struct mlx5_wq_ll *wq, u16 head_next)
297 wq->head = head_next;
298 wq->wqe_ctr++;
299 wq->cur_sz++;
302 static inline void mlx5_wq_ll_pop(struct mlx5_wq_ll *wq, __be16 ix,
305 *wq->tail_next = ix;
306 wq->tail_next = next_tail_next;
307 wq->cur_sz--;
310 static inline void mlx5_wq_ll_update_db_record(struct mlx5_wq_ll *wq)
312 *wq->db = cpu_to_be32(wq->wqe_ctr);
315 static inline u16 mlx5_wq_ll_get_head(struct mlx5_wq_ll *wq)
317 return wq->head;
320 static inline u16 mlx5_wq_ll_get_counter(struct mlx5_wq_ll *wq)
322 return wq->wqe_ctr;