[12/12] net/tap: fix incorrect rxq errors stat

Message ID 1551698315-2611-13-git-send-email-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series rxq q_errors[] statistics fixes |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK

Commit Message

David Marchand March 4, 2019, 11:18 a.m. UTC
  Transmit errors must not be reported in q_errors[] which is for
reception.

Fixes: 02f96a0a82d1 ("net/tap: add TUN/TAP device PMD")
Cc: stable@dpdk.org
Cc: Keith Wiles <keith.wiles@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/net/tap/rte_eth_tap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Wiles, Keith March 4, 2019, 1:58 p.m. UTC | #1
> On Mar 4, 2019, at 5:18 AM, David Marchand <david.marchand@redhat.com> wrote:
> 
> Transmit errors must not be reported in q_errors[] which is for
> reception.
> 
> Fixes: 02f96a0a82d1 ("net/tap: add TUN/TAP device PMD")
> Cc: stable@dpdk.org
> Cc: Keith Wiles <keith.wiles@intel.com>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> drivers/net/tap/rte_eth_tap.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
> index 6f5109f..94c728f 100644
> --- a/drivers/net/tap/rte_eth_tap.c
> +++ b/drivers/net/tap/rte_eth_tap.c
> @@ -968,10 +968,9 @@ struct ipc_queues {
> 
> 	for (i = 0; i < imax; i++) {
> 		tap_stats->q_opackets[i] = pmd->txq[i].stats.opackets;
> -		tap_stats->q_errors[i] = pmd->txq[i].stats.errs;
> 		tap_stats->q_obytes[i] = pmd->txq[i].stats.obytes;
> 		tx_total += tap_stats->q_opackets[i];
> -		tx_err_total += tap_stats->q_errors[i];
> +		tx_err_total += pmd->txq[i].stats.errs;
> 		tx_bytes_total += tap_stats->q_obytes[i];
> 	}
> 
> -- 
> 1.8.3.1
> 
Acked-by: Keith Wiles <keith.wiles@intel.com>

Regards,
Keith
  

Patch

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 6f5109f..94c728f 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -968,10 +968,9 @@  struct ipc_queues {
 
 	for (i = 0; i < imax; i++) {
 		tap_stats->q_opackets[i] = pmd->txq[i].stats.opackets;
-		tap_stats->q_errors[i] = pmd->txq[i].stats.errs;
 		tap_stats->q_obytes[i] = pmd->txq[i].stats.obytes;
 		tx_total += tap_stats->q_opackets[i];
-		tx_err_total += tap_stats->q_errors[i];
+		tx_err_total += pmd->txq[i].stats.errs;
 		tx_bytes_total += tap_stats->q_obytes[i];
 	}