[dpdk-dev] [PATCH v6 15/19] net/ngbe: add simple Tx flow
Andrew Rybchenko
andrew.rybchenko at oktetlabs.ru
Fri Jul 2 18:45:16 CEST 2021
On 6/17/21 2:00 PM, Jiawen Wu wrote:
> Initialize device with the simplest transmit functions.
>
> Signed-off-by: Jiawen Wu <jiawenwu at trustnetic.com>
The patch cannot be tested before device start up.
So, it should go after corresponding patches.
[snip]
> +uint16_t
> +ngbe_xmit_pkts_simple(void *tx_queue, struct rte_mbuf **tx_pkts,
> + uint16_t nb_pkts)
> +{
> + uint16_t nb_tx;
> +
> + /* Try to transmit at least chunks of TX_MAX_BURST pkts */
> + if (likely(nb_pkts <= RTE_PMD_NGBE_TX_MAX_BURST))
> + return tx_xmit_pkts(tx_queue, tx_pkts, nb_pkts);
> +
> + /* transmit more than the max burst, in chunks of TX_MAX_BURST */
> + nb_tx = 0;
> + while (nb_pkts) {
Compare vs 0 explicitly
> + uint16_t ret, n;
> +
> + n = (uint16_t)RTE_MIN(nb_pkts, RTE_PMD_NGBE_TX_MAX_BURST);
> + ret = tx_xmit_pkts(tx_queue, &tx_pkts[nb_tx], n);
> + nb_tx = (uint16_t)(nb_tx + ret);
> + nb_pkts = (uint16_t)(nb_pkts - ret);
> + if (ret < n)
> + break;
> + }
> +
> + return nb_tx;
> +}
> +
> /*********************************************************************
> *
> * Rx functions
More information about the dev
mailing list