This is the 1st patch of a series of 4 patches:
1/4: OpenFlow 1.2 bug fixes
2/4: Initial OpenFlow 1.3 support
3/4: OF13 TUNNEL_ID support (also on OF12 protocol)
4/4: NXPIF_OPENFLOW13 to allow OF13 packet_in to be used over OF12 (adds
support for the matching flow cookie)
OpenFlow 1.2 protocol fixes: Add OFPP_ANY to
include/openflow/openflow-1.1.h,
and allow it as a port in queue stats request. Make ovs_ofctl use OFPP_ANY
instead of OFPP_ALL for queue stats requests on OF 1.1+.
Do not check out_group on flow_mod unless the command is DELETE*.
include/openflow/openflow-1.1.h | 8 ++++++++
lib/ofp-util.c | 2 +-
ofproto/ofproto.c | 2 +-
utilities/ovs-ofctl.c | 2 +-
4 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/include/openflow/openflow-1.1.h b/include/openflow/openflow-1.1.h
index 9785db4..c4a5aba 100644
--- a/include/openflow/openflow-1.1.h
+++ b/include/openflow/openflow-1.1.h
@@ -70,6 +70,14 @@
#define OFPP11_MAX 0xffffff00
#define OFPP11_OFFSET (OFPP11_MAX - OFPP_MAX)
+/* Reserved wildcard port used only for flow mod (delete) and flow stats
+ * requests. Selects all flows regardless of output port
+ * (including flows with no output port)
+ *
+ * Define it via OFPP_NONE (0xFFFF) so that OFPP_ANY is still an enum ofp_port
+ */
+#define OFPP_ANY OFPP_NONE
+
/* OpenFlow 1.1 port config flags are just the common flags. */
#define OFPPC11_ALL \
(OFPPC_PORT_DOWN | OFPPC_NO_RECV | OFPPC_NO_FWD | OFPPC_NO_PACKET_IN)
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 4facf0a..1071457 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -1435,7 +1435,7 @@ ofputil_decode_flow_mod(struct ofputil_flow_mod *fm,
if (error) {
return error;
}
- if (ofm->out_group != htonl(OFPG_ANY)) {
+ if ((ofm->command == OFPFC_DELETE || ofm->command ==
OFPFC_DELETE_STRICT) && ofm->out_group != htonl(OFPG_ANY)) {
return OFPERR_OFPFMFC_UNKNOWN;
}
fm->flags = ntohs(ofm->flags);
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index dabb590..6ab8d08 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -3054,7 +3054,7 @@ handle_queue_stats_request(struct ofconn *ofconn,
return error;
}
- if (oqsr.port_no == OFPP_ALL) {
+ if (oqsr.port_no == OFPP_ALL || oqsr.port_no == OFPP_ANY) {
error = OFPERR_OFPQOFC_BAD_QUEUE;
HMAP_FOR_EACH (port, hmap_node, &ofproto->ports) {
if (!handle_queue_stats_for_port(port, oqsr.queue_id, &cbdata)) {
diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index 363c0a3..41ef431 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -968,7 +968,7 @@ ofctl_queue_stats(int argc, char *argv[])
if (argc > 2 && argv[2][0] && strcasecmp(argv[2], "all")) {
oqs.port_no = str_to_port_no(argv[1], argv[2]);
} else {
- oqs.port_no = OFPP_ALL;
+ oqs.port_no = (vconn_get_version(vconn) == OFP10_VERSION) ? OFPP_ALL :
OFPP_ANY;
}
if (argc > 3 && argv[3][0] && strcasecmp(argv[3], "all")) {
oqs.queue_id = atoi(argv[3]);
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev