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 B0E30A0524 for ; Fri, 5 Feb 2021 12:32:14 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AB64B40682; Fri, 5 Feb 2021 12:32:14 +0100 (CET) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by mails.dpdk.org (Postfix) with ESMTP id C5C89188A01 for ; Fri, 5 Feb 2021 12:32:13 +0100 (CET) Received: by mail-wm1-f49.google.com with SMTP id a16so7692992wmm.0 for ; Fri, 05 Feb 2021 03:32:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DT8cqSUoPa5zKWmmVuDMffI4oLN4g/jDTELHUst8E8o=; b=noK6M4Nl3arQus6K36izF/lVirvSFgnMfj5FdFtH74GQuRdl+pFFxNEfXGfop55h7g OWCmS8d9KOeXUOEQ7G1cy2pqUUi5nAPhW+clNYYZOp6mdHjaqDhdFq5cU+6kyJha3Pzi /gqmkSfpirR6oqS4Fc7bb8reJSc9xJ9rplAjN/l9xM6MS2LHwcztE4rj7boJuyPhcSPa 2f7LB+d3sShscxcpwSRMeYDnevrBRt2qRhodHPnoUqBEKtfAEndpG+4s+9U+BBSOtG40 TpOxrCuRb1Rq01frs/b/2rAIQMA1bba3nEt8Yh/YIX7kwp1CEKgFfBKyGL1Rh49fa+h7 ymeg== 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:mime-version:content-transfer-encoding; bh=DT8cqSUoPa5zKWmmVuDMffI4oLN4g/jDTELHUst8E8o=; b=q86XMy3mnlYvk0C+zro0b4nX07FWgm4TaqfW+L6gZMCzjGALKMvNvq+V9I79rwTTFT WbOltCXOHut01M6ojALSaR77x86VWYOpXz+hmITnKsfzP7FcvRFDdl8RwEmmpaVq1Ehm OxCk7xhdMPMJofI30cedfFmi/E27GvxwidxUBF0xqa2S9ORlohicCl4IsM4u2A5zEHPW cPUQsoMKWRIGFroU4r1+1jImBH1tmBtVtQx1Qp3zSILv2gKHV4jYSCev80XgIESsNxoK 4E0gLHAuCkhphcD0CjhMavvgMnibVpvhgLTgcHGUP0ODPvEUS4mp2aWUro8bePZdMQDU zMYA== X-Gm-Message-State: AOAM531/PMHc1CzbAx98IwRlbOfgFokQL6zmbfrdufg6fo8CNbDxrOxs 3MPPD4ij4wOGD7V8puV/MJCGxHkEDHwhUSAe X-Google-Smtp-Source: ABdhPJxsjyfat7S+C/39C/qn464DhbjhQg2f0sGQGiNP4EO8SfKbULEHU9/thlASpplzAh7IjjqyRg== X-Received: by 2002:a05:600c:4f02:: with SMTP id l2mr3112765wmq.67.1612524733563; Fri, 05 Feb 2021 03:32:13 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id n9sm12245575wrq.41.2021.02.05.03.32.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:32:12 -0800 (PST) From: luca.boccassi@gmail.com To: Huisong Li Cc: Lijun Ou , dpdk stable Date: Fri, 5 Feb 2021 11:17:01 +0000 Message-Id: <20210205111920.1272063-135-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/hns3: fix Rx/Tx errors stats' has been queued to stable release 20.11.1 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.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 02/07/21. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/c8f0d15cc5c0768cd762c1074144dbfb55484c7b Thanks. Luca Boccassi --- >From c8f0d15cc5c0768cd762c1074144dbfb55484c7b Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Wed, 6 Jan 2021 11:46:30 +0800 Subject: [PATCH] net/hns3: fix Rx/Tx errors stats [ upstream commit ec12dc5a554ab4f8dd8a90cab54426dfa685ba80 ] Abnormal errors stats in Rx/Tx datapath are statistics items in driver, and displayed in xstats. They should be cleared by the rte_eth_xstats_reset api, instead of the rte_eth_stats_reset. Fixes: c4b7d6761d01 ("net/hns3: get Tx abnormal errors in xstats") Fixes: 521ab3e93361 ("net/hns3: add simple Rx path") Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations") Signed-off-by: Huisong Li Signed-off-by: Lijun Ou --- drivers/net/hns3/hns3_stats.c | 59 +++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c index 42ec9b870f..62a712b1a4 100644 --- a/drivers/net/hns3/hns3_stats.c +++ b/drivers/net/hns3/hns3_stats.c @@ -551,7 +551,6 @@ hns3_stats_reset(struct rte_eth_dev *eth_dev) struct hns3_hw *hw = &hns->hw; struct hns3_cmd_desc desc_reset; struct hns3_rx_queue *rxq; - struct hns3_tx_queue *txq; uint16_t i; int ret; @@ -581,29 +580,15 @@ hns3_stats_reset(struct rte_eth_dev *eth_dev) } } - /* Clear the Rx BD errors stats */ - for (i = 0; i != eth_dev->data->nb_rx_queues; ++i) { + /* + * Clear soft stats of rx error packet which will be dropped + * in driver. + */ + for (i = 0; i < eth_dev->data->nb_rx_queues; ++i) { rxq = eth_dev->data->rx_queues[i]; if (rxq) { rxq->pkt_len_errors = 0; rxq->l2_errors = 0; - rxq->l3_csum_errors = 0; - rxq->l4_csum_errors = 0; - rxq->ol3_csum_errors = 0; - rxq->ol4_csum_errors = 0; - } - } - - /* Clear the Tx errors stats */ - for (i = 0; i != eth_dev->data->nb_tx_queues; ++i) { - txq = eth_dev->data->tx_queues[i]; - if (txq) { - txq->over_length_pkt_cnt = 0; - txq->exceed_limit_bd_pkt_cnt = 0; - txq->exceed_limit_bd_reassem_fail = 0; - txq->unsupported_tunnel_pkt_cnt = 0; - txq->queue_full_cnt = 0; - txq->pkt_padding_fail_cnt = 0; } } @@ -1053,6 +1038,38 @@ hns3_dev_xstats_get_names_by_id(struct rte_eth_dev *dev, return size; } +static void +hns3_tqp_dfx_stats_clear(struct rte_eth_dev *dev) +{ + struct hns3_rx_queue *rxq; + struct hns3_tx_queue *txq; + int i; + + /* Clear Rx dfx stats */ + for (i = 0; i < dev->data->nb_rx_queues; ++i) { + rxq = dev->data->rx_queues[i]; + if (rxq) { + rxq->l3_csum_errors = 0; + rxq->l4_csum_errors = 0; + rxq->ol3_csum_errors = 0; + rxq->ol4_csum_errors = 0; + } + } + + /* Clear Tx dfx stats */ + for (i = 0; i < dev->data->nb_tx_queues; ++i) { + txq = dev->data->tx_queues[i]; + if (txq) { + txq->over_length_pkt_cnt = 0; + txq->exceed_limit_bd_pkt_cnt = 0; + txq->exceed_limit_bd_reassem_fail = 0; + txq->unsupported_tunnel_pkt_cnt = 0; + txq->queue_full_cnt = 0; + txq->pkt_padding_fail_cnt = 0; + } + } +} + int hns3_dev_xstats_reset(struct rte_eth_dev *dev) { @@ -1068,6 +1085,8 @@ hns3_dev_xstats_reset(struct rte_eth_dev *dev) /* Clear reset stats */ memset(&hns->hw.reset.stats, 0, sizeof(struct hns3_reset_stats)); + hns3_tqp_dfx_stats_clear(dev); + if (hns->is_vf) return 0; -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:35.211049257 +0000 +++ 0135-net-hns3-fix-Rx-Tx-errors-stats.patch 2021-02-05 11:18:29.014695072 +0000 @@ -1 +1 @@ -From ec12dc5a554ab4f8dd8a90cab54426dfa685ba80 Mon Sep 17 00:00:00 2001 +From c8f0d15cc5c0768cd762c1074144dbfb55484c7b Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit ec12dc5a554ab4f8dd8a90cab54426dfa685ba80 ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org