diff options
author | Ben Pfaff <blp@nicira.com> | 2011-09-12 16:19:57 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2011-09-13 11:46:09 -0700 |
commit | 75a75043564dc9b002fffa6c6ad71e0d4d5c892e (patch) | |
tree | 2e059054c5b3e146e3777c013f6cac42246ffa4c /lib/meta-flow.c | |
parent | 308881afb61e292c629b36a357cfc37153884000 (diff) |
Implement new "learn" action.
There are a few loose ends here. First, learning actions cause too much
flow revalidation. Upcoming commits will fix that problem. The following
additional issues have not yet been addressed:
* Resource limits: nothing yet limits the maximum number of flows that
can be learned. It is possible to exhaust all system memory.
* Age reporting: there is no way to find out how soon a learned table
entry is due to be evicted.
To try this action out, here's a recipe for a very simple-minded MAC
learning switch. It uses a 10-second MAC expiration time to make it easier
to see what's going on:
ovs-vsctl del-controller br0
ovs-ofctl del-flows br0
ovs-ofctl add-flow br0 "table=0 actions=learn(table=1, hard_timeout=10, \
NXM_OF_VLAN_TCI[0..11], NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], \
output:NXM_OF_IN_PORT[]), resubmit(,1)"
ovs-ofctl add-flow br0 "table=1 priority=0 actions=flood"
You can then dump the MAC learning table with:
ovs-ofctl dump-flows br0 table=1
Diffstat (limited to 'lib/meta-flow.c')
-rw-r--r-- | lib/meta-flow.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/lib/meta-flow.c b/lib/meta-flow.c index 9727253e..140f9022 100644 --- a/lib/meta-flow.c +++ b/lib/meta-flow.c @@ -302,32 +302,6 @@ static const struct mf_field mf_fields[MFF_N_IDS] = { } }; -static bool -is_all_zeros(const uint8_t *field, size_t length) -{ - size_t i; - - for (i = 0; i < length; i++) { - if (field[i] != 0x00) { - return false; - } - } - return true; -} - -static bool -is_all_ones(const uint8_t *field, size_t length) -{ - size_t i; - - for (i = 0; i < length; i++) { - if (field[i] != 0xff) { - return false; - } - } - return true; -} - /* Returns the field with the given 'id'. */ const struct mf_field * mf_from_id(enum mf_field_id id) |