From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Cian Ferriter <cian.ferriter@intel.com>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>, dev@dpdk.org, stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/pcap: fix byte stats for drop Tx
Date: Wed, 3 Feb 2021 17:30:25 +0000 [thread overview]
Message-ID: <20210203173025.2786063-1-ferruh.yigit@intel.com> (raw)
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>
---
drivers/net/pcap/rte_eth_pcap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index ff02ade70d1a..c7751b7ba742 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -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]);
}
--
2.29.2
next reply other threads:[~2021-02-03 17:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-03 17:30 Ferruh Yigit [this message]
2021-02-04 15:47 ` Ferriter, Cian
2021-02-04 16:24 ` Ferriter, Cian
2021-02-04 16:40 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210203173025.2786063-1-ferruh.yigit@intel.com \
--to=ferruh.yigit@intel.com \
--cc=cian.ferriter@intel.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).