Lines Matching refs:wq
20 return idxd_chan->wq; in to_idxd_wq()
62 static inline void idxd_prep_desc_common(struct idxd_wq *wq, in idxd_prep_desc_common() argument
67 struct idxd_device *idxd = wq->idxd; in idxd_prep_desc_common()
74 hw->priv = !!(wq->type == IDXD_WQT_KERNEL); in idxd_prep_desc_common()
81 wq->vec_ptr = (wq->vec_ptr % idxd->num_wq_irqs) + 1; in idxd_prep_desc_common()
82 hw->int_handle = wq->vec_ptr; 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
112 struct idxd_device *idxd = wq->idxd; in idxd_dma_submit_memcpy()
115 if (wq->state != IDXD_WQ_ENABLED) in idxd_dma_submit_memcpy()
122 desc = idxd_alloc_desc(wq, IDXD_OP_BLOCK); in idxd_dma_submit_memcpy()
126 idxd_prep_desc_common(wq, desc->hw, DSA_OPCODE_MEMMOVE, in idxd_dma_submit_memcpy()
137 struct idxd_wq *wq = to_idxd_wq(chan); in idxd_dma_alloc_chan_resources() local
138 struct device *dev = &wq->idxd->pdev->dev; in idxd_dma_alloc_chan_resources()
140 idxd_wq_get(wq); in idxd_dma_alloc_chan_resources()
142 idxd_wq_refcount(wq)); in idxd_dma_alloc_chan_resources()
148 struct idxd_wq *wq = to_idxd_wq(chan); in idxd_dma_free_chan_resources() local
149 struct device *dev = &wq->idxd->pdev->dev; in idxd_dma_free_chan_resources()
151 idxd_wq_put(wq); in idxd_dma_free_chan_resources()
153 idxd_wq_refcount(wq)); in idxd_dma_free_chan_resources()
174 struct idxd_wq *wq = to_idxd_wq(c); in idxd_dma_tx_submit() local
181 rc = idxd_submit_desc(wq, desc); in idxd_dma_tx_submit()
183 idxd_free_desc(wq, desc); in idxd_dma_tx_submit()
248 int idxd_register_dma_channel(struct idxd_wq *wq) in idxd_register_dma_channel() argument
250 struct idxd_device *idxd = wq->idxd; in idxd_register_dma_channel()
265 for (i = 0; i < wq->num_descs; i++) { in idxd_register_dma_channel()
266 struct idxd_desc *desc = wq->descs[i]; in idxd_register_dma_channel()
278 wq->idxd_chan = idxd_chan; in idxd_register_dma_channel()
279 idxd_chan->wq = wq; in idxd_register_dma_channel()
280 get_device(&wq->conf_dev); in idxd_register_dma_channel()
285 void idxd_unregister_dma_channel(struct idxd_wq *wq) in idxd_unregister_dma_channel() argument
287 struct idxd_dma_chan *idxd_chan = wq->idxd_chan; in idxd_unregister_dma_channel()
289 struct idxd_dma_dev *idxd_dma = wq->idxd->idxd_dma; in idxd_unregister_dma_channel()
293 kfree(wq->idxd_chan); in idxd_unregister_dma_channel()
294 wq->idxd_chan = NULL; in idxd_unregister_dma_channel()
295 put_device(&wq->conf_dev); in idxd_unregister_dma_channel()