Skip to content

Commit

Permalink
Add skeleton for OF1.6 support.
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Ryan Moats <[email protected]>
  • Loading branch information
blp committed Apr 18, 2016
1 parent 0c05d75 commit b79d45a
Show file tree
Hide file tree
Showing 16 changed files with 177 additions and 91 deletions.
33 changes: 20 additions & 13 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -1511,25 +1511,32 @@ Using OpenFlow (Manually or Via Controller)
A: The following table lists the versions of OpenFlow supported by
each version of Open vSwitch:

Open vSwitch OF1.0 OF1.1 OF1.2 OF1.3 OF1.4 OF1.5
###============ ===== ===== ===== ===== ===== =====
1.9 and earlier yes --- --- --- --- ---
1.10 yes --- [*] [*] --- ---
1.11 yes --- [*] [*] --- ---
2.0 yes [*] [*] [*] --- ---
2.1 yes [*] [*] [*] --- ---
2.2 yes [*] [*] [*] [%] [*]
2.3 yes yes yes yes [*] [*]
Open vSwitch OF1.0 OF1.1 OF1.2 OF1.3 OF1.4 OF1.5 OF1.6
###============ ===== ===== ===== ===== ===== ===== =====
1.9 and earlier yes --- --- --- --- --- ---
1.10 yes --- [*] [*] --- --- ---
1.11 yes --- [*] [*] --- --- ---
2.0 yes [*] [*] [*] --- --- ---
2.1 yes [*] [*] [*] --- --- ---
2.2 yes [*] [*] [*] [%] [*] ---
2.3 yes yes yes yes [*] [*] ---
2.4 yes yes yes yes [*] [*] ---
2.5 yes yes yes yes [*] [*] [*]

[*] Supported, with one or more missing features.
[%] Experimental, unsafe implementation.

Open vSwitch 2.3 enables OpenFlow 1.0, 1.1, 1.2, and 1.3 by default
in ovs-vswitchd. In Open vSwitch 1.10 through 2.2, OpenFlow 1.1,
1.2, and 1.3 must be enabled manually in ovs-vswitchd. OpenFlow
1.4 and 1.5 are also supported, with missing features, in Open
vSwitch 2.3 and later, but not enabled by default. In any case,
the user may override the default:
1.2, and 1.3 must be enabled manually in ovs-vswitchd.

Some versions of OpenFlow are supported with missing features and
therefore not enabled by default: OpenFlow 1.4 and 1.5, in Open
vSwitch 2.3 and later, as well as OpenFlow 1.6 in Open vSwitch 2.5
and later. Also, the OpenFlow 1.6 specification is still under
development and thus subject to change.

In any case, the user may override the default:

- To enable OpenFlow 1.0, 1.1, 1.2, and 1.3 on bridge br0:

Expand Down
3 changes: 2 additions & 1 deletion build-aux/extract-ofp-errors
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ version_map = {"1.0": 0x01,
"1.2": 0x03,
"1.3": 0x04,
"1.4": 0x05,
"1.5": 0x06}
"1.5": 0x06,
"1.6": 0x07}
version_reverse_map = dict((v, k) for (k, v) in version_map.iteritems())

token = None
Expand Down
3 changes: 2 additions & 1 deletion build-aux/extract-ofp-msgs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ VERSION = {"1.0": 0x01,
"1.2": 0x03,
"1.3": 0x04,
"1.4": 0x05,
"1.5": 0x06}
"1.5": 0x06,
"1.6": 0x07}

NX_VENDOR_ID = 0x00002320
ONF_VENDOR_ID = 0x4f4e4600
Expand Down
5 changes: 3 additions & 2 deletions include/openflow/openflow-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/

