diff options
author | Michal Weglicki <michalx.weglicki@intel.com> | 2018-01-09 07:55:37 +0000 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-01-10 15:29:13 -0800 |
commit | 971f4b394c6e8480300494787fe919869ff3886c (patch) | |
tree | 8dfa01877f05fbc46ebcc85d3c62f3c06e820ad0 /include/openvswitch/netdev.h | |
parent | cd32509e4af4f9f7a002a6a5c137718f2173c538 (diff) | |
download | openvswitch-971f4b394c6e8480300494787fe919869ff3886c.tar.gz |
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>
Diffstat (limited to 'include/openvswitch/netdev.h')
-rw-r--r-- | include/openvswitch/netdev.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/openvswitch/netdev.h b/include/openvswitch/netdev.h index 50bafc3a6..e25c241f4 100644 --- a/include/openvswitch/netdev.h +++ b/include/openvswitch/netdev.h @@ -27,6 +27,9 @@ extern "C" { struct netdev; +/* Maximum name length for custom statistics counters */ +#define NETDEV_CUSTOM_STATS_NAME_SIZE 64 + /* Network device statistics. * * Values of unsupported statistics are set to all-1-bits (UINT64_MAX). */ @@ -85,6 +88,18 @@ struct netdev_stats { uint64_t rx_jabber_errors; }; +/* Structure representation of custom statistics counter */ +struct netdev_custom_counter { + uint64_t value; + char name[NETDEV_CUSTOM_STATS_NAME_SIZE]; +}; + +/* Structure representation of custom statistics */ +struct netdev_custom_stats { + uint16_t size; + struct netdev_custom_counter *counters; +}; + /* Features. */ enum netdev_features { NETDEV_F_10MB_HD = 1 << 0, /* 10 Mb half-duplex rate support. */ @@ -115,6 +130,8 @@ uint64_t netdev_features_to_bps(enum netdev_features features, bool netdev_features_is_full_duplex(enum netdev_features features); int netdev_set_advertisements(struct netdev *, enum netdev_features advertise); +void netdev_free_custom_stats_counters(struct netdev_custom_stats *); + #ifdef __cplusplus } #endif |