Hi,

This series comprises a fresh batch of proposed changes to introduce
flow-based tunnelling.

As things stands this series has a number of limitations, however as it is
a rather large change I wanted to get something out for review before it
grows even further.

The good news (for me at least) is that the code works in so far as I am
able to use it to ping between two kvm instances each running ovs with
these patches applied.

In general the appraoch that I have taken in user-space is to split
tunneling into realdevs and tundevs.  Tunnel realdevs are devices that look
to users like the existing port-based tunnelling implementation. Tunnel
tundevs exist in the datapath and are where tx and rx occur.  Tunnel
tundevs have very little configuration and are unable to opperate without
flow information that describes at least the remote IP.

Some limitations in this series:

* In this series, realdevs exist in the kernel although I believe
  it should not be necessary for them to do so. The reason that they are
  there is to limit the changes that are needed to the user-space netdev
  code and to allow review of the series before making those changes.

* Tunnel ID (e.g. GRE key) is broken. The id is actually passed
  around in user-space and the kernel. However it is not set on transmit by
  the tundev.
  
  I believe this can be resolve by adding a flags feild to the tun_key used
  in both flows and OVS_CB() and using a single bit to indicate that the
  key should be set. This should not be particularly difficult, I just
  haven't got to it yet. The implication of this approach is that such a
  flag would be passed to in-tree tunneling once that facility is
  available.

* gre-err() is no longer implemented but is still needed.
  THe implication of this is that while the code works for ping it probably
  will not work for anything that owuld require MSS discovery.

  I'm not entiurely sure how to fix gre_err() and it may be better
  to just implement MSS clamping in user-space as previously suggested
  by Jesse Gross.

* I have mostly removed the cache from tunneling.
  This is partly because I'm unsure that it makes much sense when using
  flow-based tunneling. And partly because I'm unsure it makes sense if
  in-tree tunneling code is used.

  The cache itself has been removed and thus is not used.  The vport code
  still implemetns update_header() and friends, this could be consolidated
  if the cache is to be permanently removed.

* Multicast could be implemented in user-space byt currently isn't.
  This means that muilticast remote IP for tunneling is broken.

* I have not implemented matches for tun_keys. This means
  that the current implementation only provides port-based tunneling
  implemented on top of flow-bassed tunneling. It is not yet possible for a
  controller to match on or set the tun_key of flows.

  I expect this to be a small body of work to complete.

* The way that I have split the patchs is somewhat arbitrary.
  I wanted to avoid one very large patch to aid review.  But a lot of the
  chagnes are inter-related, so a bisectable split seems rather difficult.
  None the less, the split could be significantly improved.

Patch list and overall diffsat:

Simon Horman (19):
  [RFC v2] datapath: tunnelling: Replace tun_id with tun_key
  datapath: Use tun_key on transmit
  odp-util: Add tun_key to parse_odp_key_attr()
  vswitchd: Add iface_parse_tunnel
  vswitchd: Add add_tunnel_ports()
  ofproto: Add set_tunnelling()
  vswitchd: Configure tunnel interfaces.
  ofproto: Add realdev_to_txdev()
  ofproto: Add tundev_to_realdev()
  classifer: Convert struct flow flow_metadata to use tun_key
  datapath, vport: Provide tunnel realdev and tundev classes and vports
  lib: Replace commit_set_tun_id_action() with
    commit_set_tunnel_action()
  global: Remove OVS_KEY_ATTR_TUN_ID
  ofproto: Set flow tun_key in compose_output_action()
  datapath: Remove mlink element from tnl_mutable_config
  datapath: remove tunnel cache
  datapath: Always use tun_key addresses for route lookup
  dataptah: remove ttl and tos from tnl_mutable_config
  datapath: Simplify vport lookup

 datapath/Modules.mk             |    3 +-
 datapath/actions.c              |    6 +-
 datapath/datapath.c             |   11 +-
 datapath/datapath.h             |    5 +-
 datapath/flow.c                 |   35 +-
 datapath/flow.h                 |   27 +-
 datapath/tunnel.c               |  720 ++++-----------------------------------
 datapath/tunnel.h               |   82 +----
 datapath/vport-capwap.c         |   17 +-
 datapath/vport-gre.c            |   29 +-
 datapath/vport-tunnel-realdev.c |  260 ++++++++++++++
 datapath/vport.c                |    3 +-
 datapath/vport.h                |    1 +
 include/linux/openvswitch.h     |   22 +-
 include/openvswitch/tunnel.h    |    4 +
 lib/classifier.c                |    8 +-
 lib/dpif-linux.c                |    2 +-
 lib/dpif-netdev.c               |    2 +-
 lib/flow.c                      |   30 +-
 lib/flow.h                      |   12 +-
 lib/meta-flow.c                 |    4 +-
 lib/netdev-vport.c              |  353 ++++++-------------
 lib/nx-match.c                  |    2 +-
 lib/odp-util.c                  |   70 ++--
 lib/odp-util.h                  |    5 +-
 lib/ofp-print.c                 |   11 +-
 lib/ofp-util.c                  |    4 +-
 ofproto/ofproto-dpif.c          |  348 +++++++++++++++++--
 ofproto/ofproto-provider.h      |   12 +
 ofproto/ofproto.c               |   28 ++
 ofproto/ofproto.h               |   46 +++
 tests/test-classifier.c         |    7 +-
 vswitchd/bridge.c               |  350 +++++++++++++++++++
 33 files changed, 1401 insertions(+), 1118 deletions(-)
 create mode 100644 datapath/vport-tunnel-realdev.c

-- 
1.7.10

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to