Takes an ethdev and a queue and sets up the tx function to be used based on * the queue parameters. Used in tx_queue_setup by primary process and then * in dev_init by secondary process when attaching to an existing ethdev. */
| 1853 | * in dev_init by secondary process when attaching to an existing ethdev. |
| 1854 | */ |
| 1855 | void |
| 1856 | ngbe_set_tx_function(struct rte_eth_dev *dev, struct ngbe_tx_queue *txq) |
| 1857 | { |
| 1858 | /* Use a simple Tx queue (no offloads, no multi segs) if possible */ |
| 1859 | if (txq->offloads == 0 && |
| 1860 | txq->tx_free_thresh >= RTE_PMD_NGBE_TX_MAX_BURST) { |
| 1861 | PMD_INIT_LOG(DEBUG, "Using simple tx code path"); |
| 1862 | dev->tx_pkt_burst = ngbe_xmit_pkts_simple; |
| 1863 | dev->tx_pkt_prepare = NULL; |
| 1864 | } else { |
| 1865 | PMD_INIT_LOG(DEBUG, "Using full-featured tx code path"); |
| 1866 | PMD_INIT_LOG(DEBUG, |
| 1867 | " - offloads = 0x%" PRIx64, |
| 1868 | txq->offloads); |
| 1869 | PMD_INIT_LOG(DEBUG, |
| 1870 | " - tx_free_thresh = %lu [RTE_PMD_NGBE_TX_MAX_BURST=%lu]", |
| 1871 | (unsigned long)txq->tx_free_thresh, |
| 1872 | (unsigned long)RTE_PMD_NGBE_TX_MAX_BURST); |
| 1873 | dev->tx_pkt_burst = ngbe_xmit_pkts; |
| 1874 | dev->tx_pkt_prepare = ngbe_prep_pkts; |
| 1875 | } |
| 1876 | } |
| 1877 | |
| 1878 | static const struct { |
| 1879 | eth_tx_burst_t pkt_burst; |
no outgoing calls
no test coverage detected