Callback to handle sending ordered packets through WRIOP based interface */
| 1723 | |
| 1724 | /* Callback to handle sending ordered packets through WRIOP based interface */ |
| 1725 | uint16_t |
| 1726 | dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) |
| 1727 | { |
| 1728 | /* Function to transmit the frames to given device and VQ*/ |
| 1729 | struct dpaa2_queue *dpaa2_q = (struct dpaa2_queue *)queue; |
| 1730 | struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data; |
| 1731 | struct dpaa2_dev_priv *priv = eth_data->dev_private; |
| 1732 | struct dpaa2_queue *order_sendq = (struct dpaa2_queue *)priv->tx_vq[0]; |
| 1733 | struct qbman_fd fd_arr[MAX_TX_RING_SLOTS]; |
| 1734 | struct rte_mbuf *mi; |
| 1735 | struct rte_mempool *mp; |
| 1736 | struct qbman_eq_desc eqdesc[MAX_TX_RING_SLOTS]; |
| 1737 | struct qbman_swp *swp; |
| 1738 | uint32_t frames_to_send, num_free_eq_desc; |
| 1739 | uint32_t loop, retry_count; |
| 1740 | int32_t ret; |
| 1741 | uint16_t num_tx = 0; |
| 1742 | uint16_t bpid; |
| 1743 | struct sw_buf_free buf_to_free[DPAA2_MAX_SGS * dpaa2_dqrr_size]; |
| 1744 | uint32_t free_count = 0; |
| 1745 | |
| 1746 | if (unlikely(!DPAA2_PER_LCORE_DPIO)) { |
| 1747 | ret = dpaa2_affine_qbman_swp(); |
| 1748 | if (ret) { |
| 1749 | DPAA2_PMD_ERR( |
| 1750 | "Failed to allocate IO portal, tid: %d", |
| 1751 | rte_gettid()); |
| 1752 | return 0; |
| 1753 | } |
| 1754 | } |
| 1755 | swp = DPAA2_PER_LCORE_PORTAL; |
| 1756 | |
| 1757 | DPAA2_PMD_DP_DEBUG("===> eth_data =%p, fqid =%d\n", |
| 1758 | eth_data, dpaa2_q->fqid); |
| 1759 | |
| 1760 | /* This would also handle normal and atomic queues as any type |
| 1761 | * of packet can be enqueued when ordered queues are being used. |
| 1762 | */ |
| 1763 | while (nb_pkts) { |
| 1764 | /*Check if the queue is congested*/ |
| 1765 | retry_count = 0; |
| 1766 | while (qbman_result_SCN_state(dpaa2_q->cscn)) { |
| 1767 | retry_count++; |
| 1768 | /* Retry for some time before giving up */ |
| 1769 | if (retry_count > CONG_RETRY_COUNT) |
| 1770 | goto skip_tx; |
| 1771 | } |
| 1772 | |
| 1773 | frames_to_send = (nb_pkts > dpaa2_eqcr_size) ? |
| 1774 | dpaa2_eqcr_size : nb_pkts; |
| 1775 | |
| 1776 | if (!priv->en_loose_ordered) { |
| 1777 | if (*dpaa2_seqn(*bufs) & DPAA2_ENQUEUE_FLAG_ORP) { |
| 1778 | num_free_eq_desc = dpaa2_free_eq_descriptors(); |
| 1779 | if (num_free_eq_desc < frames_to_send) |
| 1780 | frames_to_send = num_free_eq_desc; |
| 1781 | } |
| 1782 | } |
nothing calls this directly
no test coverage detected