DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Pei, Andy" <andy.pei@intel.com>
To: David Marchand <david.marchand@redhat.com>
Cc: dev <dev@dpdk.org>, "Xu, Rosen" <rosen.xu@intel.com>
Subject: Re: [dpdk-dev] [PATCH v3 4/4] net/ipn3ke: implementation of statistics
Date: Tue, 25 Jun 2019 07:09:59 +0000	[thread overview]
Message-ID: <5941F446C088714A85408FA3132CFCBB01037924@SHSMSX105.ccr.corp.intel.com> (raw)
In-Reply-To: <CAJFAV8yf6296nm_p8fD0w3RWWmrTAcAHP8XqxBn2tYbFYxMyLg@mail.gmail.com>

Hi Marchand,

Reply in line.

Best Regards,

From: David Marchand [mailto:david.marchand@redhat.com]
Sent: Wednesday, June 19, 2019 5:06 PM
To: Pei, Andy <andy.pei@intel.com>
Cc: dev <dev@dpdk.org>; Xu, Rosen <rosen.xu@intel.com>
Subject: Re: [dpdk-dev] [PATCH v3 4/4] net/ipn3ke: implementation of statistics



On Wed, Jun 19, 2019 at 10:56 AM Andy Pei <andy.pei@intel.com<mailto:andy.pei@intel.com>> wrote:
This patch implemente statistics read and reset
function for ipn3ke.

Fixes: 70d6b7f550f4 ("net/ipn3ke: add representor")
Cc: rosen.xu@intel.com<mailto:rosen.xu@intel.com>

Signed-off-by: Andy Pei <andy.pei@intel.com<mailto:andy.pei@intel.com>>
---
 drivers/net/ipn3ke/ipn3ke_representor.c | 3440 ++++++++++++++++++++++++++++++-
 1 file changed, 3431 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c
index b166b8f..ed82ee7 100644
--- a/drivers/net/ipn3ke/ipn3ke_representor.c
+++ b/drivers/net/ipn3ke/ipn3ke_representor.c
@@ -3,6 +3,7 @@
  */

 #include <stdint.h>
+#include <unistd.h>

 #include <rte_bus_pci.h>
 #include <rte_ethdev.h>
@@ -297,31 +298,3452 @@
 {
 }

