[dpdk-stable] patch 'net/af_packet: improve Tx statistics accuracy' has been queued to LTS release 17.11.10

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Dec 19 15:33:44 CET 2019


Hi,

FYI, your patch has been queued to LTS release 17.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/21/19. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From 88a449cc34a5bfaf019c60b8a8b0093226550787 Mon Sep 17 00:00:00 2001
From: Flavia Musatescu <flavia.musatescu at intel.com>
Date: Fri, 18 Oct 2019 15:24:31 +0100
Subject: [PATCH] net/af_packet: improve Tx statistics accuracy

[ upstream commit d4bda0ab2972cb3fd65fbb2575a51de5a68757cb ]

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")

Signed-off-by: Flavia Musatescu <flavia.musatescu at intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 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 4735280902..ae9b0e25f0 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -263,8 +263,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.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-19 14:32:29.368474807 +0000
+++ 0077-net-af_packet-improve-Tx-statistics-accuracy.patch	2019-12-19 14:32:26.173299174 +0000
@@ -1,8 +1,10 @@
-From d4bda0ab2972cb3fd65fbb2575a51de5a68757cb Mon Sep 17 00:00:00 2001
+From 88a449cc34a5bfaf019c60b8a8b0093226550787 Mon Sep 17 00:00:00 2001
 From: Flavia Musatescu <flavia.musatescu at intel.com>
 Date: Fri, 18 Oct 2019 15:24:31 +0100
 Subject: [PATCH] net/af_packet: improve Tx statistics accuracy
 
+[ upstream commit d4bda0ab2972cb3fd65fbb2575a51de5a68757cb ]
+
 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
@@ -29,7 +31,6 @@
    TX-packets: 1389156  TX-errors: 0       TX-bytes:  83349360
 
 Fixes: 74b7fc0a0ff1 ("net/af_packet: fix packet bytes counting")
-Cc: stable at dpdk.org
 
 Signed-off-by: Flavia Musatescu <flavia.musatescu at intel.com>
 Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
@@ -38,10 +39,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 dce76b04e5..5b71db7078 100644
+index 4735280902..ae9b0e25f0 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)
+@@ -263,8 +263,14 @@ eth_af_packet_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
  	}
  
  	/* kick-off transmits */


More information about the stable mailing list