[ovs-dev] [PATCH 0/3 v2.20] MPLS actions and matches

Simon Horman horms at verge.net.au
Thu Feb 28 09:15:06 UTC 2013


This series implements MPLS actions and matches based on work by
Ravi K, Leo Alterman and Yamahata-san.

Compared to the prior edition (v1.19) this series is vastly
reduced in size. This is as a result of a discussion I had with Jesse
Gross where he suggested that implementing recirculation would be
more acceptable than my inner/outer flow scheme. As such this series now:

* Adds basic MPLS support to the kernel datapath.
* Adds the set_mpls_ttl and dec_mpls_ttl. (entirely user-space code).

The two items above are independent of each other.
Neither depends on the other and they can be reviewed (and merged:)
without impacting each other.

With the changes above in place it should be possible to use MPLS with
a stack depth of one. It should be possible to use push_mpls, pop_mpls,
set_mpls_ttl and and dec_mpls_ttl. It should also be possible to use L3+
actions so long as the original frame is not MPLS.

* Implement recirculation and a host of more sophisticated MPLS features
  - copy_ttl_in
  - copy_ttl_out
  - L3+ actions on MPLS frames (e.g. pop_mpls(0x800),set_ttl)
  - multi-level mpls_pop and mpls_push
* Other more specific datapath todo items listed in the changelog of
  "datapath: Add basic MPLS support to kernel"

Key differences between v2.19 and v2.20
* Dropped inner/outer flow changes and changes that depend on them
* Updated "datapath: Add basic MPLS support to kernel" as per Jesse's review.

Key differences between v2.18 and v2.19
* Address review by Ben Pfaff
  - When encoding MPLS information in ODP flow key data use encap()
  - Remove encap_dl_type parameter from odp_flow_key_from_flow()
  - Use xlate_actions() for l3 decoding based on ether_type
    from MPLS. Previously this logic was elsewhere but did not
    take into account resubmit.
* Bufix for kernel datapath:
  - Correct logic error in ovs_flow_tbl_next() that prevented facets from
    being dumped by the kernel-datapath. The result being that ovs-vswitchd
    would evict facts from the datapath regardless if they had been
    recently used or not. This may in turn cause flow misses and upcalls to

Key differences between the v2.17 and v2.18:
* Rebase
  - The basic user-space support patch has been merged :)
  - Adjust for is_ip_any()
* Added patch to correct setting of ethertype in pop_mpls()

Key differences between the v2.15 and v2.16:
* Rebase
* Address review by Ben Pfaff, particularly in th first patch of the
  series "User-Space MPLS actions and matches"

Key differences between the v2.15 and v2.16:
* Rebase
* Use 62 for OVS_KEY_ATTR_MPLS to reduce the scope for conflict
  with new values in the future

Key differences between the v2.14 and v2.15:
* Addressed review by Ben Pfaff and Jesse Gross
  In particular:
  - Use Use OVS_ACTION_SET to set OVS_KEY_ATTR_MPLS instead o
  Still under discussion
  - Move OVS_KEY_ATTR_MPLS to after all upstream attributes
    to after all upstream attributes

Key differences between the v2.13 and v2.14:
* Reshuffle patches moving kernel datapath patches to the end of the series
  and allowing the other patches to be applied independently. That is,
  the first 10 patches of the series may be applied. They do not
  touch the kernel. And the result will be MPLS support for ovs-vswitchd
  and the user-space datapath.

Key differences between the v2.12 and v2.13:
* Rebase
* Add Inner and Outer flow support to user-space datapath
* Allow MPLS matches for OpenFlow 1.3
* Optimisations suggested by Jarno Rajahalme

Key differences between the v2.11 and v2.12:
* Rebase
* Add eth_type_mpls helper
* Add flow_innermost_dl_type helper
* calculate MPLS fitness over entire flow
  - It is sufficient to just calculate the fitness of an MPLS frame once.
  - Previously a fitness calculation was made based on expectations calculat
    on L1 and L2 data. However, this may not be correct as it will return
    ODP_FIT_TOO_MUCH in the case where the key contains L3 attributes.
* Pass MPLS lse to push_mpls
  - When push_mpls() the LSE of the flow is always already known,
    so pass it to push_mpls and set it directly. This avoids:
    + The need to re-compose an default LSE, allowing
      the removal of get_lse()
    + The need to follow each call to push_mpls() with
      a call to set_mpls_lse()
  - This fixes the previously bogus usage of push_mpls
    in dp_netdev_execute_actions, allowing push_mpls to work
    in conjunction with the user-space datapath.
* Add dl_type parameter to flow_extract_l3_onwards()
  and thus allow "flow: Split flow_extract" to be applied
  independently of the rest of this patch-set.