+/* Statistics collected by each port, VSI, VEB, and S-channel */
+struct ipn3ke_rpst_eth_stats {
+       uint64_t tx_bytes;               /* gotc */
+       uint64_t tx_multicast;           /* mptc */
+       uint64_t tx_broadcast;           /* bptc */
+       uint64_t tx_unicast;             /* uptc */
+       uint64_t tx_discards;            /* tdpc */
+       uint64_t tx_errors;              /* tepc */
+       uint64_t rx_bytes;               /* gorc */
+       uint64_t rx_multicast;           /* mprc */
+       uint64_t rx_broadcast;           /* bprc */
+       uint64_t rx_unicast;             /* uprc */
+       uint64_t rx_discards;            /* rdpc */
+       uint64_t rx_unknown_protocol;    /* rupp */
+};
+
+/* store statistics names and its offset in stats structure */
+struct ipn3ke_rpst_xstats_name_offset {
+       char name[RTE_ETH_XSTATS_NAME_SIZE];
+       unsigned int offset;
+};
+
+static const struct ipn3ke_rpst_xstats_name_offset
+ipn3ke_rpst_stats_strings[] = {
+       {"tx_multicast_packets",          offsetof(struct ipn3ke_rpst_eth_stats,
+                                                       tx_multicast)},
+       {"tx_broadcast_packets",          offsetof(struct ipn3ke_rpst_eth_stats,
+                                                       tx_broadcast)},
+       {"tx_unicast_packets",            offsetof(struct ipn3ke_rpst_eth_stats,
+                                                       tx_unicast)},
+       {"tx_dropped",                    offsetof(struct ipn3ke_rpst_eth_stats,
+                                                       tx_discards)},
+       {"rx_multicast_packets",          offsetof(struct ipn3ke_rpst_eth_stats,
+                                                       rx_multicast)},
+       {"rx_broadcast_packets",          offsetof(struct ipn3ke_rpst_eth_stats,
+                                                       rx_broadcast)},
+       {"rx_unicast_packets",            offsetof(struct ipn3ke_rpst_eth_stats,
+                                                       rx_unicast)},
+       {"rx_dropped",                    offsetof(struct ipn3ke_rpst_eth_stats,
+                                                       rx_discards)},
+       {"rx_unknown_protocol_packets", offsetof(struct ipn3ke_rpst_eth_stats,
+                                                       rx_unknown_protocol)},

Please see recent fixes on i40e and ice.
tx_dropped -> tx_dropped_packets
rx_dropped -> rx_dropped_packets

https://git.dpdk.org/next/dpdk-next-net-intel/commit/?id=e61e25233e9dfcd5386d83ab988790d9d5bd9400


>>>> Do  this in v4.

+};
+
+#define IPN3KE_RPST_ETH_XSTATS_CNT (sizeof(ipn3ke_rpst_stats_strings) / \
+               sizeof(ipn3ke_rpst_stats_strings[0]))
+
+#define IPN3KE_RPST_PRIO_XSTATS_CNT    8
+
+/* Statistics collected by the MAC */
+struct ipn3ke_rpst_hw_port_stats {
+       /* eth stats collected by the port */
+       struct ipn3ke_rpst_eth_stats eth;
+
+       /* additional port specific stats */
+       uint64_t tx_dropped_link_down;
+       uint64_t crc_errors;
+       uint64_t illegal_bytes;
+       uint64_t error_bytes;
+       uint64_t mac_local_faults;
+       uint64_t mac_remote_faults;
+       uint64_t rx_length_errors;
+       uint64_t link_xon_rx;
+       uint64_t link_xoff_rx;
+       uint64_t priority_xon_rx[IPN3KE_RPST_PRIO_XSTATS_CNT];
+       uint64_t priority_xoff_rx[IPN3KE_RPST_PRIO_XSTATS_CNT];
+       uint64_t link_xon_tx;
+       uint64_t link_xoff_tx;
+       uint64_t priority_xon_tx[IPN3KE_RPST_PRIO_XSTATS_CNT];
+       uint64_t priority_xoff_tx[IPN3KE_RPST_PRIO_XSTATS_CNT];
+       uint64_t priority_xon_2_xoff[IPN3KE_RPST_PRIO_XSTATS_CNT];
+       uint64_t rx_size_64;
+       uint64_t rx_size_65_127;
+       uint64_t rx_size_128_255;
+       uint64_t rx_size_256_511;
+       uint64_t rx_size_512_1023;
+       uint64_t rx_size_1024_1518;
+       uint64_t rx_size_big;
+       uint64_t rx_undersize;
+       uint64_t rx_fragments;
+       uint64_t rx_oversize;
+       uint64_t rx_jabber;
+       uint64_t tx_size_64;
+       uint64_t tx_size_65_127;
+       uint64_t tx_size_128_255;
+       uint64_t tx_size_256_511;
+       uint64_t tx_size_512_1023;
+       uint64_t tx_size_1024_1518;
+       uint64_t tx_size_1519_to_max;
+       uint64_t mac_short_packet_dropped;
+       uint64_t checksum_error;
+       /* flow director stats */
+       uint64_t fd_atr_match;
+       uint64_t fd_sb_match;
+       uint64_t fd_atr_tunnel_match;
+       uint32_t fd_atr_status;
+       uint32_t fd_sb_status;
+       /* EEE LPI */
+       uint32_t tx_lpi_status;
+       uint32_t rx_lpi_status;
+       uint64_t tx_lpi_count;
+       uint64_t rx_lpi_count;
+};
+
+static const struct ipn3ke_rpst_xstats_name_offset
+ipn3ke_rpst_hw_port_strings[] = {
+       {"tx_link_down_dropped",      offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                               tx_dropped_link_down)},
+       {"rx_crc_errors",             offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                               crc_errors)},
+       {"rx_illegal_byte_errors",    offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                               illegal_bytes)},
+       {"rx_error_bytes",            offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                               error_bytes)},
+       {"mac_local_errors",          offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                               mac_local_faults)},
+       {"mac_remote_errors",         offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                               mac_remote_faults)},
+       {"rx_length_errors",          offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                               rx_length_errors)},
+       {"tx_xon_packets",            offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                               link_xon_tx)},
+       {"rx_xon_packets",            offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                               link_xon_rx)},
+       {"tx_xoff_packets",           offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                               link_xoff_tx)},
+       {"rx_xoff_packets",           offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                               link_xoff_rx)},
+       {"rx_size_64_packets",        offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                               rx_size_64)},
+       {"rx_size_65_to_127_packets", offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                               rx_size_65_127)},
+       {"rx_size_128_to_255_packets",
+                               offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                        rx_size_128_255)},
+       {"rx_size_256_to_511_packets",
+                               offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                        rx_size_256_511)},
+       {"rx_size_512_to_1023_packets",
+                               offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                        rx_size_512_1023)},
+       {"rx_size_1024_to_1518_packets",
+                               offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                        rx_size_1024_1518)},
+       {"rx_size_1519_to_max_packets",
+                               offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                        rx_size_big)},

