From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) by dpdk.org (Postfix) with ESMTP id CFE192C8 for ; Tue, 20 Jun 2017 13:36:59 +0200 (CEST) Received: by mail-pg0-f67.google.com with SMTP id u62so15040424pgb.0 for ; Tue, 20 Jun 2017 04:36:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4QXkImx3oWRtmZifZgi4yxBJNwvOT3i6CGbV0A6ydX0=; b=PDmK1bZcokdt3LeYgwoXK7h+Tau6wscCW9R58C9bJxcsHGWIzjZgZLw49xA/I97Tg5 nVpl4OEJLFQR6+jby7YvAtgfUrCJz3Twa4da2tHBtUblcCFip22fzJfHkjpZYBYBiw9Q Ik+8DzhQ9s39lgs+w+nydzSsmoGf4xH4Q22Osf1SORAt50Guk/2JzKXEWAgF4zMeJvPx Aczp5out99aePV7gBp+tFVnoBPyJol9uBG8vlvY0Vjnqdf+ZVImZ1WMLYGFSB+G6xU1A xuCN7SRxquy9vozRPSlKqr1oVDWYX5puxYrYC+AAMtdHgGE0aKqhZ63cerKW+EQeLNim vuww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4QXkImx3oWRtmZifZgi4yxBJNwvOT3i6CGbV0A6ydX0=; b=BmbONodafTXLGS1oP3WK25k6JFHU3lxJM1I8zG6aX7zMucJDFN9hWvrnOkYmCuBTX6 MFC3mg7c2YPxA0sQV6LIC2zVm6EUUIDCi7wt/Jqg+74Wpw0ULUZ0ZZxs6Siw+OR4V3Mt MHKuG2zgwo9d6cCs9gGCRqoqNEhOBjsd06P+k0QNKMECa1Cvt36MwlrZ7U6NGJO6DIpW 72aqw2HLIALW0SZNlya5yHEBGLoQZSZ3oifDXi2mpnngeMkCA0cYi57ZcWP/whZSBH5h yK3I9k767XQiomfTtp/5bxG/knhn5nClqWjOwfWpXYj7BHheKdhHVdZlEo+EGuV1Ob25 T9Uw== X-Gm-Message-State: AKS2vOw5cez1dcyJoyRmY2VtETCmWbHe0BuznclwaTYrqPOIkx5B3yQG 78BJhhExLuLBTK92sBIQKw== X-Received: by 10.99.48.7 with SMTP id w7mr10896034pgw.244.1497958619196; Tue, 20 Jun 2017 04:36:59 -0700 (PDT) Received: from yliu-home.localdomain ([45.63.61.64]) by smtp.gmail.com with ESMTPSA id 25sm6104783pfj.59.2017.06.20.04.36.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 04:36:58 -0700 (PDT) From: Yuanhan Liu To: Chas Williams Cc: dpdk stable Date: Tue, 20 Jun 2017 19:35:24 +0800 Message-Id: <1497958550-13600-12-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497958550-13600-1-git-send-email-yliu@fridaylinux.org> References: <1497958550-13600-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/af_packet: fix packet bytes counting' has been queued to stable release 17.05.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jun 2017 11:37:00 -0000 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 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 --- 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