[ovs-git] Open vSwitch: ofproto-dpif: Optimize flow revalidation for MAC learning. (master)

dev at openvswitch.org dev at openvswitch.org
Tue Sep 13 18:50:42 UTC 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, master has been updated
       via  54a9cbc9637e3deba7e436aac398aaa9ba110892 (commit)
       via  9cdaaebe218dbd9d2126818725b0111a70a3df54 (commit)
       via  ecf1e7ac2bc61b1d614395354554e672535135f8 (commit)
       via  993410fbc742a6beec0841a2be542c4105684e12 (commit)
       via  75a75043564dc9b002fffa6c6ad71e0d4d5c892e (commit)
       via  308881afb61e292c629b36a357cfc37153884000 (commit)
       via  a75531e53e03d9fe9915f8041759601c07e47914 (commit)
       via  26ce31583b1654a3acaaf6de8e9567e327fbc104 (commit)
       via  8b3b8dd1a5a1a8ba3b7e62798ff70cb8f9fc7659 (commit)
       via  6a885fd0589fdfa3b5d05ca3ff4af52b085a1816 (commit)
       via  1b9d6420b95f4d0ed78e337a43d1be88b571d5fb (commit)
       via  7024dffed8cf0b19228704d99acb222b400a3354 (commit)
       via  dd5616b3d2722dba0eb4597d4b04af9386f5bfbb (commit)
       via  0ff2282245a87f253843bf357988d7230139888f (commit)
       via  93996add1ca50e85e4b3938133fcac15b56fbf01 (commit)
       via  333eba210b39a09a17c036335ed312ae123ba339 (commit)
       via  e23ae585275dfa76de50b698754b2066cc944e01 (commit)
       via  39dc90822efc67cee8485e3e410f239a2a9e6e00 (commit)
       via  aad29cd1a1fb76aa68a9c404a47b66ac516149b5 (commit)
       via  e7ed3a3a5f87d20f0cc632ae23adba6f30a4e19d (commit)
      from  21d486606d67881c9dccb59a6f0ba6cbd1af5dfa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 54a9cbc9637e3deba7e436aac398aaa9ba110892
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=54a9cbc9637e3deba7e436aac398aaa9ba110892
Author: Ben Pfaff <blp at nicira.com>
		
ofproto-dpif: Optimize flow revalidation for MAC learning.
		
Without this commit, every NXAST_LEARN action that adds a flow causes every
facet to be revalidated.  With this commit, as long as the "Usage Advice"
in the large comment on struct nx_action_learn in nicira-ext.h is followed,
this no longer happens.


commit 9cdaaebe218dbd9d2126818725b0111a70a3df54
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=9cdaaebe218dbd9d2126818725b0111a70a3df54
Author: Ben Pfaff <blp at nicira.com>
		
ofproto-dpif: Introduce an enum for the number of tables.
		
It seems reasonable that someone might want to reduce this number, so
make it an enum to simplify that.

If someone does reduce the number then rule_dpif_lookup() needs to validate
the table_id, so add code to do that too.


commit ecf1e7ac2bc61b1d614395354554e672535135f8
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=ecf1e7ac2bc61b1d614395354554e672535135f8
Author: Ben Pfaff <blp at nicira.com>
		
flow: New function flow_wildcards_is_catchall().
		
This will be used in an upcoming commit.


commit 993410fbc742a6beec0841a2be542c4105684e12
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=993410fbc742a6beec0841a2be542c4105684e12
Author: Ben Pfaff <blp at nicira.com>
		
classifier: Move zero_wildcards() to flow.c as public flow_zero_wildcards().
		
This function will soon be used elsewhere.  As it doesn't inherently have
anything to with the classifier, move it to flow.c.


commit 75a75043564dc9b002fffa6c6ad71e0d4d5c892e
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=75a75043564dc9b002fffa6c6ad71e0d4d5c892e
Author: Ben Pfaff <blp at nicira.com>
		
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


commit 308881afb61e292c629b36a357cfc37153884000
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=308881afb61e292c629b36a357cfc37153884000
Author: Ben Pfaff <blp at nicira.com>
		
ofproto: Reinterpret meaning of OpenFlow hard timeouts with OFPFC_MODIFY.
		
I finally found a good use for hard timeouts in OpenFlow, but they require
a slight reinterpretation of the meaning of hard timeouts.  Until now, a
hard timeout meant that a flow would be removed the specified number of
seconds after a flow was created.  Intervening modifications with
OFPFC_MODIFY(_STRICT) had no effect on the hard timeout; the flow would
still be deleted the specified number of seconds after its original
creation.

