From: Flavia Musatescu <flavia.musatescu@intel.com>
To: dev@dpdk.org, "John W. Linville" <linville@tuxdriver.com>
Cc: stable@dpdk.org, Flavia Musatescu <flavia.musatescu@intel.com>,
ciwillia@brocade.com
Subject: [dpdk-stable] [PATCH v4] net/af_packet: improve Tx statistics accuracy
Date: Fri, 18 Oct 2019 15:24:31 +0100 [thread overview]
Message-ID: <1571408671-29209-1-git-send-email-flavia.musatescu@intel.com> (raw)
In-Reply-To: <1571313107-31794-1-git-send-email-flavia.musatescu@intel.com>
When sendto call fails and ENOBUFS/EAGAIN error is being set
some of the packets are actually successfully transmitted.
There is no available count of those packets, so in order to
make the statistics more accurate, all the previously enqueued
packets will be considered successful, even though this is not
entirely correct.
Statistics numbers before this update:
Pktgen:
Total Rx Pkts: 1360084
Tx Pkts: 2000000
testpmd:
RX-packets: 1408346 RX-missed: 0 RX-bytes: 84503418
TX-packets: 526486 TX-errors: 881851 TX-bytes: 31589724
Statistics numbers after this update:
Pktgen:
Total Rx Pkts: 1329872
Tx Pkts: 2000000
testpmd:
RX-packets: 1389156 RX-missed: 0 RX-bytes: 83349360
TX-packets: 1389156 TX-errors: 0 TX-bytes: 83349360
Fixes: 74b7fc0a0ff1 ("net/af_packet: fix packet bytes counting")
Cc: ciwillia@brocade.com
Cc: stable@dpdk.org
Signed-off-by: Flavia Musatescu <flavia.musatescu@intel.com>
---
v2:
* Changed the comment.
v3:
* Same applied for EAGAIN error.
v4:
* Updated the statistics in the commit message
---
drivers/net/af_packet/rte_eth_af_packet.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 6df09f2..5592626 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -244,8 +244,14 @@ eth_af_packet_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
}
/* kick-off transmits */
- if (sendto(pkt_q->sockfd, NULL, 0, MSG_DONTWAIT, NULL, 0) == -1) {
- /* error sending -- no packets transmitted */
+ if (sendto(pkt_q->sockfd, NULL, 0, MSG_DONTWAIT, NULL, 0) == -1 &&
+ errno != ENOBUFS && errno != EAGAIN) {
+ /*
+ * In case of a ENOBUFS/EAGAIN error all of the enqueued
+ * packets will be considered successful even though only some
+ * are sent.
+ */
+
num_tx = 0;
num_tx_bytes = 0;
}
--
2.7.4
next prev parent reply other threads:[~2019-10-18 14:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-09 15:29 [dpdk-stable] [PATCH] " Flavia Musatescu
2019-10-09 17:26 ` [dpdk-stable] [dpdk-dev] " Stephen Hemminger
2019-10-10 17:34 ` [dpdk-stable] [PATCH v2] " Flavia Musatescu
2019-10-10 18:35 ` [dpdk-stable] [dpdk-dev] " Stephen Hemminger
2019-10-11 17:13 ` Musatescu, Flavia
2019-10-17 11:51 ` [dpdk-stable] [PATCH v3] " Flavia Musatescu
2019-10-18 14:24 ` Flavia Musatescu [this message]
2019-10-18 15:15 ` [dpdk-stable] [PATCH v4] " Ferruh Yigit
2019-10-21 18:15 ` [dpdk-stable] [dpdk-dev] " 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=1571408671-29209-1-git-send-email-flavia.musatescu@intel.com \
--to=flavia.musatescu@intel.com \
--cc=ciwillia@brocade.com \
--cc=dev@dpdk.org \
--cc=linville@tuxdriver.com \
--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).