Key differences between the v2.10 and v2.11:
* Rebase
* The last 13 patches in the series have been added to allow
  handling of actions on MPLS flows that modify any L3+ data.
  In particular, to allow modification of the IP TTL.

  This is achieved by adding the notion of inner and outer flows.
  This works as follows.

  - A match is decoded from a packet using the existing implementation
    and this is used to look up the flow.
  - If the flow includes actions that allow further decoding of
    the packet - e.g. an MPLS pop action which supplies the
    ethernet type of the encapsulated frame - then the packet is
    further decoded and a more fine-grained match is made. This match
    is then used to lookup the flow again.

  In such cases the flow added to the datapath by ovs-vswtichd
  includes the richer match and the actions. The datapath inspects
  the actions and if there are actions that allow further decoding of
  the packet it inserts the flow twice, once including only an L1 and L2
  match and once including the richer match. The former is the
  other flow and the latter is the inner flow.

  Each inner flow has a single outer flow. Outer flows may
  have more than one inner flow. Inner flows are not exposed
  to ovs-vswitchd. Inner flows are deleted when their outer
  flow is deleted.

* Check the size of nx_action_mpls_ttl.
  nx_action_pop_mpls was being checked
  due to a cut-and-paste error

Key differences between the previous post, v2.9, and this post, v2.10:
* Rebase
* Check the size of nx_action_mpls_ttl.
  nx_action_pop_mpls was being checked
  due to a cut-and-paste error

Key differences between v2.8 and v2.9
* Rebase
  and fix tests accordingly
* Always update MPLS bos pointer when
  VLAN pop is performed in kernel datapath.

Key differences between v2.7 and v2.8
* Rebase

Key differences between v2.6 and v2.7
* When encoding TTL actions (the last 4 patches) for
  an OpenFlow 1.1+ message, encode them as OpenFlow 1.1+
  actions. Previously they were encoded as NX matches.

Key differences between v2.5 and v2.6
* Dropped "flow: Set ttl in flow_compose()", this is
  now present in the master branch
* Dropped "nx-match: Do not check pre-requisites for load actions",
  instead, dl_type changes are tracked to allow correct pre-requisite
  checking in the presence of push_mpls and pop_mpls actions.

Key differences between v2.4 and v2.5
* Various clean-ups and fises to
  "User-Space MPLS actions and matches"
  as noted in its changelog.
* New patches to add support for TLS actions
* Inclusion of Justin Pettit's patch
  "flow: Set ttl in flow_compose()",
  which is a dependency of the
  "Add support for copy_ttl_out action" patch.

Key differences between v2.3 and v2.4
* Minor cleanup to "User-Space MPLS actions and matches"
  as detailed in its changelog.
* A new patch at the end of the series
  "Add support for set_mpls_ttl action"

Changes are detailed in the changelog of each patch.

The test suite passes when this series is applied on top
of the current master branch.

Diffstat and git information is provided to aid review.

The following changes since commit a614d823ae5d753297a8d0c63c703338a7ac0653:

  ofproto: Create and delete tnl_backers in type_run() (2013-02-26 11:22:32 -0800)

are available in the git repository at:

  git://github.com/horms/openvswitch.git devel/mpls-v2.20

for you to fetch changes up to 6984f12f40b7ef43d859239b2438bf0a4f6e506a:

  datapath: Add basic MPLS support to kernel (2013-02-28 18:01:44 +0900)

Simon Horman (3):
      Add support for dec_mpls_ttl action
      Add support for set_mpls_ttl action
      datapath: Add basic MPLS support to kernel

 datapath/actions.c            |  103 +++++++++++++++++++++++++++++++++++++++++
 datapath/datapath.c           |   34 ++++++++++++--
 datapath/datapath.h           |    7 +++
 datapath/flow.c               |   63 ++++++++++++++++++++++---
 datapath/flow.h               |   29 +++++++++---
 include/linux/openvswitch.h   |    2 +-
 include/openflow/nicira-ext.h |   13 ++++++
 lib/flow.c                    |    8 ++++
 lib/ofp-actions.c             |   53 +++++++++++++++++++++
 lib/ofp-actions.h             |   11 +++++
 lib/ofp-parse.c               |   22 +++++++++
 lib/ofp-util.def              |    4 ++
 lib/packets.c                 |    2 +-
 lib/packets.h                 |    1 +
 ofproto/ofproto-dpif.c        |   49 ++++++++++++++++++++
 tests/ofproto-dpif.at         |   84 +++++++++++++++++++++++++++++++++
 utilities/ovs-ofctl.8.in      |   13 ++++++
 17 files changed, 479 insertions(+), 19 deletions(-)

More information about the dev mailing list