[ovs-git] [openvswitch/ovs] 064799: lib: Refactor mac-learning updates.

GitHub noreply at github.com
Wed Sep 14 23:51:37 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 064799a172852c623b2262e65e5fbfc3957758ee
      https://github.com/openvswitch/ovs/commit/064799a172852c623b2262e65e5fbfc3957758ee
  Author: Jarno Rajahalme <jarno at ovn.org>
  Date:   2016-09-14 (Wed, 14 Sep 2016)

  Changed paths:
    M lib/mac-learning.c
    M lib/mac-learning.h
    M ofproto/ofproto-dpif-xlate.c

  Log Message:
  -----------
  lib: Refactor mac-learning updates.

Make mac table update functions part of the mac-learning module, which
also helps in figuring what is the minimal set of struct flow fields
needed for the update.  Use this to change the xlate cache entry for
XC_NORMAL to not take a copy of the struct flow, but only save the
in_port, dl_src, and some auxiliary fields.  This reduces the memory
burden of XC_NORMAL by roughly 0.5kb.

Signed-off-by: Jarno Rajahalme <jarno at ovn.org>
Acked-by: Ben Pfaff <blp at ovn.org>


  Commit: 901a517e5c8d253928e17a2c90573a1c545a2858
      https://github.com/openvswitch/ovs/commit/901a517e5c8d253928e17a2c90573a1c545a2858
  Author: Jarno Rajahalme <jarno at ovn.org>
  Date:   2016-09-14 (Wed, 14 Sep 2016)

  Changed paths:
    M ofproto/automake.mk
    M ofproto/ofproto-dpif-upcall.c
    A ofproto/ofproto-dpif-xlate-cache.c
    A ofproto/ofproto-dpif-xlate-cache.h
    M ofproto/ofproto-dpif-xlate.c
    M ofproto/ofproto-dpif-xlate.h

  Log Message:
  -----------
  ofproto-dpif-xlate: Expose xlate cache.

Later patches will need to create xlate cache entries from different
modules.  This patch refactors the xlate cache code in preparation
without any functional changes, so that the changes are clearly
visible in the following patches.

The definition of XC_ENTRY_FOR_EACH() iterator macro is changed so
that it now does not take the xlate cache pointer to unify the usage
accross all call sites.

Signed-off-by: Jarno Rajahalme <jarno at ovn.org>
Acked-by: Ben Pfaff <blp at ovn.org>


  Commit: a027899ee3e5a65c9253a24be8f8abdd9c47a023
      https://github.com/openvswitch/ovs/commit/a027899ee3e5a65c9253a24be8f8abdd9c47a023
  Author: Jarno Rajahalme <jarno at ovn.org>
  Date:   2016-09-14 (Wed, 14 Sep 2016)

  Changed paths:
    M NEWS
    M ofproto/ofproto-dpif-xlate-cache.c
    M ofproto/ofproto-dpif-xlate-cache.h
    M ofproto/ofproto-dpif-xlate.c
    M ofproto/ofproto-dpif.c
    M ofproto/ofproto-dpif.h

  Log Message:
  -----------
  ofproto-dpif-xlate: Add xlate cache type XC_TABLE.

Xlate cache entry type XC_TABLE is required for the table stats
(number of misses and matches) to be correctly attributed.

It appears that table stats have been off ever since xlate cache was
introduced.  This was now revealed by a PACKET_OUT unit test case in a
later patch that checks for table stats explicitly.

Fixes: b256dc52 ("ofproto-dpif-xlate: Cache xlate_actions() effects.")
Signed-off-by: Jarno Rajahalme <jarno at ovn.org>
Acked-by: Ben Pfaff <blp at ovn.org>


  Commit: 2c7ee5248496896b3794df1d8635b70370097847
      https://github.com/openvswitch/ovs/commit/2c7ee5248496896b3794df1d8635b70370097847
  Author: Jarno Rajahalme <jarno at ovn.org>
  Date:   2016-09-14 (Wed, 14 Sep 2016)

  Changed paths:
    M ofproto/ofproto-dpif-xlate-cache.c
    M ofproto/ofproto-dpif-xlate-cache.h
    M ofproto/ofproto-dpif-xlate.c
    M ofproto/ofproto-dpif.c
    M ofproto/ofproto-dpif.h
    M ofproto/ofproto-provider.h
    M ofproto/ofproto.c

  Log Message:
  -----------
  ofproto: Use ofproto_flow_mod for learn execution from xlate cache.

Use ofproto_flow_mod with a reference to an existing or new rule
instead of ofputil_flow_mod for learn action execution from xlate
cache

Typically we would find that when a learn xlate cache entry is
created, a preceding upcall has already created the learned flow.  In
this case the xlate cache entry takes a reference to that flow and
keeps refreshing it without needing to perform any flow table lookups.
Otherwise the creation of the xlate cache entry creates the new rule,
which is then subsequently added to the classifier.  In both cases
this is both faster and shrinks the memory cost of each learn cache
entry from ~3.5kb to about 0.3kb.

If the learned rule does not yet exist, it is created and attached to
the ofproto_flow_mod, from which it is then added.  If the referred
rule happens to expire, or is modified in any way and is thus removed
from the classifier tables, we create a new rule using the old rule as
a template, so that we can avoid storing the ofputil_flow_mod in all
cases.

