Home
last modified time | relevance | path

Searched full:wq (Results 1 – 25 of 666) sorted by relevance

12345678910>>...27

/linux/drivers/net/ethernet/huawei/hinic/
H A Dhinic_hw_wq.c34 #define WQ_SIZE(wq) ((wq)->q_depth * (wq)->wqebb_size) argument
44 #define WQ_BASE_VADDR(wqs, wq) \ argument
45 ((void *)((wqs)->page_vaddr[(wq)->page_idx]) \
46 + (wq)->block_idx * WQ_BLOCK_SIZE)
48 #define WQ_BASE_PADDR(wqs, wq) \ argument
49 ((wqs)->page_paddr[(wq)->page_idx] \
50 + (wq)->block_idx * WQ_BLOCK_SIZE)
52 #define WQ_BASE_ADDR(wqs, wq) \ argument
53 ((void *)((wqs)->shadow_page_vaddr[(wq)->page_idx]) \
54 + (wq)->block_idx * WQ_BLOCK_SIZE)
[all …]
/linux/drivers/scsi/fnic/
H A Dvnic_wq.c16 static int vnic_wq_get_ctrl(struct vnic_dev *vdev, struct vnic_wq *wq, in vnic_wq_get_ctrl() argument
19 wq->ctrl = vnic_dev_get_res(vdev, res_type, index); in vnic_wq_get_ctrl()
21 if (!wq->ctrl) in vnic_wq_get_ctrl()
28 static int vnic_wq_alloc_ring(struct vnic_dev *vdev, struct vnic_wq *wq, in vnic_wq_alloc_ring() argument
31 return vnic_dev_alloc_desc_ring(vdev, &wq->ring, desc_count, desc_size); in vnic_wq_alloc_ring()
35 static int vnic_wq_alloc_bufs(struct vnic_wq *wq) in vnic_wq_alloc_bufs() argument
38 unsigned int i, j, count = wq->ring.desc_count; in vnic_wq_alloc_bufs()
42 wq->bufs[i] = kzalloc(VNIC_WQ_BUF_BLK_SZ, GFP_ATOMIC); in vnic_wq_alloc_bufs()
43 if (!wq->bufs[i]) { in vnic_wq_alloc_bufs()
50 buf = wq->bufs[i]; in vnic_wq_alloc_bufs()
[all …]
H A Dvnic_wq_copy.h24 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()
[all …]
H A Dvnic_wq_copy.c13 void vnic_wq_copy_enable(struct vnic_wq_copy *wq) in vnic_wq_copy_enable() argument
15 iowrite32(1, &wq->ctrl->enable); in vnic_wq_copy_enable()
18 int vnic_wq_copy_disable(struct vnic_wq_copy *wq) in vnic_wq_copy_disable() argument
22 iowrite32(0, &wq->ctrl->enable); in vnic_wq_copy_disable()
26 if (!(ioread32(&wq->ctrl->running))) in vnic_wq_copy_disable()
31 printk(KERN_ERR "Failed to disable Copy WQ[%d]," in vnic_wq_copy_disable()
33 wq->index, ioread32(&wq->ctrl->fetch_index), in vnic_wq_copy_disable()
34 ioread32(&wq->ctrl->posted_index)); in vnic_wq_copy_disable()
39 void vnic_wq_copy_clean(struct vnic_wq_copy *wq, in vnic_wq_copy_clean() argument
40 void (*q_clean)(struct vnic_wq_copy *wq, in vnic_wq_copy_clean() argument
[all …]
H A Dvnic_wq.h86 static inline unsigned int vnic_wq_desc_avail(struct vnic_wq *wq) in vnic_wq_desc_avail() argument
89 return wq->ring.desc_avail; in vnic_wq_desc_avail()
92 static inline unsigned int vnic_wq_desc_used(struct vnic_wq *wq) in vnic_wq_desc_used() argument
95 return wq->ring.desc_count - wq->ring.desc_avail - 1; in vnic_wq_desc_used()
98 static inline void *vnic_wq_next_desc(struct vnic_wq *wq) in vnic_wq_next_desc() argument
100 return wq->to_use->desc; in vnic_wq_next_desc()
103 static inline void vnic_wq_post(struct vnic_wq *wq, in vnic_wq_post() argument
107 struct vnic_wq_buf *buf = wq->to_use; in vnic_wq_post()
122 iowrite32(buf->index, &wq->ctrl->posted_index); in vnic_wq_post()
124 wq->to_use = buf; in vnic_wq_post()
[all …]
/linux/drivers/net/ethernet/cisco/enic/
H A Dvnic_wq.c18 static int vnic_wq_alloc_bufs(struct vnic_wq *wq) in vnic_wq_alloc_bufs() argument
21 unsigned int i, j, count = wq->ring.desc_count; in vnic_wq_alloc_bufs()
25 wq->bufs[i] = kzalloc(VNIC_WQ_BUF_BLK_SZ(count), GFP_KERNEL); in vnic_wq_alloc_bufs()
26 if (!wq->bufs[i]) in vnic_wq_alloc_bufs()
31 buf = wq->bufs[i]; in vnic_wq_alloc_bufs()
34 buf->desc = (u8 *)wq->ring.descs + in vnic_wq_alloc_bufs()
35 wq->ring.desc_size * buf->index; in vnic_wq_alloc_bufs()
37 buf->next = wq->bufs[0]; in vnic_wq_alloc_bufs()
41 buf->next = wq->bufs[i + 1]; in vnic_wq_alloc_bufs()
51 wq->to_use = wq->to_clean = wq->bufs[0]; in vnic_wq_alloc_bufs()
[all …]
H A Dvnic_wq.h86 struct vnic_wq wq; member
90 static inline unsigned int vnic_wq_desc_avail(struct vnic_wq *wq) in vnic_wq_desc_avail() argument
93 return wq->ring.desc_avail; in vnic_wq_desc_avail()
96 static inline unsigned int vnic_wq_desc_used(struct vnic_wq *wq) in vnic_wq_desc_used() argument
99 return wq->ring.desc_count - wq->ring.desc_avail - 1; in vnic_wq_desc_used()
102 static inline void *vnic_wq_next_desc(struct vnic_wq *wq) in vnic_wq_next_desc() argument
104 return wq->to_use->desc; in vnic_wq_next_desc()
107 static inline void vnic_wq_doorbell(struct vnic_wq *wq) in vnic_wq_doorbell() argument
115 iowrite32(wq->to_use->index, &wq->ctrl->posted_index); in vnic_wq_doorbell()
118 static inline void vnic_wq_post(struct vnic_wq *wq, in vnic_wq_post() argument
[all …]
/linux/drivers/scsi/snic/
H A Dvnic_wq.c12 static inline int vnic_wq_get_ctrl(struct vnic_dev *vdev, struct vnic_wq *wq, in vnic_wq_get_ctrl() argument
15 wq->ctrl = svnic_dev_get_res(vdev, res_type, index); in vnic_wq_get_ctrl()
16 if (!wq->ctrl) in vnic_wq_get_ctrl()
22 static inline int vnic_wq_alloc_ring(struct vnic_dev *vdev, struct vnic_wq *wq, in vnic_wq_alloc_ring() argument
25 return svnic_dev_alloc_desc_ring(vdev, &wq->ring, desc_count, in vnic_wq_alloc_ring()
29 static int vnic_wq_alloc_bufs(struct vnic_wq *wq) in vnic_wq_alloc_bufs() argument
32 unsigned int i, j, count = wq->ring.desc_count; in vnic_wq_alloc_bufs()
36 wq->bufs[i] = kzalloc(VNIC_WQ_BUF_BLK_SZ, GFP_ATOMIC); in vnic_wq_alloc_bufs()
37 if (!wq->bufs[i]) { in vnic_wq_alloc_bufs()
45 buf = wq->bufs[i]; in vnic_wq_alloc_bufs()
[all …]
H A Dvnic_wq.h71 static inline unsigned int svnic_wq_desc_avail(struct vnic_wq *wq) in svnic_wq_desc_avail() argument
74 return wq->ring.desc_avail; in svnic_wq_desc_avail()
77 static inline unsigned int svnic_wq_desc_used(struct vnic_wq *wq) in svnic_wq_desc_used() argument
80 return wq->ring.desc_count - wq->ring.desc_avail - 1; in svnic_wq_desc_used()
83 static inline void *svnic_wq_next_desc(struct vnic_wq *wq) in svnic_wq_next_desc() argument
85 return wq->to_use->desc; in svnic_wq_next_desc()
88 static inline void svnic_wq_post(struct vnic_wq *wq, in svnic_wq_post() argument
92 struct vnic_wq_buf *buf = wq->to_use; in svnic_wq_post()
107 iowrite32(buf->index, &wq->ctrl->posted_index); in svnic_wq_post()
109 wq->to_use = buf; in svnic_wq_post()
[all …]
/linux/drivers/dma/idxd/
H A Ddevice.c18 static void idxd_wq_disable_cleanup(struct idxd_wq *wq);
41 static void free_hw_descs(struct idxd_wq *wq) in free_hw_descs() argument
45 for (i = 0; i < wq->num_descs; i++) in free_hw_descs()
46 kfree(wq->hw_descs[i]); in free_hw_descs()
48 kfree(wq->hw_descs); in free_hw_descs()
51 static int alloc_hw_descs(struct idxd_wq *wq, int num) in alloc_hw_descs() argument
53 struct device *dev = &wq->idxd->pdev->dev; in alloc_hw_descs()
57 wq->hw_descs = kcalloc_node(num, sizeof(struct dsa_hw_desc *), in alloc_hw_descs()
59 if (!wq->hw_descs) in alloc_hw_descs()
63 wq->hw_descs[i] = kzalloc_node(sizeof(*wq->hw_descs[i]), in alloc_hw_descs()
[all …]
H A Dcdev.c42 struct idxd_wq *wq; member
54 static void idxd_cdev_evl_drain_pasid(struct idxd_wq *wq, u32 pasid);
100 struct idxd_wq *wq = ctx->wq; in cdev_file_attr_visible() local
102 if (!wq_pasid_enabled(wq)) in cdev_file_attr_visible()
121 struct idxd_wq *wq = ctx->wq; in idxd_file_dev_release() local
122 struct idxd_device *idxd = wq->idxd; in idxd_file_dev_release()
128 if (wq_shared(wq)) { in idxd_file_dev_release()
132 /* The wq disable in the disable pasid function will drain the wq */ in idxd_file_dev_release()
133 rc = idxd_wq_disable_pasid(wq); in idxd_file_dev_release()
135 dev_err(dev, "wq disable pasid failed.\n"); in idxd_file_dev_release()
[all …]
H A Ddma.c20 return idxd_chan->wq; in to_idxd_wq()
27 struct idxd_device *idxd = desc->wq->idxd; in idxd_dma_complete_txd()
56 idxd_free_desc(desc->wq, desc); in idxd_dma_complete_txd()
66 static inline void idxd_prep_desc_common(struct idxd_wq *wq, in idxd_prep_desc_common() argument
77 * For dedicated WQ, this field is ignored and HW will use the WQCFG.priv in idxd_prep_desc_common()
88 struct idxd_wq *wq = to_idxd_wq(c); in idxd_dma_prep_interrupt() local
92 if (wq->state != IDXD_WQ_ENABLED) in idxd_dma_prep_interrupt()
96 desc = idxd_alloc_desc(wq, IDXD_OP_BLOCK); in idxd_dma_prep_interrupt()
100 idxd_prep_desc_common(wq, desc->hw, DSA_OPCODE_NOOP, in idxd_dma_prep_interrupt()
110 struct idxd_wq *wq = to_idxd_wq(c); in idxd_dma_submit_memcpy() local
[all …]
H A Didxd.h165 struct idxd_wq *wq; member
187 struct idxd_wq *wq; member
200 struct workqueue_struct *wq; member
305 struct idxd_wq *wq; member
362 struct workqueue_struct *wq; member
427 struct idxd_wq *wq; member
439 #define wq_confdev(wq) &wq->idxd_dev.conf_dev argument
449 static inline struct idxd_device_driver *wq_to_idxd_drv(struct idxd_wq *wq) in wq_to_idxd_drv() argument
451 struct device *dev = wq_confdev(wq); in wq_to_idxd_drv()
557 static inline bool is_idxd_wq_dmaengine(struct idxd_wq *wq) in is_idxd_wq_dmaengine() argument
[all …]
H A Dsysfs.c342 struct idxd_wq *wq = idxd->wqs[i]; in group_work_queues_show() local
344 if (!wq->group) in group_work_queues_show()
347 if (wq->group->id == group->id) in group_work_queues_show()
348 rc += sysfs_emit_at(buf, rc, "wq%d.%d ", idxd->id, wq->id); in group_work_queues_show()
590 struct idxd_wq *wq = confdev_to_wq(dev); in wq_clients_show() local
592 return sysfs_emit(buf, "%d\n", wq->client_count); in wq_clients_show()
601 struct idxd_wq *wq = confdev_to_wq(dev); in wq_state_show() local
603 switch (wq->state) { in wq_state_show()
619 struct idxd_wq *wq = confdev_to_wq(dev); in wq_group_id_show() local
621 if (wq->group) in wq_group_id_show()
[all …]
H A Dsubmit.c11 static struct idxd_desc *__get_desc(struct idxd_wq *wq, int idx, int cpu) in __get_desc() argument
14 struct idxd_device *idxd = wq->idxd; in __get_desc()
16 desc = wq->descs[idx]; in __get_desc()
27 struct idxd_desc *idxd_alloc_desc(struct idxd_wq *wq, enum idxd_op_type optype) in idxd_alloc_desc() argument
30 struct idxd_device *idxd = wq->idxd; in idxd_alloc_desc()
38 sbq = &wq->sbq; in idxd_alloc_desc()
44 return __get_desc(wq, idx, cpu); in idxd_alloc_desc()
62 return __get_desc(wq, idx, cpu); in idxd_alloc_desc()
66 void idxd_free_desc(struct idxd_wq *wq, struct idxd_desc *desc) in idxd_free_desc() argument
71 sbitmap_queue_clear(&wq->sbq, desc->id, cpu); in idxd_free_desc()
[all …]
H A Ddefaults.c10 struct idxd_wq *wq; in idxd_load_iaa_device_defaults() local
15 wq = idxd->wqs[0]; in idxd_load_iaa_device_defaults()
17 if (wq->state != IDXD_WQ_DISABLED) in idxd_load_iaa_device_defaults()
21 set_bit(WQ_FLAG_DEDICATED, &wq->flags); in idxd_load_iaa_device_defaults()
22 wq->threshold = 0; in idxd_load_iaa_device_defaults()
24 /* only setting up 1 wq, so give it all the wq space */ in idxd_load_iaa_device_defaults()
25 wq->size = idxd->max_wq_size; in idxd_load_iaa_device_defaults()
28 wq->priority = 10; in idxd_load_iaa_device_defaults()
31 wq->type = IDXD_WQT_KERNEL; in idxd_load_iaa_device_defaults()
33 /* set wq group to 0 */ in idxd_load_iaa_device_defaults()
[all …]
/linux/fs/autofs/
H A Dwaitq.c17 struct autofs_wait_queue *wq, *nwq; in autofs_catatonic_mode() local
28 wq = sbi->queues; in autofs_catatonic_mode()
30 while (wq) { in autofs_catatonic_mode()
31 nwq = wq->next; in autofs_catatonic_mode()
32 wq->status = -ENOENT; /* Magic is gone - report failure */ in autofs_catatonic_mode()
33 kfree(wq->name.name - wq->offset); in autofs_catatonic_mode()
34 wq->name.name = NULL; in autofs_catatonic_mode()
35 wake_up(&wq->queue); in autofs_catatonic_mode()
36 if (!--wq->wait_ctr) in autofs_catatonic_mode()
37 kfree(wq); in autofs_catatonic_mode()
[all …]
/linux/io_uring/
H A Dio-wq.c22 #include "io-wq.h"
36 IO_WQ_BIT_EXIT = 0, /* wq exiting */
44 * One for each thread in a wq pool
52 struct io_wq *wq; member
145 static bool create_io_worker(struct io_wq *wq, struct io_wq_acct *acct);
147 static bool io_acct_cancel_pending_work(struct io_wq *wq,
151 static void io_wq_cancel_tw_create(struct io_wq *wq);
174 static inline struct io_wq_acct *io_get_acct(struct io_wq *wq, bool bound) in io_get_acct() argument
176 return &wq->acct[bound ? IO_WQ_ACCT_BOUND : IO_WQ_ACCT_UNBOUND]; in io_get_acct()
179 static inline struct io_wq_acct *io_work_get_acct(struct io_wq *wq, in io_work_get_acct() argument
[all …]
/linux/drivers/net/ethernet/mellanox/mlx5/core/
H A Dwq.c34 #include "wq.h"
38 void *wqc, struct mlx5_wq_cyc *wq, in mlx5_wq_cyc_create() argument
41 u8 log_wq_stride = MLX5_GET(wq, wqc, log_wq_stride); in mlx5_wq_cyc_create()
42 u8 log_wq_sz = MLX5_GET(wq, wqc, log_wq_sz); in mlx5_wq_cyc_create()
43 struct mlx5_frag_buf_ctrl *fbc = &wq->fbc; in mlx5_wq_cyc_create()
52 wq->db = wq_ctrl->db.db; in mlx5_wq_cyc_create()
62 wq->sz = mlx5_wq_cyc_get_size(wq); in mlx5_wq_cyc_create()
74 void mlx5_wq_cyc_wqe_dump(struct mlx5_wq_cyc *wq, u16 ix, u8 nstrides) in mlx5_wq_cyc_wqe_dump() argument
84 len = nstrides << wq->fbc.log_stride; in mlx5_wq_cyc_wqe_dump()
85 wqe = mlx5_wq_cyc_get_wqe(wq, ix); in mlx5_wq_cyc_wqe_dump()
[all …]
H A Dwc.c8 #include "wq.h"
17 struct mlx5_cqwq wq; member
33 struct mlx5_wq_cyc wq; member
51 err = mlx5_cqwq_create(mdev, &param, cqc, &cq->wq, &cq->wq_ctrl); in mlx5_wc_create_cqwq()
59 for (i = 0; i < mlx5_cqwq_get_size(&cq->wq); i++) { in mlx5_wc_create_cqwq()
60 struct mlx5_cqe64 *cqe = mlx5_cqwq_get_wqe(&cq->wq, i); in mlx5_wc_create_cqwq()
125 mlx5_core_err(mdev, "Failed to create wc cq wq, err=%d\n", err); in mlx5_wc_create_cq()
154 void *in, *sqc, *wq; in create_wc_sq() local
165 wq = MLX5_ADDR_OF(sqc, sqc, wq); in create_wc_sq()
178 MLX5_SET(wq, wq, wq_type, MLX5_WQ_TYPE_CYCLIC); in create_wc_sq()
[all …]
/linux/drivers/infiniband/hw/cxgb4/
H A Dt4.h480 static inline int t4_rqes_posted(struct t4_wq *wq) in t4_rqes_posted() argument
482 return wq->rq.in_use; in t4_rqes_posted()
485 static inline int t4_rq_empty(struct t4_wq *wq) in t4_rq_empty() argument
487 return wq->rq.in_use == 0; in t4_rq_empty()
490 static inline u32 t4_rq_avail(struct t4_wq *wq) in t4_rq_avail() argument
492 return wq->rq.size - 1 - wq->rq.in_use; in t4_rq_avail()
495 static inline void t4_rq_produce(struct t4_wq *wq, u8 len16) in t4_rq_produce() argument
497 wq->rq.in_use++; in t4_rq_produce()
498 if (++wq->rq.pidx == wq->rq.size) in t4_rq_produce()
499 wq->rq.pidx = 0; in t4_rq_produce()
[all …]
H A Dcq.c184 static void insert_recv_cqe(struct t4_wq *wq, struct t4_cq *cq, u32 srqidx) in insert_recv_cqe() argument
188 pr_debug("wq %p cq %p sw_cidx %u sw_pidx %u\n", in insert_recv_cqe()
189 wq, cq, cq->sw_cidx, cq->sw_pidx); in insert_recv_cqe()
195 CQE_QPID_V(wq->sq.qid)); in insert_recv_cqe()
203 int c4iw_flush_rq(struct t4_wq *wq, struct t4_cq *cq, int count) in c4iw_flush_rq() argument
206 int in_use = wq->rq.in_use - count; in c4iw_flush_rq()
208 pr_debug("wq %p cq %p rq.in_use %u skip count %u\n", in c4iw_flush_rq()
209 wq, cq, wq->rq.in_use, count); in c4iw_flush_rq()
211 insert_recv_cqe(wq, cq, 0); in c4iw_flush_rq()
217 static void insert_sq_cqe(struct t4_wq *wq, struct t4_cq *cq, in insert_sq_cqe() argument
[all …]
/linux/include/linux/
H A Dswait.h90 * @wq: the waitqueue to test for waiters
121 static inline int swait_active(struct swait_queue_head *wq) in swait_active() argument
123 return !list_empty(&wq->task_list); in swait_active()
128 * @wq: the waitqueue to test for waiters
130 * Returns true if @wq has waiting processes
134 static inline bool swq_has_sleeper(struct swait_queue_head *wq) in swq_has_sleeper() argument
144 return swait_active(wq); in swq_has_sleeper()
158 #define ___swait_event(wq, condition, state, ret, cmd) \ argument
166 long __int = prepare_to_swait_event(&wq, &__wait, state);\
178 finish_swait(&wq, &__wait); \
[all …]
/linux/drivers/net/ethernet/mellanox/mlx5/core/lib/
H A Daso.c8 #include "wq.h"
12 struct mlx5_cqwq wq; member
31 struct mlx5_wq_cyc wq; member
56 err = mlx5_cqwq_create(mdev, &param, cqc_data, &cq->wq, &cq->wq_ctrl); in mlx5_aso_alloc_cq()
64 for (i = 0; i < mlx5_cqwq_get_size(&cq->wq); i++) { in mlx5_aso_alloc_cq()
65 struct mlx5_cqe64 *cqe = mlx5_cqwq_get_wqe(&cq->wq, i); in mlx5_aso_alloc_cq()
138 mlx5_core_err(mdev, "Failed to alloc aso wq cq, err=%d\n", err); in mlx5_aso_create_cq()
144 mlx5_core_err(mdev, "Failed to create aso wq cq, err=%d\n", err); in mlx5_aso_create_cq()
161 void *sqc_wq = MLX5_ADDR_OF(sqc, sqc_data, wq); in mlx5_aso_alloc_sq()
162 struct mlx5_wq_cyc *wq = &sq->wq; in mlx5_aso_alloc_sq() local
[all …]
/linux/kernel/
H A Dworkqueue.c165 * PW: wq_pool_mutex and wq->mutex protected for writes. Either for reads.
167 * PWR: wq_pool_mutex and wq->mutex protected for writes. Either or
170 * WQ: wq->mutex protected.
172 * WR: wq->mutex protected for writes. RCU protected for reads.
174 * WO: wq->mutex protected for writes. Updated with WRITE_ONCE() and can be read
258 struct workqueue_struct *wq; /* I: the owning workqueue */ member
285 struct list_head pwqs_node; /* WR: node on wq->pwqs */
286 struct list_head mayday_node; /* MD: node on wq->maydays */
294 * grabbing wq->mutex.
304 struct list_head list; /* WQ: list of flushers */
[all …]

12345678910>>...27