Just a note, but those stats won't work with the current way ovs looks at per size counters.

>>>> Just keep this in the same way with I40E currently.


+       {"rx_undersized_errors",      offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                              rx_undersize)},
+       {"rx_oversize_errors",        offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                              rx_oversize)},
+       {"rx_mac_short_dropped",      offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                              mac_short_packet_dropped)},
+       {"rx_fragmented_errors",      offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                              rx_fragments)},
+       {"rx_jabber_errors",          offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                              rx_jabber)},
+       {"tx_size_64_packets",        offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                              tx_size_64)},
+       {"tx_size_65_to_127_packets",
+                               offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                        tx_size_65_127)},
+       {"tx_size_128_to_255_packets",
+                               offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                        tx_size_128_255)},
+       {"tx_size_256_to_511_packets",
+                               offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                        tx_size_256_511)},
+       {"tx_size_512_to_1023_packets",
+                               offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                        tx_size_512_1023)},
+       {"tx_size_1024_to_1518_packets",
+                               offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                        tx_size_1024_1518)},
+       {"tx_size_1519_to_max_packets",
+                               offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                        tx_size_1519_to_max)},

Idem rx.


+       {"rx_flow_director_atr_match_packets",
+                               offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                        fd_atr_match)},
+       {"rx_flow_director_sb_match_packets",
+                               offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                        fd_sb_match)},
+       {"tx_low_power_idle_status",  offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                              tx_lpi_status)},
+       {"rx_low_power_idle_status",  offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                              rx_lpi_status)},
+       {"tx_low_power_idle_count",   offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                              tx_lpi_count)},
+       {"rx_low_power_idle_count",   offsetof(struct ipn3ke_rpst_hw_port_stats,
+                                              rx_lpi_count)},
+};

[snip]

