• Home
  • Raw
  • Download

Lines Matching refs:pool

60 	struct hisi_acc_sgl_pool *pool;  in hisi_acc_create_sgl_pool()  local
84 pool = kzalloc(sizeof(*pool), GFP_KERNEL); in hisi_acc_create_sgl_pool()
85 if (!pool) in hisi_acc_create_sgl_pool()
87 block = pool->mem_block; in hisi_acc_create_sgl_pool()
113 pool->sgl_num_per_block = sgl_num_per_block; in hisi_acc_create_sgl_pool()
114 pool->block_num = remain_sgl ? block_num + 1 : block_num; in hisi_acc_create_sgl_pool()
115 pool->count = count; in hisi_acc_create_sgl_pool()
116 pool->sgl_size = sgl_size; in hisi_acc_create_sgl_pool()
117 pool->sge_nr = sge_nr; in hisi_acc_create_sgl_pool()
119 return pool; in hisi_acc_create_sgl_pool()
126 kfree_sensitive(pool); in hisi_acc_create_sgl_pool()
138 void hisi_acc_free_sgl_pool(struct device *dev, struct hisi_acc_sgl_pool *pool) in hisi_acc_free_sgl_pool() argument
143 if (!dev || !pool) in hisi_acc_free_sgl_pool()
146 block = pool->mem_block; in hisi_acc_free_sgl_pool()
148 for (i = 0; i < pool->block_num; i++) in hisi_acc_free_sgl_pool()
152 kfree(pool); in hisi_acc_free_sgl_pool()
156 static struct hisi_acc_hw_sgl *acc_get_sgl(struct hisi_acc_sgl_pool *pool, in acc_get_sgl() argument
162 if (!pool || !hw_sgl_dma || index >= pool->count) in acc_get_sgl()
165 block = pool->mem_block; in acc_get_sgl()
166 block_index = index / pool->sgl_num_per_block; in acc_get_sgl()
167 offset = index % pool->sgl_num_per_block; in acc_get_sgl()
169 *hw_sgl_dma = block[block_index].sgl_dma + pool->sgl_size * offset; in acc_get_sgl()
170 return (void *)block[block_index].sgl + pool->sgl_size * offset; in acc_get_sgl()
220 struct hisi_acc_sgl_pool *pool, in hisi_acc_sg_buf_map_to_hw_sgl() argument
229 if (!dev || !sgl || !pool || !hw_sgl_dma) in hisi_acc_sg_buf_map_to_hw_sgl()
240 if (sg_n_mapped > pool->sge_nr) { in hisi_acc_sg_buf_map_to_hw_sgl()
245 curr_hw_sgl = acc_get_sgl(pool, index, &curr_sgl_dma); in hisi_acc_sg_buf_map_to_hw_sgl()
252 curr_hw_sgl->entry_length_in_sgl = cpu_to_le16(pool->sge_nr); in hisi_acc_sg_buf_map_to_hw_sgl()
261 update_hw_sgl_sum_sge(curr_hw_sgl, pool->sge_nr); in hisi_acc_sg_buf_map_to_hw_sgl()