summaryrefslogtreecommitdiff
path: root/include/openflow
diff options
context:
space:
mode:
authormweglicx <michalx.weglicki@intel.com>2016-05-05 09:46:01 +0100
committerBen Pfaff <blp@ovn.org>2016-05-06 15:28:56 -0700
commitd6e3feb57c44e18580015d8e99dd751cff4f2c9e (patch)
tree2d243eed928b2b3fad094e9990f98713176adbc4 /include/openflow
parent104aec4e0c57bc92a3c22cea9dff69f74adda861 (diff)
downloadopenvswitch-d6e3feb57c44e18580015d8e99dd751cff4f2c9e.tar.gz
Add support for extended netdev statistics based on RFC 2819.
Implementation of new statistics extension for DPDK ports: - Add new counters definition to netdev struct and open flow, based on RFC2819. - Initialize netdev statistics as "filtered out" before passing it to particular netdev implementation (because of that change, statistics which are not collected are reported as filtered out, and some unit tests were modified in this respect). - 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+. - Add new vendor id: INTEL_VENDOR_ID. - New statistics are printed to output via ofctl only if those are present in reply message. - Add new file header: include/openflow/intel-ext.h which contains new statistics definition. - Extended statistics are implemented only for dpdk-physical and dpdk-vhost port types. - Dpdk-physical implementation uses xstats to collect statistics. - Dpdk-vhost implements only part of statistics (RX packet sized based counters). Signed-off-by: Michal Weglicki <michalx.weglicki@intel.com> [blp@ovn.org made software devices more consistent] Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'include/openflow')
-rw-r--r--include/openflow/automake.mk1
-rw-r--r--include/openflow/intel-ext.h73
-rw-r--r--include/openflow/openflow-common.h1
3 files changed, 75 insertions, 0 deletions
diff --git a/include/openflow/automake.mk b/include/openflow/automake.mk
index d7dac9132..18cc64989 100644
--- a/include/openflow/automake.mk
+++ b/include/openflow/automake.mk
@@ -1,5 +1,6 @@
openflowincludedir = $(includedir)/openflow
openflowinclude_HEADERS = \
+ include/openflow/intel-ext.h \
include/openflow/netronome-ext.h \
include/openflow/nicira-ext.h \
include/openflow/openflow-1.0.h \
diff --git a/include/openflow/intel-ext.h b/include/openflow/intel-ext.h
new file mode 100644
index 000000000..974e63e0d
--- /dev/null
+++ b/include/openflow/intel-ext.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright(c) 2016 Intel Corporation. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OPENFLOW_INTEL_EXT_H
+#define OPENFLOW_INTEL_EXT_H
+
+/* This file presents Intel vendor extension. It is not anyhow
+ * standardized, so all those definitions are not part of
+ * official openflow headers (openflow.h). Nevertheless below
+ * features introduces real value so it could be suitable for
+ * standardization */
+
+/* Intel extended statistics type */
+
+enum intel_port_stats_subtype {
+ INTEL_PORT_STATS_RFC2819 = 1,
+};
+
+#define INTEL_PORT_STATS_RFC2819_SIZE 184
+
+/* Struct implements custom property type based on
+ * 'ofp_prop_experimenter'. */
+struct intel_port_stats_rfc2819 {
+ 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[4];
+
+ ovs_be64 rx_1_to_64_packets;
+ ovs_be64 rx_65_to_127_packets;
+ ovs_be64 rx_128_to_255_packets;
+ ovs_be64 rx_256_to_511_packets;
+ ovs_be64 rx_512_to_1023_packets;
+ ovs_be64 rx_1024_to_1522_packets;
+ ovs_be64 rx_1523_to_max_packets;
+
+ ovs_be64 tx_1_to_64_packets;
+ ovs_be64 tx_65_to_127_packets;
+ ovs_be64 tx_128_to_255_packets;
+ ovs_be64 tx_256_to_511_packets;
+ ovs_be64 tx_512_to_1023_packets;
+ ovs_be64 tx_1024_to_1522_packets;
+ ovs_be64 tx_1523_to_max_packets;
+
+ ovs_be64 tx_multicast_packets;
+ ovs_be64 rx_broadcast_packets;
+ ovs_be64 tx_broadcast_packets;
+ ovs_be64 rx_undersized_errors;
+ ovs_be64 rx_oversize_errors;
+ ovs_be64 rx_fragmented_errors;
+ ovs_be64 rx_jabber_errors;
+
+};
+OFP_ASSERT(sizeof (struct intel_port_stats_rfc2819) ==
+ INTEL_PORT_STATS_RFC2819_SIZE);
+
+#endif /* openflow/intel-ext.h */
diff --git a/include/openflow/openflow-common.h b/include/openflow/openflow-common.h
index 089ff1889..7b619a997 100644
--- a/include/openflow/openflow-common.h
+++ b/include/openflow/openflow-common.h
@@ -108,6 +108,7 @@ enum ofp_version {
#define NTR_COMPAT_VENDOR_ID 0x00001540 /* Incorrect value used in v2.4. */
#define NX_VENDOR_ID 0x00002320 /* Nicira. */
#define ONF_VENDOR_ID 0x4f4e4600 /* Open Networking Foundation. */
+#define INTEL_VENDOR_ID 0x0000AA01 /* Intel */
#define OFP_MAX_TABLE_NAME_LEN 32
#define OFP_MAX_PORT_NAME_LEN 16