[dpdk-dev] [PATCH 04/32] net/ngbe: support TSO
Ferruh Yigit
ferruh.yigit at intel.com
Wed Sep 15 18:57:36 CEST 2021
On 9/8/2021 9:37 AM, Jiawen Wu wrote:
> Add transmit datapath with offloads, and support TCP segmentation
> offload.
>
> Signed-off-by: Jiawen Wu <jiawenwu at trustnetic.com>
<...>
> +/* 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.
> + */
> +void
> +ngbe_set_tx_function(struct rte_eth_dev *dev, struct ngbe_tx_queue *txq)
> +{
> + /* Use a simple Tx queue (no offloads, no multi segs) if possible */
> + if (txq->offloads == 0 &&
> + txq->tx_free_thresh >= RTE_PMD_NGBE_TX_MAX_BURST) {
> + PMD_INIT_LOG(DEBUG, "Using simple tx code path");
> + dev->tx_pkt_burst = ngbe_xmit_pkts_simple;
> + dev->tx_pkt_prepare = NULL;
> + } else {
> + PMD_INIT_LOG(DEBUG, "Using full-featured tx code path");
> + PMD_INIT_LOG(DEBUG,
> + " - offloads = 0x%" PRIx64,
> + txq->offloads);
> + PMD_INIT_LOG(DEBUG,
> + " - tx_free_thresh = %lu [RTE_PMD_NGBE_TX_MAX_BURST=%lu]",
> + (unsigned long)txq->tx_free_thresh,
> + (unsigned long)RTE_PMD_NGBE_TX_MAX_BURST);
> + dev->tx_pkt_burst = ngbe_xmit_pkts;
> + dev->tx_pkt_prepare = ngbe_prep_pkts;
> + }
> +}
Since driver has multiple Rx/Tx functions now, you may want to implement new
APIs to get info about current burst function (in a separate patch):
'rte_eth_rx_burst_mode_get()'
'rte_eth_tx_burst_mode_get()'
More information about the dev
mailing list