/*
* Copyright (c) 2008-2014 Nicira, Inc.
* Copyright (c) 2008-2015 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -77,7 +77,8 @@ enum ofp_version {
OFP12_VERSION = 0x03,
OFP13_VERSION = 0x04,
OFP14_VERSION = 0x05,
OFP15_VERSION = 0x06
OFP15_VERSION = 0x06,
OFP16_VERSION = 0x07
};

/* Vendor (aka experimenter) IDs.
Expand Down
9 changes: 6 additions & 3 deletions include/openvswitch/ofp-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,12 @@ enum ofputil_protocol {
OFPUTIL_P_OF13_OXM = 1 << 6,
OFPUTIL_P_OF14_OXM = 1 << 7,
OFPUTIL_P_OF15_OXM = 1 << 8,
OFPUTIL_P_OF16_OXM = 1 << 9,
#define OFPUTIL_P_ANY_OXM (OFPUTIL_P_OF12_OXM | \
OFPUTIL_P_OF13_OXM | \
OFPUTIL_P_OF14_OXM | \
OFPUTIL_P_OF15_OXM)
OFPUTIL_P_OF15_OXM | \
OFPUTIL_P_OF16_OXM)

#define OFPUTIL_P_NXM_OF11_UP (OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF11_STD | \
OFPUTIL_P_ANY_OXM)
Expand All @@ -129,10 +131,11 @@ enum ofputil_protocol {
#define OFPUTIL_P_OF12_UP (OFPUTIL_P_OF12_OXM | OFPUTIL_P_OF13_UP)
#define OFPUTIL_P_OF13_UP (OFPUTIL_P_OF13_OXM | OFPUTIL_P_OF14_UP)
#define OFPUTIL_P_OF14_UP (OFPUTIL_P_OF14_OXM | OFPUTIL_P_OF15_UP)
#define OFPUTIL_P_OF15_UP OFPUTIL_P_OF15_OXM
#define OFPUTIL_P_OF15_UP (OFPUTIL_P_OF15_OXM | OFPUTIL_P_OF16_UP)
#define OFPUTIL_P_OF16_UP OFPUTIL_P_OF16_OXM

/* All protocols. */
#define OFPUTIL_P_ANY ((1 << 9) - 1)
#define OFPUTIL_P_ANY ((1 << 10) - 1)

/* Protocols in which a specific table may be specified in flow_mods. */
#define OFPUTIL_P_TID (OFPUTIL_P_OF10_STD_TID | \
Expand Down
1 change: 1 addition & 0 deletions lib/ofp-actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -7192,6 +7192,7 @@ get_ofpact_map(enum ofp_version version)
case OFP13_VERSION:
case OFP14_VERSION:
case OFP15_VERSION:
case OFP16_VERSION:
default:
return of12;
}
Expand Down
4 changes: 3 additions & 1 deletion lib/ofp-errors.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, 2014, 2016 Nicira, Inc.
* Copyright (c) 2012, 2013, 2014, 2015, 2016 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -55,6 +55,8 @@ ofperr_domain_from_version(enum ofp_version version)
return &ofperr_of14;
case OFP15_VERSION:
return &ofperr_of15;
case OFP16_VERSION:
return &ofperr_of16;
default:
return NULL;
}
Expand Down
5 changes: 5 additions & 0 deletions lib/ofp-msgs.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ ofp_is_stat_request(enum ofp_version version, uint8_t type)
case OFP13_VERSION:
case OFP14_VERSION:
case OFP15_VERSION:
case OFP16_VERSION:
return type == OFPT11_STATS_REQUEST;
}

Expand All @@ -344,6 +345,7 @@ ofp_is_stat_reply(enum ofp_version version, uint8_t type)
case OFP13_VERSION:
case OFP14_VERSION:
case OFP15_VERSION:
case OFP16_VERSION:
return type == OFPT11_STATS_REPLY;
}

Expand Down Expand Up @@ -385,6 +387,7 @@ ofphdrs_len(const struct ofphdrs *hdrs)
case OFP13_VERSION:
case OFP14_VERSION:
case OFP15_VERSION:
case OFP16_VERSION:
if (hdrs->type == OFPT11_STATS_REQUEST ||
hdrs->type == OFPT11_STATS_REPLY) {
return (hdrs->stat == OFPST_VENDOR
Expand Down Expand Up @@ -810,6 +813,7 @@ ofpraw_stats_request_to_reply(enum ofpraw raw, uint8_t version)
case OFP13_VERSION:
case OFP14_VERSION:
case OFP15_VERSION:
case OFP16_VERSION:
ovs_assert(hdrs.type == OFPT11_STATS_REQUEST);
hdrs.type = OFPT11_STATS_REPLY;
break;
Expand Down Expand Up @@ -1030,6 +1034,7 @@ ofpmp_flags__(const struct ofp_header *oh)
case OFP13_VERSION:
case OFP14_VERSION:
case OFP15_VERSION:
case OFP16_VERSION:
return &((struct ofp11_stats_msg *) oh)->flags;
default:
OVS_NOT_REACHED();
Expand Down
4 changes: 4 additions & 0 deletions lib/ofp-print.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ ofp_print_switch_features(struct ds *string, const struct ofp_header *oh)
case OFP13_VERSION:
case OFP14_VERSION:
case OFP15_VERSION:
case OFP16_VERSION:
return; /* no ports in ofp13_switch_features */
default:
OVS_NOT_REACHED();
Expand Down Expand Up @@ -2343,6 +2344,9 @@ ofp_print_version(const struct ofp_header *oh,
case OFP15_VERSION:
ds_put_cstr(string, " (OF1.5)");
break;
case OFP16_VERSION:
ds_put_cstr(string, " (OF1.6)");
break;
default:
ds_put_format(string, " (OF 0x%02"PRIx8")", oh->version);
break;
Expand Down
Loading

0 comments on commit b79d45a

Please sign in to comment.