From: Raslan Darawsheh Date: Wed, 10 Oct 2018 07:01:41 +0000 (+0000) Subject: net/tap: fix reported number of Tx packets X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9396ad3346720b424a10dcf6640c919e37a4fcf7;hp=ea2c9969b52d9a2f269397f6dbc5b24495607945;p=dpdk.git net/tap: fix reported number of Tx packets When writev fails to send packets it doesn't update the number of Tx packets, but it still num_tx is updated. The value that should be returned is the actual number of sent packets which is num_packets. Fixes: 02f96a0a82d1 ("net/tap: add TUN/TAP device PMD") CC: stable@dpdk.org Signed-off-by: Raslan Darawsheh Acked-by: Keith Wiles --- diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 84aaf24101..77f26940b6 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -685,7 +685,7 @@ pmd_tx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) txq->stats.errs += nb_pkts - num_tx; txq->stats.obytes += num_tx_bytes; - return num_tx; + return num_packets; } static const char *