From: Tomasz Kulasek Date: Fri, 30 Oct 2015 14:25:54 +0000 (+0100) Subject: bonding: support stats per queue X-Git-Tag: spdx-start~8219 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=55587b01cc84f6219f300ebc020a83f23c768a4f;p=dpdk.git bonding: support stats per queue 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. Signed-off-by: Tomasz Kulasek Acked-by: Declan Doherty --- diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 2880f5c182..eecb3811a4 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]; + } + } }