This series implements support for layer 3 encapsulated packets. At the core of this change is removing the assumption that all packets/flows have Ethernet header. Support for layer 3 packets in GRE tunnels is also added by this patchset.
The implementation automatically adds appropriate pop_eth and push_eth actions to datapath flows. This may change in the future when OpenFlow support for these actions will be added, since discussions on EXT-112 in the ONF showed preference for explicitly requiring the pop_eth and push_eth actions in OpenFlow rules. This series is based on work by Lorand Jakab, Thomas Morin and others. Unlike Lorand's work this series does not update the kernel datapath nor the LISP vport implementation in the version of the kernel datapath in the OVS tree. Rather it focuses only on userspace including the user-space datapath, and provides layer 3 GRE support. It should, however, be in keeping with his goal of providing a clean path for porting the LISP datapath support to the mainline kernel for inclusion there. To aid review this series is available at: tree: https://github.com//horms/openvswitch branch: me/l3-vpn tag: l3-vpn-v10 I have prepared a separate series for the kernel datapath against the net-next tree. I plan to post it in conjunction with this patchset as: "[PATCH v9 net-next 0/7] openvswitch: support for layer 3 encapsulated packets" It may be found on github: tree: https://github.com//horms/linux branch: me/l3-vpn tag: l3-vpn-v10 Changes from v9: * Reworked GRE changes to make use of a mode rather than a new tunnel type for layer 3 * Ensure that packets sent to controller have an ethernet header * Avoid popping ethernet header multiple times resulting in a corrupted packet * Set packet_ethtype in set_ethertype() * Do not include zero-value OVS_KEY_ATTR_PACKET_ETHERTYPE attribute in flow key of layer 2 packets as this creates an unnecessary incompatibility with kernel datapaths that are unaware of that attribute. * Don't update tnl_port_map_lookup() to always match on next_base_layer: the implementation didn't actually do that and thus was a lot of code change for no behavioural change. Changes from v8: * Rebased * Addressed review of v8 (I picked most of this out of Jakubs tree on github) * Support non-IP packets * Support non-tap GRE vports Changes from v7: * Rebased * Addressed Jesse's comments: * Clean up ovs_packet_cmd_execute() * Use attributes instead of reaching into the IP header to determine L3 protocol Changes from v6: * Rebased * Patch 2: Removed MFF_ETH_SRC and MFF_ETH_DST from Ethernet prerequisites to allow setting Ethernet addresses in push_eth without knowing a priori the layer of the output port; this will be reverted when {push,pop}_eth will be explicit (see above) * Patch 3: Re-added "key->eth.tci = 0" in flow_extract(), since removal broke validation of flows * Added support for layer 3 packets in "ovs_packet" netlink messages which execute actions on a packet received in a miss upcall. Support is in two new commits, one for user space, one for the linux datapath, to make review easier. Changes from v5: * Addressed the new round of comments from Jesse * Renamed noeth to is_layer3 * Fixed is_layer3 wildcarding * Fixed style issues Changes from v4: * Addressed the new round of comments from Jesse * Rebased several times Changes from v3: * Addressed the new round of comments from Ben * Rebased several times Changes from v2: * Addressed the new round of comments from Ben * Addressed Jesse's comments * Rebased several times Changes from the initial version: * Addressed all comments from Ben's review * Fixed all failing unit tests Lorand Jakab (3): userspace: add support for pop_eth and push_eth actions userspace: add layer 3 flow and switching support userspace: add layer 3 support to packet metadata Simon Horman (2): userspace: extend layer 3 support to cover non-IP packets userspace: add non-tap (l3) support to GRE vports build-aux/extract-ofp-fields | 1 + datapath/flow_netlink.c | 2 +- datapath/linux/compat/include/linux/openvswitch.h | 16 ++ include/openvswitch/flow.h | 20 +- include/openvswitch/match.h | 1 + include/openvswitch/meta-flow.h | 9 +- include/openvswitch/ofp-print.h | 8 +- lib/dp-packet.h | 14 +- lib/dpif-netdev.c | 6 +- lib/dpif-netlink.c | 4 + lib/dpif.c | 9 +- lib/flow.c | 118 +++++++--- lib/flow.h | 5 + lib/match.c | 13 +- lib/meta-flow.c | 10 + lib/netdev-bsd.c | 2 + lib/netdev-dummy.c | 1 + lib/netdev-linux.c | 5 +- lib/netdev-vport.c | 59 ++++- lib/netdev.h | 1 + lib/nx-match.c | 2 +- lib/odp-execute.c | 29 +++ lib/odp-util.c | 253 +++++++++++++++++----- lib/odp-util.h | 7 +- lib/ofp-print.c | 27 ++- lib/ofp-util.c | 2 +- lib/packets.c | 34 +++ lib/packets.h | 6 + lib/tnl-ports.c | 62 ++++-- lib/tnl-ports.h | 2 +- ofproto/ofproto-dpif-rid.h | 2 +- ofproto/ofproto-dpif-sflow.c | 9 + ofproto/ofproto-dpif-xlate.c | 37 +++- ofproto/ofproto-dpif-xlate.h | 2 +- ofproto/ofproto-dpif.c | 2 +- ofproto/tunnel.c | 3 +- tests/ofproto-dpif.at | 6 +- tests/tunnel-push-pop-ipv6.at | 11 +- tests/tunnel-push-pop.at | 35 ++- tests/tunnel.at | 10 +- vswitchd/vswitch.xml | 13 ++ 41 files changed, 679 insertions(+), 179 deletions(-) -- 2.7.0.rc3.207.g0ac5344 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev