From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3BE0C31E5D for ; Wed, 19 Jun 2019 09:05:46 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 4F95C2080C for ; Wed, 19 Jun 2019 09:05:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F95C2080C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F1D2C1C2AB; Wed, 19 Jun 2019 11:05:44 +0200 (CEST) Received: from mail-ua1-f66.google.com (mail-ua1-f66.google.com [209.85.222.66]) by dpdk.org (Postfix) with ESMTP id 3FC9B1C2A7 for ; Wed, 19 Jun 2019 11:05:43 +0200 (CEST) Received: by mail-ua1-f66.google.com with SMTP id s4so9050348uad.7 for ; Wed, 19 Jun 2019 02:05:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ji+iAFSsuCnovTtYGYMwHkim6ZFDc/5/08hRR666ous=; b=ggSQb8eqIbe4P6VzTIWCMtlCGfk4PYhcSdOyMg1osdlcOdxWlZsZHWvmjtv7fPRI8L bozqwQwicU3sM4LRebnRpKqxLiDd2DA24y4amkdv8b2VhuP5KLygd0JwVmSAaeDk5Oij PrJKm45PTrB5Xjnz3dK7OadoG1lk7LCJhGNE6aHT4/5wwfTaSCZ5B9XvoI1mLIJUN/BT zFpmTYc92qTN/v7fLfyOixTD05GMq8DW2Opkk4fknTm2kMZukFS/J+zsTTW1+GTQIzyk uM4mqQCKGYqivLf/cV6zd6W2ocdEx2Gk76J+pNCtP4/Tg5/MVOZXiUZlalkBghSBVMdJ qCzA== X-Gm-Message-State: APjAAAVbJOBwaiypC43u3WEVaW51a4p0e/qOjm4GziKvPuKj9SDQhnw3 6HaKGe7fIDKtj8M2LbJqYDKLSrxFAOD9946/WGELpA== X-Google-Smtp-Source: APXvYqxJM9NG4N8Hpe07YVgPFRhDaoZ2CTRWsqscbFwUgN/ozhhvrtyvEXzvN/tjlcw0fmVBZZRn/ec9wmmzF8/N4pQ= X-Received: by 2002:ab0:6198:: with SMTP id h24mr6117158uan.41.1560935142619; Wed, 19 Jun 2019 02:05:42 -0700 (PDT) MIME-Version: 1.0 References: <1560246526-264797-3-git-send-email-andy.pei@intel.com> <1560934174-408632-1-git-send-email-andy.pei@intel.com> <1560934174-408632-4-git-send-email-andy.pei@intel.com> In-Reply-To: <1560934174-408632-4-git-send-email-andy.pei@intel.com> From: David Marchand Date: Wed, 19 Jun 2019 11:05:31 +0200 Message-ID: To: Andy Pei Cc: dev , Rosen Xu Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v3 4/4] net/ipn3ke: implementation of statistics X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Jun 19, 2019 at 10:56 AM Andy Pei wrote: > This patch implemente statistics read and reset > function for ipn3ke. > > Fixes: 70d6b7f550f4 ("net/ipn3ke: add representor") > Cc: rosen.xu@intel.com > > Signed-off-by: Andy Pei > --- > 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 > +#include > > #include > #include > @@ -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 +}; > + > +#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. + {"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