summaryrefslogtreecommitdiffstats
path: root/src/plugins/avf
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2021-05-19 10:35:10 +0200
committerDamjan Marion <damarion@cisco.com>2021-05-19 10:35:32 +0200
commit8fe2afe88360a7ad4f6a22f4bf049511066e97af (patch)
tree86449ac5b3ce3ba8ac8e1b19930eb536a76da3e8 /src/plugins/avf
parentfb50bc31bfd54902231925749cacbbcd6dfccc96 (diff)
avf: print stats in separate log class
Type: improvement Change-Id: Ia1a4b1b1acad989cbd47a805b900160ba0071071 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/avf')
-rw-r--r--src/plugins/avf/avf.h6
-rw-r--r--src/plugins/avf/device.c19
-rw-r--r--src/plugins/avf/format.c19
3 files changed, 38 insertions, 6 deletions
diff --git a/src/plugins/avf/avf.h b/src/plugins/avf/avf.h
index c03a7c252ae..10297e6f0ce 100644
--- a/src/plugins/avf/avf.h
+++ b/src/plugins/avf/avf.h
@@ -85,6 +85,7 @@
extern vlib_log_class_registration_t avf_log;
+extern vlib_log_class_registration_t avf_stats_log;
#define avf_log_err(dev, f, ...) \
vlib_log (VLIB_LOG_LEVEL_ERR, avf_log.class, "%U: " f, \
@@ -101,6 +102,10 @@ extern vlib_log_class_registration_t avf_log;
format_vlib_pci_addr, &dev->pci_addr, \
## __VA_ARGS__)
+#define avf_stats_log_debug(dev, f, ...) \
+ vlib_log (VLIB_LOG_LEVEL_DEBUG, avf_stats_log.class, "%U: " f, \
+ format_vlib_pci_addr, &dev->pci_addr, ##__VA_ARGS__)
+
#define foreach_avf_device_flags \
_ (0, INITIALIZED, "initialized") \
_ (1, ERROR, "error") \
@@ -356,6 +361,7 @@ format_function_t format_avf_vf_cap_flags;
format_function_t format_avf_vlan_supported_caps;
format_function_t format_avf_vlan_caps;
format_function_t format_avf_vlan_support;
+format_function_t format_avf_eth_stats;
vnet_flow_dev_ops_function_t avf_flow_ops_fn;
static_always_inline avf_device_t *
diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c
index 28fe0a42f08..09dafa3d1e5 100644
--- a/src/plugins/avf/device.c
+++ b/src/plugins/avf/device.c
@@ -36,11 +36,14 @@
#define PCI_DEVICE_ID_INTEL_X710_VF 0x154c
#define PCI_DEVICE_ID_INTEL_X722_VF 0x37cd
-/* *INDENT-OFF* */
VLIB_REGISTER_LOG_CLASS (avf_log) = {
.class_name = "avf",
};
-/* *INDENT-ON* */
+
+VLIB_REGISTER_LOG_CLASS (avf_stats_log) = {
+ .class_name = "avf",
+ .subclass_name = "stats",
+};
avf_main_t avf_main;
void avf_delete_if (vlib_main_t * vm, avf_device_t * ad, int with_barrier);
@@ -815,13 +818,17 @@ avf_op_get_stats (vlib_main_t * vm, avf_device_t * ad,
virtchnl_eth_stats_t * es)
{
virtchnl_queue_select_t qs = { 0 };
+ clib_error_t *err;
qs.vsi_id = ad->vsi_id;
- avf_log_debug (ad, "get_stats: vsi_id %u", ad->vsi_id);
+ err = avf_send_to_pf (vm, ad, VIRTCHNL_OP_GET_STATS, &qs,
+ sizeof (virtchnl_queue_select_t), es,
+ sizeof (virtchnl_eth_stats_t));
- return avf_send_to_pf (vm, ad, VIRTCHNL_OP_GET_STATS,
- &qs, sizeof (virtchnl_queue_select_t),
- es, sizeof (virtchnl_eth_stats_t));
+ avf_stats_log_debug (ad, "get_stats: vsi_id %u\n %U", ad->vsi_id,
+ format_avf_eth_stats, es);
+
+ return err;
}
clib_error_t *
diff --git a/src/plugins/avf/format.c b/src/plugins/avf/format.c
index 26157804c77..0a153a093d9 100644
--- a/src/plugins/avf/format.c
+++ b/src/plugins/avf/format.c
@@ -239,3 +239,22 @@ format_avf_vlan_caps (u8 *s, va_list *args)
vc->offloads.ethertype_match);
return s;
}
+
+u8 *
+format_avf_eth_stats (u8 *s, va_list *args)
+{
+ virtchnl_eth_stats_t *es = va_arg (*args, virtchnl_eth_stats_t *);
+ u32 indent = format_get_indent (s);
+ u8 *v = 0;
+
+#define _(st) \
+ if (v) \
+ v = format (v, "\n%U", format_white_space, indent); \
+ v = format (v, "%-20s = %lu", #st, es->st);
+ foreach_virtchnl_eth_stats
+#undef _
+
+ s = format (s, "%v", v);
+ vec_free (v);
+ return s;
+}
gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
Descriptions of section entries:

	M: Maintainer Full name and E-mail address: Full Name <address@domain>
	   One maintainer per line.  Multiple M: lines acceptable.
	F: Files and directories with wildcard patterns.
	   A trailing slash includes all files and subdirectory files.
	   F:	drivers/net/	all files in and below drivers/net
	   F:	drivers/net/*	all files in drivers/net, but not below
	   One pattern per line.  Multiple F: lines acceptable.
	C: Single line comment related to current section.

		-----------------------------------

Build System
M:	Damjan Marion <damarion@cisco.com>
F:	Makefile
F:	src/CMakeLists.txt
F:	src/cmake/

Build System Internal
M:	Dave Barach <dave@barachs.net>
F:	build-root/Makefile
F:	build-data/

Doxygen
M:	Chris Luke <chrisy@flirble.org>
F:	doxygen/

Sphinx Documents
M:     John DeNisco <jdenisco@cisco.com>
M:     Ray Kinsella <raykinsella78@gmail.com>
F:     docs/

DPDK Development Packaging
M:	Damjan Marion <damarion@cisco.com>
F:	dpdk/
F:	dpdk/*

Infrastructure Library
M:	Dave Barach <dave@barachs.net>
F:	src/vppinfra/

Vector Library
M:	Dave Barach <dave@barachs.net>
M:	Damjan Marion <damarion@cisco.com>
F:	src/vlib/

Binary API Libraries
M:	Dave Barach <dave@barachs.net>
F:	src/vlibapi/
F:	src/vlibmemory/

VNET Bidirectonal Forwarding Detection (BFD)
M:	Klement Sekera <ksekera@cisco.com>
F:	src/vnet/bfd/

VNET Device Drivers
M:	Damjan Marion <damarion@cisco.com>
F:	src/vnet/devices/

VNET Device Drivers - DPDK Crypto
M:	Sergio Gonzalez Monroy <sergio.gonzalez.monroy@outlook.com>
M:      Radu Nicolau <radu.nicolau@intel.com>
F:	src/devices/dpdk/ipsec/

VNET Feature Arcs
M:	Dave Barach <dave@barachs.net>
M:	Damjan Marion <damarion@cisco.com>
F:	src/vnet/feature/

VNET FIB
M:	Neale Ranns <nranns@cisco.com>
F:	src/vnet/fib/
F:	src/vnet/mfib/
F:	src/vnet/dpo
F:	src/vnet/adj

VNET IPv4 and IPv6 LPM
M:	Dave Barach <dave@barachs.net>
F:	src/vnet/ip/

VNET Segment Routing (IPv6 and MPLS)
M:	Pablo Camarillo <pcamaril@cisco.com>
F:	src/vnet/srv6/
F:	src/vnet/srmpls/
F:	src/examples/srv6-sample-localsid/

VNET IPSec
M:	Matus Fabian <matfabia@cisco.com>
M:	Radu Nicolau <radu.nicolau@intel.com>
F:	src/vnet/ipsec/

VNET L2
M:	John Lo <loj@cisco.com>
F:	src/vnet/l2/

VNET Link Layer Discovery Protocol (LLDP)
M:	Klement Sekera <ksekera@cisco.com>
F:	src/vnet/lldp/

VNET LISP
M:	Florin Coras <fcoras@cisco.com>
F:	src/vnet/lisp-cp/
F:	src/vnet/lisp-gpe/

Plugin - MAP
M:	Ole Troan <ot@cisco.com>
F:	src/plugins/map

VNET MPLS
M:	Neale Ranns <nranns@cisco.com>
F:	src/vnet/mpls/

VNET Host Stack Session Layer
M:	Florin Coras <fcoras@cisco.com>
F:	src/vnet/session

VNET TCP Stack
M:	Florin Coras <fcoras@cisco.com>
F:	src/vnet/tcp

VNET VXLAN
M:	John Lo <loj@cisco.com>
F:	src/vnet/vxlan/

VNET VXLAN-GPE
M:	Hongjun Ni <hongjun.ni@intel.com>
F:	src/vnet/vxlan-gpe/

VNET IPIP
M:	Ole Troan <otroan@employees.org>
F:	src/vnet/ipip/

VNET TLS and TLS engine plugins
M: 	Florin Coras <fcoras@cisco.com>
M:	Ping Yu <ping.yu@intel.com>
F:	src/vnet/tls
F:	src/plugins/tlsopenssl
F:	src/plugins/tlsmbedtls

Plugin - ACL
M:	Andrew Yourtchenko <ayourtch@gmail.com>
F:	src/plugins/acl/

Plugin - flowprobe
M:	Ole Troan <otroan@employees.org>
F:	src/plugins/flowprobe/

Plugin - GTPU
M:	Hongjun Ni <hongjun.ni@intel.com>
F:	src/plugins/gtpu/

Plugin - PPPoE
M:	Hongjun Ni <hongjun.ni@intel.com>
F:	src/plugins/pppoe/

Plugin - IPv6 Segment Routing Dynamic Proxy
M:	Francois Clad <fclad@cisco.com>
F:	src/plugins/srv6-ad/

Plugin - IPv6 Segment Routing Masquerading Proxy
M:	Francois Clad <fclad@cisco.com>
F:	src/plugins/srv6-am/

Plugin - IPv6 Segment Routing Static Proxy
M:	Francois Clad <fclad@cisco.com>
F:	src/plugins/srv6-as/

Plugin - Load Balancer
M:      Pierre Pfister <ppfister@cisco.com>
M:      Hongjun Ni <hongjun.ni@intel.com>
F:      src/plugins/lb/

Plugin - NSH
M:      Hongjun Ni <hongjun.ni@intel.com>
M:      Vengada <venggovi@cisco.com>
F:      src/plugins/nsh/

Plugin - Time-based MAC filter
M:	Dave Barach <dave@barachs.net>
F:      src/plugins/mactime/

Plugin - Network Delay Simulator
M:	Dave Barach <dave@barachs.net>
F:      src/plugins/nsim/

Test Infrastructure
M:	Klement Sekera <ksekera@cisco.com>
M:  Paul Vinciguerra <pvinci@vinciconsulting.com>
F:	test/

SVM Library
M:	Dave Barach <dave@barachs.net>
F:	src/svm

VPP API TEST
M:	Dave Barach <dave@barachs.net>
F:	src/vat/

VPP Executable
M:	Dave Barach <dave@barachs.net>
F:	src/vpp/

Graphical Event Viewer
M:	Dave Barach <dave@barachs.net>
F:	src/tools/g2/

Performance Tooling
M:	Dave Barach <dave@barachs.net>
F:	src/tools/perftool/

Binary API Compiler
M:	Ole Troan <otroan@employees.org>
F:	src/tools/vppapigen/

Plugin - RDMA (ibverb) driver
M:	BenoƮt Ganne <bganne@cisco.com>
M:	Damjan Marion <damarion@cisco.com>
F:	src/plugins/rdma/

THE REST
C:	Contact vpp-dev Mailing List <vpp-dev@fd.io>
F:	*
F:	*/