src/dpdk/drivers/net/txgbe/txgbe_rxtx.c
static inline void
txgbe_tx_fill_hw_ring(struct txgbe_tx_queue *txq, struct rte_mbuf **pkts,
		      uint16_t nb_pkts)
{
	volatile struct txgbe_tx_desc *txdp = &txq->tx_ring[txq->tx_tail];
	struct txgbe_tx_entry *txep = &txq->sw_ring[txq->tx_tail];
	const int N_PER_LOOP = 4;
	const int N_PER_LOOP_MASK = N_PER_LOOP - 1;
	int mainpart, leftover;
	int i, j;

	/*
	 * Process most of the packets in chunks of N pkts.  Any
	 * leftover packets will get processed one at a time.
	 */
	mainpart = (nb_pkts & ((uint32_t)~N_PER_LOOP_MASK));
	leftover = (nb_pkts & ((uint32_t)N_PER_LOOP_MASK));
	for (i = 0; i < mainpart; i += N_PER_LOOP) {
		/* Copy N mbuf pointers to the S/W ring */
		for (j = 0; j < N_PER_LOOP; ++j)
			(txep + i + j)->mbuf = *(pkts + i + j);
		tx4(txdp + i, pkts + i);
	}

	if (unlikely(leftover > 0)) {
		for (i = 0; i < leftover; ++i) {
			(txep + mainpart + i)->mbuf = *(pkts + mainpart + i);
			tx1(txdp + mainpart + i, pkts + mainpart + i);
		}
	}
}
/*
 * Fill H/W descriptor ring with mbuf data.
 * Copy mbuf pointers to the S/W ring.
 */
Fill H/W descriptor ring with mbuf data.
Copy mbuf pointers to the S/W ring.
Fill H / W descriptor ring with mbuf data . Copy mbuf pointers to the S / W ring .
static inline void
txgbe_tx_fill_hw_ring(struct txgbe_tx_queue *txq, struct rte_mbuf **pkts,
		      uint16_t nb_pkts)
{
	volatile struct txgbe_tx_desc *txdp = &txq->tx_ring[txq->tx_tail];
	struct txgbe_tx_entry *txep = &txq->sw_ring[txq->tx_tail];
	const int N_PER_LOOP = 4;
	const int N_PER_LOOP_MASK = N_PER_LOOP - 1;
	int mainpart, leftover;
	int i, j;
	mainpart = (nb_pkts & ((uint32_t)~N_PER_LOOP_MASK));
	leftover = (nb_pkts & ((uint32_t)N_PER_LOOP_MASK));
	for (i = 0; i < mainpart; i += N_PER_LOOP) {
		for (j = 0; j < N_PER_LOOP; ++j)
			(txep + i + j)->mbuf = *(pkts + i + j);
		tx4(txdp + i, pkts + i);
	}
	if (unlikely(leftover > 0)) {
		for (i = 0; i < leftover; ++i) {
			(txep + mainpart + i)->mbuf = *(pkts + mainpart + i);
			tx1(txdp + mainpart + i, pkts + mainpart + i);
		}
	}
}
static inline void txgbe_tx_fill_hw_ring ( struct txgbe_tx_queue * txq , struct rte_mbuf * * pkts , uint16_t nb_pkts ) { volatile struct txgbe_tx_desc * txdp = & txq -> tx_ring [ txq -> tx_tail ] ; struct txgbe_tx_entry * txep = & txq -> sw_ring [ txq -> tx_tail ] ; const int N_PER_LOOP = 4 ; const int N_PER_LOOP_MASK = N_PER_LOOP - 1 ; int mainpart , leftover ; int i , j ; mainpart = ( nb_pkts & ( ( uint32_t ) ~ N_PER_LOOP_MASK ) ) ; leftover = ( nb_pkts & ( ( uint32_t ) N_PER_LOOP_MASK ) ) ; for ( i = 0 ; i < mainpart ; i += N_PER_LOOP ) { for ( j = 0 ; j < N_PER_LOOP ; ++ j ) ( txep + i + j ) -> mbuf = * ( pkts + i + j ) ; tx4 ( txdp + i , pkts + i ) ; } if ( unlikely ( leftover > 0 ) ) { for ( i = 0 ; i < leftover ; ++ i ) { ( txep + mainpart + i ) -> mbuf = * ( pkts + mainpart + i ) ; tx1 ( txdp + mainpart + i , pkts + mainpart + i ) ; } } }
Fill H/W descriptor ring with mbuf data.
Fill H / W descriptor ring with mbuf data .
/*
	 * Process most of the packets in chunks of N pkts.  Any
	 * leftover packets will get processed one at a time.
	 */ /* Copy N mbuf pointers to the S/W ring */