net/pcap: fix byte stats for drop Tx
authorFerruh Yigit <ferruh.yigit@intel.com>
Wed, 3 Feb 2021 17:30:25 +0000 (17:30 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 4 Feb 2021 17:19:37 +0000 (18:19 +0100)
commitcec222d6e55d9bd15eff7fbbf45464c0c6a941c0
tree36b42d860b7d2a63e65c4098e33a46ccfc7f1f78
parent295b34f55b001bceb27d9177b55326ccda49351b
net/pcap: fix byte stats for drop Tx

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: a3f5252e5cbd ("net/pcap: enable infinitely Rx a pcap file")
Cc: stable@dpdk.org
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>
drivers/net/pcap/rte_eth_pcap.c