Lines Matching refs:io_cq
9 struct ena_com_io_cq *io_cq) in ena_com_get_next_rx_cdesc() argument
15 head_masked = io_cq->head & (io_cq->q_depth - 1); in ena_com_get_next_rx_cdesc()
16 expected_phase = io_cq->phase; in ena_com_get_next_rx_cdesc()
18 cdesc = (struct ena_eth_io_rx_cdesc_base *)(io_cq->cdesc_addr.virt_addr in ena_com_get_next_rx_cdesc()
19 + (head_masked * io_cq->cdesc_entry_size_in_bytes)); in ena_com_get_next_rx_cdesc()
228 ena_com_rx_cdesc_idx_to_ptr(struct ena_com_io_cq *io_cq, u16 idx) in ena_com_rx_cdesc_idx_to_ptr() argument
230 idx &= (io_cq->q_depth - 1); in ena_com_rx_cdesc_idx_to_ptr()
232 ((uintptr_t)io_cq->cdesc_addr.virt_addr + in ena_com_rx_cdesc_idx_to_ptr()
233 idx * io_cq->cdesc_entry_size_in_bytes); in ena_com_rx_cdesc_idx_to_ptr()
236 static u16 ena_com_cdesc_rx_pkt_get(struct ena_com_io_cq *io_cq, in ena_com_cdesc_rx_pkt_get() argument
244 cdesc = ena_com_get_next_rx_cdesc(io_cq); in ena_com_cdesc_rx_pkt_get()
248 ena_com_cq_inc_head(io_cq); in ena_com_cdesc_rx_pkt_get()
256 *first_cdesc_idx = io_cq->cur_rx_pkt_cdesc_start_idx; in ena_com_cdesc_rx_pkt_get()
257 count += io_cq->cur_rx_pkt_cdesc_count; in ena_com_cdesc_rx_pkt_get()
259 head_masked = io_cq->head & (io_cq->q_depth - 1); in ena_com_cdesc_rx_pkt_get()
261 io_cq->cur_rx_pkt_cdesc_count = 0; in ena_com_cdesc_rx_pkt_get()
262 io_cq->cur_rx_pkt_cdesc_start_idx = head_masked; in ena_com_cdesc_rx_pkt_get()
264 netdev_dbg(ena_com_io_cq_to_ena_dev(io_cq)->net_device, in ena_com_cdesc_rx_pkt_get()
266 io_cq->qid, *first_cdesc_idx, count); in ena_com_cdesc_rx_pkt_get()
268 io_cq->cur_rx_pkt_cdesc_count += count; in ena_com_cdesc_rx_pkt_get()
350 static void ena_com_rx_set_flags(struct ena_com_io_cq *io_cq, in ena_com_rx_set_flags() argument
373 netdev_dbg(ena_com_io_cq_to_ena_dev(io_cq)->net_device, in ena_com_rx_set_flags()
542 int ena_com_rx_pkt(struct ena_com_io_cq *io_cq, in ena_com_rx_pkt() argument
548 u16 q_depth = io_cq->q_depth; in ena_com_rx_pkt()
553 WARN(io_cq->direction != ENA_COM_IO_QUEUE_DIRECTION_RX, "wrong Q type"); in ena_com_rx_pkt()
555 nb_hw_desc = ena_com_cdesc_rx_pkt_get(io_cq, &cdesc_idx); in ena_com_rx_pkt()
561 netdev_dbg(ena_com_io_cq_to_ena_dev(io_cq)->net_device, in ena_com_rx_pkt()
562 "Fetch rx packet: queue %d completed desc: %d\n", io_cq->qid, in ena_com_rx_pkt()
566 netdev_err(ena_com_io_cq_to_ena_dev(io_cq)->net_device, in ena_com_rx_pkt()
572 cdesc = ena_com_rx_cdesc_idx_to_ptr(io_cq, cdesc_idx); in ena_com_rx_pkt()
584 cdesc = ena_com_rx_cdesc_idx_to_ptr(io_cq, cdesc_idx + i); in ena_com_rx_pkt()
591 netdev_dbg(ena_com_io_cq_to_ena_dev(io_cq)->net_device, in ena_com_rx_pkt()
596 ena_com_rx_set_flags(io_cq, ena_rx_ctx, cdesc); in ena_com_rx_pkt()
640 bool ena_com_cq_empty(struct ena_com_io_cq *io_cq) in ena_com_cq_empty() argument
644 cdesc = ena_com_get_next_rx_cdesc(io_cq); in ena_com_cq_empty()