io_sq 333 drivers/net/ethernet/amazon/ena/ena_com.c struct ena_com_io_sq *io_sq) io_sq 338 drivers/net/ethernet/amazon/ena/ena_com.c memset(&io_sq->desc_addr, 0x0, sizeof(io_sq->desc_addr)); io_sq 340 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->dma_addr_bits = (u8)ena_dev->dma_addr_bits; io_sq 341 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->desc_entry_size = io_sq 342 drivers/net/ethernet/amazon/ena/ena_com.c (io_sq->direction == ENA_COM_IO_QUEUE_DIRECTION_TX) ? io_sq 346 drivers/net/ethernet/amazon/ena/ena_com.c size = io_sq->desc_entry_size * io_sq->q_depth; io_sq 348 drivers/net/ethernet/amazon/ena/ena_com.c if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST) { io_sq 351 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->desc_addr.virt_addr = io_sq 353 drivers/net/ethernet/amazon/ena/ena_com.c &io_sq->desc_addr.phys_addr, io_sq 356 drivers/net/ethernet/amazon/ena/ena_com.c if (!io_sq->desc_addr.virt_addr) { io_sq 357 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->desc_addr.virt_addr = io_sq 359 drivers/net/ethernet/amazon/ena/ena_com.c &io_sq->desc_addr.phys_addr, io_sq 363 drivers/net/ethernet/amazon/ena/ena_com.c if (!io_sq->desc_addr.virt_addr) { io_sq 369 drivers/net/ethernet/amazon/ena/ena_com.c if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { io_sq 371 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->bounce_buf_ctrl.buffer_size = io_sq 373 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->bounce_buf_ctrl.buffers_num = io_sq 375 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->bounce_buf_ctrl.next_to_use = 0; io_sq 377 drivers/net/ethernet/amazon/ena/ena_com.c size = io_sq->bounce_buf_ctrl.buffer_size * io_sq 378 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->bounce_buf_ctrl.buffers_num; io_sq 382 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->bounce_buf_ctrl.base_buffer = io_sq 385 drivers/net/ethernet/amazon/ena/ena_com.c if (!io_sq->bounce_buf_ctrl.base_buffer) io_sq 386 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->bounce_buf_ctrl.base_buffer = io_sq 389 drivers/net/ethernet/amazon/ena/ena_com.c if (!io_sq->bounce_buf_ctrl.base_buffer) { io_sq 394 drivers/net/ethernet/amazon/ena/ena_com.c memcpy(&io_sq->llq_info, &ena_dev->llq_info, io_sq 395 drivers/net/ethernet/amazon/ena/ena_com.c sizeof(io_sq->llq_info)); io_sq 398 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->llq_buf_ctrl.curr_bounce_buf = io_sq 399 drivers/net/ethernet/amazon/ena/ena_com.c ena_com_get_next_bounce_buffer(&io_sq->bounce_buf_ctrl); io_sq 400 drivers/net/ethernet/amazon/ena/ena_com.c memset(io_sq->llq_buf_ctrl.curr_bounce_buf, io_sq 401 drivers/net/ethernet/amazon/ena/ena_com.c 0x0, io_sq->llq_info.desc_list_entry_size); io_sq 402 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->llq_buf_ctrl.descs_left_in_line = io_sq 403 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->llq_info.descs_num_before_header; io_sq 405 drivers/net/ethernet/amazon/ena/ena_com.c if (io_sq->llq_info.max_entries_in_tx_burst > 0) io_sq 406 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->entries_in_tx_burst_left = io_sq 407 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->llq_info.max_entries_in_tx_burst; io_sq 410 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->tail = 0; io_sq 411 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->next_to_comp = 0; io_sq 412 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->phase = 1; io_sq 877 drivers/net/ethernet/amazon/ena/ena_com.c struct ena_com_io_sq *io_sq) io_sq 887 drivers/net/ethernet/amazon/ena/ena_com.c if (io_sq->direction == ENA_COM_IO_QUEUE_DIRECTION_TX) io_sq 896 drivers/net/ethernet/amazon/ena/ena_com.c destroy_cmd.sq.sq_idx = io_sq->idx; io_sq 912 drivers/net/ethernet/amazon/ena/ena_com.c struct ena_com_io_sq *io_sq, io_sq 927 drivers/net/ethernet/amazon/ena/ena_com.c if (io_sq->desc_addr.virt_addr) { io_sq 928 drivers/net/ethernet/amazon/ena/ena_com.c size = io_sq->desc_entry_size * io_sq->q_depth; io_sq 931 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->desc_addr.virt_addr, io_sq 932 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->desc_addr.phys_addr); io_sq 934 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->desc_addr.virt_addr = NULL; io_sq 937 drivers/net/ethernet/amazon/ena/ena_com.c if (io_sq->bounce_buf_ctrl.base_buffer) { io_sq 938 drivers/net/ethernet/amazon/ena/ena_com.c devm_kfree(ena_dev->dmadev, io_sq->bounce_buf_ctrl.base_buffer); io_sq 939 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->bounce_buf_ctrl.base_buffer = NULL; io_sq 1198 drivers/net/ethernet/amazon/ena/ena_com.c struct ena_com_io_sq *io_sq, u16 cq_idx) io_sq 1210 drivers/net/ethernet/amazon/ena/ena_com.c if (io_sq->direction == ENA_COM_IO_QUEUE_DIRECTION_TX) io_sq 1219 drivers/net/ethernet/amazon/ena/ena_com.c create_cmd.sq_caps_2 |= io_sq->mem_queue_type & io_sq 1230 drivers/net/ethernet/amazon/ena/ena_com.c create_cmd.sq_depth = io_sq->q_depth; io_sq 1232 drivers/net/ethernet/amazon/ena/ena_com.c if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST) { io_sq 1235 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->desc_addr.phys_addr); io_sq 1252 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->idx = cmd_completion.sq_idx; io_sq 1254 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->db_addr = (u32 __iomem *)((uintptr_t)ena_dev->reg_bar + io_sq 1257 drivers/net/ethernet/amazon/ena/ena_com.c if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { io_sq 1258 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->header_addr = (u8 __iomem *)((uintptr_t)ena_dev->mem_bar io_sq 1261 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->desc_addr.pbuf_dev_addr = io_sq 1266 drivers/net/ethernet/amazon/ena/ena_com.c pr_debug("created sq[%u], depth[%u]\n", io_sq->idx, io_sq->q_depth); io_sq 1274 drivers/net/ethernet/amazon/ena/ena_com.c struct ena_com_io_sq *io_sq; io_sq 1283 drivers/net/ethernet/amazon/ena/ena_com.c io_sq = &ena_dev->io_sq_queues[qid]; io_sq 1285 drivers/net/ethernet/amazon/ena/ena_com.c if (io_sq->direction != ENA_COM_IO_QUEUE_DIRECTION_RX) io_sq 1288 drivers/net/ethernet/amazon/ena/ena_com.c rss->rss_ind_tbl[i].cq_idx = io_sq->idx; io_sq 1418 drivers/net/ethernet/amazon/ena/ena_com.c struct ena_com_io_sq **io_sq, io_sq 1427 drivers/net/ethernet/amazon/ena/ena_com.c *io_sq = &ena_dev->io_sq_queues[qid]; io_sq 1821 drivers/net/ethernet/amazon/ena/ena_com.c struct ena_com_io_sq *io_sq; io_sq 1831 drivers/net/ethernet/amazon/ena/ena_com.c io_sq = &ena_dev->io_sq_queues[ctx->qid]; io_sq 1834 drivers/net/ethernet/amazon/ena/ena_com.c memset(io_sq, 0x0, sizeof(*io_sq)); io_sq 1844 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->q_depth = ctx->queue_size; io_sq 1845 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->direction = ctx->direction; io_sq 1846 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->qid = ctx->qid; io_sq 1848 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->mem_queue_type = ctx->mem_queue_type; io_sq 1852 drivers/net/ethernet/amazon/ena/ena_com.c io_sq->tx_max_header_size = io_sq 1855 drivers/net/ethernet/amazon/ena/ena_com.c ret = ena_com_init_io_sq(ena_dev, ctx, io_sq); io_sq 1866 drivers/net/ethernet/amazon/ena/ena_com.c ret = ena_com_create_io_sq(ena_dev, io_sq, io_cq->idx); io_sq 1875 drivers/net/ethernet/amazon/ena/ena_com.c ena_com_io_queue_free(ena_dev, io_sq, io_cq); io_sq 1881 drivers/net/ethernet/amazon/ena/ena_com.c struct ena_com_io_sq *io_sq; io_sq 1890 drivers/net/ethernet/amazon/ena/ena_com.c io_sq = &ena_dev->io_sq_queues[qid]; io_sq 1893 drivers/net/ethernet/amazon/ena/ena_com.c ena_com_destroy_io_sq(ena_dev, io_sq); io_sq 1896 drivers/net/ethernet/amazon/ena/ena_com.c ena_com_io_queue_free(ena_dev, io_sq, io_cq); io_sq 470 drivers/net/ethernet/amazon/ena/ena_com.h struct ena_com_io_sq **io_sq, io_sq 62 drivers/net/ethernet/amazon/ena/ena_eth_com.c static void *get_sq_desc_regular_queue(struct ena_com_io_sq *io_sq) io_sq 67 drivers/net/ethernet/amazon/ena/ena_eth_com.c tail_masked = io_sq->tail & (io_sq->q_depth - 1); io_sq 69 drivers/net/ethernet/amazon/ena/ena_eth_com.c offset = tail_masked * io_sq->desc_entry_size; io_sq 71 drivers/net/ethernet/amazon/ena/ena_eth_com.c return (void *)((uintptr_t)io_sq->desc_addr.virt_addr + offset); io_sq 74 drivers/net/ethernet/amazon/ena/ena_eth_com.c static int ena_com_write_bounce_buffer_to_dev(struct ena_com_io_sq *io_sq, io_sq 77 drivers/net/ethernet/amazon/ena/ena_eth_com.c struct ena_com_llq_info *llq_info = &io_sq->llq_info; io_sq 82 drivers/net/ethernet/amazon/ena/ena_eth_com.c dst_tail_mask = io_sq->tail & (io_sq->q_depth - 1); io_sq 85 drivers/net/ethernet/amazon/ena/ena_eth_com.c if (is_llq_max_tx_burst_exists(io_sq)) { io_sq 86 drivers/net/ethernet/amazon/ena/ena_eth_com.c if (unlikely(!io_sq->entries_in_tx_burst_left)) { io_sq 91 drivers/net/ethernet/amazon/ena/ena_eth_com.c io_sq->entries_in_tx_burst_left--; io_sq 93 drivers/net/ethernet/amazon/ena/ena_eth_com.c io_sq->qid, io_sq->entries_in_tx_burst_left); io_sq 102 drivers/net/ethernet/amazon/ena/ena_eth_com.c __iowrite64_copy(io_sq->desc_addr.pbuf_dev_addr + dst_offset, io_sq 105 drivers/net/ethernet/amazon/ena/ena_eth_com.c io_sq->tail++; io_sq 108 drivers/net/ethernet/amazon/ena/ena_eth_com.c if (unlikely((io_sq->tail & (io_sq->q_depth - 1)) == 0)) io_sq 109 drivers/net/ethernet/amazon/ena/ena_eth_com.c io_sq->phase ^= 1; io_sq 114 drivers/net/ethernet/amazon/ena/ena_eth_com.c static int ena_com_write_header_to_bounce(struct ena_com_io_sq *io_sq, io_sq 118 drivers/net/ethernet/amazon/ena/ena_eth_com.c struct ena_com_llq_pkt_ctrl *pkt_ctrl = &io_sq->llq_buf_ctrl; io_sq 119 drivers/net/ethernet/amazon/ena/ena_eth_com.c struct ena_com_llq_info *llq_info = &io_sq->llq_info; io_sq 123 drivers/net/ethernet/amazon/ena/ena_eth_com.c if (unlikely(io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST)) io_sq 127 drivers/net/ethernet/amazon/ena/ena_eth_com.c llq_info->descs_num_before_header * io_sq->desc_entry_size; io_sq 145 drivers/net/ethernet/amazon/ena/ena_eth_com.c static void *get_sq_desc_llq(struct ena_com_io_sq *io_sq) io_sq 147 drivers/net/ethernet/amazon/ena/ena_eth_com.c struct ena_com_llq_pkt_ctrl *pkt_ctrl = &io_sq->llq_buf_ctrl; io_sq 158 drivers/net/ethernet/amazon/ena/ena_eth_com.c sq_desc = bounce_buffer + pkt_ctrl->idx * io_sq->desc_entry_size; io_sq 165 drivers/net/ethernet/amazon/ena/ena_eth_com.c static int ena_com_close_bounce_buffer(struct ena_com_io_sq *io_sq) io_sq 167 drivers/net/ethernet/amazon/ena/ena_eth_com.c struct ena_com_llq_pkt_ctrl *pkt_ctrl = &io_sq->llq_buf_ctrl; io_sq 168 drivers/net/ethernet/amazon/ena/ena_eth_com.c struct ena_com_llq_info *llq_info = &io_sq->llq_info; io_sq 171 drivers/net/ethernet/amazon/ena/ena_eth_com.c if (unlikely(io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST)) io_sq 176 drivers/net/ethernet/amazon/ena/ena_eth_com.c rc = ena_com_write_bounce_buffer_to_dev(io_sq, io_sq 182 drivers/net/ethernet/amazon/ena/ena_eth_com.c ena_com_get_next_bounce_buffer(&io_sq->bounce_buf_ctrl); io_sq 183 drivers/net/ethernet/amazon/ena/ena_eth_com.c memset(io_sq->llq_buf_ctrl.curr_bounce_buf, io_sq 192 drivers/net/ethernet/amazon/ena/ena_eth_com.c static void *get_sq_desc(struct ena_com_io_sq *io_sq) io_sq 194 drivers/net/ethernet/amazon/ena/ena_eth_com.c if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) io_sq 195 drivers/net/ethernet/amazon/ena/ena_eth_com.c return get_sq_desc_llq(io_sq); io_sq 197 drivers/net/ethernet/amazon/ena/ena_eth_com.c return get_sq_desc_regular_queue(io_sq); io_sq 200 drivers/net/ethernet/amazon/ena/ena_eth_com.c static int ena_com_sq_update_llq_tail(struct ena_com_io_sq *io_sq) io_sq 202 drivers/net/ethernet/amazon/ena/ena_eth_com.c struct ena_com_llq_pkt_ctrl *pkt_ctrl = &io_sq->llq_buf_ctrl; io_sq 203 drivers/net/ethernet/amazon/ena/ena_eth_com.c struct ena_com_llq_info *llq_info = &io_sq->llq_info; io_sq 207 drivers/net/ethernet/amazon/ena/ena_eth_com.c rc = ena_com_write_bounce_buffer_to_dev(io_sq, io_sq 213 drivers/net/ethernet/amazon/ena/ena_eth_com.c ena_com_get_next_bounce_buffer(&io_sq->bounce_buf_ctrl); io_sq 214 drivers/net/ethernet/amazon/ena/ena_eth_com.c memset(io_sq->llq_buf_ctrl.curr_bounce_buf, io_sq 222 drivers/net/ethernet/amazon/ena/ena_eth_com.c llq_info->desc_list_entry_size / io_sq->desc_entry_size; io_sq 228 drivers/net/ethernet/amazon/ena/ena_eth_com.c static int ena_com_sq_update_tail(struct ena_com_io_sq *io_sq) io_sq 230 drivers/net/ethernet/amazon/ena/ena_eth_com.c if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) io_sq 231 drivers/net/ethernet/amazon/ena/ena_eth_com.c return ena_com_sq_update_llq_tail(io_sq); io_sq 233 drivers/net/ethernet/amazon/ena/ena_eth_com.c io_sq->tail++; io_sq 236 drivers/net/ethernet/amazon/ena/ena_eth_com.c if (unlikely((io_sq->tail & (io_sq->q_depth - 1)) == 0)) io_sq 237 drivers/net/ethernet/amazon/ena/ena_eth_com.c io_sq->phase ^= 1; io_sq 288 drivers/net/ethernet/amazon/ena/ena_eth_com.c static int ena_com_create_and_store_tx_meta_desc(struct ena_com_io_sq *io_sq, io_sq 294 drivers/net/ethernet/amazon/ena/ena_eth_com.c meta_desc = get_sq_desc(io_sq); io_sq 313 drivers/net/ethernet/amazon/ena/ena_eth_com.c meta_desc->len_ctrl |= (io_sq->phase << io_sq 331 drivers/net/ethernet/amazon/ena/ena_eth_com.c memcpy(&io_sq->cached_tx_meta, ena_meta, io_sq 334 drivers/net/ethernet/amazon/ena/ena_eth_com.c return ena_com_sq_update_tail(io_sq); io_sq 369 drivers/net/ethernet/amazon/ena/ena_eth_com.c int ena_com_prepare_tx(struct ena_com_io_sq *io_sq, io_sq 378 drivers/net/ethernet/amazon/ena/ena_eth_com.c u16 start_tail = io_sq->tail; io_sq 383 drivers/net/ethernet/amazon/ena/ena_eth_com.c WARN(io_sq->direction != ENA_COM_IO_QUEUE_DIRECTION_TX, "wrong Q type"); io_sq 386 drivers/net/ethernet/amazon/ena/ena_eth_com.c if (unlikely(!ena_com_sq_have_enough_space(io_sq, num_bufs + 1))) { io_sq 391 drivers/net/ethernet/amazon/ena/ena_eth_com.c if (unlikely(header_len > io_sq->tx_max_header_size)) { io_sq 393 drivers/net/ethernet/amazon/ena/ena_eth_com.c header_len, io_sq->tx_max_header_size); io_sq 397 drivers/net/ethernet/amazon/ena/ena_eth_com.c if (unlikely(io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV && io_sq 401 drivers/net/ethernet/amazon/ena/ena_eth_com.c rc = ena_com_write_header_to_bounce(io_sq, buffer_to_push, header_len); io_sq 405 drivers/net/ethernet/amazon/ena/ena_eth_com.c have_meta = ena_tx_ctx->meta_valid && ena_com_meta_desc_changed(io_sq, io_sq 408 drivers/net/ethernet/amazon/ena/ena_eth_com.c rc = ena_com_create_and_store_tx_meta_desc(io_sq, ena_tx_ctx); io_sq 415 drivers/net/ethernet/amazon/ena/ena_eth_com.c rc = ena_com_close_bounce_buffer(io_sq); io_sq 416 drivers/net/ethernet/amazon/ena/ena_eth_com.c *nb_hw_desc = io_sq->tail - start_tail; io_sq 420 drivers/net/ethernet/amazon/ena/ena_eth_com.c desc = get_sq_desc(io_sq); io_sq 432 drivers/net/ethernet/amazon/ena/ena_eth_com.c desc->len_ctrl |= (io_sq->phase << ENA_ETH_IO_TX_DESC_PHASE_SHIFT) & io_sq 474 drivers/net/ethernet/amazon/ena/ena_eth_com.c rc = ena_com_sq_update_tail(io_sq); io_sq 478 drivers/net/ethernet/amazon/ena/ena_eth_com.c desc = get_sq_desc(io_sq); io_sq 484 drivers/net/ethernet/amazon/ena/ena_eth_com.c desc->len_ctrl |= (io_sq->phase << io_sq 493 drivers/net/ethernet/amazon/ena/ena_eth_com.c GENMASK_ULL(io_sq->dma_addr_bits - 1, 32)) >> 32); io_sq 504 drivers/net/ethernet/amazon/ena/ena_eth_com.c rc = ena_com_sq_update_tail(io_sq); io_sq 508 drivers/net/ethernet/amazon/ena/ena_eth_com.c rc = ena_com_close_bounce_buffer(io_sq); io_sq 510 drivers/net/ethernet/amazon/ena/ena_eth_com.c *nb_hw_desc = io_sq->tail - start_tail; io_sq 515 drivers/net/ethernet/amazon/ena/ena_eth_com.c struct ena_com_io_sq *io_sq, io_sq 550 drivers/net/ethernet/amazon/ena/ena_eth_com.c io_sq->next_to_comp += nb_hw_desc; io_sq 552 drivers/net/ethernet/amazon/ena/ena_eth_com.c pr_debug("[%s][QID#%d] Updating SQ head to: %d\n", __func__, io_sq->qid, io_sq 553 drivers/net/ethernet/amazon/ena/ena_eth_com.c io_sq->next_to_comp); io_sq 562 drivers/net/ethernet/amazon/ena/ena_eth_com.c int ena_com_add_single_rx_desc(struct ena_com_io_sq *io_sq, io_sq 568 drivers/net/ethernet/amazon/ena/ena_eth_com.c WARN(io_sq->direction != ENA_COM_IO_QUEUE_DIRECTION_RX, "wrong Q type"); io_sq 570 drivers/net/ethernet/amazon/ena/ena_eth_com.c if (unlikely(!ena_com_sq_have_enough_space(io_sq, 1))) io_sq 573 drivers/net/ethernet/amazon/ena/ena_eth_com.c desc = get_sq_desc(io_sq); io_sq 583 drivers/net/ethernet/amazon/ena/ena_eth_com.c desc->ctrl |= io_sq->phase & ENA_ETH_IO_RX_DESC_PHASE_MASK; io_sq 590 drivers/net/ethernet/amazon/ena/ena_eth_com.c ((ena_buf->paddr & GENMASK_ULL(io_sq->dma_addr_bits - 1, 32)) >> 32); io_sq 592 drivers/net/ethernet/amazon/ena/ena_eth_com.c return ena_com_sq_update_tail(io_sq); io_sq 78 drivers/net/ethernet/amazon/ena/ena_eth_com.h int ena_com_prepare_tx(struct ena_com_io_sq *io_sq, io_sq 83 drivers/net/ethernet/amazon/ena/ena_eth_com.h struct ena_com_io_sq *io_sq, io_sq 86 drivers/net/ethernet/amazon/ena/ena_eth_com.h int ena_com_add_single_rx_desc(struct ena_com_io_sq *io_sq, io_sq 98 drivers/net/ethernet/amazon/ena/ena_eth_com.h static inline int ena_com_free_desc(struct ena_com_io_sq *io_sq) io_sq 102 drivers/net/ethernet/amazon/ena/ena_eth_com.h next_to_comp = io_sq->next_to_comp; io_sq 103 drivers/net/ethernet/amazon/ena/ena_eth_com.h tail = io_sq->tail; io_sq 106 drivers/net/ethernet/amazon/ena/ena_eth_com.h return io_sq->q_depth - 1 - cnt; io_sq 110 drivers/net/ethernet/amazon/ena/ena_eth_com.h static inline bool ena_com_sq_have_enough_space(struct ena_com_io_sq *io_sq, io_sq 115 drivers/net/ethernet/amazon/ena/ena_eth_com.h if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST) io_sq 116 drivers/net/ethernet/amazon/ena/ena_eth_com.h return ena_com_free_desc(io_sq) >= required_buffers; io_sq 123 drivers/net/ethernet/amazon/ena/ena_eth_com.h temp = required_buffers / io_sq->llq_info.descs_per_entry + 2; io_sq 125 drivers/net/ethernet/amazon/ena/ena_eth_com.h return ena_com_free_desc(io_sq) > temp; io_sq 128 drivers/net/ethernet/amazon/ena/ena_eth_com.h static inline bool ena_com_meta_desc_changed(struct ena_com_io_sq *io_sq, io_sq 134 drivers/net/ethernet/amazon/ena/ena_eth_com.h return !!memcmp(&io_sq->cached_tx_meta, io_sq 139 drivers/net/ethernet/amazon/ena/ena_eth_com.h static inline bool is_llq_max_tx_burst_exists(struct ena_com_io_sq *io_sq) io_sq 141 drivers/net/ethernet/amazon/ena/ena_eth_com.h return (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) && io_sq 142 drivers/net/ethernet/amazon/ena/ena_eth_com.h io_sq->llq_info.max_entries_in_tx_burst > 0; io_sq 145 drivers/net/ethernet/amazon/ena/ena_eth_com.h static inline bool ena_com_is_doorbell_needed(struct ena_com_io_sq *io_sq, io_sq 153 drivers/net/ethernet/amazon/ena/ena_eth_com.h if (!is_llq_max_tx_burst_exists(io_sq)) io_sq 156 drivers/net/ethernet/amazon/ena/ena_eth_com.h llq_info = &io_sq->llq_info; io_sq 159 drivers/net/ethernet/amazon/ena/ena_eth_com.h if (unlikely(ena_com_meta_desc_changed(io_sq, ena_tx_ctx))) io_sq 168 drivers/net/ethernet/amazon/ena/ena_eth_com.h pr_debug("queue: %d num_descs: %d num_entries_needed: %d\n", io_sq->qid, io_sq 171 drivers/net/ethernet/amazon/ena/ena_eth_com.h return num_entries_needed > io_sq->entries_in_tx_burst_left; io_sq 174 drivers/net/ethernet/amazon/ena/ena_eth_com.h static inline int ena_com_write_sq_doorbell(struct ena_com_io_sq *io_sq) io_sq 176 drivers/net/ethernet/amazon/ena/ena_eth_com.h u16 max_entries_in_tx_burst = io_sq->llq_info.max_entries_in_tx_burst; io_sq 177 drivers/net/ethernet/amazon/ena/ena_eth_com.h u16 tail = io_sq->tail; io_sq 180 drivers/net/ethernet/amazon/ena/ena_eth_com.h io_sq->qid, tail); io_sq 182 drivers/net/ethernet/amazon/ena/ena_eth_com.h writel(tail, io_sq->db_addr); io_sq 184 drivers/net/ethernet/amazon/ena/ena_eth_com.h if (is_llq_max_tx_burst_exists(io_sq)) { io_sq 186 drivers/net/ethernet/amazon/ena/ena_eth_com.h io_sq->qid, max_entries_in_tx_burst); io_sq 187 drivers/net/ethernet/amazon/ena/ena_eth_com.h io_sq->entries_in_tx_burst_left = max_entries_in_tx_burst; io_sq 228 drivers/net/ethernet/amazon/ena/ena_eth_com.h static inline void ena_com_comp_ack(struct ena_com_io_sq *io_sq, u16 elem) io_sq 230 drivers/net/ethernet/amazon/ena/ena_eth_com.h io_sq->next_to_comp += elem;