Lines Matching refs:io_sq
54 int ena_com_prepare_tx(struct ena_com_io_sq *io_sq,
59 struct ena_com_io_sq *io_sq,
62 int ena_com_add_single_rx_desc(struct ena_com_io_sq *io_sq,
74 static inline int ena_com_free_q_entries(struct ena_com_io_sq *io_sq) in ena_com_free_q_entries() argument
78 next_to_comp = io_sq->next_to_comp; in ena_com_free_q_entries()
79 tail = io_sq->tail; in ena_com_free_q_entries()
82 return io_sq->q_depth - 1 - cnt; in ena_com_free_q_entries()
86 static inline bool ena_com_sq_have_enough_space(struct ena_com_io_sq *io_sq, in ena_com_sq_have_enough_space() argument
91 if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST) in ena_com_sq_have_enough_space()
92 return ena_com_free_q_entries(io_sq) >= required_buffers; in ena_com_sq_have_enough_space()
99 temp = required_buffers / io_sq->llq_info.descs_per_entry + 2; in ena_com_sq_have_enough_space()
101 return ena_com_free_q_entries(io_sq) > temp; in ena_com_sq_have_enough_space()
104 static inline bool ena_com_meta_desc_changed(struct ena_com_io_sq *io_sq, in ena_com_meta_desc_changed() argument
110 return !!memcmp(&io_sq->cached_tx_meta, in ena_com_meta_desc_changed()
115 static inline bool is_llq_max_tx_burst_exists(struct ena_com_io_sq *io_sq) in is_llq_max_tx_burst_exists() argument
117 return (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) && in is_llq_max_tx_burst_exists()
118 io_sq->llq_info.max_entries_in_tx_burst > 0; in is_llq_max_tx_burst_exists()
121 static inline bool ena_com_is_doorbell_needed(struct ena_com_io_sq *io_sq, in ena_com_is_doorbell_needed() argument
129 if (!is_llq_max_tx_burst_exists(io_sq)) in ena_com_is_doorbell_needed()
132 llq_info = &io_sq->llq_info; in ena_com_is_doorbell_needed()
136 unlikely(ena_com_meta_desc_changed(io_sq, ena_tx_ctx))) in ena_com_is_doorbell_needed()
145 netdev_dbg(ena_com_io_sq_to_ena_dev(io_sq)->net_device, in ena_com_is_doorbell_needed()
146 "Queue: %d num_descs: %d num_entries_needed: %d\n", io_sq->qid, num_descs, in ena_com_is_doorbell_needed()
149 return num_entries_needed > io_sq->entries_in_tx_burst_left; in ena_com_is_doorbell_needed()
152 static inline int ena_com_write_sq_doorbell(struct ena_com_io_sq *io_sq) in ena_com_write_sq_doorbell() argument
154 u16 max_entries_in_tx_burst = io_sq->llq_info.max_entries_in_tx_burst; in ena_com_write_sq_doorbell()
155 u16 tail = io_sq->tail; in ena_com_write_sq_doorbell()
157 netdev_dbg(ena_com_io_sq_to_ena_dev(io_sq)->net_device, in ena_com_write_sq_doorbell()
158 "Write submission queue doorbell for queue: %d tail: %d\n", io_sq->qid, tail); in ena_com_write_sq_doorbell()
160 writel(tail, io_sq->db_addr); in ena_com_write_sq_doorbell()
162 if (is_llq_max_tx_burst_exists(io_sq)) { in ena_com_write_sq_doorbell()
163 netdev_dbg(ena_com_io_sq_to_ena_dev(io_sq)->net_device, in ena_com_write_sq_doorbell()
164 "Reset available entries in tx burst for queue %d to %d\n", io_sq->qid, in ena_com_write_sq_doorbell()
166 io_sq->entries_in_tx_burst_left = max_entries_in_tx_burst; in ena_com_write_sq_doorbell()
186 static inline void ena_com_comp_ack(struct ena_com_io_sq *io_sq, u16 elem) in ena_com_comp_ack() argument
188 io_sq->next_to_comp += elem; in ena_com_comp_ack()