Lines Matching refs:wq
36 static inline unsigned int vnic_wq_copy_desc_avail(struct vnic_wq_copy *wq) in vnic_wq_copy_desc_avail() argument
38 return wq->ring.desc_avail; in vnic_wq_copy_desc_avail()
41 static inline unsigned int vnic_wq_copy_desc_in_use(struct vnic_wq_copy *wq) in vnic_wq_copy_desc_in_use() argument
43 return wq->ring.desc_count - 1 - wq->ring.desc_avail; in vnic_wq_copy_desc_in_use()
46 static inline void *vnic_wq_copy_next_desc(struct vnic_wq_copy *wq) in vnic_wq_copy_next_desc() argument
48 struct fcpio_host_req *desc = wq->ring.descs; in vnic_wq_copy_next_desc()
49 return &desc[wq->to_use_index]; in vnic_wq_copy_next_desc()
52 static inline void vnic_wq_copy_post(struct vnic_wq_copy *wq) in vnic_wq_copy_post() argument
55 ((wq->to_use_index + 1) == wq->ring.desc_count) ? in vnic_wq_copy_post()
56 (wq->to_use_index = 0) : (wq->to_use_index++); in vnic_wq_copy_post()
57 wq->ring.desc_avail--; in vnic_wq_copy_post()
66 iowrite32(wq->to_use_index, &wq->ctrl->posted_index); in vnic_wq_copy_post()
69 static inline void vnic_wq_copy_desc_process(struct vnic_wq_copy *wq, u16 index) in vnic_wq_copy_desc_process() argument
73 if (wq->to_clean_index <= index) in vnic_wq_copy_desc_process()
74 cnt = (index - wq->to_clean_index) + 1; in vnic_wq_copy_desc_process()
76 cnt = wq->ring.desc_count - wq->to_clean_index + index + 1; in vnic_wq_copy_desc_process()
78 wq->to_clean_index = ((index + 1) % wq->ring.desc_count); in vnic_wq_copy_desc_process()
79 wq->ring.desc_avail += cnt; in vnic_wq_copy_desc_process()
83 static inline void vnic_wq_copy_service(struct vnic_wq_copy *wq, in vnic_wq_copy_service() argument
85 void (*q_service)(struct vnic_wq_copy *wq, in vnic_wq_copy_service() argument
88 struct fcpio_host_req *wq_desc = wq->ring.descs; in vnic_wq_copy_service()
94 (*q_service)(wq, &wq_desc[wq->to_clean_index]); in vnic_wq_copy_service()
96 wq->ring.desc_avail++; in vnic_wq_copy_service()
98 curr_index = wq->to_clean_index; in vnic_wq_copy_service()
103 ((wq->to_clean_index + 1) == wq->ring.desc_count) ? in vnic_wq_copy_service()
104 (wq->to_clean_index = 0) : (wq->to_clean_index++); in vnic_wq_copy_service()
111 (wq->to_clean_index == wq->to_use_index)) in vnic_wq_copy_service()
116 void vnic_wq_copy_enable(struct vnic_wq_copy *wq);
117 int vnic_wq_copy_disable(struct vnic_wq_copy *wq);
118 void vnic_wq_copy_free(struct vnic_wq_copy *wq);
119 int vnic_wq_copy_alloc(struct vnic_dev *vdev, struct vnic_wq_copy *wq,
121 void vnic_wq_copy_init(struct vnic_wq_copy *wq, unsigned int cq_index,
124 void vnic_wq_copy_clean(struct vnic_wq_copy *wq,
125 void (*q_clean)(struct vnic_wq_copy *wq,