[PATCH 02/10] port: adjust the sink port counters

Cristian Dumitrescu cristian.dumitrescu at intel.com
Sat Aug 6 00:00:21 CEST 2022


The sink port is tasked to drop all packets, hence the packet and byte
counters should be named to reflect the drop operation.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu at intel.com>
---
 lib/port/rte_swx_port_source_sink.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/port/rte_swx_port_source_sink.c b/lib/port/rte_swx_port_source_sink.c
index d3cf42c30b..757a2c4a2e 100644
--- a/lib/port/rte_swx_port_source_sink.c
+++ b/lib/port/rte_swx_port_source_sink.c
@@ -299,8 +299,8 @@ sink_pkt_tx(void *port, struct rte_swx_pkt *pkt)
 	m->pkt_len = pkt->length;
 	m->data_off = (uint16_t)pkt->offset;
 
-	p->stats.n_pkts++;
-	p->stats.n_bytes += pkt->length;
+	p->stats.n_pkts_drop++;
+	p->stats.n_bytes_drop += pkt->length;
 
 #ifdef RTE_PORT_PCAP
 	if (p->f_dump) {
@@ -335,8 +335,8 @@ __sink_pkt_clone_tx(void *port, struct rte_swx_pkt *pkt, uint32_t truncation_len
 	m->pkt_len = pkt->length;
 	m->data_off = (uint16_t)pkt->offset;
 
-	p->stats.n_pkts++;
-	p->stats.n_bytes += pkt->length;
+	p->stats.n_pkts_drop++;
+	p->stats.n_bytes_drop += pkt->length;
 	p->stats.n_pkts_clone++;
 
 #ifdef RTE_PORT_PCAP
-- 
2.34.1



More information about the dev mailing list