• Home
  • Raw
  • Download

Lines Matching refs:sq

59 #define SQ_DB_ADDR(sq, pi)      ((u64 *)((sq)->db_base) + SQ_DB_PI_LOW(pi))  argument
61 #define SQ_MASKED_IDX(sq, idx) ((idx) & (sq)->wq->mask) argument
93 struct hinic_sq *sq, u16 global_qid) in hinic_sq_prepare_ctxt() argument
100 wq = sq->wq; in hinic_sq_prepare_ctxt()
214 static int alloc_sq_skb_arr(struct hinic_sq *sq) in alloc_sq_skb_arr() argument
216 struct hinic_wq *wq = sq->wq; in alloc_sq_skb_arr()
219 skb_arr_size = wq->q_depth * sizeof(*sq->saved_skb); in alloc_sq_skb_arr()
220 sq->saved_skb = vzalloc(skb_arr_size); in alloc_sq_skb_arr()
221 if (!sq->saved_skb) in alloc_sq_skb_arr()
231 static void free_sq_skb_arr(struct hinic_sq *sq) in free_sq_skb_arr() argument
233 vfree(sq->saved_skb); in free_sq_skb_arr()
276 int hinic_init_sq(struct hinic_sq *sq, struct hinic_hwif *hwif, in hinic_init_sq() argument
281 sq->hwif = hwif; in hinic_init_sq()
283 sq->wq = wq; in hinic_init_sq()
285 sq->irq = entry->vector; in hinic_init_sq()
286 sq->msix_entry = entry->entry; in hinic_init_sq()
288 sq->hw_ci_addr = ci_addr; in hinic_init_sq()
289 sq->hw_ci_dma_addr = ci_dma_addr; in hinic_init_sq()
291 sq->db_base = db_base + SQ_DB_OFF; in hinic_init_sq()
293 return alloc_sq_skb_arr(sq); in hinic_init_sq()
300 void hinic_clean_sq(struct hinic_sq *sq) in hinic_clean_sq() argument
302 free_sq_skb_arr(sq); in hinic_clean_sq()
451 int hinic_get_sq_free_wqebbs(struct hinic_sq *sq) in hinic_get_sq_free_wqebbs() argument
453 struct hinic_wq *wq = sq->wq; in hinic_get_sq_free_wqebbs()
592 void hinic_sq_prepare_wqe(struct hinic_sq *sq, u16 prod_idx, in hinic_sq_prepare_wqe() argument
614 static u32 sq_prepare_db(struct hinic_sq *sq, u16 prod_idx, unsigned int cos) in sq_prepare_db() argument
616 struct hinic_qp *qp = container_of(sq, struct hinic_qp, sq); in sq_prepare_db()
617 u8 hi_prod_idx = SQ_DB_PI_HI(SQ_MASKED_IDX(sq, prod_idx)); in sq_prepare_db()
634 void hinic_sq_write_db(struct hinic_sq *sq, u16 prod_idx, unsigned int wqe_size, in hinic_sq_write_db() argument
637 struct hinic_wq *wq = sq->wq; in hinic_sq_write_db()
644 writel(sq_prepare_db(sq, prod_idx, cos), SQ_DB_ADDR(sq, prod_idx)); in hinic_sq_write_db()
655 struct hinic_sq_wqe *hinic_sq_get_wqe(struct hinic_sq *sq, in hinic_sq_get_wqe() argument
658 struct hinic_hw_wqe *hw_wqe = hinic_get_wqe(sq->wq, wqe_size, in hinic_sq_get_wqe()
672 void hinic_sq_return_wqe(struct hinic_sq *sq, unsigned int wqe_size) in hinic_sq_return_wqe() argument
674 hinic_return_wqe(sq->wq, wqe_size); in hinic_sq_return_wqe()
685 void hinic_sq_write_wqe(struct hinic_sq *sq, u16 prod_idx, in hinic_sq_write_wqe() argument
691 sq->saved_skb[prod_idx] = skb; in hinic_sq_write_wqe()
696 hinic_write_wqe(sq->wq, hw_wqe, wqe_size); in hinic_sq_write_wqe()
709 struct hinic_sq_wqe *hinic_sq_read_wqebb(struct hinic_sq *sq, in hinic_sq_read_wqebb() argument
720 hw_wqe = hinic_read_wqe(sq->wq, sizeof(*ctrl), cons_idx); in hinic_sq_read_wqebb()
724 *skb = sq->saved_skb[*cons_idx]; in hinic_sq_read_wqebb()
733 *wqe_size = ALIGN(*wqe_size, sq->wq->wqebb_size); in hinic_sq_read_wqebb()
747 struct hinic_sq_wqe *hinic_sq_read_wqe(struct hinic_sq *sq, in hinic_sq_read_wqe() argument
753 hw_wqe = hinic_read_wqe(sq->wq, wqe_size, cons_idx); in hinic_sq_read_wqe()
754 *skb = sq->saved_skb[*cons_idx]; in hinic_sq_read_wqe()
764 void hinic_sq_put_wqe(struct hinic_sq *sq, unsigned int wqe_size) in hinic_sq_put_wqe() argument
766 hinic_put_wqe(sq->wq, wqe_size); in hinic_sq_put_wqe()