Skip to content

Commit

Permalink
net/pcap: fix byte stats for drop Tx
Browse files Browse the repository at this point in the history
[ upstream commit cec222d ]

Drop Tx path in pcap is Tx that just drops the packets, which is used
for the case only Rx from a pcap file is requested/matters.

The byte stats was calculated using first mbuf segment, which gives
wrong values for multi segmented mbufs, updated to use packet length
instead.

Bugzilla ID: 597
Fixes: a3f5252 ("net/pcap: enable infinitely Rx a pcap file")

Reported-by: Cian Ferriter <cian.ferriter@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Cian Ferriter <cian.ferriter@intel.com>
  • Loading branch information
Ferruh Yigit authored and bluca committed Feb 8, 2021
1 parent df1ba25 commit 63e152d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/pcap/rte_eth_pcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ eth_tx_drop(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
return 0;

for (i = 0; i < nb_pkts; i++) {
tx_bytes += bufs[i]->data_len;
tx_bytes += bufs[i]->pkt_len;
rte_pktmbuf_free(bufs[i]);
}

Expand Down

0 comments on commit 63e152d

Please sign in to comment.