--
David Marchand

  reply	other threads:[~2019-06-25  7:10 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-03  6:31 [dpdk-dev] [PATCH 1/2] net/ipn3ke: add new register address Andy Pei
2019-06-03  6:31 ` [dpdk-dev] [PATCH 2/2] net/ipn3ke: implementation of statistics Andy Pei
2019-06-11  9:48   ` [dpdk-dev] [PATCH v2 1/4] net/ipn3ke: add new register address Andy Pei
2019-06-11  9:48     ` [dpdk-dev] [PATCH v2 2/4] net/ipn3ke: delete MAC register address mask Andy Pei
2019-06-12  1:17       ` Xu, Rosen
2019-06-11  9:48     ` [dpdk-dev] [PATCH v2 3/4] net/ipn3ke: clear statistics when init and start dev Andy Pei
2019-06-12  1:17       ` Xu, Rosen
2019-06-19  8:49       ` [dpdk-dev] [PATCH v3 1/4] net/ipn3ke: add new register address Andy Pei
2019-06-19  8:49         ` [dpdk-dev] [PATCH v3 2/4] net/ipn3ke: delete MAC register address mask Andy Pei
2019-06-19  8:49         ` [dpdk-dev] [PATCH v3 3/4] net/ipn3ke: clear statistics when init and start dev Andy Pei
2019-06-19  8:49         ` [dpdk-dev] [PATCH v3 4/4] net/ipn3ke: implementation of statistics Andy Pei
2019-06-19  9:05           ` David Marchand
2019-06-25  7:09             ` Pei, Andy [this message]
2019-06-25  7:16               ` David Marchand
2019-06-25  8:53                 ` Pei, Andy
2019-06-25  8:58                   ` David Marchand
2019-06-27  6:02                     ` Pei, Andy
2019-06-25  7:50           ` [dpdk-dev] [PATCH v4 1/4] net/ipn3ke: add new register address Andy Pei
2019-06-25  7:50             ` [dpdk-dev] [PATCH v4 2/4] net/ipn3ke: delete MAC register address mask Andy Pei
2019-06-25  7:50             ` [dpdk-dev] [PATCH v4 3/4] net/ipn3ke: clear statistics when init and start dev Andy Pei
2019-06-25  7:50             ` [dpdk-dev] [PATCH v4] net/ipn3ke: implementation of statistics Andy Pei
2019-06-25  8:00           ` [dpdk-dev] [PATCH v4 1/4] net/ipn3ke: add new register address Andy Pei
2019-06-25  8:00             ` [dpdk-dev] [PATCH v4 2/4] net/ipn3ke: delete MAC register address mask Andy Pei
2019-06-25  8:00             ` [dpdk-dev] [PATCH v4 3/4] net/ipn3ke: clear statistics when init and start dev Andy Pei
2019-06-25  8:00             ` [dpdk-dev] [PATCH v4 4/4] net/ipn3ke: implementation of statistics Andy Pei
2019-06-27  5:49               ` Xu, Rosen
2019-06-28  8:54                 ` Pei, Andy
2019-07-01 10:36               ` [dpdk-dev] [PATCH v5 1/4] net/ipn3ke: add new register address Andy Pei
2019-07-01 10:36                 ` [dpdk-dev] [PATCH v5 2/4] net/ipn3ke: delete MAC register address mask Andy Pei
2019-07-02 10:00                   ` Xu, Rosen
2019-07-08  2:06                     ` Zhang, Qi Z
2019-07-01 10:36                 ` [dpdk-dev] [PATCH v5 3/4] net/ipn3ke: clear statistics when init and start dev Andy Pei
2019-07-02 10:00                   ` Xu, Rosen
2019-07-08  2:07                     ` Zhang, Qi Z
2019-07-01 10:36                 ` [dpdk-dev] [PATCH v5 4/4] net/ipn3ke: implementation of statistics Andy Pei
2019-07-02 10:01                   ` Xu, Rosen
2019-07-08  2:09                     ` Zhang, Qi Z
2019-07-02  9:59                 ` [dpdk-dev] [PATCH v5 1/4] net/ipn3ke: add new register address Xu, Rosen
2019-07-08  2:06                   ` Zhang, Qi Z
2019-07-08 16:00                 ` Ferruh Yigit
2019-07-09  1:33                   ` Pei, Andy
2019-06-11  9:48     ` [dpdk-dev] [PATCH v2 4/4] net/ipn3ke: implementation of statistics Andy Pei
2019-06-12  1:17       ` Xu, Rosen
2019-06-18 11:59       ` Ferruh Yigit
2019-06-18 12:39         ` Ferruh Yigit
2019-06-19  3:23           ` Pei, Andy
2019-06-12  1:17     ` [dpdk-dev] [PATCH v2 1/4] net/ipn3ke: add new register address Xu, Rosen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5941F446C088714A85408FA3132CFCBB01037924@SHSMSX105.ccr.corp.intel.com \
    --to=andy.pei@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=rosen.xu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).