Lines Matching refs:wq
24 static inline unsigned int vnic_wq_copy_desc_avail(struct vnic_wq_copy *wq) in vnic_wq_copy_desc_avail() argument
26 return wq->ring.desc_avail; in vnic_wq_copy_desc_avail()
29 static inline unsigned int vnic_wq_copy_desc_in_use(struct vnic_wq_copy *wq) in vnic_wq_copy_desc_in_use() argument
31 return wq->ring.desc_count - 1 - wq->ring.desc_avail; in vnic_wq_copy_desc_in_use()
34 static inline void *vnic_wq_copy_next_desc(struct vnic_wq_copy *wq) in vnic_wq_copy_next_desc() argument
36 struct fcpio_host_req *desc = wq->ring.descs; in vnic_wq_copy_next_desc()
37 return &desc[wq->to_use_index]; in vnic_wq_copy_next_desc()
40 static inline void vnic_wq_copy_post(struct vnic_wq_copy *wq) in vnic_wq_copy_post() argument
43 ((wq->to_use_index + 1) == wq->ring.desc_count) ? in vnic_wq_copy_post()
44 (wq->to_use_index = 0) : (wq->to_use_index++); in vnic_wq_copy_post()
45 wq->ring.desc_avail--; in vnic_wq_copy_post()
54 iowrite32(wq->to_use_index, &wq->ctrl->posted_index); in vnic_wq_copy_post()
57 static inline void vnic_wq_copy_desc_process(struct vnic_wq_copy *wq, u16 index) in vnic_wq_copy_desc_process() argument
61 if (wq->to_clean_index <= index) in vnic_wq_copy_desc_process()
62 cnt = (index - wq->to_clean_index) + 1; in vnic_wq_copy_desc_process()
64 cnt = wq->ring.desc_count - wq->to_clean_index + index + 1; in vnic_wq_copy_desc_process()
66 wq->to_clean_index = ((index + 1) % wq->ring.desc_count); in vnic_wq_copy_desc_process()
67 wq->ring.desc_avail += cnt; in vnic_wq_copy_desc_process()
71 static inline void vnic_wq_copy_service(struct vnic_wq_copy *wq, in vnic_wq_copy_service() argument
73 void (*q_service)(struct vnic_wq_copy *wq, in vnic_wq_copy_service() argument
76 struct fcpio_host_req *wq_desc = wq->ring.descs; in vnic_wq_copy_service()
82 (*q_service)(wq, &wq_desc[wq->to_clean_index]); in vnic_wq_copy_service()
84 wq->ring.desc_avail++; in vnic_wq_copy_service()
86 curr_index = wq->to_clean_index; in vnic_wq_copy_service()
91 ((wq->to_clean_index + 1) == wq->ring.desc_count) ? in vnic_wq_copy_service()
92 (wq->to_clean_index = 0) : (wq->to_clean_index++); in vnic_wq_copy_service()
99 (wq->to_clean_index == wq->to_use_index)) in vnic_wq_copy_service()
104 void vnic_wq_copy_enable(struct vnic_wq_copy *wq);
105 int vnic_wq_copy_disable(struct vnic_wq_copy *wq);
106 void vnic_wq_copy_free(struct vnic_wq_copy *wq);
107 int vnic_wq_copy_alloc(struct vnic_dev *vdev, struct vnic_wq_copy *wq,
109 void vnic_wq_copy_init(struct vnic_wq_copy *wq, unsigned int cq_index,
112 void vnic_wq_copy_clean(struct vnic_wq_copy *wq,
113 void (*q_clean)(struct vnic_wq_copy *wq,