Lines Matching refs:io_sq
52 int ena_com_prepare_tx(struct ena_com_io_sq *io_sq,
57 struct ena_com_io_sq *io_sq,
60 int ena_com_add_single_rx_desc(struct ena_com_io_sq *io_sq,
72 static inline int ena_com_free_q_entries(struct ena_com_io_sq *io_sq) in ena_com_free_q_entries() argument
76 next_to_comp = io_sq->next_to_comp; in ena_com_free_q_entries()
77 tail = io_sq->tail; in ena_com_free_q_entries()
80 return io_sq->q_depth - 1 - cnt; in ena_com_free_q_entries()
84 static inline bool ena_com_sq_have_enough_space(struct ena_com_io_sq *io_sq, in ena_com_sq_have_enough_space() argument
89 if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST) in ena_com_sq_have_enough_space()
90 return ena_com_free_q_entries(io_sq) >= required_buffers; in ena_com_sq_have_enough_space()
97 temp = required_buffers / io_sq->llq_info.descs_per_entry + 2; in ena_com_sq_have_enough_space()
99 return ena_com_free_q_entries(io_sq) > temp; in ena_com_sq_have_enough_space()
102 static inline bool ena_com_meta_desc_changed(struct ena_com_io_sq *io_sq, in ena_com_meta_desc_changed() argument
108 return !!memcmp(&io_sq->cached_tx_meta, in ena_com_meta_desc_changed()
113 static inline bool is_llq_max_tx_burst_exists(struct ena_com_io_sq *io_sq) in is_llq_max_tx_burst_exists() argument
115 return (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) && in is_llq_max_tx_burst_exists()
116 io_sq->llq_info.max_entries_in_tx_burst > 0; in is_llq_max_tx_burst_exists()
119 static inline bool ena_com_is_doorbell_needed(struct ena_com_io_sq *io_sq, in ena_com_is_doorbell_needed() argument
127 if (!is_llq_max_tx_burst_exists(io_sq)) in ena_com_is_doorbell_needed()
130 llq_info = &io_sq->llq_info; in ena_com_is_doorbell_needed()
134 unlikely(ena_com_meta_desc_changed(io_sq, ena_tx_ctx))) in ena_com_is_doorbell_needed()
143 netdev_dbg(ena_com_io_sq_to_ena_dev(io_sq)->net_device, in ena_com_is_doorbell_needed()
145 io_sq->qid, num_descs, num_entries_needed); in ena_com_is_doorbell_needed()
147 return num_entries_needed > io_sq->entries_in_tx_burst_left; in ena_com_is_doorbell_needed()
150 static inline int ena_com_write_sq_doorbell(struct ena_com_io_sq *io_sq) in ena_com_write_sq_doorbell() argument
152 u16 max_entries_in_tx_burst = io_sq->llq_info.max_entries_in_tx_burst; in ena_com_write_sq_doorbell()
153 u16 tail = io_sq->tail; in ena_com_write_sq_doorbell()
155 netdev_dbg(ena_com_io_sq_to_ena_dev(io_sq)->net_device, in ena_com_write_sq_doorbell()
157 io_sq->qid, tail); in ena_com_write_sq_doorbell()
159 writel(tail, io_sq->db_addr); in ena_com_write_sq_doorbell()
161 if (is_llq_max_tx_burst_exists(io_sq)) { in ena_com_write_sq_doorbell()
162 netdev_dbg(ena_com_io_sq_to_ena_dev(io_sq)->net_device, in ena_com_write_sq_doorbell()
164 io_sq->qid, max_entries_in_tx_burst); in ena_com_write_sq_doorbell()
165 io_sq->entries_in_tx_burst_left = max_entries_in_tx_burst; in ena_com_write_sq_doorbell()
207 static inline void ena_com_comp_ack(struct ena_com_io_sq *io_sq, u16 elem) in ena_com_comp_ack() argument
209 io_sq->next_to_comp += elem; in ena_com_comp_ack()