mirror of
https://github.com/openvswitch/ovs
synced 2025-10-25 15:07:05 +00:00
netdev: Custom statistics.
- New get_custom_stats interface function is added to netdev. It allows particular netdev implementation to expose custom counters in dictionary format (counter name/counter value). - New statistics are retrieved using experimenter code and are printed as a result to ofctl dump-ports. - New counters are available for OpenFlow 1.4+. - New statistics are printed to output via ofctl only if those are present in reply message. - New statistics definition is added to include/openflow/intel-ext.h. - Custom statistics are implemented only for dpdk-physical port type. - DPDK-physical implementation uses xstats to collect statistics. Only dropped and error counters are exposed. Co-authored-by: Ben Pfaff <blp@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org> Signed-off-by: Michal Weglicki <michalx.weglicki@intel.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
committed by
Ben Pfaff
parent
cd32509e4a
commit
971f4b394c
@@ -27,9 +27,11 @@
|
||||
|
||||
enum intel_port_stats_subtype {
|
||||
INTEL_PORT_STATS_RFC2819 = 1,
|
||||
INTEL_PORT_STATS_CUSTOM
|
||||
};
|
||||
|
||||
#define INTEL_PORT_STATS_RFC2819_SIZE 184
|
||||
#define INTEL_PORT_STATS_CUSTOM_SIZE 16
|
||||
|
||||
/* Struct implements custom property type based on
|
||||
* 'ofp_prop_experimenter'. */
|
||||
@@ -70,4 +72,30 @@ struct intel_port_stats_rfc2819 {
|
||||
OFP_ASSERT(sizeof (struct intel_port_stats_rfc2819) ==
|
||||
INTEL_PORT_STATS_RFC2819_SIZE);
|
||||
|
||||
/* Structure implements custom property type based on
|
||||
* 'ofp_prop_experimenter'. It contains custom
|
||||
* statistics in dictionary format */
|
||||
struct intel_port_custom_stats {
|
||||
ovs_be16 type; /* OFPPSPT14_EXPERIMENTER. */
|
||||
ovs_be16 length; /* Length in bytes of this property excluding
|
||||
* trailing padding. */
|
||||
ovs_be32 experimenter; /* INTEL_VENDOR_ID. */
|
||||
ovs_be32 exp_type; /* INTEL_PORT_STATS_*. */
|
||||
|
||||
uint8_t pad[2];
|
||||
ovs_be16 stats_array_size; /* number of counters. */
|
||||
|
||||
/* Followed by:
|
||||
* - Exactly 'stats_array_size' array elements of
|
||||
* dynamic structure which contains:
|
||||
* - "NAME SIZE" - counter name size (number of characters)
|
||||
* - "COUNTER NAME" - Exact number of characters
|
||||
* defined by "NAME SIZE".
|
||||
* - "COUNTER VALUE" - ovs_be64 counter value,
|
||||
* - Zero or more bytes to fill out the
|
||||
* overall length in header.length. */
|
||||
};
|
||||
OFP_ASSERT(sizeof(struct intel_port_custom_stats) ==
|
||||
INTEL_PORT_STATS_CUSTOM_SIZE);
|
||||
|
||||
#endif /* openflow/intel-ext.h */
|
||||
|
||||
Reference in New Issue
Block a user