MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dpaa2_dev_prefetch_rx

Function dpaa2_dev_prefetch_rx

dpdk/drivers/net/dpaa2/dpaa2_rxtx.c:715–876  ·  view source on GitHub ↗

This function assumes that caller will be keep the same value for nb_pkts * across calls per queue, if that is not the case, better use non-prefetch * version of rx call. * It will return the packets as requested in previous call without honoring * the current nb_pkts or bufs space. */

Source from the content-addressed store, hash-verified

713 * the current nb_pkts or bufs space.
714 */
715uint16_t
716dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
717{
718 /* Function receive frames for a given device and VQ*/
719 struct dpaa2_queue *dpaa2_q = (struct dpaa2_queue *)queue;
720 struct qbman_result *dq_storage, *dq_storage1 = NULL;
721 uint32_t fqid = dpaa2_q->fqid;
722 int ret, num_rx = 0, pull_size;
723 uint8_t pending, status;
724 struct qbman_swp *swp;
725 const struct qbman_fd *fd;
726 struct qbman_pull_desc pulldesc;
727 struct queue_storage_info_t *q_storage = dpaa2_q->q_storage;
728 struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data;
729 struct dpaa2_dev_priv *priv = eth_data->dev_private;
730
731 if (unlikely(dpaa2_enable_err_queue))
732 dump_err_pkts(priv->rx_err_vq);
733
734 if (unlikely(!DPAA2_PER_LCORE_ETHRX_DPIO)) {
735 ret = dpaa2_affine_qbman_ethrx_swp();
736 if (ret) {
737 DPAA2_PMD_ERR("Failure in affining portal");
738 return 0;
739 }
740 }
741
742 if (unlikely(!rte_dpaa2_bpid_info &&
743 rte_eal_process_type() == RTE_PROC_SECONDARY))
744 rte_dpaa2_bpid_info = dpaa2_q->bp_array;
745
746 swp = DPAA2_PER_LCORE_ETHRX_PORTAL;
747 pull_size = (nb_pkts > dpaa2_dqrr_size) ? dpaa2_dqrr_size : nb_pkts;
748 if (unlikely(!q_storage->active_dqs)) {
749 q_storage->toggle = 0;
750 dq_storage = q_storage->dq_storage[q_storage->toggle];
751 q_storage->last_num_pkts = pull_size;
752 qbman_pull_desc_clear(&pulldesc);
753 qbman_pull_desc_set_numframes(&pulldesc,
754 q_storage->last_num_pkts);
755 qbman_pull_desc_set_fq(&pulldesc, fqid);
756 qbman_pull_desc_set_storage(&pulldesc, dq_storage,
757 (uint64_t)(DPAA2_VADDR_TO_IOVA(dq_storage)), 1);
758 if (check_swp_active_dqs(DPAA2_PER_LCORE_ETHRX_DPIO->index)) {
759 while (!qbman_check_command_complete(
760 get_swp_active_dqs(
761 DPAA2_PER_LCORE_ETHRX_DPIO->index)))
762 ;
763 clear_swp_active_dqs(DPAA2_PER_LCORE_ETHRX_DPIO->index);
764 }
765 while (1) {
766 if (qbman_swp_pull(swp, &pulldesc)) {
767 DPAA2_PMD_DP_DEBUG("VDQ command is not issued."
768 " QBMAN is busy (1)\n");
769 /* Portal was busy, try again */
770 continue;
771 }
772 break;

Callers

nothing calls this directly

Calls 15

dump_err_pktsFunction · 0.85
rte_eal_process_typeFunction · 0.85
qbman_pull_desc_clearFunction · 0.85
qbman_pull_desc_set_fqFunction · 0.85
check_swp_active_dqsFunction · 0.85
get_swp_active_dqsFunction · 0.85
clear_swp_active_dqsFunction · 0.85
qbman_swp_pullFunction · 0.85

Tested by

no test coverage detected