| 737 | #endif |
| 738 | |
| 739 | uint16_t dpaa_eth_queue_rx(void *q, |
| 740 | struct rte_mbuf **bufs, |
| 741 | uint16_t nb_bufs) |
| 742 | { |
| 743 | struct qman_fq *fq = q; |
| 744 | struct qm_dqrr_entry *dq; |
| 745 | uint32_t num_rx = 0, ifid = ((struct dpaa_if *)fq->dpaa_intf)->ifid; |
| 746 | int num_rx_bufs, ret; |
| 747 | uint32_t vdqcr_flags = 0; |
| 748 | |
| 749 | if (unlikely(rte_dpaa_bpid_info == NULL && |
| 750 | rte_eal_process_type() == RTE_PROC_SECONDARY)) |
| 751 | rte_dpaa_bpid_info = fq->bp_array; |
| 752 | |
| 753 | #ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER |
| 754 | if (fq->fqid == ((struct dpaa_if *)fq->dpaa_intf)->rx_queues[0].fqid) |
| 755 | dpaa_eth_err_queue((struct dpaa_if *)fq->dpaa_intf); |
| 756 | #endif |
| 757 | |
| 758 | if (likely(fq->is_static)) |
| 759 | return dpaa_eth_queue_portal_rx(fq, bufs, nb_bufs); |
| 760 | |
| 761 | if (unlikely(!DPAA_PER_LCORE_PORTAL)) { |
| 762 | ret = rte_dpaa_portal_init((void *)0); |
| 763 | if (ret) { |
| 764 | DPAA_PMD_ERR("Failure in affining portal"); |
| 765 | return 0; |
| 766 | } |
| 767 | } |
| 768 | |
| 769 | /* Until request for four buffers, we provide exact number of buffers. |
| 770 | * Otherwise we do not set the QM_VDQCR_EXACT flag. |
| 771 | * Not setting QM_VDQCR_EXACT flag can provide two more buffers than |
| 772 | * requested, so we request two less in this case. |
| 773 | */ |
| 774 | if (nb_bufs < 4) { |
| 775 | vdqcr_flags = QM_VDQCR_EXACT; |
| 776 | num_rx_bufs = nb_bufs; |
| 777 | } else { |
| 778 | num_rx_bufs = nb_bufs > DPAA_MAX_DEQUEUE_NUM_FRAMES ? |
| 779 | (DPAA_MAX_DEQUEUE_NUM_FRAMES - 2) : (nb_bufs - 2); |
| 780 | } |
| 781 | ret = qman_set_vdq(fq, num_rx_bufs, vdqcr_flags); |
| 782 | if (ret) |
| 783 | return 0; |
| 784 | |
| 785 | do { |
| 786 | dq = qman_dequeue(fq); |
| 787 | if (!dq) |
| 788 | continue; |
| 789 | bufs[num_rx++] = dpaa_eth_fd_to_mbuf(&dq->fd, ifid); |
| 790 | dpaa_display_frame_info(&dq->fd, fq->fqid, true); |
| 791 | qman_dqrr_consume(fq, dq); |
| 792 | } while (fq->flags & QMAN_FQ_STATE_VDQCR); |
| 793 | |
| 794 | return num_rx; |
| 795 | } |
| 796 |
nothing calls this directly
no test coverage detected