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

Function dpaa2_dev_rx

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

Source from the content-addressed store, hash-verified

955}
956
957uint16_t
958dpaa2_dev_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
959{
960 /* Function receive frames for a given device and VQ */
961 struct dpaa2_queue *dpaa2_q = (struct dpaa2_queue *)queue;
962 struct qbman_result *dq_storage;
963 uint32_t fqid = dpaa2_q->fqid;
964 int ret, num_rx = 0, next_pull = nb_pkts, num_pulled;
965 uint8_t pending, status;
966 struct qbman_swp *swp;
967 const struct qbman_fd *fd;
968 struct qbman_pull_desc pulldesc;
969 struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data;
970 struct dpaa2_dev_priv *priv = eth_data->dev_private;
971
972 if (unlikely(dpaa2_enable_err_queue))
973 dump_err_pkts(priv->rx_err_vq);
974
975 if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
976 ret = dpaa2_affine_qbman_swp();
977 if (ret) {
978 DPAA2_PMD_ERR(
979 "Failed to allocate IO portal, tid: %d",
980 rte_gettid());
981 return 0;
982 }
983 }
984 swp = DPAA2_PER_LCORE_PORTAL;
985
986 do {
987 dq_storage = dpaa2_q->q_storage->dq_storage[0];
988 qbman_pull_desc_clear(&pulldesc);
989 qbman_pull_desc_set_fq(&pulldesc, fqid);
990 qbman_pull_desc_set_storage(&pulldesc, dq_storage,
991 (size_t)(DPAA2_VADDR_TO_IOVA(dq_storage)), 1);
992
993 if (next_pull > dpaa2_dqrr_size) {
994 qbman_pull_desc_set_numframes(&pulldesc,
995 dpaa2_dqrr_size);
996 next_pull -= dpaa2_dqrr_size;
997 } else {
998 qbman_pull_desc_set_numframes(&pulldesc, next_pull);
999 next_pull = 0;
1000 }
1001
1002 while (1) {
1003 if (qbman_swp_pull(swp, &pulldesc)) {
1004 DPAA2_PMD_DP_DEBUG(
1005 "VDQ command is not issued.QBMAN is busy\n");
1006 /* Portal was busy, try again */
1007 continue;
1008 }
1009 break;
1010 }
1011
1012 rte_prefetch0((void *)((size_t)(dq_storage + 1)));
1013 /* Check if the previous issued command is completed. */
1014 while (!qbman_check_command_complete(dq_storage))

Callers

nothing calls this directly

Calls 15

dump_err_pktsFunction · 0.85
dpaa2_affine_qbman_swpFunction · 0.85
rte_gettidFunction · 0.85
qbman_pull_desc_clearFunction · 0.85
qbman_pull_desc_set_fqFunction · 0.85
qbman_swp_pullFunction · 0.85
qbman_check_new_resultFunction · 0.85
qbman_result_DQ_flagsFunction · 0.85

Tested by

no test coverage detected