Signed-off-by: Jarno Rajahalme <jarno at ovn.org>
Acked-by: Ben Pfaff <blp at ovn.org>


  Commit: df70a7731c6d50458e46c865975d569dd3909212
      https://github.com/openvswitch/ovs/commit/df70a7731c6d50458e46c865975d569dd3909212
  Author: Jarno Rajahalme <jarno at ovn.org>
  Date:   2016-09-14 (Wed, 14 Sep 2016)

  Changed paths:
    M ofproto/ofproto-dpif-upcall.c
    M ofproto/ofproto-dpif-xlate-cache.c
    M ofproto/ofproto-dpif-xlate-cache.h
    M ofproto/ofproto-dpif-xlate.c
    M ofproto/ofproto-dpif-xlate.h

  Log Message:
  -----------
  ofproto-dpif-xlate: Allow translating without side-effects.

Extend 'may_learn' attribute to also control the treatment of
FIN_TIMEOUT action and asynchronous messages (packet ins,
continuations), so that when 'may_learn' is 'false' and
'resubmit_stats' is 'NULL', no OpenFlow-visible side effects are
generated by the translation.

Correspondingly, add support for one-time asynchronous messages to
xlate cache, so that all side-effects of the translation may be
executed at a later stage.  This will be useful for bundle commits.

Signed-off-by: Jarno Rajahalme <jarno at ovn.org>
Acked-by: Ben Pfaff <blp at ovn.org>


  Commit: 493f017d8ad57aff226fb26e177b64b02a15cea4
      https://github.com/openvswitch/ovs/commit/493f017d8ad57aff226fb26e177b64b02a15cea4
  Author: Jarno Rajahalme <jarno at ovn.org>
  Date:   2016-09-14 (Wed, 14 Sep 2016)

  Changed paths:
    M lib/coverage.h

  Log Message:
  -----------
  coverage: Rename init functions to avoid symbol collisions.

ofproto now uses various *_init() functions, so use something else for
coverage constructors.

Signed-off-by: Jarno Rajahalme <jarno at ovn.org>
Acked-by: Ben Pfaff <blp at ovn.org>


  Commit: 1f4a893366826e392722d5b1ba59e94331bfe5c9
      https://github.com/openvswitch/ovs/commit/1f4a893366826e392722d5b1ba59e94331bfe5c9
  Author: Jarno Rajahalme <jarno at ovn.org>
  Date:   2016-09-14 (Wed, 14 Sep 2016)

  Changed paths:
    M ofproto/ofproto-dpif-upcall.c
    M ofproto/ofproto-dpif-xlate-cache.c
    M ofproto/ofproto-dpif-xlate-cache.h
    M ofproto/ofproto-dpif-xlate.c
    M ofproto/ofproto-dpif-xlate.h
    M ofproto/ofproto-dpif.c
    M ofproto/ofproto-dpif.h
    M ofproto/ofproto-provider.h
    M ofproto/ofproto.c

  Log Message:
  -----------
  ofproto: Refactor packet_out handling.

Refactor handle_packet_out() to prepare for bundle support for packet
outs in a later patch.

Two new callbacks are introduced in ofproto-provider class:
->packet_xlate() and ->packet_execute().  ->packet_xlate() translates
the packet using the flow and actions provided by the caller, but
defers all OpenFlow-visible side-effects (stats, learn actions, actual
packet output, etc.) to be explicitly executed with the
->packet_execute() call.

Adds a new ofproto_rule_reduce_timeouts__() that must be called with
'ofproto_mutex' held.  This is used in the next patch.

Signed-off-by: Jarno Rajahalme <jarno at ovn.org>
Acked-by: Ben Pfaff <blp at ovn.org>


  Commit: 6dd3c787f5914ea27b239b6852d8fc0815033128
      https://github.com/openvswitch/ovs/commit/6dd3c787f5914ea27b239b6852d8fc0815033128
  Author: Jarno Rajahalme <jarno at ovn.org>
  Date:   2016-09-14 (Wed, 14 Sep 2016)

  Changed paths:
    M NEWS
    M include/openvswitch/ofp-parse.h
    M include/openvswitch/ofp-util.h
    M lib/ofp-parse.c
    M lib/ofp-util.c
    M ofproto/bundles.h
    M ofproto/ofproto-dpif.c
    M ofproto/ofproto-provider.h
    M ofproto/ofproto.c
    M tests/bfd.at
    M tests/cfm.at
    M tests/ofp-print.at
    M tests/ofproto.at
    M utilities/ovs-ofctl.8.in
    M utilities/ovs-ofctl.c

  Log Message:
  -----------
  ofproto: Support packet_outs in bundles.

Add support for OFPT_PACKET_OUT messages in bundles.

While ovs-ofctl already has a packet-out command, we did not have a
string parser for it, as the parsing was done directly from command
line arguments.

This patch adds the string parser for packet-out messages, adds
support for it into the 'ovs-ofctl packet-out' command, and adds a new
ofctl/packet-out ovs-appctl command that can be used when ovs-ofctl is
used as a flow monitor.  The old 'ovs-ofctl packet-out syntax is
deprecated' and will be removed in a later OVS release.

The new packet-out parser is further supported with the ovs-ofctl
bundle command, which allows bundles to mix flow mods, group mods and
packet-out messages.  Also the packet-outs in bundles are only
executed if the whole bundle is successful.  A failing packet-out
translation may also make the whole bundle to fail.

Signed-off-by: Jarno Rajahalme <jarno at ovn.org>
Acked-by: Ben Pfaff <blp at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/40df456680fc...6dd3c787f591


More information about the git mailing list