Lines Matching refs:io_sq
318 struct ena_com_io_sq *io_sq) in ena_com_init_io_sq() argument
323 memset(&io_sq->desc_addr, 0x0, sizeof(io_sq->desc_addr)); in ena_com_init_io_sq()
325 io_sq->dma_addr_bits = (u8)ena_dev->dma_addr_bits; in ena_com_init_io_sq()
326 io_sq->desc_entry_size = in ena_com_init_io_sq()
327 (io_sq->direction == ENA_COM_IO_QUEUE_DIRECTION_TX) ? in ena_com_init_io_sq()
331 size = io_sq->desc_entry_size * io_sq->q_depth; in ena_com_init_io_sq()
333 if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST) { in ena_com_init_io_sq()
336 io_sq->desc_addr.virt_addr = in ena_com_init_io_sq()
338 &io_sq->desc_addr.phys_addr, in ena_com_init_io_sq()
341 if (!io_sq->desc_addr.virt_addr) { in ena_com_init_io_sq()
342 io_sq->desc_addr.virt_addr = in ena_com_init_io_sq()
344 &io_sq->desc_addr.phys_addr, in ena_com_init_io_sq()
348 if (!io_sq->desc_addr.virt_addr) { in ena_com_init_io_sq()
355 if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { in ena_com_init_io_sq()
357 io_sq->bounce_buf_ctrl.buffer_size = in ena_com_init_io_sq()
359 io_sq->bounce_buf_ctrl.buffers_num = in ena_com_init_io_sq()
361 io_sq->bounce_buf_ctrl.next_to_use = 0; in ena_com_init_io_sq()
363 size = io_sq->bounce_buf_ctrl.buffer_size * in ena_com_init_io_sq()
364 io_sq->bounce_buf_ctrl.buffers_num; in ena_com_init_io_sq()
368 io_sq->bounce_buf_ctrl.base_buffer = in ena_com_init_io_sq()
371 if (!io_sq->bounce_buf_ctrl.base_buffer) in ena_com_init_io_sq()
372 io_sq->bounce_buf_ctrl.base_buffer = in ena_com_init_io_sq()
375 if (!io_sq->bounce_buf_ctrl.base_buffer) { in ena_com_init_io_sq()
381 memcpy(&io_sq->llq_info, &ena_dev->llq_info, in ena_com_init_io_sq()
382 sizeof(io_sq->llq_info)); in ena_com_init_io_sq()
385 io_sq->llq_buf_ctrl.curr_bounce_buf = in ena_com_init_io_sq()
386 ena_com_get_next_bounce_buffer(&io_sq->bounce_buf_ctrl); in ena_com_init_io_sq()
387 memset(io_sq->llq_buf_ctrl.curr_bounce_buf, in ena_com_init_io_sq()
388 0x0, io_sq->llq_info.desc_list_entry_size); in ena_com_init_io_sq()
389 io_sq->llq_buf_ctrl.descs_left_in_line = in ena_com_init_io_sq()
390 io_sq->llq_info.descs_num_before_header; in ena_com_init_io_sq()
391 io_sq->disable_meta_caching = in ena_com_init_io_sq()
392 io_sq->llq_info.disable_meta_caching; in ena_com_init_io_sq()
394 if (io_sq->llq_info.max_entries_in_tx_burst > 0) in ena_com_init_io_sq()
395 io_sq->entries_in_tx_burst_left = in ena_com_init_io_sq()
396 io_sq->llq_info.max_entries_in_tx_burst; in ena_com_init_io_sq()
399 io_sq->tail = 0; in ena_com_init_io_sq()
400 io_sq->next_to_comp = 0; in ena_com_init_io_sq()
401 io_sq->phase = 1; in ena_com_init_io_sq()
905 struct ena_com_io_sq *io_sq) in ena_com_destroy_io_sq() argument
915 if (io_sq->direction == ENA_COM_IO_QUEUE_DIRECTION_TX) in ena_com_destroy_io_sq()
924 destroy_cmd.sq.sq_idx = io_sq->idx; in ena_com_destroy_io_sq()
941 struct ena_com_io_sq *io_sq, in ena_com_io_queue_free() argument
956 if (io_sq->desc_addr.virt_addr) { in ena_com_io_queue_free()
957 size = io_sq->desc_entry_size * io_sq->q_depth; in ena_com_io_queue_free()
960 io_sq->desc_addr.virt_addr, in ena_com_io_queue_free()
961 io_sq->desc_addr.phys_addr); in ena_com_io_queue_free()
963 io_sq->desc_addr.virt_addr = NULL; in ena_com_io_queue_free()
966 if (io_sq->bounce_buf_ctrl.base_buffer) { in ena_com_io_queue_free()
967 devm_kfree(ena_dev->dmadev, io_sq->bounce_buf_ctrl.base_buffer); in ena_com_io_queue_free()
968 io_sq->bounce_buf_ctrl.base_buffer = NULL; in ena_com_io_queue_free()
1222 struct ena_com_io_sq *io_sq, u16 cq_idx) in ena_com_create_io_sq() argument
1234 if (io_sq->direction == ENA_COM_IO_QUEUE_DIRECTION_TX) in ena_com_create_io_sq()
1243 create_cmd.sq_caps_2 |= io_sq->mem_queue_type & in ena_com_create_io_sq()
1254 create_cmd.sq_depth = io_sq->q_depth; in ena_com_create_io_sq()
1256 if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST) { in ena_com_create_io_sq()
1259 io_sq->desc_addr.phys_addr); in ena_com_create_io_sq()
1278 io_sq->idx = cmd_completion.sq_idx; in ena_com_create_io_sq()
1280 io_sq->db_addr = (u32 __iomem *)((uintptr_t)ena_dev->reg_bar + in ena_com_create_io_sq()
1283 if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { in ena_com_create_io_sq()
1284 io_sq->header_addr = (u8 __iomem *)((uintptr_t)ena_dev->mem_bar in ena_com_create_io_sq()
1287 io_sq->desc_addr.pbuf_dev_addr = in ena_com_create_io_sq()
1293 io_sq->idx, io_sq->q_depth); in ena_com_create_io_sq()
1301 struct ena_com_io_sq *io_sq; in ena_com_ind_tbl_convert_to_device() local
1310 io_sq = &ena_dev->io_sq_queues[qid]; in ena_com_ind_tbl_convert_to_device()
1312 if (io_sq->direction != ENA_COM_IO_QUEUE_DIRECTION_RX) in ena_com_ind_tbl_convert_to_device()
1315 rss->rss_ind_tbl[i].cq_idx = io_sq->idx; in ena_com_ind_tbl_convert_to_device()
1447 struct ena_com_io_sq **io_sq, in ena_com_get_io_handlers() argument
1457 *io_sq = &ena_dev->io_sq_queues[qid]; in ena_com_get_io_handlers()
1873 struct ena_com_io_sq *io_sq; in ena_com_create_io_queue() local
1884 io_sq = &ena_dev->io_sq_queues[ctx->qid]; in ena_com_create_io_queue()
1887 memset(io_sq, 0x0, sizeof(*io_sq)); in ena_com_create_io_queue()
1897 io_sq->q_depth = ctx->queue_size; in ena_com_create_io_queue()
1898 io_sq->direction = ctx->direction; in ena_com_create_io_queue()
1899 io_sq->qid = ctx->qid; in ena_com_create_io_queue()
1901 io_sq->mem_queue_type = ctx->mem_queue_type; in ena_com_create_io_queue()
1905 io_sq->tx_max_header_size = in ena_com_create_io_queue()
1908 ret = ena_com_init_io_sq(ena_dev, ctx, io_sq); in ena_com_create_io_queue()
1919 ret = ena_com_create_io_sq(ena_dev, io_sq, io_cq->idx); in ena_com_create_io_queue()
1928 ena_com_io_queue_free(ena_dev, io_sq, io_cq); in ena_com_create_io_queue()
1934 struct ena_com_io_sq *io_sq; in ena_com_destroy_io_queue() local
1944 io_sq = &ena_dev->io_sq_queues[qid]; in ena_com_destroy_io_queue()
1947 ena_com_destroy_io_sq(ena_dev, io_sq); in ena_com_destroy_io_queue()
1950 ena_com_io_queue_free(ena_dev, io_sq, io_cq); in ena_com_destroy_io_queue()