Lines Matching refs:cq

25 				     struct otx2_cq_queue *cq);
28 struct otx2_cq_queue *cq) in otx2_nix_cq_op_status() argument
30 u64 incr = (u64)(cq->cq_idx) << 32; in otx2_nix_cq_op_status()
41 cq->cq_tail = status & 0xFFFFF; in otx2_nix_cq_op_status()
42 cq->cq_head = (status >> 20) & 0xFFFFF; in otx2_nix_cq_op_status()
43 if (cq->cq_tail < cq->cq_head) in otx2_nix_cq_op_status()
44 cq->pend_cqe = (cq->cqe_cnt - cq->cq_head) + in otx2_nix_cq_op_status()
45 cq->cq_tail; in otx2_nix_cq_op_status()
47 cq->pend_cqe = cq->cq_tail - cq->cq_head; in otx2_nix_cq_op_status()
52 static struct nix_cqe_hdr_s *otx2_get_next_cqe(struct otx2_cq_queue *cq) in otx2_get_next_cqe() argument
56 cqe_hdr = (struct nix_cqe_hdr_s *)CQE_ADDR(cq, cq->cq_head); in otx2_get_next_cqe()
60 cq->cq_head++; in otx2_get_next_cqe()
61 cq->cq_head &= (cq->cqe_cnt - 1); in otx2_get_next_cqe()
126 struct otx2_cq_queue *cq, in otx2_snd_pkt_handler() argument
140 pfvf->netdev->name, cq->cint_idx, in otx2_snd_pkt_handler()
333 struct otx2_cq_queue *cq, in otx2_rcv_pkt_handler() argument
345 if (otx2_check_rcv_errors(pfvf, cqe, cq->cq_idx)) in otx2_rcv_pkt_handler()
350 if (otx2_xdp_rcv_pkt_handler(pfvf, pfvf->xdp_prog, cqe, cq)) in otx2_rcv_pkt_handler()
365 seg_size[seg], parse, cq->cq_idx)) in otx2_rcv_pkt_handler()
366 cq->pool_ptrs++; in otx2_rcv_pkt_handler()
372 skb_record_rx_queue(skb, cq->cq_idx); in otx2_rcv_pkt_handler()
381 struct otx2_cq_queue *cq, int budget) in otx2_rx_napi_handler() argument
386 if (cq->pend_cqe >= budget) in otx2_rx_napi_handler()
389 if (otx2_nix_cq_op_status(pfvf, cq) || !cq->pend_cqe) in otx2_rx_napi_handler()
393 while (likely(processed_cqe < budget) && cq->pend_cqe) { in otx2_rx_napi_handler()
394 cqe = (struct nix_cqe_rx_s *)CQE_ADDR(cq, cq->cq_head); in otx2_rx_napi_handler()
401 cq->cq_head++; in otx2_rx_napi_handler()
402 cq->cq_head &= (cq->cqe_cnt - 1); in otx2_rx_napi_handler()
404 otx2_rcv_pkt_handler(pfvf, napi, cq, cqe); in otx2_rx_napi_handler()
409 cq->pend_cqe--; in otx2_rx_napi_handler()
414 ((u64)cq->cq_idx << 32) | processed_cqe); in otx2_rx_napi_handler()
419 void otx2_refill_pool_ptrs(void *dev, struct otx2_cq_queue *cq) in otx2_refill_pool_ptrs() argument
424 while (cq->pool_ptrs) { in otx2_refill_pool_ptrs()
425 if (otx2_alloc_buffer(pfvf, cq, &bufptr)) in otx2_refill_pool_ptrs()
427 otx2_aura_freeptr(pfvf, cq->cq_idx, bufptr + OTX2_HEAD_ROOM); in otx2_refill_pool_ptrs()
428 cq->pool_ptrs--; in otx2_refill_pool_ptrs()
433 struct otx2_cq_queue *cq, int budget) in otx2_tx_napi_handler() argument
439 if (cq->pend_cqe >= budget) in otx2_tx_napi_handler()
442 if (otx2_nix_cq_op_status(pfvf, cq) || !cq->pend_cqe) in otx2_tx_napi_handler()
446 while (likely(processed_cqe < budget) && cq->pend_cqe) { in otx2_tx_napi_handler()
447 cqe = (struct nix_cqe_tx_s *)otx2_get_next_cqe(cq); in otx2_tx_napi_handler()
453 if (cq->cq_type == CQ_XDP) { in otx2_tx_napi_handler()
454 qidx = cq->cq_idx - pfvf->hw.rx_queues; in otx2_tx_napi_handler()
458 otx2_snd_pkt_handler(pfvf, cq, in otx2_tx_napi_handler()
459 &pfvf->qset.sq[cq->cint_idx], in otx2_tx_napi_handler()
464 cq->pend_cqe--; in otx2_tx_napi_handler()
469 ((u64)cq->cq_idx << 32) | processed_cqe); in otx2_tx_napi_handler()
474 txq = netdev_get_tx_queue(pfvf->netdev, cq->cint_idx); in otx2_tx_napi_handler()
490 struct otx2_cq_queue *cq; in otx2_napi_handler() local
502 cq = &qset->cq[cq_idx]; in otx2_napi_handler()
503 if (cq->cq_type == CQ_RX) { in otx2_napi_handler()
504 rx_cq = cq; in otx2_napi_handler()
506 cq, budget); in otx2_napi_handler()
508 workdone += otx2_tx_napi_handler(pfvf, cq, budget); in otx2_napi_handler()
1014 void otx2_cleanup_rx_cqes(struct otx2_nic *pfvf, struct otx2_cq_queue *cq) in otx2_cleanup_rx_cqes() argument
1021 xdp_rxq_info_unreg(&cq->xdp_rxq); in otx2_cleanup_rx_cqes()
1023 if (otx2_nix_cq_op_status(pfvf, cq) || !cq->pend_cqe) in otx2_cleanup_rx_cqes()
1026 while (cq->pend_cqe) { in otx2_cleanup_rx_cqes()
1027 cqe = (struct nix_cqe_rx_s *)otx2_get_next_cqe(cq); in otx2_cleanup_rx_cqes()
1029 cq->pend_cqe--; in otx2_cleanup_rx_cqes()
1034 otx2_free_rcv_seg(pfvf, cqe, cq->cq_idx); in otx2_cleanup_rx_cqes()
1045 ((u64)cq->cq_idx << 32) | processed_cqe); in otx2_cleanup_rx_cqes()
1048 void otx2_cleanup_tx_cqes(struct otx2_nic *pfvf, struct otx2_cq_queue *cq) in otx2_cleanup_tx_cqes() argument
1056 sq = &pfvf->qset.sq[cq->cint_idx]; in otx2_cleanup_tx_cqes()
1058 if (otx2_nix_cq_op_status(pfvf, cq) || !cq->pend_cqe) in otx2_cleanup_tx_cqes()
1061 while (cq->pend_cqe) { in otx2_cleanup_tx_cqes()
1062 cqe = (struct nix_cqe_tx_s *)otx2_get_next_cqe(cq); in otx2_cleanup_tx_cqes()
1064 cq->pend_cqe--; in otx2_cleanup_tx_cqes()
1079 ((u64)cq->cq_idx << 32) | processed_cqe); in otx2_cleanup_tx_cqes()
1159 struct otx2_cq_queue *cq) in otx2_xdp_rcv_pkt_handler() argument
1162 int qidx = cq->cq_idx; in otx2_xdp_rcv_pkt_handler()
1173 xdp_init_buff(&xdp, pfvf->rbsize, &cq->xdp_rxq); in otx2_xdp_rcv_pkt_handler()
1187 cq->pool_ptrs++; in otx2_xdp_rcv_pkt_handler()
1191 cq->pool_ptrs++; in otx2_xdp_rcv_pkt_handler()
1210 cq->pool_ptrs++; in otx2_xdp_rcv_pkt_handler()