[v4,3/4] app/testpmd: record rx_burst and fwd_dropped in flowgen

Message ID 20210812131901.25665-4-wangzhihong.wzh@bytedance.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series app/testpmd: flowgen fixes and improvements |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

王志宏 Aug. 12, 2021, 1:19 p.m. UTC
  Call inc_rx_burst_stats for rx operation, and record fwd_dropped.

Signed-off-by: Zhihong Wang <wangzhihong.wzh@bytedance.com>
---
 app/test-pmd/flowgen.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Li, Xiaoyun Aug. 13, 2021, 1:44 a.m. UTC | #1
> -----Original Message-----
> From: Zhihong Wang <wangzhihong.wzh@bytedance.com>
> Sent: Thursday, August 12, 2021 21:19
> To: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Li, Xiaoyun
> <xiaoyun.li@intel.com>; Singh, Aman Deep <aman.deep.singh@intel.com>;
> irusskikh@marvell.com; cchemparathy@tilera.com
> Cc: Zhihong Wang <wangzhihong.wzh@bytedance.com>
> Subject: [PATCH v4 3/4] app/testpmd: record rx_burst and fwd_dropped in
> flowgen
> 
> Call inc_rx_burst_stats for rx operation, and record fwd_dropped.
> 
> Signed-off-by: Zhihong Wang <wangzhihong.wzh@bytedance.com>
> ---
>  app/test-pmd/flowgen.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
  

Patch

diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c
index 96d0cc79df..229794ee9c 100644
--- a/app/test-pmd/flowgen.c
+++ b/app/test-pmd/flowgen.c
@@ -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);