From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 6F8D6187 for ; Sun, 22 Apr 2018 17:12:16 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A358A20E8C; Sun, 22 Apr 2018 11:12:15 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 22 Apr 2018 11:12:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=9XGJrh94dMQXNPGbp rPUo+q47VKcpe+NKPaDCbiGjV4=; b=cAtL96Bhz3QQKhSfNFzwuOczR3jORlSmO uycrVbTDxtI7H5ehy94xR30V2+CTEcClES+zzDUlliSQlaa1mfT9hn5pPFY+4GpM OXuJkbLxsJvgtZ/DaqznJ4j667oGz5qi9x3F5OAIKlU8wnZwEnBNr5NtbY8Y4E0u rS2VpG8n8aJrCgU0fHPKDhcQGCetwb2m3inxVA6itlqgrjI7piLkvnlLEeNYJqcg fSbGVX2u5eqSxL992CyUsQA8mwEyExO7DD2bjdqU4oFMunQmqfevpRe8tKVHQ/CY cBcs0ZI2Ytl9Btbe6hHfqoByV5eylcBeSLwEhsixENQ0fov/8Yfpw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=9XGJrh94dMQXNPGbprPUo+q47VKcpe+NKPaDCbiGjV4=; b=L0Acipee U1rQ/UFHZqi/3AZ6qwojRkbwHZrmHOwA+99+GT95ILGRo+iPfr3rY0vt2pjB66Zt MPuwEgX5qQglTCoKmg91MeKaxJBjrknJ6ZYIJ+xhEkxBaHz816Kq9dl13ziKj39M EQvyts7/L54kbwg4SrJlL8B4N2BjD8rWWkvTOWevEQrGSrbdI82xtNBwj3o1K3Ub X9CLlxg3nqNtciUyYjYFwF2cwhB2mmfSsQ7tTSziQX01c0lm4DEkKhDaGm4RCxvE 8/REMgg5dUmRc2MMH19O0erX8whm0pY4TfX1B+zehHq04Aaxn+Ws9b712Lt3YISu 6i4/fSS/A/9ZTQ== X-ME-Sender: Received: from yuanhanliu-NB0.tencent.com (unknown [223.74.148.66]) by mail.messagingengine.com (Postfix) with ESMTPA id 0861B10253; Sun, 22 Apr 2018 11:12:13 -0400 (EDT) From: Yuanhan Liu To: Matej Vido Cc: dpdk stable Date: Sun, 22 Apr 2018 23:09:40 +0800 Message-Id: <20180422150949.17523-50-yliu@fridaylinux.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180422150949.17523-1-yliu@fridaylinux.org> References: <20180422150949.17523-1-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/szedata2: fix total stats' has been queued to LTS release 17.11.2 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: Sun, 22 Apr 2018 15:12:16 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/29/18. So please shout if anyone has objections. Thanks. --yliu --- >>From c0ba6842c991f2cb7f73383f6aa6c88c46fa9193 Mon Sep 17 00:00:00 2001 From: Matej Vido Date: Wed, 4 Apr 2018 15:42:18 +0200 Subject: [PATCH] net/szedata2: fix total stats [ upstream commit 745f6a1e7e37d80920d38be4fffbb442a09ab7cf ] Counters from all queues have to be summed up for total stats even though the number of queue stats counters is not sufficient. Fixes: 83556fd2c0fc ("szedata2: change to physical device type") Signed-off-by: Matej Vido --- drivers/net/szedata2/rte_eth_szedata2.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index 45aebed33..81ff73f52 100644 --- a/drivers/net/szedata2/rte_eth_szedata2.c +++ b/drivers/net/szedata2/rte_eth_szedata2.c @@ -1054,22 +1054,29 @@ eth_stats_get(struct rte_eth_dev *dev, uint64_t tx_err_total = 0; uint64_t rx_total_bytes = 0; uint64_t tx_total_bytes = 0; - const struct pmd_internals *internals = dev->data->dev_private; - for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS && i < nb_rx; i++) { - stats->q_ipackets[i] = internals->rx_queue[i].rx_pkts; - stats->q_ibytes[i] = internals->rx_queue[i].rx_bytes; - rx_total += stats->q_ipackets[i]; - rx_total_bytes += stats->q_ibytes[i]; + for (i = 0; i < nb_rx; i++) { + struct szedata2_rx_queue *rxq = dev->data->rx_queues[i]; + + if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) { + stats->q_ipackets[i] = rxq->rx_pkts; + stats->q_ibytes[i] = rxq->rx_bytes; + } + rx_total += rxq->rx_pkts; + rx_total_bytes += rxq->rx_bytes; } - for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS && i < nb_tx; i++) { - stats->q_opackets[i] = internals->tx_queue[i].tx_pkts; - stats->q_obytes[i] = internals->tx_queue[i].tx_bytes; - stats->q_errors[i] = internals->tx_queue[i].err_pkts; - tx_total += stats->q_opackets[i]; - tx_total_bytes += stats->q_obytes[i]; - tx_err_total += stats->q_errors[i]; + for (i = 0; i < nb_tx; i++) { + struct szedata2_tx_queue *txq = dev->data->tx_queues[i]; + + if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) { + stats->q_opackets[i] = txq->tx_pkts; + stats->q_obytes[i] = txq->tx_bytes; + stats->q_errors[i] = txq->err_pkts; + } + tx_total += txq->tx_pkts; + tx_total_bytes += txq->tx_bytes; + tx_err_total += txq->err_pkts; } stats->ipackets = rx_total; -- 2.11.0