[dpdk-stable] patch 'net/af_packet: fix packet bytes counting' has been queued to stable release 17.05.1

Yuanhan Liu yliu at fridaylinux.org
Tue Jun 20 13:35:24 CEST 2017


Hi,

FYI, your patch has been queued to stable release 17.05.1

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

Thanks.

	--yliu

---
>From 0f288f83f229ba9563beda2b7b90b4dc82d013c1 Mon Sep 17 00:00:00 2001
From: Chas Williams <ciwillia at brocade.com>
Date: Wed, 17 May 2017 14:03:35 -0400
Subject: [PATCH] net/af_packet: fix packet bytes counting

[ upstream commit 74b7fc0a0ff151d7160171cfb0f712dcdd704505 ]

On error, we also need to zero the bytes transmitted.

Fixes: f4ff17a465d2 ("net/af_packet: guard against buffer overruns in Tx path")

Signed-off-by: Chas Williams <ciwillia at brocade.com>
---
 drivers/net/af_packet/rte_eth_af_packet.c | 7 +++++--
 1 file changed, 5 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 dd77152..9ccb7af 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -252,8 +252,11 @@ 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)
-		num_tx = 0; /* error sending -- no packets transmitted */
+	if (sendto(pkt_q->sockfd, NULL, 0, MSG_DONTWAIT, NULL, 0) == -1) {
+		/* error sending -- no packets transmitted */
+		num_tx = 0;
+		num_tx_bytes = 0;
+	}
 
 	pkt_q->framenum = framenum;
 	pkt_q->tx_pkts += num_tx;
-- 
2.7.4



More information about the stable mailing list