From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id BB4A69239 for ; Fri, 30 Oct 2015 15:26:23 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 30 Oct 2015 07:26:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,218,1444719600"; d="scan'208";a="838881319" Received: from unknown (HELO Sent) ([10.217.248.220]) by orsmga002.jf.intel.com with SMTP; 30 Oct 2015 07:26:21 -0700 Received: by Sent (sSMTP sendmail emulation); Fri, 30 Oct 2015 15:26:20 +0100 From: Tomasz Kulasek To: dev@dpdk.org Date: Fri, 30 Oct 2015 15:25:54 +0100 Message-Id: <1446215156-12260-8-git-send-email-tomaszx.kulasek@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1446215156-12260-1-git-send-email-tomaszx.kulasek@intel.com> References: <1444989651-6236-1-git-send-email-tomaszx.kulasek@intel.com> <1446215156-12260-1-git-send-email-tomaszx.kulasek@intel.com> Subject: [dpdk-dev] [PATCH v7 7/9] bonding: per queue stats X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Oct 2015 14:26:24 -0000 This patch adds fills bonding port's stats with a sum of corresponding values taken from bonded slaves, when stats are requested for bonding port. v5 changes: - removed queue_stats_mapping_set from eth_dev_ops of bonding device Signed-off-by: Tomasz Kulasek Acked-by: Declan Doherty --- drivers/net/bonding/rte_eth_bond_pmd.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 2880f5c..eecb381 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1801,7 +1801,7 @@ bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) { struct bond_dev_private *internals = dev->data->dev_private; struct rte_eth_stats slave_stats; - int i; + int i, j; for (i = 0; i < internals->slave_count; i++) { rte_eth_stats_get(internals->slaves[i].port_id, &slave_stats); @@ -1820,6 +1820,15 @@ bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->rx_pause_xon += slave_stats.rx_pause_xon; stats->tx_pause_xoff += slave_stats.tx_pause_xoff; stats->rx_pause_xoff += slave_stats.rx_pause_xoff; + + for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) { + stats->q_ipackets[j] += slave_stats.q_ipackets[j]; + stats->q_opackets[j] += slave_stats.q_opackets[j]; + stats->q_ibytes[j] += slave_stats.q_ibytes[j]; + stats->q_obytes[j] += slave_stats.q_obytes[j]; + stats->q_errors[j] += slave_stats.q_errors[j]; + } + } } -- 1.7.9.5