From c37c03826ce05e0d8262180b102923574eea01eb Mon Sep 17 00:00:00 2001 From: Alexandru Copot Date: Mon, 3 Mar 2014 15:22:32 +0200 Subject: [PATCH] ofproto: Allow the use of the OpenFlow 1.4 protocol This defines the version number for OpenFlow 1.4 so that the switch can actually use it. The ovsdb schema is also modified. Signed-off-by: Alexandru Copot Cc: Daniel Baluta [blp@nicira.com adjusted code in cases where 1.3 and 1.4 are the same] Signed-off-by: Ben Pfaff --- DESIGN | 6 ++ FAQ | 34 ++++----- OPENFLOW-1.1+ | 2 +- build-aux/extract-ofp-errors | 3 +- build-aux/extract-ofp-msgs | 8 +-- include/openflow/openflow-common.h | 4 +- lib/ofp-errors.c | 2 + lib/ofp-msgs.c | 5 ++ lib/ofp-msgs.h | 4 +- lib/ofp-print.c | 2 + lib/ofp-util.c | 109 +++++++++++++++++++++++++---- lib/ofp-util.h | 7 +- tests/ofp-errors.at | 2 + utilities/ovs-ofctl.8.in | 5 +- utilities/ovs-ofctl.c | 1 + vswitchd/vswitch.ovsschema | 5 +- 16 files changed, 152 insertions(+), 47 deletions(-) diff --git a/DESIGN b/DESIGN index 4d654d01d..f864135a8 100644 --- a/DESIGN +++ b/DESIGN @@ -266,6 +266,12 @@ OpenFlow 1.3 makes these changes: The table for 1.3 is the same as the one shown above for 1.2. +OpenFlow 1.4 +------------ + +OpenFlow 1.4 does not change flow_mod semantics. + + OFPT_PACKET_IN ============== diff --git a/FAQ b/FAQ index a54bbf93c..27bd5b88f 100644 --- a/FAQ +++ b/FAQ @@ -1090,20 +1090,23 @@ Using OpenFlow (Manually or Via Controller) Q: What versions of OpenFlow does Open vSwitch support? -A: Open vSwitch 1.9 and earlier support only OpenFlow 1.0 (plus - extensions that bring in many of the features from later versions - of OpenFlow). +A: The following table lists the versions of OpenFlow supported by + each version of Open vSwitch: - Open vSwitch 1.10 and later have experimental support for OpenFlow - 1.2 and 1.3. On these versions of Open vSwitch, the following - command enables OpenFlow 1.0, 1.2, and 1.3 on bridge br0: + Open vSwitch OF1.0 OF1.1 OF1.2 OF1.3 OF1.4 + =============== ===== ===== ===== ===== ===== + 1.9 and earlier yes --- --- --- --- + 1.10 yes --- [*] [*] --- + 1.11 yes --- [*] [*] --- + 2.0 yes [*] [*] [*] --- + 2.1 yes [*] [*] [*] --- + 2.2 yes [*] [*] [*] [*] - ovs-vsctl set bridge br0 protocols=OpenFlow10,OpenFlow12,OpenFlow13 + [*] Supported, with one or more missing features. - Open vSwitch version 2.0 and later will have experimental support - for OpenFlow 1.1, 1.2, and 1.3. On these versions of Open vSwitch, - the following command enables OpenFlow 1.0, 1.1, 1.2, and 1.3 on - bridge br0: + Because of missing features, OpenFlow 1.1, 1.2, 1.3, and 1.4 must + be enabled manually. The following command enables OpenFlow 1.0, + 1.1, 1.2, and 1.3 on bridge br0: ovs-vsctl set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13 @@ -1112,11 +1115,10 @@ A: Open vSwitch 1.9 and earlier support only OpenFlow 1.0 (plus ovs-ofctl -O OpenFlow13 dump-flows br0 - Support for OpenFlow 1.1, 1.2, and 1.3 is still incomplete. Work - to be done is tracked in OPENFLOW-1.1+ in the Open vSwitch sources - (also via http://openvswitch.org/development/openflow-1-x-plan/). - When support for a given OpenFlow version is solidly implemented, - Open vSwitch will enable that version by default. + OPENFLOW-1.1+ in the Open vSwitch source tree tracks support for + OpenFlow 1.1 and later features. When support for a given OpenFlow + version is solidly implemented, Open vSwitch will enable that + version by default. Q: Does Open vSwitch support MPLS? diff --git a/OPENFLOW-1.1+ b/OPENFLOW-1.1+ index 4363d28a2..6fee77c91 100644 --- a/OPENFLOW-1.1+ +++ b/OPENFLOW-1.1+ @@ -1,7 +1,7 @@ OpenFlow 1.1+ support in Open vSwitch ===================================== -Open vSwitch support for OpenFlow 1.1, 1.2, and 1.3 is a work in +Open vSwitch support for OpenFlow 1.1 and beyond is a work in progress. This file describes the work still to be done. The Plan diff --git a/build-aux/extract-ofp-errors b/build-aux/extract-ofp-errors index bffead400..ee8dd0f49 100755 --- a/build-aux/extract-ofp-errors +++ b/build-aux/extract-ofp-errors @@ -10,7 +10,8 @@ macros = {} version_map = {"1.0": 0x01, "1.1": 0x02, "1.2": 0x03, - "1.3": 0x04} + "1.3": 0x04, + "1.4": 0x05} version_reverse_map = dict((v, k) for (k, v) in version_map.iteritems()) token = None diff --git a/build-aux/extract-ofp-msgs b/build-aux/extract-ofp-msgs index 448e7dbb9..957119219 100755 --- a/build-aux/extract-ofp-msgs +++ b/build-aux/extract-ofp-msgs @@ -26,10 +26,10 @@ version_map = {"1.0": (OFP10_VERSION, OFP10_VERSION), "1.2": (OFP12_VERSION, OFP12_VERSION), "1.3": (OFP13_VERSION, OFP13_VERSION), "1.4": (OFP14_VERSION, OFP14_VERSION), - "1.0+": (OFP10_VERSION, OFP13_VERSION), - "1.1+": (OFP11_VERSION, OFP13_VERSION), - "1.2+": (OFP12_VERSION, OFP13_VERSION), - "1.3+": (OFP13_VERSION, OFP13_VERSION), + "1.0+": (OFP10_VERSION, OFP14_VERSION), + "1.1+": (OFP11_VERSION, OFP14_VERSION), + "1.2+": (OFP12_VERSION, OFP14_VERSION), + "1.3+": (OFP13_VERSION, OFP14_VERSION), "1.4+": (OFP14_VERSION, OFP14_VERSION), "1.0-1.1": (OFP10_VERSION, OFP11_VERSION), "1.0-1.2": (OFP10_VERSION, OFP12_VERSION), diff --git a/include/openflow/openflow-common.h b/include/openflow/openflow-common.h index 53aa67eb7..33df02b30 100644 --- a/include/openflow/openflow-common.h +++ b/include/openflow/openflow-common.h @@ -75,12 +75,12 @@ enum ofp_version { OFP10_VERSION = 0x01, OFP11_VERSION = 0x02, OFP12_VERSION = 0x03, - OFP13_VERSION = 0x04 + OFP13_VERSION = 0x04, + OFP14_VERSION = 0x05 /* When we add real support for these versions, add them to the enum so * that we get compiler warnings everywhere we might forget to provide * support. Until then, keep them as macros to avoid those warnings. */ -#define OFP14_VERSION 0x05 #define OFP15_VERSION 0x06 }; diff --git a/lib/ofp-errors.c b/lib/ofp-errors.c index 30a021bee..a8c5c3164 100644 --- a/lib/ofp-errors.c +++ b/lib/ofp-errors.c @@ -50,6 +50,8 @@ ofperr_domain_from_version(enum ofp_version version) return &ofperr_of12; case OFP13_VERSION: return &ofperr_of13; + case OFP14_VERSION: + return &ofperr_of14; default: return NULL; } diff --git a/lib/ofp-msgs.c b/lib/ofp-msgs.c index 4f07d0e18..092741fd7 100644 --- a/lib/ofp-msgs.c +++ b/lib/ofp-msgs.c @@ -268,6 +268,7 @@ ofp_is_stat_request(enum ofp_version version, uint8_t type) case OFP11_VERSION: case OFP12_VERSION: case OFP13_VERSION: + case OFP14_VERSION: return type == OFPT11_STATS_REQUEST; } @@ -283,6 +284,7 @@ ofp_is_stat_reply(enum ofp_version version, uint8_t type) case OFP11_VERSION: case OFP12_VERSION: case OFP13_VERSION: + case OFP14_VERSION: return type == OFPT11_STATS_REPLY; } @@ -322,6 +324,7 @@ ofphdrs_len(const struct ofphdrs *hdrs) case OFP11_VERSION: case OFP12_VERSION: case OFP13_VERSION: + case OFP14_VERSION: if (hdrs->type == OFPT11_STATS_REQUEST || hdrs->type == OFPT11_STATS_REPLY) { return (hdrs->stat == OFPST_VENDOR @@ -753,6 +756,7 @@ ofpraw_stats_request_to_reply(enum ofpraw raw, uint8_t version) case OFP11_VERSION: case OFP12_VERSION: case OFP13_VERSION: + case OFP14_VERSION: ovs_assert(hdrs.type == OFPT11_STATS_REQUEST); hdrs.type = OFPT11_STATS_REPLY; break; @@ -939,6 +943,7 @@ ofpmp_flags__(const struct ofp_header *oh) case OFP11_VERSION: case OFP12_VERSION: case OFP13_VERSION: + case OFP14_VERSION: return &((struct ofp11_stats_msg *) oh)->flags; default: OVS_NOT_REACHED(); diff --git a/lib/ofp-msgs.h b/lib/ofp-msgs.h index 26fd6a305..d8dee5b53 100644 --- a/lib/ofp-msgs.h +++ b/lib/ofp-msgs.h @@ -278,7 +278,7 @@ enum ofpraw { OFPRAW_OFPST11_TABLE_REPLY, /* OFPST 1.2 (3): struct ofp12_table_stats[]. */ OFPRAW_OFPST12_TABLE_REPLY, - /* OFPST 1.3 (3): struct ofp13_table_stats[]. */ + /* OFPST 1.3+ (3): struct ofp13_table_stats[]. */ OFPRAW_OFPST13_TABLE_REPLY, /* OFPST 1.0 (4): struct ofp10_port_stats_request. */ @@ -310,7 +310,7 @@ enum ofpraw { /* OFPST 1.1-1.2 (6): uint8_t[8][]. */ OFPRAW_OFPST11_GROUP_REPLY, - /* OFPST 1.3 (6): uint8_t[8][]. */ + /* OFPST 1.3+ (6): uint8_t[8][]. */ OFPRAW_OFPST13_GROUP_REPLY, /* OFPST 1.1+ (7): void. */ diff --git a/lib/ofp-print.c b/lib/ofp-print.c index c8d7f95a1..a83133468 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -540,6 +540,7 @@ ofp_print_switch_features(struct ds *string, const struct ofp_header *oh) case OFP12_VERSION: break; case OFP13_VERSION: + case OFP14_VERSION: return; /* no ports in ofp13_switch_features */ default: OVS_NOT_REACHED(); @@ -1790,6 +1791,7 @@ ofp_print_ofpst_table_reply(struct ds *string, const struct ofp_header *oh, int verbosity) { switch ((enum ofp_version)oh->version) { + case OFP14_VERSION: case OFP13_VERSION: ofp_print_ofpst_table_reply13(string, oh, verbosity); break; diff --git a/lib/ofp-util.c b/lib/ofp-util.c index fca18deed..e87d53985 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -573,6 +573,7 @@ ofputil_match_typical_len(enum ofputil_protocol protocol) case OFPUTIL_P_OF12_OXM: case OFPUTIL_P_OF13_OXM: + case OFPUTIL_P_OF14_OXM: return NXM_TYPICAL_LEN; default: @@ -613,6 +614,7 @@ ofputil_put_ofp11_match(struct ofpbuf *b, const struct match *match, case OFPUTIL_P_OF12_OXM: case OFPUTIL_P_OF13_OXM: + case OFPUTIL_P_OF14_OXM: return oxm_put_match(b, match); } @@ -659,6 +661,7 @@ static const struct proto_abbrev proto_abbrevs[] = { #define N_PROTO_ABBREVS ARRAY_SIZE(proto_abbrevs) enum ofputil_protocol ofputil_flow_dump_protocols[] = { + OFPUTIL_P_OF14_OXM, OFPUTIL_P_OF13_OXM, OFPUTIL_P_OF12_OXM, OFPUTIL_P_OF11_STD, @@ -683,6 +686,8 @@ ofputil_protocols_from_ofp_version(enum ofp_version version) return OFPUTIL_P_OF12_OXM; case OFP13_VERSION: return OFPUTIL_P_OF13_OXM; + case OFP14_VERSION: + return OFPUTIL_P_OF14_OXM; default: return 0; } @@ -716,6 +721,8 @@ ofputil_protocol_to_ofp_version(enum ofputil_protocol protocol) return OFP12_VERSION; case OFPUTIL_P_OF13_OXM: return OFP13_VERSION; + case OFPUTIL_P_OF14_OXM: + return OFP14_VERSION; } OVS_NOT_REACHED(); @@ -792,6 +799,9 @@ ofputil_protocol_set_tid(enum ofputil_protocol protocol, bool enable) case OFPUTIL_P_OF13_OXM: return OFPUTIL_P_OF13_OXM; + case OFPUTIL_P_OF14_OXM: + return OFPUTIL_P_OF14_OXM; + default: OVS_NOT_REACHED(); } @@ -832,6 +842,9 @@ ofputil_protocol_set_base(enum ofputil_protocol cur, case OFPUTIL_P_OF13_OXM: return ofputil_protocol_set_tid(OFPUTIL_P_OF13_OXM, tid); + case OFPUTIL_P_OF14_OXM: + return ofputil_protocol_set_tid(OFPUTIL_P_OF14_OXM, tid); + default: OVS_NOT_REACHED(); } @@ -868,6 +881,9 @@ ofputil_protocol_to_string(enum ofputil_protocol protocol) case OFPUTIL_P_OF13_OXM: return "OXM-OpenFlow13"; + + case OFPUTIL_P_OF14_OXM: + return "OXM-OpenFlow14"; } /* Check abbreviations. */ @@ -1003,6 +1019,9 @@ ofputil_version_from_string(const char *s) if (!strcasecmp(s, "OpenFlow13")) { return OFP13_VERSION; } + if (!strcasecmp(s, "OpenFlow14")) { + return OFP14_VERSION; + } return 0; } @@ -1073,6 +1092,8 @@ ofputil_version_to_string(enum ofp_version ofp_version) return "OpenFlow12"; case OFP13_VERSION: return "OpenFlow13"; + case OFP14_VERSION: + return "OpenFlow14"; default: OVS_NOT_REACHED(); } @@ -1306,6 +1327,7 @@ ofputil_encode_set_protocol(enum ofputil_protocol current, case OFPUTIL_P_OF11_STD: case OFPUTIL_P_OF12_OXM: case OFPUTIL_P_OF13_OXM: + case OFPUTIL_P_OF14_OXM: /* There is only one variant of each OpenFlow 1.1+ protocol, and we * verified above that we're not trying to change versions. */ OVS_NOT_REACHED(); @@ -2077,7 +2099,8 @@ ofputil_encode_flow_mod(const struct ofputil_flow_mod *fm, switch (protocol) { case OFPUTIL_P_OF11_STD: case OFPUTIL_P_OF12_OXM: - case OFPUTIL_P_OF13_OXM: { + case OFPUTIL_P_OF13_OXM: + case OFPUTIL_P_OF14_OXM: { struct ofp11_flow_mod *ofm; int tailroom; @@ -2561,7 +2584,8 @@ ofputil_encode_flow_stats_request(const struct ofputil_flow_stats_request *fsr, switch (protocol) { case OFPUTIL_P_OF11_STD: case OFPUTIL_P_OF12_OXM: - case OFPUTIL_P_OF13_OXM: { + case OFPUTIL_P_OF13_OXM: + case OFPUTIL_P_OF14_OXM: { struct ofp11_flow_stats_request *ofsr; raw = (fsr->aggregate @@ -3053,7 +3077,8 @@ ofputil_encode_flow_removed(const struct ofputil_flow_removed *fr, switch (protocol) { case OFPUTIL_P_OF11_STD: case OFPUTIL_P_OF12_OXM: - case OFPUTIL_P_OF13_OXM: { + case OFPUTIL_P_OF13_OXM: + case OFPUTIL_P_OF14_OXM: { struct ofp12_flow_removed *ofr; msg = ofpraw_alloc_xid(OFPRAW_OFPT11_FLOW_REMOVED, @@ -3417,6 +3442,7 @@ ofputil_encode_packet_in(const struct ofputil_packet_in *pin, case OFPUTIL_P_OF12_OXM: case OFPUTIL_P_OF13_OXM: + case OFPUTIL_P_OF14_OXM: packet = ofputil_encode_ofp12_packet_in(pin, protocol); break; @@ -3664,6 +3690,7 @@ ofputil_get_phy_port_size(enum ofp_version ofp_version) case OFP11_VERSION: case OFP12_VERSION: case OFP13_VERSION: + case OFP14_VERSION: return sizeof(struct ofp11_port); default: OVS_NOT_REACHED(); @@ -3736,6 +3763,10 @@ ofputil_put_phy_port(enum ofp_version ofp_version, break; } + case OFP14_VERSION: + OVS_NOT_REACHED(); + break; + default: OVS_NOT_REACHED(); } @@ -3765,6 +3796,10 @@ ofputil_append_port_desc_stats_reply(enum ofp_version ofp_version, break; } + case OFP14_VERSION: + OVS_NOT_REACHED(); + break; + default: OVS_NOT_REACHED(); } @@ -3828,6 +3863,9 @@ ofputil_capabilities_mask(enum ofp_version ofp_version) case OFP12_VERSION: case OFP13_VERSION: return OFPC_COMMON | OFPC12_PORT_BLOCKED; + case OFP14_VERSION: + OVS_NOT_REACHED(); + break; default: /* Caller needs to check osf->header.version itself */ return 0; @@ -3954,6 +3992,7 @@ ofputil_encode_switch_features(const struct ofputil_switch_features *features, raw = OFPRAW_OFPT11_FEATURES_REPLY; break; case OFP13_VERSION: + case OFP14_VERSION: raw = OFPRAW_OFPT13_FEATURES_REPLY; break; default: @@ -3976,6 +4015,7 @@ ofputil_encode_switch_features(const struct ofputil_switch_features *features, osf->actions = encode_action_bits(features->actions, of10_action_bits); break; case OFP13_VERSION: + case OFP14_VERSION: osf->auxiliary_id = features->auxiliary_id; /* fall through */ case OFP11_VERSION: @@ -4054,6 +4094,7 @@ ofputil_encode_port_status(const struct ofputil_port_status *ps, case OFP11_VERSION: case OFP12_VERSION: case OFP13_VERSION: + case OFP14_VERSION: raw = OFPRAW_OFPT11_PORT_STATUS; break; @@ -4150,6 +4191,9 @@ ofputil_encode_port_mod(const struct ofputil_port_mod *pm, opm->advertise = netdev_port_features_to_ofp11(pm->advertise); break; } + case OFP14_VERSION: + OVS_NOT_REACHED(); + break; default: OVS_NOT_REACHED(); } @@ -4210,6 +4254,9 @@ ofputil_encode_table_mod(const struct ofputil_table_mod *pm, otm->config = htonl(pm->config); break; } + case OFP14_VERSION: + OVS_NOT_REACHED(); + break; default: OVS_NOT_REACHED(); } @@ -4516,6 +4563,7 @@ ofputil_encode_table_stats_reply(const struct ofp12_table_stats stats[], int n, break; case OFP13_VERSION: + case OFP14_VERSION: ofputil_put_ofp13_table_stats(&stats[i], reply); break; @@ -4824,7 +4872,8 @@ ofputil_encode_packet_out(const struct ofputil_packet_out *po, case OFP11_VERSION: case OFP12_VERSION: - case OFP13_VERSION: { + case OFP13_VERSION: + case OFP14_VERSION:{ struct ofp11_packet_out *opo; size_t len; @@ -4882,6 +4931,7 @@ ofputil_encode_barrier_request(enum ofp_version ofp_version) enum ofpraw type; switch (ofp_version) { + case OFP14_VERSION: case OFP13_VERSION: case OFP12_VERSION: case OFP11_VERSION: @@ -5162,6 +5212,9 @@ ofputil_pull_phy_port(enum ofp_version ofp_version, struct ofpbuf *b, const struct ofp11_port *op = ofpbuf_try_pull(b, sizeof *op); return op ? ofputil_decode_ofp11_port(pp, op) : EOF; } + case OFP14_VERSION: + OVS_NOT_REACHED(); + break; default: OVS_NOT_REACHED(); } @@ -5490,7 +5543,8 @@ ofputil_encode_dump_ports_request(enum ofp_version ofp_version, ofp_port_t port) } case OFP11_VERSION: case OFP12_VERSION: - case OFP13_VERSION: { + case OFP13_VERSION: + case OFP14_VERSION:{ struct ofp11_port_stats_request *req; request = ofpraw_alloc(OFPRAW_OFPST11_PORT_REQUEST, ofp_version, 0); req = ofpbuf_put_zeros(request, sizeof *req); @@ -5581,6 +5635,10 @@ ofputil_append_port_stat(struct list *replies, break; } + case OFP14_VERSION: + OVS_NOT_REACHED(); + break; + default: OVS_NOT_REACHED(); } @@ -5663,6 +5721,9 @@ ofputil_get_port_stats_size(enum ofp_version ofp_version) return sizeof(struct ofp11_port_stats); case OFP13_VERSION: return sizeof(struct ofp13_port_stats); + case OFP14_VERSION: + OVS_NOT_REACHED(); + return 0; default: OVS_NOT_REACHED(); } @@ -5761,6 +5822,10 @@ ofputil_decode_port_stats_request(const struct ofp_header *request, return 0; } + case OFP14_VERSION: + OVS_NOT_REACHED(); + break; + default: OVS_NOT_REACHED(); } @@ -5796,7 +5861,8 @@ ofputil_encode_group_stats_request(enum ofp_version ofp_version, "(\'-O OpenFlow11\')"); case OFP11_VERSION: case OFP12_VERSION: - case OFP13_VERSION: { + case OFP13_VERSION: + case OFP14_VERSION: { struct ofp11_group_stats_request *req; request = ofpraw_alloc(OFPRAW_OFPST11_GROUP_REQUEST, ofp_version, 0); req = ofpbuf_put_zeros(request, sizeof *req); @@ -5827,10 +5893,10 @@ ofputil_encode_group_desc_request(enum ofp_version ofp_version) "(\'-O OpenFlow11\')"); case OFP11_VERSION: case OFP12_VERSION: - case OFP13_VERSION: { + case OFP13_VERSION: + case OFP14_VERSION: request = ofpraw_alloc(OFPRAW_OFPST11_GROUP_DESC_REQUEST, ofp_version, 0); break; - } default: OVS_NOT_REACHED(); } @@ -5900,6 +5966,10 @@ ofputil_append_group_stats(struct list *replies, ofputil_append_of13_group_stats(ogs, replies); break; + case OFP14_VERSION: + OVS_NOT_REACHED(); + break; + case OFP10_VERSION: default: OVS_NOT_REACHED(); @@ -5919,11 +5989,11 @@ ofputil_encode_group_features_request(enum ofp_version ofp_version) ovs_fatal(0, "dump-group-features needs OpenFlow 1.2 or later " "(\'-O OpenFlow12\')"); case OFP12_VERSION: - case OFP13_VERSION: { + case OFP13_VERSION: + case OFP14_VERSION: request = ofpraw_alloc(OFPRAW_OFPST12_GROUP_FEATURES_REQUEST, - ofp_version, 0); + ofp_version, 0); break; - } default: OVS_NOT_REACHED(); } @@ -6250,7 +6320,8 @@ ofputil_encode_group_mod(enum ofp_version ofp_version, case OFP11_VERSION: case OFP12_VERSION: - case OFP13_VERSION: { + case OFP13_VERSION: + case OFP14_VERSION: b = ofpraw_alloc(OFPRAW_OFPT11_GROUP_MOD, ofp_version, 0); start_ogm = b->size; ofpbuf_put_zeros(b, sizeof *ogm); @@ -6275,7 +6346,6 @@ ofputil_encode_group_mod(enum ofp_version ofp_version, ogm->group_id = htonl(gm->group_id); break; - } default: OVS_NOT_REACHED(); @@ -6338,6 +6408,7 @@ ofputil_decode_queue_stats_request(const struct ofp_header *request, struct ofputil_queue_stats_request *oqsr) { switch ((enum ofp_version)request->version) { + case OFP14_VERSION: case OFP13_VERSION: case OFP12_VERSION: case OFP11_VERSION: { @@ -6374,7 +6445,8 @@ ofputil_encode_queue_stats_request(enum ofp_version ofp_version, switch (ofp_version) { case OFP11_VERSION: case OFP12_VERSION: - case OFP13_VERSION: { + case OFP13_VERSION: + case OFP14_VERSION: { struct ofp11_queue_stats_request *req; request = ofpraw_alloc(OFPRAW_OFPST11_QUEUE_REQUEST, ofp_version, 0); req = ofpbuf_put_zeros(request, sizeof *req); @@ -6410,6 +6482,9 @@ ofputil_get_queue_stats_size(enum ofp_version ofp_version) return sizeof(struct ofp11_queue_stats); case OFP13_VERSION: return sizeof(struct ofp13_queue_stats); + case OFP14_VERSION: + OVS_NOT_REACHED(); + return 0; default: OVS_NOT_REACHED(); } @@ -6599,6 +6674,10 @@ ofputil_append_queue_stat(struct list *replies, break; } + case OFP14_VERSION: + OVS_NOT_REACHED(); + break; + default: OVS_NOT_REACHED(); } diff --git a/lib/ofp-util.h b/lib/ofp-util.h index 748364615..4d955fde8 100644 --- a/lib/ofp-util.h +++ b/lib/ofp-util.h @@ -108,7 +108,8 @@ enum ofputil_protocol { * variant. */ OFPUTIL_P_OF12_OXM = 1 << 5, OFPUTIL_P_OF13_OXM = 1 << 6, -#define OFPUTIL_P_ANY_OXM (OFPUTIL_P_OF12_OXM | OFPUTIL_P_OF13_OXM) + OFPUTIL_P_OF14_OXM = 1 << 7, +#define OFPUTIL_P_ANY_OXM (OFPUTIL_P_OF12_OXM | OFPUTIL_P_OF13_OXM | OFPUTIL_P_OF14_OXM) #define OFPUTIL_P_NXM_OF11_UP (OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF11_STD | \ OFPUTIL_P_ANY_OXM) @@ -121,8 +122,10 @@ enum ofputil_protocol { #define OFPUTIL_P_OF13_UP (OFPUTIL_P_OF13_OXM) +#define OFPUTIL_P_OF14_UP (OFPUTIL_P_OF14_OXM) + /* All protocols. */ -#define OFPUTIL_P_ANY ((1 << 7) - 1) +#define OFPUTIL_P_ANY ((1 << 8) - 1) /* Protocols in which a specific table may be specified in flow_mods. */ #define OFPUTIL_P_TID (OFPUTIL_P_OF10_STD_TID | \ diff --git a/tests/ofp-errors.at b/tests/ofp-errors.at index 92f2a98f3..a8d7cfaed 100644 --- a/tests/ofp-errors.at +++ b/tests/ofp-errors.at @@ -90,11 +90,13 @@ AT_CHECK([ovs-ofctl print-error OFPBIC_BAD_EXPERIMENTER], [0], [dnl OpenFlow 1.1: vendor 0, type 3, code 5 OpenFlow 1.2: vendor 0, type 3, code 5 OpenFlow 1.3: vendor 0, type 3, code 5 +OpenFlow 1.4: vendor 0, type 3, code 5 ]) AT_CHECK([ovs-ofctl print-error OFPBIC_BAD_EXP_TYPE], [0], [dnl OpenFlow 1.1: vendor 0, type 3, code 5 OpenFlow 1.2: vendor 0, type 3, code 6 OpenFlow 1.3: vendor 0, type 3, code 6 +OpenFlow 1.4: vendor 0, type 3, code 6 ]) AT_CLEANUP diff --git a/utilities/ovs-ofctl.8.in b/utilities/ovs-ofctl.8.in index 1d4d89d41..d6f8ae7f6 100644 --- a/utilities/ovs-ofctl.8.in +++ b/utilities/ovs-ofctl.8.in @@ -1973,8 +1973,9 @@ format. . .IP "\fBOXM-OpenFlow12\fR" .IQ "\fBOXM-OpenFlow13\fR" +.IQ "\fBOXM-OpenFlow14\fR" These are the standard OXM (OpenFlow Extensible Match) flow format in -OpenFlow 1.2 and 1.3, respectively. +OpenFlow 1.2, 1.3, and 1.4, respectively. .RE . .IP @@ -1988,7 +1989,7 @@ Any supported flow format. .IP "\fBNXM\fR" \fBNXM\-table_id\fR or \fBNXM+table_id\fR. .IP "\fBOXM\fR" -\fBOXM-OpenFlow12\fR or \fBOXM-OpenFlow13\fR. +\fBOXM-OpenFlow12\fR, \fBOXM-OpenFlow13\fR, or \fBOXM-OpenFlow14\fR. .RE . .IP diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index 8ae7c34a9..0f6e98406 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -1539,6 +1539,7 @@ ofctl_monitor(int argc, char *argv[]) case OFP11_VERSION: case OFP12_VERSION: case OFP13_VERSION: + case OFP14_VERSION: break; default: OVS_NOT_REACHED(); diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema index 9eb21ed71..efaa1dabc 100644 --- a/vswitchd/vswitch.ovsschema +++ b/vswitchd/vswitch.ovsschema @@ -1,6 +1,6 @@ {"name": "Open_vSwitch", "version": "7.4.0", - "cksum": "951746691 20389", + "cksum": "2387737815 20431", "tables": { "Open_vSwitch": { "columns": { @@ -83,7 +83,8 @@ "enum": ["set", ["OpenFlow10", "OpenFlow11", "OpenFlow12", - "OpenFlow13"]]}, + "OpenFlow13", + "OpenFlow14"]]}, "min": 0, "max": "unlimited"}}, "fail_mode": { "type": {"key": {"type": "string", -- 2.43.0