This commit changes the effect of OFPFC_MODIFY(_STRICT).  Now, modifying
a flow resets its hard timeout counter.  A flow will time out the specified
number of seconds after creation or after the last time it is modified,
whichever comes later.


commit a75531e53e03d9fe9915f8041759601c07e47914
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=a75531e53e03d9fe9915f8041759601c07e47914
Author: Ben Pfaff <blp at nicira.com>
		
test-openflowd: Allow specifying port type on --ports option.
		
This allows a command like "test-openflowd --enable-dummy dummy at br0
--ports=dummy at eth0,dummy at eth1,dummy at eth2" to create a dummy datapath with
a number of dummy ports.  This is more useful for testing than a dummy
datapath with just an internal port, since output to "flood" and "normal"
has less pathological results.


commit 26ce31583b1654a3acaaf6de8e9567e327fbc104
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=26ce31583b1654a3acaaf6de8e9567e327fbc104
Author: Ben Pfaff <blp at nicira.com>
		
dpif-netdev: Also allow "dummy" netdevs in a dpif-netdev.
		
I've always intended this to work, but either I never tested it or the
support rotted.

This will soon be used in some tests that I will add.


commit 8b3b8dd1a5a1a8ba3b7e62798ff70cb8f9fc7659
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=8b3b8dd1a5a1a8ba3b7e62798ff70cb8f9fc7659
Author: Ben Pfaff <blp at nicira.com>
		
ofproto-dpif: Add -generate option to ofproto/trace command.
		


commit 6a885fd0589fdfa3b5d05ca3ff4af52b085a1816
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=6a885fd0589fdfa3b5d05ca3ff4af52b085a1816
Author: Ben Pfaff <blp at nicira.com>
		
meta-flow: New library for working with fields by id.
		
OVS already has a fairly good set of functions for working with fields that
are known at compile time, but support for working with fields that are
known only at runtime is fairly limited (and fairly unneeded).  However,
with NXM identifiers becoming more and more widely used throughout Nicira
extensions, it's becoming corresponding more and more common to need to
refer to fields at runtime.  This new library represents a first attempt
at a systematic approach for doing so.


commit 1b9d6420b95f4d0ed78e337a43d1be88b571d5fb
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=1b9d6420b95f4d0ed78e337a43d1be88b571d5fb
Author: Ben Pfaff <blp at nicira.com>
		
ofproto: Mark some parameters 'const'.
		


commit 7024dffed8cf0b19228704d99acb222b400a3354
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=7024dffed8cf0b19228704d99acb222b400a3354
Author: Ben Pfaff <blp at nicira.com>
		
ofproto: Add 'ofproto' parameter to most flow_mod functions.
		


commit dd5616b3d2722dba0eb4597d4b04af9386f5bfbb
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=dd5616b3d2722dba0eb4597d4b04af9386f5bfbb
Author: Ben Pfaff <blp at nicira.com>
		
ofproto: Avoid using list_size() to compute length of 'pending' list.
		
Currently this only gets checked for incoming OpenFlow OFPT_FLOW_MOD
messages, so it's hard to imagine it being any kind of bottleneck, but the
NXAST_LEARN action that is soon to be added will be able to create flows
more quickly than we normally expect from a controller.  (On the other
hand, ofproto-dpif, outside of a special testing mode, always completes
operations immediately, so 'pending' will always have length 0.  But this
change still feels right to me for some reason.)


commit 0ff2282245a87f253843bf357988d7230139888f
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=0ff2282245a87f253843bf357988d7230139888f
Author: Ben Pfaff <blp at nicira.com>
		
ofp-util: New function for parsing key-value pairs.
		
This will soon have a new user, but it's a worthwhile cleanup on its own.


commit 93996add1ca50e85e4b3938133fcac15b56fbf01
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=93996add1ca50e85e4b3938133fcac15b56fbf01
Author: Ben Pfaff <blp at nicira.com>
		
ofp-util: Add type-safe functions for serializing actions.
		


commit 333eba210b39a09a17c036335ed312ae123ba339
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=333eba210b39a09a17c036335ed312ae123ba339
Author: Ben Pfaff <blp at nicira.com>
		
ofp-parse: Refactor action parsing to improve compiler warnings.
		
When a new action is added, compiler warnings show most of the places that
need new code to handle that action.  The action parsing code in
ofp-parse.c was the one remaining missing case.  This commit fixes that.


commit e23ae585275dfa76de50b698754b2066cc944e01
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=e23ae585275dfa76de50b698754b2066cc944e01
Author: Ben Pfaff <blp at nicira.com>
		
ofp-util: Further abstract definitions of action properties.
		
This commit primarily moves the OFPAT_ACTION and NXAST_ACTION invocations
into a new file ofp-util.def.  This allows multiple places in the source to
use them.

This commit also adds a new function ofputil_action_code_from_name().
The following commit will add the first user.


commit 39dc90822efc67cee8485e3e410f239a2a9e6e00
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=39dc90822efc67cee8485e3e410f239a2a9e6e00
Author: Ben Pfaff <blp at nicira.com>
		
ofp-util: New functions for parsing and formatting OpenFlow port numbers.
		
These functions were previously used only in ofp-parse.c and ofp-print.c,
but they are more generally useful and future commits will add more users.


commit aad29cd1a1fb76aa68a9c404a47b66ac516149b5
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=aad29cd1a1fb76aa68a9c404a47b66ac516149b5
Author: Ben Pfaff <blp at nicira.com>
		
packets: Add more utility functions for IPv4 and IPv6 addresses.
		
We had these functions scattered around the source tree anyway.  packets.h
is a good place to centralize them.

I do plan to introduce some additional callers.


commit e7ed3a3a5f87d20f0cc632ae23adba6f30a4e19d
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=e7ed3a3a5f87d20f0cc632ae23adba6f30a4e19d
Author: Ben Pfaff <blp at nicira.com>
		
classifier: Change cls_rule_set_nd_target() to take a pointer.
		
The other cls_rule_*() functions that take IPv6 addresses take a pointer
to an in6_addr, so cls_rule_set_nd_target() should as well for consistency.
Possibly this is more efficient also, although I guess it doesn't really
make much of a difference either way.


-----------------------------------------------------------------------

Summary of changes:
 NEWS                          |    1 +
 include/openflow/nicira-ext.h |  216 ++++++-
 lib/automake.mk               |    5 +
 lib/autopath.c                |    6 +-
 lib/bundle.c                  |    7 +-
 lib/classifier.c              |   89 +--
 lib/classifier.h              |   14 +-
 lib/dpif-netdev.c             |    2 +-
 lib/flow.c                    |  161 ++++
 lib/flow.h                    |    5 +
 lib/learn.c                   |  662 +++++++++++++++++
 lib/{autopath.h => learn.h}   |   28 +-
 lib/meta-flow.c               | 1631 +++++++++++++++++++++++++++++++++++++++++
 lib/meta-flow.h               |  220 ++++++
 lib/multipath.c               |    6 +-
 lib/netdev.c                  |   19 +
 lib/netdev.h                  |    2 +
 lib/nx-match.c                |  381 ++---------
 lib/nx-match.def              |   83 +--
 lib/nx-match.h                |    3 +-
 lib/ofp-parse.c               |  881 ++++++-----------------
 lib/ofp-print.c               |   62 +--
 lib/ofp-util.c                |  287 ++++++--
 lib/ofp-util.def              |   38 +
 lib/ofp-util.h                |  107 ++-
 lib/packets.c                 |   55 ++-
 lib/packets.h                 |    4 +
 lib/util.c                    |   62 ++
 lib/util.h                    |    6 +-
 ofproto/ofproto-dpif.c        |  274 +++++++-
 ofproto/ofproto-provider.h    |   18 +-
 ofproto/ofproto-unixctl.man   |   24 +-
 ofproto/ofproto.c             |  187 +++--
 tests/automake.mk             |    1 +
 tests/learn.at                |   88 +++
 tests/test-openflowd.c        |    6 +-
 tests/test-util.c             |   31 +-
 tests/testsuite.at            |    1 +
 utilities/ovs-ofctl.8.in      |   62 ++
 39 files changed, 4323 insertions(+), 1412 deletions(-)
 create mode 100644 lib/learn.c
 copy lib/{autopath.h => learn.h} (53%)
 create mode 100644 lib/meta-flow.c
 create mode 100644 lib/meta-flow.h
 create mode 100644 lib/ofp-util.def
 create mode 100644 tests/learn.at


hooks/post-receive
-- 
Open vSwitch



More information about the git mailing list