[dpdk-dev] [PATCH 1/2] qede: add support for xstats

2016-07-08 Thread Bruce Richardson
On Fri, Jul 08, 2016 at 11:36:54AM +0100, Remy Horton wrote:
> 
> On 07/07/2016 23:50, Rasesh Mody wrote:
> >This patch adds support for extended statistics for QEDE PMD.
> >
> >Signed-off-by: Rasesh Mody 
> 
> Acked-by: Remy Horton 

Applied to dpdk-next-net/rel_16_07

/Bruce


[dpdk-dev] [PATCH 1/2] qede: add support for xstats

2016-07-08 Thread Remy Horton

On 07/07/2016 23:50, Rasesh Mody wrote:
> This patch adds support for extended statistics for QEDE PMD.
>
> Signed-off-by: Rasesh Mody 

Acked-by: Remy Horton 


[dpdk-dev] [PATCH 1/2] qede: add support for xstats

2016-07-07 Thread Rasesh Mody
This patch adds support for extended statistics for QEDE PMD.

Signed-off-by: Rasesh Mody 
---
 doc/guides/nics/overview.rst   |2 +-
 drivers/net/qede/qede_ethdev.c |  204 ++--
 2 files changed, 197 insertions(+), 9 deletions(-)

diff --git a/doc/guides/nics/overview.rst b/doc/guides/nics/overview.rst
index a23eb5c..91fb18d 100644
--- a/doc/guides/nics/overview.rst
+++ b/doc/guides/nics/overview.rst
@@ -128,7 +128,7 @@ Most of these differences are summarized below.
Packet type parsingY Y Y   Y   Y Y Y   Y   Y Y Y Y Y Y  
   Y Y Y
Timesync   Y Y Y   Y Y
Basic statsY Y Y   Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y  
 Y Y Y   Y Y Y Y Y
-   Extended stats Y   Y   Y Y Y Y Y Y Y Y Y Y Y Y Y Y  
 Y   Y
+   Extended stats Y   Y   Y Y Y Y Y Y Y Y Y Y Y Y Y Y  
   Y Y   Y   Y
Stats per queueY   Y Y Y Y Y Y Y Y  
   Y Y   Y Y   Y Y
EEPROM dumpY   Y   Y Y
Registers dump Y   Y Y Y Y Y Y  
   Y
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index bb531be..3f6b77d 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -14,6 +14,151 @@ static const struct qed_eth_ops *qed_ops;
 static const char *drivername = "qede pmd";
 static int64_t timer_period = 1;

+struct rte_qede_xstats_name_off {
+   char name[RTE_ETH_XSTATS_NAME_SIZE];
+   uint64_t offset;
+};
+
+static const struct rte_qede_xstats_name_off qede_xstats_strings[] = {
+   {"rx_unicast_bytes", offsetof(struct ecore_eth_stats, rx_ucast_bytes)},
+   {"rx_multicast_bytes",
+   offsetof(struct ecore_eth_stats, rx_mcast_bytes)},
+   {"rx_broadcast_bytes",
+   offsetof(struct ecore_eth_stats, rx_bcast_bytes)},
+   {"rx_unicast_packets", offsetof(struct ecore_eth_stats, rx_ucast_pkts)},
+   {"rx_multicast_packets",
+   offsetof(struct ecore_eth_stats, rx_mcast_pkts)},
+   {"rx_broadcast_packets",
+   offsetof(struct ecore_eth_stats, rx_bcast_pkts)},
+
+   {"tx_unicast_bytes", offsetof(struct ecore_eth_stats, tx_ucast_bytes)},
+   {"tx_multicast_bytes",
+   offsetof(struct ecore_eth_stats, tx_mcast_bytes)},
+   {"tx_broadcast_bytes",
+   offsetof(struct ecore_eth_stats, tx_bcast_bytes)},
+   {"tx_unicast_packets", offsetof(struct ecore_eth_stats, tx_ucast_pkts)},
+   {"tx_multicast_packets",
+   offsetof(struct ecore_eth_stats, tx_mcast_pkts)},
+   {"tx_broadcast_packets",
+   offsetof(struct ecore_eth_stats, tx_bcast_pkts)},
+
+   {"rx_64_byte_packets",
+   offsetof(struct ecore_eth_stats, rx_64_byte_packets)},
+   {"rx_65_to_127_byte_packets",
+   offsetof(struct ecore_eth_stats, rx_65_to_127_byte_packets)},
+   {"rx_128_to_255_byte_packets",
+   offsetof(struct ecore_eth_stats, rx_128_to_255_byte_packets)},
+   {"rx_256_to_511_byte_packets",
+   offsetof(struct ecore_eth_stats, rx_256_to_511_byte_packets)},
+   {"rx_512_to_1023_byte_packets",
+   offsetof(struct ecore_eth_stats, rx_512_to_1023_byte_packets)},
+   {"rx_1024_to_1518_byte_packets",
+   offsetof(struct ecore_eth_stats, rx_1024_to_1518_byte_packets)},
+   {"rx_1519_to_1522_byte_packets",
+   offsetof(struct ecore_eth_stats, rx_1519_to_1522_byte_packets)},
+   {"rx_1519_to_2047_byte_packets",
+   offsetof(struct ecore_eth_stats, rx_1519_to_2047_byte_packets)},
+   {"rx_2048_to_4095_byte_packets",
+   offsetof(struct ecore_eth_stats, rx_2048_to_4095_byte_packets)},
+   {"rx_4096_to_9216_byte_packets",
+   offsetof(struct ecore_eth_stats, rx_4096_to_9216_byte_packets)},
+   {"rx_9217_to_16383_byte_packets",
+   offsetof(struct ecore_eth_stats,
+rx_9217_to_16383_byte_packets)},
+   {"tx_64_byte_packets",
+   offsetof(struct ecore_eth_stats, tx_64_byte_packets)},
+   {"tx_65_to_127_byte_packets",
+   offsetof(struct ecore_eth_stats, tx_65_to_127_byte_packets)},
+   {"tx_128_to_255_byte_packets",
+   offsetof(struct ecore_eth_stats, tx_128_to_255_byte_packets)},
+   {"tx_256_to_511_byte_packets",
+   offsetof(struct ecore_eth_stats, tx_256_to_511_byte_packets)},
+   {"tx_512_to_1023_byte_packets",
+   offsetof(struct ecore_eth_stats, tx_512_to_1023_byte_packets)},
+   {"tx_1024_to_1518_byte_packets",
+   offsetof(struct ecore_eth_stats, tx_1024_to_1518_byte_packets)},
+   {"trx_1519_to_1522_byte_packets",
+   offsetof(struct ecore_eth_stats, tx_1519_to_2047_byte_packets)},
+