[ovs-git] Open vSwitch: ofproto-dpif: Avoid extra flow copy in xlate_actions() for unneeded warnings. (master)

dev at openvswitch.org dev at openvswitch.org
Thu Apr 19 03:38:12 UTC 2012


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  43d50bc845055bee6243456d934106fc537d793d (commit)
       via  ccb7c863c137635bc02031590a80f3999f46cb32 (commit)
       via  70c2fd5633aaac5ba266b29a1904db92ba3ecd35 (commit)
       via  9d6ac44e2b584b34bc7e14f2daa7bb0bdfab16ab (commit)
       via  5fe20d5da471aa2d966834bdeb87b3a63c24340e (commit)
       via  112bc5f46f04c46e1d4fbfaa93f76ea39b39b66e (commit)
       via  c23740be661db40a54b8cd0c397945fb3987e771 (commit)
       via  18e89129873f9dbdcdaa3cee909c1690da008e8d (commit)
       via  7376da647fb2d327f8765381b27b4db8d81a104f (commit)
       via  b23cdad927a3b7f282e30d358be2c93597f8b9a3 (commit)
       via  90a7c55e56bca82a0b7a05ed068d054b5c8a7584 (commit)
       via  26cd7e348bdb1443d31889c8e773ef8c7f2a4ea8 (commit)
       via  5f5fbd1780b356373e31d939f4312589599c5e67 (commit)
       via  72d32ac0b3a1358cb36cf43f15ee7c026be36d2c (commit)
       via  8843668ae593f51b3bf4ab189fa218c40f0f0e33 (commit)
       via  7d7447df778f7c9eacd0506369103e823bf20d6f (commit)
       via  2b459b83afe20f644f801dbdeafb750c7dade5d1 (commit)
       via  eabe7c680d2aa8c3d5ed1b97d99ae982eb4aac7c (commit)
       via  050ac423de5945fa7aacca4b7cb9e19a912ff106 (commit)
       via  cca408daa5dba2465ebf1ba9cc7cc842617b0ab9 (commit)
       via  3de9590b77ceb6a0a7e4e9ca1a46273006c87eab (commit)
       via  407556ac6c902d060202f5e1aa3b92849b8f99ed (commit)
       via  7393104d1a31b5b256e491ec689cc7358f101280 (commit)
       via  b99d3ceeedd2c5533c13f9794616fc6d9c49c0de (commit)
       via  530a1d915be60e1b48f91af951f34aee53013b09 (commit)
       via  8017806940cfeaba963d6a6f51ae7573cbea6792 (commit)
      from  8d25d9a254786eeb164f4fe4cef28b07378afaa2 (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 43d50bc845055bee6243456d934106fc537d793d
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=43d50bc845055bee6243456d934106fc537d793d
Author: Ben Pfaff <blp at nicira.com>
		
ofproto-dpif: Avoid extra flow copy in xlate_actions() for unneeded warnings.
		
The copy of the extra flow copy here was showing up in profiles.  We only
need this copy if we end up doing a "trace" to warn the user.  Most runs
won't ever do that, so don't start making copies until we actually hit
such a case.

This has a small behavioral change in that we'll only get a warning on the
*second* time we hit the resubmit recursion limit, not on the first.  I
doubt that's really a problem.

Signed-off-by: Ben Pfaff <blp at nicira.com>


commit ccb7c863c137635bc02031590a80f3999f46cb32
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=ccb7c863c137635bc02031590a80f3999f46cb32
Author: Ben Pfaff <blp at nicira.com>
		
ofproto-dpif: Avoid extra flow copy in xlate_actions() if no mirrors.
		
This was showing up on profiles.

Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 70c2fd5633aaac5ba266b29a1904db92ba3ecd35
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=70c2fd5633aaac5ba266b29a1904db92ba3ecd35
Author: Ben Pfaff <blp at nicira.com>
		
ofproto-dpif: Avoid calling get_ofp_port() twice in xlate_normal().
		
This was showing up in profiles.

Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 9d6ac44e2b584b34bc7e14f2daa7bb0bdfab16ab
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=9d6ac44e2b584b34bc7e14f2daa7bb0bdfab16ab
Author: Ben Pfaff <blp at nicira.com>
		
ofproto-dpif: Implement "flow setup governor" to speed up many short flows.
		
The cost of creating and initializing facets and subfacets and installing,
tracking, and uninstalling kernel flows is significant.  When most flows
have only one or a few packets, this overhead is higher than the cost of
handling each packet individually.  This commit introduces heuristics that
cheaply count (approximately) the number of packets seen in a flow and
skips most of this expensive bookkeeping until the packet count exceeds a
threshold (currently 5 packets).

Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 5fe20d5da471aa2d966834bdeb87b3a63c24340e
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=5fe20d5da471aa2d966834bdeb87b3a63c24340e
Author: Ben Pfaff <blp at nicira.com>
		
ofproto-dpif: Avoid malloc() in common case for "execute" operations.
		
Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 112bc5f46f04c46e1d4fbfaa93f76ea39b39b66e
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=112bc5f46f04c46e1d4fbfaa93f76ea39b39b66e
Author: Ben Pfaff <blp at nicira.com>
		
ofproto-dpif: Make it easier to credit statistics for resubmits.
		
Until now, crediting statistics to OpenFlow rules due to "resubmit" actions
has required setting up a "resubmit hook" with a callback function and
auxiliary data.  This commit makes it easier to do, by adding a member to
struct action_xlate_ctx that specifies statistics to credit to each
resubmitted rule.

This commit includes one small behavioral change as an optimization.
Previously, rule_execute() translated the rule twice: once to get the ODP
actions, then a second time after executing the ODP actions to credit
statistics to the rules.  After this commit, rule_execute() translates the
rule only once, crediting statistics as a side effect.  The difference only
becomes visible when executing the actions fails: previously the statistics
would not be incremented, after this commit they will be.  It is very
unusual for executing actions to fail (generally this indicates a bug) so
I'm not concerned about it.

Signed-off-by: Ben Pfaff <blp at nicira.com>


commit c23740be661db40a54b8cd0c397945fb3987e771
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=c23740be661db40a54b8cd0c397945fb3987e771
Author: Ben Pfaff <blp at nicira.com>
		
classifier: Optimize search of "catchall" table.
		
Most flow tables have some kind of "catchall" rule that matches every
packet.  For this table, the cost of copying, zeroing, and hashing the
input flow is significant.  This patch avoids these costs.

Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 18e89129873f9dbdcdaa3cee909c1690da008e8d
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=18e89129873f9dbdcdaa3cee909c1690da008e8d
Author: Ben Pfaff <blp at nicira.com>
		
mac-learning: Speed up mac_table_hash().
		
Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 7376da647fb2d327f8765381b27b4db8d81a104f
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=7376da647fb2d327f8765381b27b4db8d81a104f
Author: Ben Pfaff <blp at nicira.com>
		
hash: Speed up hash_bytes().
		
Signed-off-by: Ben Pfaff <blp at nicira.com>


commit b23cdad927a3b7f282e30d358be2c93597f8b9a3
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=b23cdad927a3b7f282e30d358be2c93597f8b9a3
Author: Ben Pfaff <blp at nicira.com>
		
ofproto-dpif: Avoid malloc() of "struct flow_miss".
		
In addition to avoid malloc() for struct flow_miss, this commit avoids
copying "struct flow" around, which is a significant benefit because
struct flow is currently 144 bytes.

Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 90a7c55e56bca82a0b7a05ed068d054b5c8a7584
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=90a7c55e56bca82a0b7a05ed068d054b5c8a7584
Author: Ben Pfaff <blp at nicira.com>
		
dpif: Make caller of dpif_recv() provide buffer space.
		
This improves performance under heavy flow setup loads.

Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 26cd7e348bdb1443d31889c8e773ef8c7f2a4ea8
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=26cd7e348bdb1443d31889c8e773ef8c7f2a4ea8
Author: Ben Pfaff <blp at nicira.com>
		
ofproto-dpif: Avoid malloc() in common case for allocating subfacets.
		
Usually a facet has exactly one subfacet that has the same lifetime as
the facet.  Allocating both the facet and its subfacet in a single memory
block improves performance.

Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 5f5fbd1780b356373e31d939f4312589599c5e67
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=5f5fbd1780b356373e31d939f4312589599c5e67
Author: Ben Pfaff <blp at nicira.com>
		
ofproto-dpif: Move definition of "struct subfacet" earlier.
		
The next commit will add an instance of struct subfacet as a member of
struct facet, so struct subfacet must be declared first.

This commit moves around code without otherwise changing it.

Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 72d32ac0b3a1358cb36cf43f15ee7c026be36d2c
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=72d32ac0b3a1358cb36cf43f15ee7c026be36d2c
Author: Ben Pfaff <blp at nicira.com>
		
netlink-socket: Make caller provide message receive buffers.
		
Typically an nl_sock client can stack-allocate the buffer for receiving
a Netlink message, which provides a performance boost.

Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 8843668ae593f51b3bf4ab189fa218c40f0f0e33
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=8843668ae593f51b3bf4ab189fa218c40f0f0e33
Author: Ben Pfaff <blp at nicira.com>
		
netlink-socket: Remove unnecessary #include.
		
Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 7d7447df778f7c9eacd0506369103e823bf20d6f
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=7d7447df778f7c9eacd0506369103e823bf20d6f
Author: Ben Pfaff <blp at nicira.com>
		
netlink: Postpone choosing sequence numbers until send time.
		
Choosing sequence numbers at time of creating a packet means that
nl_sock_transact_multiple() has to search for the sequence number
of a reply, because the sequence numbers of the requests aren't
necessarily sequential.  This commit makes it possible to avoid
the search, by deferring choice of sequence numbers until the
time that we send the packets.  It doesn't actually modify
nl_sock_transact_multiple(), which will happen in a later commit.

Previously, I was concerned about a theoretical race condition
described in a comment in the old versino of this code:

    This implementation uses sequence numbers that are unique
    process-wide, to avoid a hypothetical race: send request, close
    socket, open new socket that reuses the old socket's PID value,
    send request on new socket, receive reply from kernel to old
    socket but with same PID and sequence number.  (This race could be
    avoided other ways, e.g. by preventing PIDs from being quickly
    reused).

However, I no longer believe that this can be a real problem,
because Netlink operates synchronously.  The reply to a request
will always arrive before the socket can be closed and a new
socket opened with the old socket's PID.

Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 2b459b83afe20f644f801dbdeafb750c7dade5d1
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=2b459b83afe20f644f801dbdeafb750c7dade5d1
Author: Ben Pfaff <blp at nicira.com>
		
ofproto-dpif: Avoid computing flow hash multiple times.
		
Signed-off-by: Ben Pfaff <blp at nicira.com>


commit eabe7c680d2aa8c3d5ed1b97d99ae982eb4aac7c
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=eabe7c680d2aa8c3d5ed1b97d99ae982eb4aac7c
Author: Ben Pfaff <blp at nicira.com>
		
dpif-linux: Avoid malloc() in dpif_linux_operate().
		
Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 050ac423de5945fa7aacca4b7cb9e19a912ff106
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=050ac423de5945fa7aacca4b7cb9e19a912ff106
Author: Ben Pfaff <blp at nicira.com>
		
ofproto-dpif: Avoid malloc() in common cases for xlate_actions().
		
Signed-off-by: Ben Pfaff <blp at nicira.com>


commit cca408daa5dba2465ebf1ba9cc7cc842617b0ab9
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=cca408daa5dba2465ebf1ba9cc7cc842617b0ab9
Author: Ben Pfaff <blp at nicira.com>
		
ofpbuf: New functions ofpbuf_use_stub() and ofpbuf_get_uninit_pointer().
		
Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 3de9590b77ceb6a0a7e4e9ca1a46273006c87eab
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=3de9590b77ceb6a0a7e4e9ca1a46273006c87eab
Author: Ben Pfaff <blp at nicira.com>
		
ofproto-dpif: Don't do an extra flow translation when removing facets.
		
When we remove a facet, it seems superfluous to translate the flow
once more just to update the MAC learning table, since we know that
it was done within a second or so anyway (e.g. when the flow stats
were last updated).

Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 407556ac6c902d060202f5e1aa3b92849b8f99ed
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=407556ac6c902d060202f5e1aa3b92849b8f99ed
Author: Ben Pfaff <blp at nicira.com>
		
netlink-socket: Avoid forcing a reply for final message in a transaction.
		
Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 7393104d1a31b5b256e491ec689cc7358f101280
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=7393104d1a31b5b256e491ec689cc7358f101280
Author: Ben Pfaff <blp at nicira.com>
		
dpif: Include TCP flags in "ovs-dpctl dump-flows" output.
		
Signed-off-by: Ben Pfaff <blp at nicira.com>


commit b99d3ceeedd2c5533c13f9794616fc6d9c49c0de
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=b99d3ceeedd2c5533c13f9794616fc6d9c49c0de
Author: Ben Pfaff <blp at nicira.com>
		
ofproto-dpif: Batch flow uninstallations due to expiration.
		
Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 530a1d915be60e1b48f91af951f34aee53013b09
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=530a1d915be60e1b48f91af951f34aee53013b09
Author: Ben Pfaff <blp at nicira.com>
		
ofproto-dpif: Drop unneeded _SAFE from iteration in handle_flow_miss().
		
The loop never frees the packet that it operates on, so _SAFE is not
needed.

Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 8017806940cfeaba963d6a6f51ae7573cbea6792
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=8017806940cfeaba963d6a6f51ae7573cbea6792
Author: Ben Pfaff <blp at nicira.com>
		
ofproto-dpif: Keep subfacet "used" times more up-to-date.
		
handle_flow_miss() didn't update subfacet "used" times for packets
processed by userspace.  This commit fixes the problem.

Found by inspection.  I didn't verify the bug in testing.

Signed-off-by: Ben Pfaff <blp at nicira.com>


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

Summary of changes:
 NEWS                            |    2 +-
 lib/classifier.c                |   21 +-
 lib/classifier.h                |    7 +-
 lib/dpif-linux.c                |  208 +++++---
 lib/dpif-netdev.c               |   16 +-
 lib/dpif-provider.h             |   34 +-
 lib/dpif.c                      |   75 ++-
 lib/dpif.h                      |   15 +-
 lib/hash.c                      |   17 +-
 lib/mac-learning.c              |    5 +-
 lib/netlink-notifier.c          |   10 +-
 lib/netlink-socket.c            |  295 +++++++-----
 lib/netlink-socket.h            |   21 +-
 lib/netlink.c                   |   29 +-
 lib/ofpbuf.c                    |   52 ++-
 lib/ofpbuf.h                    |    7 +-
 lib/packets.c                   |   37 ++
 lib/packets.h                   |    1 +
 ofproto/automake.mk             |    4 +-
 ofproto/ofproto-dpif-governor.c |  188 +++++++
 ofproto/ofproto-dpif-governor.h |   53 ++
 ofproto/ofproto-dpif.c          | 1038 +++++++++++++++++++++++++--------------
 tests/test-netflow.c            |   30 +-
 utilities/nlmon.c               |   14 +-
 vswitchd/ovs-brcompatd.c        |   49 +-
 25 files changed, 1483 insertions(+), 745 deletions(-)
 create mode 100644 ofproto/ofproto-dpif-governor.c
 create mode 100644 ofproto/ofproto-dpif-governor.h


hooks/post-receive
-- 
Open vSwitch



More information about the git mailing list