| 420 | } |
| 421 | |
| 422 | uint16_t |
| 423 | mana_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) |
| 424 | { |
| 425 | uint16_t pkt_received = 0; |
| 426 | uint16_t wqe_posted = 0; |
| 427 | struct mana_rxq *rxq = dpdk_rxq; |
| 428 | struct mana_priv *priv = rxq->priv; |
| 429 | struct rte_mbuf *mbuf; |
| 430 | int ret; |
| 431 | uint32_t pkt_idx = rxq->backlog_idx; |
| 432 | uint32_t pkt_len; |
| 433 | uint32_t i; |
| 434 | int polled = 0; |
| 435 | |
| 436 | #ifdef RTE_ARCH_32 |
| 437 | rxq->wqe_cnt_to_short_db = 0; |
| 438 | #endif |
| 439 | |
| 440 | repoll: |
| 441 | /* Polling on new completions if we have no backlog */ |
| 442 | if (rxq->comp_buf_idx == rxq->comp_buf_len) { |
| 443 | RTE_ASSERT(!pkt_idx); |
| 444 | rxq->comp_buf_len = |
| 445 | gdma_poll_completion_queue(&rxq->gdma_cq, |
| 446 | rxq->gdma_comp_buf, pkts_n); |
| 447 | rxq->comp_buf_idx = 0; |
| 448 | polled = 1; |
| 449 | } |
| 450 | |
| 451 | i = rxq->comp_buf_idx; |
| 452 | while (i < rxq->comp_buf_len) { |
| 453 | struct mana_rx_comp_oob *oob = (struct mana_rx_comp_oob *) |
| 454 | rxq->gdma_comp_buf[i].cqe_data; |
| 455 | struct mana_rxq_desc *desc = |
| 456 | &rxq->desc_ring[rxq->desc_ring_tail]; |
| 457 | |
| 458 | mbuf = desc->pkt; |
| 459 | |
| 460 | switch (oob->cqe_hdr.cqe_type) { |
| 461 | case CQE_RX_OKAY: |
| 462 | case CQE_RX_COALESCED_4: |
| 463 | /* Proceed to process mbuf */ |
| 464 | break; |
| 465 | |
| 466 | case CQE_RX_TRUNCATED: |
| 467 | default: |
| 468 | DP_LOG(ERR, "RX CQE type %d client %d vendor %d", |
| 469 | oob->cqe_hdr.cqe_type, oob->cqe_hdr.client_type, |
| 470 | oob->cqe_hdr.vendor_err); |
| 471 | |
| 472 | rxq->stats.errors++; |
| 473 | rte_pktmbuf_free(mbuf); |
| 474 | |
| 475 | i++; |
| 476 | goto drop; |
| 477 | } |
| 478 | |
| 479 | DP_LOG(DEBUG, "mana_rx_comp_oob type %d rxq %p", |
nothing calls this directly
no test coverage detected