aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-06-17 15:04:12 -0700
committerBen Pfaff <blp@nicira.com>2010-06-17 15:04:12 -0700
commitc1c9c9c4b636ab2acf2f75024c282a9a497ca9a9 (patch)
tree02d8e5c448f1b75126f965ee5173ddde5111d63c /include
parenta90b56b7708a17e8bd689d4a3558348f04cb8dcb (diff)
Implement QoS framework.
ovs-vswitchd doesn't declare its QoS capabilities in the database yet, so the controller has to know what they are. We can add that later. The linux-htb QoS class has been tested to the extent that I can see that it sets up the queues I expect when I run "tc qdisc show" and "tc class show". I haven't tested that the effects on flows are what we expect them to be. I am sure that there will be problems in that area that we will have to fix.
Diffstat (limited to 'include')
-rw-r--r--include/openflow/openflow.h39
-rw-r--r--include/openvswitch/datapath-protocol.h12
2 files changed, 48 insertions, 3 deletions
diff --git a/include/openflow/openflow.h b/include/openflow/openflow.h
index b77cd701..f84fd020 100644
--- a/include/openflow/openflow.h
+++ b/include/openflow/openflow.h
@@ -419,6 +419,18 @@ struct ofp_action_header {
};
OFP_ASSERT(sizeof(struct ofp_action_header) == 8);
+/* OFPAT_ENQUEUE action struct: send packets to given queue on port. */
+struct ofp_action_enqueue {
+ uint16_t type; /* OFPAT_ENQUEUE. */
+ uint16_t len; /* Len is 16. */
+ uint16_t port; /* Port that queue belongs. Should
+ refer to a valid physical port
+ (i.e. < OFPP_MAX) or OFPP_IN_PORT. */
+ uint8_t pad[6]; /* Pad for 64-bit alignment. */
+ uint32_t queue_id; /* Where to enqueue the packets. */
+};
+OFP_ASSERT(sizeof(struct ofp_action_enqueue) == 16);
+
union ofp_action {
uint16_t type;
struct ofp_action_header header;
@@ -713,8 +725,8 @@ enum ofp_stats_types {
OFPST_PORT,
/* Queue statistics for a port
- * The request body defines the port
- * The reply body is an array of struct ofp_queue_stats */
+ * The request body is struct ofp_queue_stats_request.
+ * The reply body is an array of struct ofp_queue_stats. */
OFPST_QUEUE,
/* Vendor extension.
@@ -859,6 +871,29 @@ struct ofp_port_stats {
};
OFP_ASSERT(sizeof(struct ofp_port_stats) == 104);
+/* All ones is used to indicate all queues in a port (for stats retrieval). */
+#define OFPQ_ALL 0xffffffff
+
+/* Body for ofp_stats_request of type OFPST_QUEUE. */
+struct ofp_queue_stats_request {
+ uint16_t port_no; /* All ports if OFPP_ALL. */
+ uint8_t pad[2]; /* Align to 32-bits. */
+ uint32_t queue_id; /* All queues if OFPQ_ALL. */
+};
+OFP_ASSERT(sizeof(struct ofp_queue_stats_request) == 8);
+
+/* Body for ofp_stats_reply of type OFPST_QUEUE consists of an array of this
+ * structure type. */
+struct ofp_queue_stats {
+ uint16_t port_no;
+ uint8_t pad[2]; /* Align to 32-bits. */
+ uint32_t queue_id; /* Queue id. */
+ uint64_t tx_bytes; /* Number of transmitted bytes. */
+ uint64_t tx_packets; /* Number of transmitted packets. */
+ uint64_t tx_errors; /* Number of packets dropped due to overrun. */
+};
+OFP_ASSERT(sizeof(struct ofp_queue_stats) == 32);
+
/* Vendor extension. */
struct ofp_vendor_header {
struct ofp_header header; /* Type OFPT_VENDOR. */
diff --git a/include/openvswitch/datapath-protocol.h b/include/openvswitch/datapath-protocol.h
index 4b2168cb..13aa9225 100644
--- a/include/openvswitch/datapath-protocol.h
+++ b/include/openvswitch/datapath-protocol.h
@@ -279,7 +279,9 @@ struct odp_flowvec {
#define ODPAT_SET_TP_SRC 11 /* TCP/UDP source port. */
#define ODPAT_SET_TP_DST 12 /* TCP/UDP destination port. */
#define ODPAT_SET_TUNNEL 13 /* Set the encapsulating tunnel ID. */
-#define ODPAT_N_ACTIONS 14
+#define ODPAT_SET_PRIORITY 14 /* Set skb->priority. */
+#define ODPAT_POP_PRIORITY 15 /* Restore original skb->priority. */
+#define ODPAT_N_ACTIONS 16
struct odp_action_output {
uint16_t type; /* ODPAT_OUTPUT. */
@@ -353,6 +355,13 @@ struct odp_action_tp_port {
uint16_t reserved2;
};
+/* Action structure for ODPAT_SET_PRIORITY. */
+struct odp_action_priority {
+ uint16_t type; /* ODPAT_SET_PRIORITY. */
+ uint16_t reserved;
+ uint32_t priority; /* skb->priority value. */
+};
+
union odp_action {
uint16_t type;
struct odp_action_output output;
@@ -365,6 +374,7 @@ union odp_action {
struct odp_action_nw_addr nw_addr;
struct odp_action_nw_tos nw_tos;
struct odp_action_tp_port tp_port;
+ struct odp_action_priority priority;
};
struct odp_execute {