2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-28 21:07:47 +00:00

59 Commits

Author SHA1 Message Date
Ben Pfaff
0e553d9c10 Implement new "fin_timeout" action and "learn" feature.
The "learn" action can create matching return flows.  If those have a long
timeout then it's a good idea to have a way to notice when in fact the
flows have terminated.  This new action and matching "learn" feature
provides that way.

Feature #8603.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-02-15 10:37:03 -08:00
Ben Pfaff
0c3d5fc89a ovs-ofctl: Add "packet-out" command.
I don't expect this to be widely useful.  An upcoming commit will add a
use in unit tests.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-02-09 13:23:37 -08:00
Ben Pfaff
816fd533f8 meta-flow: New "subfield" data structure.
Until now, parts of a field have been dealt with in a fairly ad-hoc way.
struct mf_subfield and the supporting functions added by this commit make
their use more systematic.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-02-01 14:15:11 -08:00
Ben Pfaff
90bf1e0732 Better abstract OpenFlow error codes.
This commit switches from using the actual protocol values of error codes
internally in Open vSwitch, to using abstract values that are translated to
and from protocol values at message parsing and serialization time.  I
believe that this makes the code easier to read and to write.

This is also one step along the way toward OpenFlow 1.1 support because
OpenFlow 1.1 renumbered a bunch of error codes.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-01-12 15:54:25 -08:00
Ben Pfaff
f299fbeb4b learn: Avoid 1-byte buffer underrun in learn_format().
Reported-and-tested-by: Jari Sundell <sundell.software@gmail.com>
2011-12-01 08:33:55 -08:00
Ben Pfaff
28da1f8f72 nx-match: Fold all of its data structures into mf_field.
This is less redundant.
2011-11-21 14:45:54 -08:00
Ben Pfaff
4cb3fde7c9 learn: Check learn actions after parsing in learn_parse().
learn_parse() and learn_check() are supposed to apply the same checks, but
they are implemented very differently.  It seems best to have learn_parse()
actually call learn_check() just to be sure.

This would have caught the bug fixed in the previous commit, because
the tests actually contain instances of "learn" actions that trigger the
bug, but the tests only parsed the actions without ever doing anything
that checked them (like sending them to ovs-vswitchd over OpenFlow).
2011-10-18 13:43:39 -07:00
Ben Pfaff
db0a4375c4 learn: Allow read-only fields to be matched.
nxm_dst_check() requires a writable field.  Since NX_LEARN_DST_MATCH only
matches on a field and doesn't write to a field, use nxm_src_check() for
that case instead.

Bug #7507.
Reported-by: Michael Mao <mmao@nicira.com>
2011-10-18 13:43:39 -07:00
Ben Pfaff
75a7504356 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
2011-09-13 11:46:09 -07:00