summaryrefslogtreecommitdiffstats
path: root/app/test-pmd/csumonly.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/test-pmd/csumonly.c')
-rw-r--r--app/test-pmd/csumonly.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 7e4f6620..ac4bd8f4 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -643,6 +643,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
uint16_t i;
uint64_t ol_flags;
uint16_t testpmd_ol_flags;
+ uint32_t retry;
uint32_t rx_bad_ip_csum;
uint32_t rx_bad_l4_csum;
struct testpmd_offload_info info;
@@ -676,6 +677,9 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
info.tso_segsz = txp->tso_segsz;
for (i = 0; i < nb_rx; i++) {
+ if (likely(i < nb_rx - 1))
+ rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1],
+ void *));
ol_flags = 0;
info.is_tunnel = 0;
@@ -845,6 +849,17 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
}
}
nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, nb_rx);
+ /*
+ * Retry if necessary
+ */
+ if (unlikely(nb_tx < nb_rx) && fs->retry_enabled) {
+ retry = 0;
+ while (nb_tx < nb_rx && retry++ < burst_tx_retry_num) {
+ rte_delay_us(burst_tx_delay_time);
+ nb_tx += rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
+ &pkts_burst[nb_tx], nb_rx - nb_tx);
+ }
+ }
fs->tx_packets += nb_tx;
fs->rx_bad_ip_csum += rx_bad_ip_csum;
fs->rx_bad_l4_csum += rx_bad_l4_csum;