From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4CC9EA0543 for ; Tue, 21 Jun 2022 10:04:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 47EF740151; Tue, 21 Jun 2022 10:04:15 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2068.outbound.protection.outlook.com [40.107.94.68]) by mails.dpdk.org (Postfix) with ESMTP id 34BBA427F0 for ; Tue, 21 Jun 2022 10:04:14 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L0On1o4WQ8SrD9wEGttzQUl37glG8f60yktcalY1an9MFjlOCjrj5szzTZTo46xWF9JtgVn4WKC7RUqYO11qKp6pOeLG4EDQB987E9eMR/OfPfeg8AmFwoI6UY3Kqmq5B9Ox6fl/KD7bWENz79JnayFHUl5UEXueTzGd9r6uk+PEBvZ3U3BVDdjr/z1f/AVGt/eL+49xXLwKDqHvXEWAQrXKdXreXy9UrP7RwsDY2GGLb9lXPMfnTCgxnaB5z1KqjOO58Xtq0WvaZ0EfRzE6RNXXqOWAN7XYYsGsM3T6OciJSzaJINkSJUli7MFVCfi8XsyZmAOsZ0rsGEU+6IZbRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RnsjiGfas5JD8li8b3WA3IBcytR6YrFYHs9USvnpESw=; b=gNpIzuDK8yQbiE4eibeQxma9ReU8bYZkWk+Pos8ld+lsb4zlhORQOUdkkbSFX7g2HyiSyuU09XyErPgHAeQqfkJqH/PgiTbLYlocw5dNflzFxXaR1Ug52XaoPrGAhPZESCt586ydBReyyJBhve4HoXPRcmp7SeNkrOhYbNdSdwrCXJrwX5KqNcZU6ovYqNVxbhV6PvPI4ocSpNuKk9xQyDEKbO5f5yuauySgZam5r2phTp99QWENFiOdbhIfLkLDYnO55jQAv5sV2lzLujHCPVLIplS5iC5zAJkNnCrivfqWEEE0AWvDUUhZTHj19BSQByt/YzQ4Wi1lUBpb3fmXtg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RnsjiGfas5JD8li8b3WA3IBcytR6YrFYHs9USvnpESw=; b=VDtioYbLSDVVgNeP74ZJEaw9R7WpeOsDT0+SBLc4QzhgTnEw7loFr/hSmEM7z+MCPYTnceZEKgaC48+suxfKSyvOQ/AN6cBBDIcPZHK2/8AM/64LDvJUYKz4KBLUcivJTcNunI4RxneCvRGg0hz4mzSWbbcUQH6sYih6TlqohSHMur4aDao89lL5VaSx9EV7iA5yDHr+AUdlGu+LYZ59t6AeBTF1f8OGb7ansmaLnTN1lMkttPXldsw6hpnGQ2s3Te+PCsFD3Ul2jfOCh6HGsRuE5fY9agjBmNabCY2ISgtTv9Pf2E0le9KNyJcNLzJ2GwUYIgv2tZQa7RxzJTQVEw== Received: from DM5PR1401CA0005.namprd14.prod.outlook.com (2603:10b6:4:4a::15) by MWHPR1201MB0093.namprd12.prod.outlook.com (2603:10b6:301:54::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.14; Tue, 21 Jun 2022 08:04:12 +0000 Received: from DM6NAM11FT037.eop-nam11.prod.protection.outlook.com (2603:10b6:4:4a:cafe::41) by DM5PR1401CA0005.outlook.office365.com (2603:10b6:4:4a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.14 via Frontend Transport; Tue, 21 Jun 2022 08:04:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.236) by DM6NAM11FT037.mail.protection.outlook.com (10.13.172.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5353.14 via Frontend Transport; Tue, 21 Jun 2022 08:04:11 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 21 Jun 2022 08:04:10 +0000 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 21 Jun 2022 01:04:09 -0700 From: Xueming Li To: Raja Zidane CC: Viacheslav Ovsiienko , dpdk stable Subject: patch 'net/mlx5: fix Rx/Tx stats concurrency' has been queued to stable release 20.11.6 Date: Tue, 21 Jun 2022 11:01:17 +0300 Message-ID: <20220621080301.2315720-12-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220621080301.2315720-1-xuemingl@nvidia.com> References: <20220621080301.2315720-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9db75eb7-d5f0-4673-2b9a-08da535ca071 X-MS-TrafficTypeDiagnostic: MWHPR1201MB0093:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z4z2EoJDvv7zTsGOFeLsLbB+Bz8eo2rTHXjDd/ytykFBf9+ft+zYo8uFXDB+d7fMj3WEiXa/U0iP2qMelTjlUi5BnCCTzKQKVnn/Ajv6ji6uAq4ruwyTxWd+UYUfO/XGIUMwChIFS9DubSV0GVYQAcpsEi7pwvohDtYYsgh3NWtrKxMwTcEhH6kxsn/rFvpax03zH9VRbM0d985SyIWFZRe1cukT7dy7mvOyOd1zK4MinlkZ3toJU7P6x0MyBlUnzeKCapBaATUWeaxPJQ8ve+fLI/QsXzeVrGdRIr3ZKmmzfQPzQDFkqY/pc6jfIXbD7XVMMYmX1ziDNM/L5ncO3MUiIZKQG8NO0wem2R1YfCvt4dStXOoQb5Q9vEnS4iAYYZPuwt30fuTxIrIZG2h84hWLrOUbBB4m1yXAJpTkoByvi46REdxKIU9v1FUZMQFTn2wdyWzz/zq4zdYgBuiZqQUWyZPtIBEYiqoM9hNnFC0qEofoi2tZdgc5zmDU4eI9ipNaEfjop+8DMsko5c39ncP3Qf1KWvn1M3vSADFD8vn5N72UozrE4w6cHR+XZ7XcxrWZuVthOMoMd/JScXMzH2wqyMX21N64hJ6MvQZtH/KUjAZmKL5Xvx5VDJC8Ur6+ZBOQI06QzxvQFP35idt8Fz6EBH/hmDqpzxX99Ylw9W3RBTmbdrnKPrVLH9Bu7GPfwmh4PYGM6/xKX19twn/y/cHym607KsKvRMU9Rqx27w2ZeXP1ZP4CuBBnAMyMyPRz+nxtgffKa70SZ3NdoIYvES7GplA7NeyGk6oJMeOGMT3ahcqJbLd4/koPuE4vVR/UG34VQ4K5ZA2Lj/hN2C/dDkIReipSvbgMiopMRqoudmw= X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(376002)(346002)(136003)(396003)(40470700004)(46966006)(36840700001)(70206006)(70586007)(186003)(2616005)(36756003)(82310400005)(41300700001)(19627235002)(83380400001)(8676002)(36860700001)(2906002)(4326008)(6286002)(426003)(336012)(86362001)(26005)(16526019)(81166007)(966005)(356005)(47076005)(55016003)(40460700003)(40480700001)(478600001)(30864003)(54906003)(5660300002)(8936002)(82740400003)(6862004)(1076003)(316002)(37006003)(53546011)(6666004)(6636002)(7696005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2022 08:04:11.8808 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9db75eb7-d5f0-4673-2b9a-08da535ca071 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT037.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0093 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 20.11.6 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/23/22. 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. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/c4d51b3f05b56efe4e435187e67d698a07e30b94 Thanks. Xueming Li --- >From c4d51b3f05b56efe4e435187e67d698a07e30b94 Mon Sep 17 00:00:00 2001 From: Raja Zidane Date: Wed, 20 Apr 2022 18:32:17 +0300 Subject: [PATCH] net/mlx5: fix Rx/Tx stats concurrency Cc: Xueming Li [ upstream commit 773a7de21a984bb7bdb6396a659ccc585a44a806 ] Queue statistics are being continuously updated in Rx/Tx burst routines while handling traffic. In addition to that, statistics can be reset (written with zeroes) on statistics reset in other threads, causing a race condition, which in turn could result in wrong stats. The patch provides an approach with reference values, allowing the actual counters to be writable within Rx/Tx burst threads only, and updating reference values on stats reset. Fixes: 87011737b715 ("mlx5: add software counters") Signed-off-by: Raja Zidane Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_rxtx.c | 1 + drivers/net/mlx5/mlx5_rxtx.h | 2 ++ drivers/net/mlx5/mlx5_stats.c | 41 ++++++++++++++++++++--------------- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 734c462a09..edabe229d4 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -78,6 +78,7 @@ static uint16_t mlx5_tx_burst_##func(void *txq, \ } #define MLX5_TXOFF_INFO(func, olx) {mlx5_tx_burst_##func, olx}, + struct mlx5_txq_stats stats_reset; /* stats on last reset. */ static __rte_always_inline uint32_t rxq_cq_to_pkt_type(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe, diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h index 237a7faa5c..8760ab78f7 100644 --- a/drivers/net/mlx5/mlx5_rxtx.h +++ b/drivers/net/mlx5/mlx5_rxtx.h @@ -153,6 +153,7 @@ struct mlx5_rxq_data { struct mlx5_dev_ctx_shared *sh; /* Shared context. */ uint16_t idx; /* Queue index. */ struct mlx5_rxq_stats stats; + struct mlx5_rxq_stats stats_reset; /* stats on last reset. */ rte_xmm_t mbuf_initializer; /* Default rearm/flags for vectorized Rx. */ struct rte_mbuf fake_mbuf; /* elts padding for vectorized Rx. */ void *cq_uar; /* Verbs CQ user access region. */ @@ -271,6 +272,7 @@ struct mlx5_txq_data { int32_t ts_offset; /* Timestamp field dynamic offset. */ struct mlx5_dev_ctx_shared *sh; /* Shared context. */ struct mlx5_txq_stats stats; /* TX queue counters. */ + struct mlx5_txq_stats stats_reset; /* stats on last reset. */ #ifndef RTE_ARCH_64 rte_spinlock_t *uar_lock; /* UAR access lock required for 32bit implementations */ diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c index 82d4d4a745..450037aea0 100644 --- a/drivers/net/mlx5/mlx5_stats.c +++ b/drivers/net/mlx5/mlx5_stats.c @@ -113,18 +113,23 @@ mlx5_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) idx = rxq->idx; if (idx < RTE_ETHDEV_QUEUE_STAT_CNTRS) { #ifdef MLX5_PMD_SOFT_COUNTERS - tmp.q_ipackets[idx] += rxq->stats.ipackets; - tmp.q_ibytes[idx] += rxq->stats.ibytes; + tmp.q_ipackets[idx] += rxq->stats.ipackets - + rxq->stats_reset.ipackets; + tmp.q_ibytes[idx] += rxq->stats.ibytes - + rxq->stats_reset.ibytes; #endif tmp.q_errors[idx] += (rxq->stats.idropped + - rxq->stats.rx_nombuf); + rxq->stats.rx_nombuf) - + (rxq->stats_reset.idropped + + rxq->stats_reset.rx_nombuf); } #ifdef MLX5_PMD_SOFT_COUNTERS - tmp.ipackets += rxq->stats.ipackets; - tmp.ibytes += rxq->stats.ibytes; + tmp.ipackets += rxq->stats.ipackets - rxq->stats_reset.ipackets; + tmp.ibytes += rxq->stats.ibytes - rxq->stats_reset.ibytes; #endif - tmp.ierrors += rxq->stats.idropped; - tmp.rx_nombuf += rxq->stats.rx_nombuf; + tmp.ierrors += rxq->stats.idropped - rxq->stats_reset.idropped; + tmp.rx_nombuf += rxq->stats.rx_nombuf - + rxq->stats_reset.rx_nombuf; } for (i = 0; (i != priv->txqs_n); ++i) { struct mlx5_txq_data *txq = (*priv->txqs)[i]; @@ -134,15 +139,17 @@ mlx5_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) idx = txq->idx; if (idx < RTE_ETHDEV_QUEUE_STAT_CNTRS) { #ifdef MLX5_PMD_SOFT_COUNTERS - tmp.q_opackets[idx] += txq->stats.opackets; - tmp.q_obytes[idx] += txq->stats.obytes; + tmp.q_opackets[idx] += txq->stats.opackets - + txq->stats_reset.opackets; + tmp.q_obytes[idx] += txq->stats.obytes - + txq->stats_reset.obytes; #endif } #ifdef MLX5_PMD_SOFT_COUNTERS - tmp.opackets += txq->stats.opackets; - tmp.obytes += txq->stats.obytes; + tmp.opackets += txq->stats.opackets - txq->stats_reset.opackets; + tmp.obytes += txq->stats.obytes - txq->stats_reset.obytes; #endif - tmp.oerrors += txq->stats.oerrors; + tmp.oerrors += txq->stats.oerrors - txq->stats_reset.oerrors; } ret = mlx5_os_read_dev_stat(priv, "out_of_buffer", &tmp.imissed); if (ret == 0) { @@ -182,14 +189,14 @@ mlx5_stats_reset(struct rte_eth_dev *dev) for (i = 0; (i != priv->rxqs_n); ++i) { if ((*priv->rxqs)[i] == NULL) continue; - memset(&(*priv->rxqs)[i]->stats, 0, - sizeof(struct mlx5_rxq_stats)); + (*priv->rxqs)[i]->stats_reset = (*priv->rxqs)[i]->stats; } for (i = 0; (i != priv->txqs_n); ++i) { - if ((*priv->txqs)[i] == NULL) + struct mlx5_txq_data *txq_data = (*priv->txqs)[i]; + + if (txq_data == NULL) continue; - memset(&(*priv->txqs)[i]->stats, 0, - sizeof(struct mlx5_txq_stats)); + txq_data->stats_reset = txq_data->stats; } mlx5_os_read_dev_stat(priv, "out_of_buffer", &stats_ctrl->imissed_base); stats_ctrl->imissed = 0; -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-21 15:37:49.793124379 +0800 +++ 0011-net-mlx5-fix-Rx-Tx-stats-concurrency.patch 2022-06-21 15:37:48.977784372 +0800 @@ -1 +1 @@ -From 773a7de21a984bb7bdb6396a659ccc585a44a806 Mon Sep 17 00:00:00 2001 +From c4d51b3f05b56efe4e435187e67d698a07e30b94 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 773a7de21a984bb7bdb6396a659ccc585a44a806 ] @@ -17 +19,0 @@ -Cc: stable@dpdk.org @@ -22,10 +24,22 @@ - drivers/net/mlx5/mlx5_rx.h | 1 + - drivers/net/mlx5/mlx5_stats.c | 40 +++++++++++++++++++++-------------- - drivers/net/mlx5/mlx5_tx.h | 1 + - 3 files changed, 26 insertions(+), 16 deletions(-) - -diff --git a/drivers/net/mlx5/mlx5_rx.h b/drivers/net/mlx5/mlx5_rx.h -index 5bf88b6181..e715ed6b62 100644 ---- a/drivers/net/mlx5/mlx5_rx.h -+++ b/drivers/net/mlx5/mlx5_rx.h -@@ -126,6 +126,7 @@ struct mlx5_rxq_data { + drivers/net/mlx5/mlx5_rxtx.c | 1 + + drivers/net/mlx5/mlx5_rxtx.h | 2 ++ + drivers/net/mlx5/mlx5_stats.c | 41 ++++++++++++++++++++--------------- + 3 files changed, 27 insertions(+), 17 deletions(-) + +diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c +index 734c462a09..edabe229d4 100644 +--- a/drivers/net/mlx5/mlx5_rxtx.c ++++ b/drivers/net/mlx5/mlx5_rxtx.c +@@ -78,6 +78,7 @@ static uint16_t mlx5_tx_burst_##func(void *txq, \ + } + + #define MLX5_TXOFF_INFO(func, olx) {mlx5_tx_burst_##func, olx}, ++ struct mlx5_txq_stats stats_reset; /* stats on last reset. */ + + static __rte_always_inline uint32_t + rxq_cq_to_pkt_type(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe, +diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h +index 237a7faa5c..8760ab78f7 100644 +--- a/drivers/net/mlx5/mlx5_rxtx.h ++++ b/drivers/net/mlx5/mlx5_rxtx.h +@@ -153,6 +153,7 @@ struct mlx5_rxq_data { @@ -38 +52,9 @@ - struct mlx5_uar_data uar_data; /* CQ doorbell. */ + void *cq_uar; /* Verbs CQ user access region. */ +@@ -271,6 +272,7 @@ struct mlx5_txq_data { + int32_t ts_offset; /* Timestamp field dynamic offset. */ + struct mlx5_dev_ctx_shared *sh; /* Shared context. */ + struct mlx5_txq_stats stats; /* TX queue counters. */ ++ struct mlx5_txq_stats stats_reset; /* stats on last reset. */ + #ifndef RTE_ARCH_64 + rte_spinlock_t *uar_lock; + /* UAR access lock required for 32bit implementations */ @@ -40 +62 @@ -index 732775954a..f64fa3587b 100644 +index 82d4d4a745..450037aea0 100644 @@ -43 +65 @@ -@@ -114,18 +114,23 @@ mlx5_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) +@@ -113,18 +113,23 @@ mlx5_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) @@ -74 +96 @@ -@@ -135,15 +140,17 @@ mlx5_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) +@@ -134,15 +139,17 @@ mlx5_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) @@ -97,3 +119,3 @@ -@@ -185,13 +192,14 @@ mlx5_stats_reset(struct rte_eth_dev *dev) - - if (rxq_data == NULL) +@@ -182,14 +189,14 @@ mlx5_stats_reset(struct rte_eth_dev *dev) + for (i = 0; (i != priv->rxqs_n); ++i) { + if ((*priv->rxqs)[i] == NULL) @@ -101,2 +123,3 @@ -- memset(&rxq_data->stats, 0, sizeof(struct mlx5_rxq_stats)); -+ rxq_data->stats_reset = rxq_data->stats; +- memset(&(*priv->rxqs)[i]->stats, 0, +- sizeof(struct mlx5_rxq_stats)); ++ (*priv->rxqs)[i]->stats_reset = (*priv->rxqs)[i]->stats; @@ -116,12 +138,0 @@ -diff --git a/drivers/net/mlx5/mlx5_tx.h b/drivers/net/mlx5/mlx5_tx.h -index dfa04612ff..20776919c2 100644 ---- a/drivers/net/mlx5/mlx5_tx.h -+++ b/drivers/net/mlx5/mlx5_tx.h -@@ -164,6 +164,7 @@ struct mlx5_txq_data { - int32_t ts_offset; /* Timestamp field dynamic offset. */ - struct mlx5_dev_ctx_shared *sh; /* Shared context. */ - struct mlx5_txq_stats stats; /* TX queue counters. */ -+ struct mlx5_txq_stats stats_reset; /* stats on last reset. */ - struct mlx5_uar_data uar_data; - struct rte_mbuf *elts[0]; - /* Storage for queued packets, must be the last field. */