On 6/17/21 2:00 PM, Jiawen Wu wrote: > Initialize device with the simplest transmit functions. > > Signed-off-by: Jiawen Wu <jiawe...@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