app/testpmd: record Rx and dropped stats in flowgen
authorZhihong Wang <wangzhihong.wzh@bytedance.com>
Fri, 13 Aug 2021 08:05:47 +0000 (16:05 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 24 Aug 2021 16:54:18 +0000 (18:54 +0200)
Call inc_rx_burst_stats for rx operation, and record fwd_dropped.

Signed-off-by: Zhihong Wang <wangzhihong.wzh@bytedance.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
app/test-pmd/flowgen.c

index 96d0cc7..229794e 100644 (file)
@@ -87,6 +87,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs)
        /* Receive a burst of packets and discard them. */
        nb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, pkts_burst,
                                 nb_pkt_per_burst);
+       inc_rx_burst_stats(fs, nb_rx);
        fs->rx_packets += nb_rx;
 
        for (i = 0; i < nb_rx; i++)
@@ -186,6 +187,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs)
                while (next_flow < 0)
                        next_flow += cfg_n_flows;
 
+               fs->fwd_dropped += nb_pkt - nb_tx;
                do {
                        rte_pktmbuf_free(pkts_burst[nb_tx]);
                } while (++nb_tx < nb_pkt);