From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by dpdk.org (Postfix) with ESMTP id 2ADAF10BD for ; Mon, 30 Apr 2018 16:43:19 +0200 (CEST) Received: by mail-wr0-f194.google.com with SMTP id i14-v6so5121866wre.2 for ; Mon, 30 Apr 2018 07:43:19 -0700 (PDT) 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; bh=68kmp0IuACxsafCDY+x4taHLhO5cX6NoaoWyL8ub6nM=; b=nMhFdmrfCDfn1xu3VpRYIqTYc9T3cHMdJT39SQl/xvFW9ILDFwLss5XRvB/l/TUivj eTS26eej+nimxLpxsjVs5NMsiUHMu3WKGUXySNY/rcNn6R1Cw2xjtYt/vVwPOhQaJgcF pOVIW5VDju5JwDT+DZ0zcaHIl2yftqTyjos6+8iTSKBKC95PXLW2jboxaYMM0nPmFVyo 7an9nWDPvHBcXd4CAlOk1J7oMb8XrL8yQOgK9dfxcEnSAZv+IqrZUwWJCEAdMpI4qvul PrN2yXpzehj32awxYjJdkhB0N8RPrGe0O9XlLhc1Bfh77iOO9pN6wOYjWhxQDlhd4fOW Ux8w== 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; bh=68kmp0IuACxsafCDY+x4taHLhO5cX6NoaoWyL8ub6nM=; b=HTEhpnccqPUdLOskc5Xx7drcrV7QGptRN25QRe7NmnU9opfTOSfcEgrOV+uAh+StnO 3ap/HxUE6q1SdIpyLWh8BQmCnXXQrRQGeUYIs/QFT8Aftl6h43E79hBAr9LxxW7ltw6a MiH6/6pwAzT5XCaQYxpygtEs5YrCaofho5/nod5ULxAZfbbD+fcQ80NcdYyxFP5F3vDc pbQqCiO0QRpR0amMyphUso1axnv4jDYPTZoG5YeFGMTsaJtTUdzyKkUJkI9r9lw5UprJ T6aXOiB/lBFh6HwUc/Q6ouXq01/J63IRIFR5n7eeh7W2504a36yCYsdoTMRdlVDchGwv 7jvw== X-Gm-Message-State: ALQs6tAkpB3waURIISySnptG2itBIH0ZoWRwvhaZU31qjzLe4q9Dc24k DZPwLLb1kDxyCH9mjUFFki2Td5aQUA0= X-Google-Smtp-Source: AB8JxZqztAZp6cP49OVRfL8a69x2W8+SaM6786CXSAubeP002dYEzo4xfYYQ9jY+HSre1ubVysYolw== X-Received: by 2002:adf:9d15:: with SMTP id k21-v6mr8715489wre.213.1525099398317; Mon, 30 Apr 2018 07:43:18 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id v5sm7247492wmh.19.2018.04.30.07.43.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 07:43:17 -0700 (PDT) From: luca.boccassi@gmail.com To: Matej Vido Cc: dpdk stable Date: Mon, 30 Apr 2018 15:40:48 +0100 Message-Id: <20180430144223.18657-33-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180430144223.18657-1-luca.boccassi@gmail.com> References: <20180430140606.4615-80-luca.boccassi@gmail.com> <20180430144223.18657-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'net/szedata2: fix total stats' has been queued to stable release 18.02.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: Mon, 30 Apr 2018 14:43:19 -0000 Hi, FYI, your patch has been queued to stable release 18.02.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 05/02/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From a294181ee190a11149e08f086001ed5ec599d404 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 e53c738db..dc2079e0d 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.14.2