Lines Matching refs:io_sq

312 			      struct ena_com_io_sq *io_sq)  in ena_com_init_io_sq()  argument
316 memset(&io_sq->desc_addr, 0x0, sizeof(io_sq->desc_addr)); in ena_com_init_io_sq()
318 io_sq->dma_addr_bits = (u8)ena_dev->dma_addr_bits; in ena_com_init_io_sq()
319 io_sq->desc_entry_size = in ena_com_init_io_sq()
320 (io_sq->direction == ENA_COM_IO_QUEUE_DIRECTION_TX) ? in ena_com_init_io_sq()
324 size = io_sq->desc_entry_size * io_sq->q_depth; in ena_com_init_io_sq()
326 if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST) { in ena_com_init_io_sq()
327 io_sq->desc_addr.virt_addr = in ena_com_init_io_sq()
328 dma_alloc_coherent(ena_dev->dmadev, size, &io_sq->desc_addr.phys_addr, in ena_com_init_io_sq()
330 if (!io_sq->desc_addr.virt_addr) { in ena_com_init_io_sq()
331 io_sq->desc_addr.virt_addr = in ena_com_init_io_sq()
333 &io_sq->desc_addr.phys_addr, GFP_KERNEL); in ena_com_init_io_sq()
336 if (!io_sq->desc_addr.virt_addr) { in ena_com_init_io_sq()
342 if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { in ena_com_init_io_sq()
344 io_sq->bounce_buf_ctrl.buffer_size = in ena_com_init_io_sq()
346 io_sq->bounce_buf_ctrl.buffers_num = in ena_com_init_io_sq()
348 io_sq->bounce_buf_ctrl.next_to_use = 0; in ena_com_init_io_sq()
350 size = (size_t)io_sq->bounce_buf_ctrl.buffer_size * in ena_com_init_io_sq()
351 io_sq->bounce_buf_ctrl.buffers_num; in ena_com_init_io_sq()
353 io_sq->bounce_buf_ctrl.base_buffer = devm_kzalloc(ena_dev->dmadev, size, GFP_KERNEL); in ena_com_init_io_sq()
354 if (!io_sq->bounce_buf_ctrl.base_buffer) in ena_com_init_io_sq()
355 io_sq->bounce_buf_ctrl.base_buffer = in ena_com_init_io_sq()
358 if (!io_sq->bounce_buf_ctrl.base_buffer) { in ena_com_init_io_sq()
363 memcpy(&io_sq->llq_info, &ena_dev->llq_info, in ena_com_init_io_sq()
364 sizeof(io_sq->llq_info)); in ena_com_init_io_sq()
367 io_sq->llq_buf_ctrl.curr_bounce_buf = in ena_com_init_io_sq()
368 ena_com_get_next_bounce_buffer(&io_sq->bounce_buf_ctrl); in ena_com_init_io_sq()
369 memset(io_sq->llq_buf_ctrl.curr_bounce_buf, in ena_com_init_io_sq()
370 0x0, io_sq->llq_info.desc_list_entry_size); in ena_com_init_io_sq()
371 io_sq->llq_buf_ctrl.descs_left_in_line = in ena_com_init_io_sq()
372 io_sq->llq_info.descs_num_before_header; in ena_com_init_io_sq()
373 io_sq->disable_meta_caching = in ena_com_init_io_sq()
374 io_sq->llq_info.disable_meta_caching; in ena_com_init_io_sq()
376 if (io_sq->llq_info.max_entries_in_tx_burst > 0) in ena_com_init_io_sq()
377 io_sq->entries_in_tx_burst_left = in ena_com_init_io_sq()
378 io_sq->llq_info.max_entries_in_tx_burst; in ena_com_init_io_sq()
381 io_sq->tail = 0; in ena_com_init_io_sq()
382 io_sq->next_to_comp = 0; in ena_com_init_io_sq()
383 io_sq->phase = 1; in ena_com_init_io_sq()
872 struct ena_com_io_sq *io_sq) in ena_com_destroy_io_sq() argument
882 if (io_sq->direction == ENA_COM_IO_QUEUE_DIRECTION_TX) in ena_com_destroy_io_sq()
891 destroy_cmd.sq.sq_idx = io_sq->idx; in ena_com_destroy_io_sq()
907 struct ena_com_io_sq *io_sq, in ena_com_io_queue_free() argument
921 if (io_sq->desc_addr.virt_addr) { in ena_com_io_queue_free()
922 size = io_sq->desc_entry_size * io_sq->q_depth; in ena_com_io_queue_free()
924 dma_free_coherent(ena_dev->dmadev, size, io_sq->desc_addr.virt_addr, in ena_com_io_queue_free()
925 io_sq->desc_addr.phys_addr); in ena_com_io_queue_free()
927 io_sq->desc_addr.virt_addr = NULL; in ena_com_io_queue_free()
930 if (io_sq->bounce_buf_ctrl.base_buffer) { in ena_com_io_queue_free()
931 devm_kfree(ena_dev->dmadev, io_sq->bounce_buf_ctrl.base_buffer); in ena_com_io_queue_free()
932 io_sq->bounce_buf_ctrl.base_buffer = NULL; in ena_com_io_queue_free()
1177 struct ena_com_io_sq *io_sq, u16 cq_idx) in ena_com_create_io_sq() argument
1189 if (io_sq->direction == ENA_COM_IO_QUEUE_DIRECTION_TX) in ena_com_create_io_sq()
1198 create_cmd.sq_caps_2 |= io_sq->mem_queue_type & in ena_com_create_io_sq()
1209 create_cmd.sq_depth = io_sq->q_depth; in ena_com_create_io_sq()
1211 if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST) { in ena_com_create_io_sq()
1214 io_sq->desc_addr.phys_addr); in ena_com_create_io_sq()
1231 io_sq->idx = cmd_completion.sq_idx; in ena_com_create_io_sq()
1233 io_sq->db_addr = (u32 __iomem *)((uintptr_t)ena_dev->reg_bar + in ena_com_create_io_sq()
1236 if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { in ena_com_create_io_sq()
1237 io_sq->desc_addr.pbuf_dev_addr = in ena_com_create_io_sq()
1242 netdev_dbg(ena_dev->net_device, "Created sq[%u], depth[%u]\n", io_sq->idx, io_sq->q_depth); in ena_com_create_io_sq()
1250 struct ena_com_io_sq *io_sq; in ena_com_ind_tbl_convert_to_device() local
1259 io_sq = &ena_dev->io_sq_queues[qid]; in ena_com_ind_tbl_convert_to_device()
1261 if (io_sq->direction != ENA_COM_IO_QUEUE_DIRECTION_RX) in ena_com_ind_tbl_convert_to_device()
1264 rss->rss_ind_tbl[i].cq_idx = io_sq->idx; in ena_com_ind_tbl_convert_to_device()
1389 struct ena_com_io_sq **io_sq, in ena_com_get_io_handlers() argument
1398 *io_sq = &ena_dev->io_sq_queues[qid]; in ena_com_get_io_handlers()
1801 struct ena_com_io_sq *io_sq; in ena_com_create_io_queue() local
1811 io_sq = &ena_dev->io_sq_queues[ctx->qid]; in ena_com_create_io_queue()
1814 memset(io_sq, 0x0, sizeof(*io_sq)); in ena_com_create_io_queue()
1824 io_sq->q_depth = ctx->queue_size; in ena_com_create_io_queue()
1825 io_sq->direction = ctx->direction; in ena_com_create_io_queue()
1826 io_sq->qid = ctx->qid; in ena_com_create_io_queue()
1828 io_sq->mem_queue_type = ctx->mem_queue_type; in ena_com_create_io_queue()
1832 io_sq->tx_max_header_size = min_t(u32, ena_dev->tx_max_header_size, SZ_256); in ena_com_create_io_queue()
1834 ret = ena_com_init_io_sq(ena_dev, ctx, io_sq); in ena_com_create_io_queue()
1845 ret = ena_com_create_io_sq(ena_dev, io_sq, io_cq->idx); in ena_com_create_io_queue()
1854 ena_com_io_queue_free(ena_dev, io_sq, io_cq); in ena_com_create_io_queue()
1860 struct ena_com_io_sq *io_sq; in ena_com_destroy_io_queue() local
1869 io_sq = &ena_dev->io_sq_queues[qid]; in ena_com_destroy_io_queue()
1872 ena_com_destroy_io_sq(ena_dev, io_sq); in ena_com_destroy_io_queue()
1875 ena_com_io_queue_free(ena_dev, io_sq, io_cq); in ena_com_destroy_io_queue()