[ovs-dev] [PATCH ovs V3 00/25] Introducing HW offload support for openvswitch

Roi Dayan roid at mellanox.com
Wed Feb 8 15:29:13 UTC 2017


This patch series introduces rule offload functionality to dpif-netlink 
via netdev ports new flow offloading API. The user can specify whether to
enable rule offloading or not via OVS configuration. Netdev providers
are able to implement netdev flow offload API in order to offload rules.

This patch series also implements one offload scheme for netdev-linux,
using TC flower classifier, which was chosen because its sort of natural
to state OVS DP rules for this classifier. However, the code can be
extended to support other classifiers such as U32, eBPF, etc which support
offload as well.

The use-case we are currently addressing is the newly sriov switchdev mode
in the Linux kernel which was introduced in version 4.8 [1][2].
This series was tested against sriov vfs vports representors of the
Mellanox 100G ConnectX-4 series exposed by the mlx5 kernel driver.


V2->V3:
    - Code styling fixes
    - Bug fixes
    - Using already available macros/functions to match current OVS code
    - Refactored code according to V2 review
    - Replaced bool option skip-hw for string option tc-policy
    - Added hw offload tests using policy skip_hw
    - Fixed most compatability compiling issues
        - Travis
            https://travis-ci.org/roidayan/ovs/builds/199610124
        - AppVeyor
            https://ci.appveyor.com/project/roidayan/ovs/build/1.0.14
    - Fixed compiling with DPDK enabled

    TODO:
    - need to fix datapath compiling issues found in travis after adding tc
      compatability headers
    - need to fix failing test cases because of get_ifindex


V1->V2:
    - Added generic netdev flow offloads API.
    - Implemented relevant flow API in netdev-linux (and netdev-vport).
    - Added a other_config hw-offload option to enable offloading (defaults to false).
    - Fixed coding style to conform with OVS.
    - Policy removed for now. (Will be discussed how best implemented later).


Thanks,
Paul & Roi


Paul Blakey (25):
  tc: Add tc flower interface
  netdev-linux: Move some tc related functions to tc.c
  netdev: Adding a new netdev api to be used for offloading flows
  other-config: Add hw-offload switch to control netdev flow offloading
  other-config: Add tc-policy switch to control tc flower flag
  dpif: Save added ports in a port map for netdev flow api use
  dpif-netlink: Flush added ports using netdev flow api
  netdev-tc-offloads: Implement netdev flow flush using tc interface
  dpif-netlink: Dump netdevs flows on flow dump
  netdev-tc-offloads: Add ufid to tc/netdev map
  netdev-tc-offloads: Implement netdev flow dump api using tc interface
  dpif-netlink: Use netdev flow put api to insert a flow
  netdev-tc-offloads: Add flower mask to priority map
  netdev-tc-offloads: Implement netdev flow put using tc interface
  dpif-netlink: Delete a flow from netdev
  netdev-tc-offloads: Implement netdev flow del using tc interface
  dpif-netlink: Use netdev flow get api to query a flow
  netdev-tc-offloads: Implement flow get using tc interface
  netdev-linux: Disallow setting policing when configured with hw
    offload
  netdev-vport: Implement netdev vport get_ifindex on Linux
  netdev-vport: Use common offloads interface
  netdev-tc-offloads: Add ingress on netdev flow api init
  dpctl: Add an option to dump only certain kinds of flows
  tests: Add system-offloads-testsuite
  compat: Add tc compatibility headers for old kernels

 acinclude.m4                         |   26 +
 configure.ac                         |    1 +
 include/automake.mk                  |    1 +
 include/linux/automake.mk            |    4 +
 include/linux/pkt_cls.h              |  579 ++++++++++++++++++
 include/linux/tc_act/tc_tunnel_key.h |   48 ++
 include/linux/tc_act/tc_vlan.h       |   44 ++
 lib/automake.mk                      |    4 +
 lib/dpctl.c                          |   21 +-
 lib/dpif-netdev.c                    |    3 +-
 lib/dpif-netlink.c                   |  484 ++++++++++++++-
 lib/dpif-provider.h                  |    6 +-
 lib/dpif.c                           |   29 +-
 lib/dpif.h                           |    5 +-
 lib/netdev-bsd.c                     |    2 +
 lib/netdev-dpdk.c                    |    1 +
 lib/netdev-dummy.c                   |    2 +
 lib/netdev-linux.c                   |  194 ++----
 lib/netdev-linux.h                   |   11 +
 lib/netdev-provider.h                |   53 ++
 lib/netdev-tc-offloads.c             |  820 ++++++++++++++++++++++++++
 lib/netdev-tc-offloads.h             |   42 ++
 lib/netdev-vport.c                   |   50 +-
 lib/netdev.c                         |  326 ++++++++++
 lib/netdev.h                         |   40 ++
 lib/odp-util.c                       |   53 ++
 lib/odp-util.h                       |    3 +
 lib/tc.c                             | 1076 ++++++++++++++++++++++++++++++++++
 lib/tc.h                             |  120 ++++
 ofproto/ofproto-dpif-upcall.c        |    3 +-
 ofproto/ofproto-dpif.c               |    2 +-
 tests/.gitignore                     |    1 +
 tests/automake.mk                    |   16 +
 tests/ofproto-macros.at              |    6 +-
 tests/system-offloaded-traffic.at    |   67 +++
 tests/system-offloads-testsuite.at   |   25 +
 vswitchd/bridge.c                    |    1 +
 vswitchd/vswitch.xml                 |   28 +
 38 files changed, 4019 insertions(+), 178 deletions(-)
 create mode 100644 include/linux/automake.mk
 create mode 100644 include/linux/pkt_cls.h
 create mode 100644 include/linux/tc_act/tc_tunnel_key.h
 create mode 100644 include/linux/tc_act/tc_vlan.h
 create mode 100644 lib/netdev-tc-offloads.c
 create mode 100644 lib/netdev-tc-offloads.h
 create mode 100644 lib/tc.c
 create mode 100644 lib/tc.h
 create mode 100644 tests/system-offloaded-traffic.at
 create mode 100644 tests/system-offloads-testsuite.at

-- 
2.7.4



More information about the dev mailing list