Lines Matching refs:dmem
54 static int nicvf_alloc_q_desc_mem(struct nicvf *nic, struct q_desc_mem *dmem, in nicvf_alloc_q_desc_mem() argument
57 dmem->q_len = q_len; in nicvf_alloc_q_desc_mem()
58 dmem->size = (desc_size * q_len) + align_bytes; in nicvf_alloc_q_desc_mem()
60 dmem->unalign_base = dma_alloc_coherent(&nic->pdev->dev, dmem->size, in nicvf_alloc_q_desc_mem()
61 &dmem->dma, GFP_KERNEL); in nicvf_alloc_q_desc_mem()
62 if (!dmem->unalign_base) in nicvf_alloc_q_desc_mem()
66 dmem->phys_base = NICVF_ALIGNED_ADDR((u64)dmem->dma, align_bytes); in nicvf_alloc_q_desc_mem()
67 dmem->base = dmem->unalign_base + (dmem->phys_base - dmem->dma); in nicvf_alloc_q_desc_mem()
72 static void nicvf_free_q_desc_mem(struct nicvf *nic, struct q_desc_mem *dmem) in nicvf_free_q_desc_mem() argument
74 if (!dmem) in nicvf_free_q_desc_mem()
77 dma_free_coherent(&nic->pdev->dev, dmem->size, in nicvf_free_q_desc_mem()
78 dmem->unalign_base, dmem->dma); in nicvf_free_q_desc_mem()
79 dmem->unalign_base = NULL; in nicvf_free_q_desc_mem()
80 dmem->base = NULL; in nicvf_free_q_desc_mem()
261 err = nicvf_alloc_q_desc_mem(nic, &rbdr->dmem, ring_len, in nicvf_init_rbdr()
267 rbdr->desc = rbdr->dmem.base; in nicvf_init_rbdr()
330 if (!rbdr->dmem.base) in nicvf_free_rbdr()
346 head &= (rbdr->dmem.q_len - 1); in nicvf_free_rbdr()
375 nicvf_free_q_desc_mem(nic, &rbdr->dmem); in nicvf_free_rbdr()
416 tail &= (rbdr->dmem.q_len - 1); in nicvf_refill_rbdr()
481 err = nicvf_alloc_q_desc_mem(nic, &cq->dmem, q_len, CMP_QUEUE_DESC_SIZE, in nicvf_init_cmp_queue()
486 cq->desc = cq->dmem.base; in nicvf_init_cmp_queue()
497 if (!cq->dmem.base) in nicvf_free_cmp_queue()
500 nicvf_free_q_desc_mem(nic, &cq->dmem); in nicvf_free_cmp_queue()
509 err = nicvf_alloc_q_desc_mem(nic, &sq->dmem, q_len, SND_QUEUE_DESC_SIZE, in nicvf_init_snd_queue()
514 sq->desc = sq->dmem.base; in nicvf_init_snd_queue()
563 hdr_sqe &= (sq->dmem.q_len - 1); in nicvf_unmap_sndq_buffers()
581 if (!sq->dmem.base) in nicvf_free_snd_queue()
586 sq->dmem.q_len * TSO_HEADER_SIZE, in nicvf_free_snd_queue()
620 sq->head &= (sq->dmem.q_len - 1); in nicvf_free_snd_queue()
624 nicvf_free_q_desc_mem(nic, &sq->dmem); in nicvf_free_snd_queue()
841 qidx, (u64)(cq->dmem.phys_base)); in nicvf_cmp_queue_config()
890 qidx, (u64)(sq->dmem.phys_base)); in nicvf_snd_queue_config()
930 qidx, (u64)(rbdr->dmem.phys_base)); in nicvf_rbdr_config()
1129 sq->tail &= (sq->dmem.q_len - 1); in nicvf_get_sq_desc()
1150 sq->head &= (sq->dmem.q_len - 1); in nicvf_put_sq_desc()
1156 qentry &= (sq->dmem.q_len - 1); in nicvf_get_nxt_sqentry()
1424 qentry &= (sq->dmem.q_len - 1); in nicvf_sq_add_gather_subdesc()