controller is not configured, this happens implicitly to
every packet.)
- - The "autopath" Nicira extension action. However, "autopath"
- is deprecated and scheduled for removal in February 2013.
-
- Mirrors configured for output to a bonded port.
It would make a lot of sense for Open vSwitch to present a bond as
post-v1.10.0
---------------------
- Stable bond mode has been removed.
+ - The autopath action has been removed.
v1.10.0 - xx xxx xxxx
NXAST_NOTE, /* struct nx_action_note */
NXAST_SET_TUNNEL64, /* struct nx_action_set_tunnel64 */
NXAST_MULTIPATH, /* struct nx_action_multipath */
- NXAST_AUTOPATH__DEPRECATED, /* struct nx_action_autopath */
+ NXAST_AUTOPATH__OBSOLETE, /* No longer used. */
NXAST_BUNDLE, /* struct nx_action_bundle */
NXAST_BUNDLE_LOAD, /* struct nx_action_bundle */
NXAST_RESUBMIT_TABLE, /* struct nx_action_resubmit */
};
OFP_ASSERT(sizeof(struct nx_action_fin_timeout) == 16);
\f
-/* Action structure for NXAST_AUTOPATH.
- *
- * This action performs the following steps in sequence:
- *
- * 1. Hashes the flow using an implementation-defined hash function.
- *
- * The hashed fields' values are drawn from the current state of the
- * flow, including all modifications that have been made by actions up to
- * this point.
- *
- * 2. Selects an OpenFlow 'port'.
- *
- * 'port' is selected in an implementation-defined manner, taking into
- * account 'id' and the hash value calculated in step 1.
- *
- * Generally a switch will have been configured with a set of ports that
- * may be chosen given 'id'. The switch may take into account any number
- * of factors when choosing 'port' from its configured set. Factors may
- * include carrier, load, and the results of configuration protocols such
- * as LACP.
- *
- * 3. Stores 'port' in dst[ofs:ofs+n_bits].
- *
- * The format and semantics of 'dst' and 'ofs_nbits' are similar to those
- * for the NXAST_REG_LOAD action.
- *
- * The switch will reject actions in which ofs+n_bits is greater than the width
- * of 'dst', with error type OFPET_BAD_ACTION, code OFPBAC_BAD_ARGUMENT.
- */
-struct nx_action_autopath {
- ovs_be16 type; /* OFPAT_VENDOR. */
- ovs_be16 len; /* Length is 24. */
- ovs_be32 vendor; /* NX_VENDOR_ID. */
- ovs_be16 subtype; /* NXAST_AUTOPATH. */
-
- /* Where to store the result. */
- ovs_be16 ofs_nbits; /* (ofs << 6) | (n_bits - 1). */
- ovs_be32 dst; /* Destination. */
-
- ovs_be32 id; /* Autopath ID. */
- ovs_be32 pad;
-};
-OFP_ASSERT(sizeof(struct nx_action_autopath) == 24);
-\f
/* Action structure for NXAST_BUNDLE and NXAST_BUNDLE_LOAD.
*
* The bundle actions choose a slave from a supplied list of options.
lib_libopenvswitch_a_SOURCES = \
lib/aes128.c \
lib/aes128.h \
- lib/autopath.c \
- lib/autopath.h \
lib/backtrace.c \
lib/backtrace.h \
lib/bitmap.c \
+++ /dev/null
-/*
- * Copyright (c) 2011, 2012 Nicira, Inc.
- *
- * 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.
- */
-
-#include <config.h>
-
-#include "autopath.h"
-
-#include <inttypes.h>
-#include <stdlib.h>
-
-#include "flow.h"
-#include "meta-flow.h"
-#include "nx-match.h"
-#include "ofp-actions.h"
-#include "ofp-errors.h"
-#include "ofp-util.h"
-#include "openflow/nicira-ext.h"
-#include "vlog.h"
-
-VLOG_DEFINE_THIS_MODULE(autopath);
-
-void
-autopath_parse(struct ofpact_autopath *ap, const char *s_)
-{
- char *s;
- char *id_str, *dst, *save_ptr;
- uint16_t port;
-
- ofpact_init_AUTOPATH(ap);
-
- s = xstrdup(s_);
- save_ptr = NULL;
- id_str = strtok_r(s, ", ", &save_ptr);
- dst = strtok_r(NULL, ", ", &save_ptr);
-
- if (!dst) {
- ovs_fatal(0, "%s: not enough arguments to autopath action", s_);
- }
-
- if (!ofputil_port_from_string(id_str, &port)) {
- ovs_fatal(0, "%s: bad port number", s_);
- }
- ap->port = port;
-
- mf_parse_subfield(&ap->dst, dst);
- if (ap->dst.n_bits < 16) {
- ovs_fatal(0, "%s: %d-bit destination field has %u possible values, "
- "less than required 65536",
- s_, ap->dst.n_bits, 1u << ap->dst.n_bits);
- }
-
- free(s);
-}
-
-enum ofperr
-autopath_from_openflow(const struct nx_action_autopath *nap,
- struct ofpact_autopath *autopath)
-{
- ofpact_init_AUTOPATH(autopath);
- autopath->dst.field = mf_from_nxm_header(ntohl(nap->dst));
- autopath->dst.ofs = nxm_decode_ofs(nap->ofs_nbits);
- autopath->dst.n_bits = nxm_decode_n_bits(nap->ofs_nbits);
- autopath->port = ntohl(nap->id);
-
- if (autopath->dst.n_bits < 16) {
- VLOG_WARN("at least 16 bit destination is required for autopath "
- "action.");
- return OFPERR_OFPBAC_BAD_ARGUMENT;
- }
-
- return autopath_check(autopath, NULL);
-}
-
-enum ofperr
-autopath_check(const struct ofpact_autopath *autopath, const struct flow *flow)
-{
- VLOG_WARN_ONCE("The autopath action is deprecated and may be removed in"
- " February 2013. Please email dev@openvswitch.org with"
- " concerns.");
- return mf_check_dst(&autopath->dst, flow);
-}
-
-void
-autopath_to_nxast(const struct ofpact_autopath *autopath,
- struct ofpbuf *openflow)
-{
- struct nx_action_autopath *ap;
-
- ap = ofputil_put_NXAST_AUTOPATH__DEPRECATED(openflow);
- ap->ofs_nbits = nxm_encode_ofs_nbits(autopath->dst.ofs,
- autopath->dst.n_bits);
- ap->dst = htonl(autopath->dst.field->nxm_header);
- ap->id = htonl(autopath->port);
-}
+++ /dev/null
-/*
- * Copyright (c) 2011, 2012 Nicira, Inc.
- *
- * 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 AUTOPATH_H
-#define AUTOPATH_H 1
-
-#include <stdint.h>
-#include "ofp-errors.h"
-
-struct flow;
-struct nx_action_autopath;
-struct ofpact_autopath;
-struct ofpbuf;
-
-/* NXAST_AUTOPATH helper functions.
- *
- * See include/openflow/nicira-ext.h for NXAST_AUTOPATH specification. */
-
-void autopath_parse(struct ofpact_autopath *, const char *);
-
-enum ofperr autopath_from_openflow(const struct nx_action_autopath *,
- struct ofpact_autopath *);
-enum ofperr autopath_check(const struct ofpact_autopath *,
- const struct flow *);
-void autopath_to_nxast(const struct ofpact_autopath *,
- struct ofpbuf *openflow);
-
-#endif /* autopath.h */
#include <config.h>
#include "ofp-actions.h"
-#include "autopath.h"
#include "bundle.h"
#include "byte-order.h"
#include "compiler.h"
ofpact_put_MULTIPATH(out));
break;
- case OFPUTIL_NXAST_AUTOPATH__DEPRECATED:
- error = autopath_from_openflow((const struct nx_action_autopath *) a,
- ofpact_put_AUTOPATH(out));
- break;
-
case OFPUTIL_NXAST_BUNDLE:
case OFPUTIL_NXAST_BUNDLE_LOAD:
error = bundle_from_openflow((const struct nx_action_bundle *) a, out);
case OFPACT_MULTIPATH:
return multipath_check(ofpact_get_MULTIPATH(a), flow);
- case OFPACT_AUTOPATH:
- return autopath_check(ofpact_get_AUTOPATH(a), flow);
-
case OFPACT_NOTE:
case OFPACT_EXIT:
return 0;
multipath_to_nxast(ofpact_get_MULTIPATH(a), out);
break;
- case OFPACT_AUTOPATH:
- autopath_to_nxast(ofpact_get_AUTOPATH(a), out);
- break;
-
case OFPACT_NOTE:
ofpact_note_to_nxast(ofpact_get_NOTE(a), out);
break;
case OFPACT_RESUBMIT:
case OFPACT_LEARN:
case OFPACT_MULTIPATH:
- case OFPACT_AUTOPATH:
case OFPACT_NOTE:
case OFPACT_EXIT:
case OFPACT_PUSH_MPLS:
case OFPACT_RESUBMIT:
case OFPACT_LEARN:
case OFPACT_MULTIPATH:
- case OFPACT_AUTOPATH:
case OFPACT_NOTE:
case OFPACT_EXIT:
ofpact_to_nxast(a, out);
case OFPACT_RESUBMIT:
case OFPACT_LEARN:
case OFPACT_MULTIPATH:
- case OFPACT_AUTOPATH:
case OFPACT_NOTE:
case OFPACT_EXIT:
case OFPACT_PUSH_MPLS:
{
const struct ofpact_enqueue *enqueue;
const struct ofpact_resubmit *resubmit;
- const struct ofpact_autopath *autopath;
const struct ofpact_controller *controller;
const struct ofpact_metadata *metadata;
const struct ofpact_tunnel *tunnel;
multipath_format(ofpact_get_MULTIPATH(a), s);
break;
- case OFPACT_AUTOPATH:
- autopath = ofpact_get_AUTOPATH(a);
- ds_put_cstr(s, "autopath(");
- ofputil_format_port(autopath->port, s);
- ds_put_char(s, ',');
- mf_format_subfield(&autopath->dst, s);
- ds_put_char(s, ')');
- break;
-
case OFPACT_NOTE:
print_note(ofpact_get_NOTE(a), s);
break;
\
/* Arithmetic. */ \
DEFINE_OFPACT(MULTIPATH, ofpact_multipath, ofpact) \
- DEFINE_OFPACT(AUTOPATH, ofpact_autopath, ofpact) \
\
/* Other. */ \
DEFINE_OFPACT(NOTE, ofpact_note, data) \
struct mf_subfield dst;
};
-/* OFPACT_AUTOPATH.
- *
- * Used for NXAST_AUTOPATH. */
-struct ofpact_autopath {
- struct ofpact ofpact;
- struct mf_subfield dst;
- uint32_t port;
-};
-
/* OFPACT_NOTE.
*
* Used for NXAST_NOTE. */
#include <errno.h>
#include <stdlib.h>
-#include "autopath.h"
#include "bundle.h"
#include "byte-order.h"
#include "dynamic-string.h"
multipath_parse(ofpact_put_MULTIPATH(ofpacts), arg);
break;
- case OFPUTIL_NXAST_AUTOPATH__DEPRECATED:
- autopath_parse(ofpact_put_AUTOPATH(ofpacts), arg);
- break;
-
case OFPUTIL_NXAST_BUNDLE:
bundle_parse(arg, ofpacts);
break;
#include <netinet/in.h>
#include <netinet/icmp6.h>
#include <stdlib.h>
-#include "autopath.h"
#include "bundle.h"
#include "byte-order.h"
#include "classifier.h"
NXAST_ACTION(NXAST_NOTE, nx_action_note, 1, "note")
NXAST_ACTION(NXAST_SET_TUNNEL64, nx_action_set_tunnel64, 0, "set_tunnel64")
NXAST_ACTION(NXAST_MULTIPATH, nx_action_multipath, 0, "multipath")
-NXAST_ACTION(NXAST_AUTOPATH__DEPRECATED,nx_action_autopath, 0, "autopath")
NXAST_ACTION(NXAST_BUNDLE, nx_action_bundle, 1, "bundle")
NXAST_ACTION(NXAST_BUNDLE_LOAD, nx_action_bundle, 1, "bundle_load")
NXAST_ACTION(NXAST_RESUBMIT_TABLE, nx_action_resubmit, 0, NULL)
* OFPUTIL_NXAST_NOTE
* OFPUTIL_NXAST_SET_TUNNEL64
* OFPUTIL_NXAST_MULTIPATH
- * OFPUTIL_NXAST_AUTOPATH
* OFPUTIL_NXAST_BUNDLE
* OFPUTIL_NXAST_BUNDLE_LOAD
* OFPUTIL_NXAST_RESUBMIT_TABLE
#include <errno.h>
-#include "autopath.h"
#include "bond.h"
#include "bundle.h"
#include "byte-order.h"
ovs_be64 tun_id;
};
-static void
-xlate_autopath(struct action_xlate_ctx *ctx,
- const struct ofpact_autopath *ap)
-{
- uint16_t ofp_port = ap->port;
- struct ofport_dpif *port = get_ofp_port(ctx->ofproto, ofp_port);
-
- if (!port || !port->bundle) {
- ofp_port = OFPP_NONE;
- } else if (port->bundle->bond) {
- /* Autopath does not support VLAN hashing. */
- struct ofport_dpif *slave = bond_choose_output_slave(
- port->bundle->bond, &ctx->flow, 0, &ctx->tags);
- if (slave) {
- ofp_port = slave->up.ofp_port;
- }
- }
- nxm_reg_load(&ap->dst, ofp_port, &ctx->flow);
-}
-
static bool
slave_enabled_cb(uint16_t ofp_port, void *ofproto_)
{
multipath_execute(ofpact_get_MULTIPATH(a), &ctx->flow);
break;
- case OFPACT_AUTOPATH:
- xlate_autopath(ctx, ofpact_get_AUTOPATH(a));
- break;
-
case OFPACT_BUNDLE:
ctx->ofproto->has_bundle_action = true;
xlate_bundle_action(ctx, ofpact_get_BUNDLE(a));
tests/ovs-ofctl.at \
tests/odp.at \
tests/multipath.at \
- tests/autopath.at \
tests/lacp.at \
tests/learn.at \
tests/vconn.at \
+++ /dev/null
-AT_BANNER([autopath link selection])
-
-AT_SETUP([autopath basic])
-AT_CHECK([ovs-ofctl parse-flow 'actions=autopath(1, NXM_NX_REG0[[]])'], [0],
- [usable protocols: any
-chosen protocol: OpenFlow10-table_id
-OFPT_FLOW_MOD (xid=0x1): ADD actions=autopath(1,NXM_NX_REG0[[]])
-], [stderr])
-AT_CHECK([ovs-ofctl parse-flow 'actions=autopath(2, NXM_NX_REG0[[2..30]])'], [0],
- [usable protocols: any
-chosen protocol: OpenFlow10-table_id
-OFPT_FLOW_MOD (xid=0x1): ADD actions=autopath(2,NXM_NX_REG0[[2..30]])
-], [stderr])
-AT_CHECK([[sed 's/^[^|]*|[^|]*|//' stderr]], [0], [dnl
-autopath|WARN|The autopath action is deprecated and may be removed in February 2013. Please email dev@openvswitch.org with concerns.
-])
-AT_CLEANUP
-
-AT_SETUP([autopath action missing argument])
-AT_CHECK([ovs-ofctl parse-flow actions=autopath], [1], [],
- [ovs-ofctl: : not enough arguments to autopath action
-])
-AT_CLEANUP
-
-AT_SETUP([autopath action bad port])
-AT_CHECK([ovs-ofctl parse-flow 'actions=autopath(bad, NXM_NX_REG0[[]])'], [1], [],
- [ovs-ofctl: bad, NXM_NX_REG0[[]]: bad port number
-])
-AT_CLEANUP
-
-AT_SETUP([autopath action destination too narrow])
-AT_CHECK([ovs-ofctl parse-flow 'actions=autopath(1,NXM_NX_REG0[[0..7]])'], [1], [],
- [ovs-ofctl: 1,NXM_NX_REG0[[0..7]]: 8-bit destination field has 256 possible values, less than required 65536
-])
-AT_CLEANUP
-
# actions=multipath(eth_src,50,modulo_n,1,0,NXM_NX_REG0[])
ffff 0020 00002320 000a 0000 0032 0000 0000 0000 0000 0000 0000 001f 00010004
-# actions=autopath(2,NXM_NX_REG0[2..30])
-& autopath|WARN|The autopath action is deprecated and may be removed in February 2013. Please email dev@openvswitch.org with concerns.
-ffff 0018 00002320 000b 009c 00010004 00000002 00000000
-
# actions=bundle(eth_src,0,hrw,ofport,slaves:4,8)
ffff 0028 00002320 000c 0001 0000 0000 00000002 0002 0000 00000000 00000000 dnl
0004 0008 00000000
# actions=multipath(eth_src,50,modulo_n,1,0,NXM_NX_REG0[])
ffff 0020 00002320 000a 0000 0032 0000 0000 0000 0000 0000 0000 001f 00010004
-# actions=autopath(2,NXM_NX_REG0[2..30])
-& autopath|WARN|The autopath action is deprecated and may be removed in February 2013. Please email dev@openvswitch.org with concerns.
-ffff 0018 00002320 000b 009c 00010004 00000002 00000000
-
# actions=bundle(eth_src,0,hrw,ofport,slaves:4,8)
ffff 0028 00002320 000c 0001 0000 0000 00000002 0002 0000 00000000 00000000 dnl
0004 0008 00000000
actions=drop
reg0=123,actions=move:NXM_NX_REG0[0..5]->NXM_NX_REG1[26..31],load:55->NXM_NX_REG2[0..31],move:NXM_NX_REG0[0..31]->NXM_NX_TUN_ID[0..31],move:NXM_NX_REG0[0..15]->NXM_OF_VLAN_TCI[]
actions=move:OXM_OF_ETH_DST[]->OXM_OF_ETH_SRC[]
-actions=autopath(5,NXM_NX_REG0[])
vlan_tci=0x1123/0x1fff,actions=drop
]])
AT_CHECK([ovs-ofctl -F nxm -mmm parse-flows flows.txt], [0], [stdout], [stderr])
NXT_FLOW_MOD: ADD <any> actions=drop
NXT_FLOW_MOD: ADD NXM_NX_REG0(0000007b) actions=move:NXM_NX_REG0[0..5]->NXM_NX_REG1[26..31],load:0x37->NXM_NX_REG2[],move:NXM_NX_REG0[]->NXM_NX_TUN_ID[0..31],move:NXM_NX_REG0[0..15]->NXM_OF_VLAN_TCI[]
NXT_FLOW_MOD: ADD <any> actions=move:NXM_OF_ETH_DST[]->NXM_OF_ETH_SRC[]
-NXT_FLOW_MOD: ADD <any> actions=autopath(5,NXM_NX_REG0[])
NXT_FLOW_MOD: ADD NXM_OF_VLAN_TCI_W(1123/1fff) actions=drop
]])
-AT_CHECK([[sed 's/^[^|]*|[^|]*|//' stderr]], [0], [dnl
-autopath|WARN|The autopath action is deprecated and may be removed in February 2013. Please email dev@openvswitch.org with concerns.
-])
AT_CLEANUP
AT_SETUP([ovs-ofctl parse-nx-match])
m4_include([tests/ovs-ofctl.at])
m4_include([tests/odp.at])
m4_include([tests/multipath.at])
-m4_include([tests/autopath.at])
m4_include([tests/learn.at])
m4_include([tests/vconn.at])
m4_include([tests/file_name.at])
.IP
Refer to \fBnicira\-ext.h\fR for more details.
.
-.IP "\fBautopath(\fIid\fB, \fIdst\fB[\fIstart\fB..\fIend\fB])\fR"
-Deprecated and slated for removal in Feburary 2013.
-.IP
-Given \fIid\fR, chooses an OpenFlow port and populates it in
-\fIdst\fB[\fIstart\fB..\fIend\fB]\fR, which must be an NXM field as
-described above.
-.IP
-Currently, \fIid\fR should be the OpenFlow port number of an interface on the
-bridge. If it isn't then \fIdst\fB[\fIstart\fB..\fIend\fB]\fR will be
-populated with the OpenFlow port "none". If \fIid\fR is a member of a bond,
-the normal bond selection logic will be used to choose the destination port.
-Otherwise, the register will be populated with \fIid\fR itself.
-.IP
-Refer to \fBnicira\-ext.h\fR for more details.
-.
.IP "\fBbundle(\fIfields\fB, \fIbasis\fB, \fIalgorithm\fB, \fIslave_type\fB, slaves:[\fIs1\fB, \fIs2\fB, ...])\fR"
Hashes \fIfields\fR using \fIbasis\fR as a universal hash parameter, then
applies the bundle link selection \fIalgorithm\fR to choose one of the listed