From patchwork Mon Jan 20 15:08:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Britstein X-Patchwork-Id: 1226023 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=mellanox.com Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 481ZpG3rrWz9sRk for ; Tue, 21 Jan 2020 02:09:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 08A6885B0C; Mon, 20 Jan 2020 15:09:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yBpu2AF8xev3; Mon, 20 Jan 2020 15:09:34 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1A823859C1; Mon, 20 Jan 2020 15:09:04 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 094B4C1D85; Mon, 20 Jan 2020 15:09:04 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id A0500C0174 for ; Mon, 20 Jan 2020 15:08:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8E0B6857D8 for ; Mon, 20 Jan 2020 15:08:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kQIyGFk5aqZo for ; Mon, 20 Jan 2020 15:08:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by fraxinus.osuosl.org (Postfix) with ESMTP id 17432857B0 for ; Mon, 20 Jan 2020 15:08:49 +0000 (UTC) Received: from Internal Mail-Server by MTLPINE1 (envelope-from elibr@mellanox.com) with ESMTPS (AES256-SHA encrypted); 20 Jan 2020 17:08:43 +0200 Received: from dev-r-vrt-215.mtr.labs.mlnx. (dev-r-vrt-215.mtr.labs.mlnx [10.212.215.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 00KF8hUo013116; Mon, 20 Jan 2020 17:08:43 +0200 From: Eli Britstein To: dev@openvswitch.org, Ilya Maximets Date: Mon, 20 Jan 2020 15:08:05 +0000 Message-Id: <20200120150830.16262-1-elibr@mellanox.com> X-Mailer: git-send-email 2.14.5 Cc: Simon Horman , Eli Britstein , Ameer Mahagneh Subject: [ovs-dev] [PATCH 00/25] netdev datapath vxlan offload X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" In the netdev datapath, packets arriving over a tunnel are processed by more than one flow. For example a packet that should be decapsulated and forwarded to another port is processed by two flows: 1. in_port=, outer-header matches, dst-port=4789 (VXLAN), actions:tnl_pop(vxlan_sys_4789). 2. in_port=vxlan_sys_4789, tunnel matches (VNI for example), inner-header matches, actions: vm1. In order to offload such a multi-flow processing path, a multi-table HW model is used. Flow #1 matches are offloaded as is, but tnl_pop is translated to MARK and JUMP to a tnl-port table actions. Flow #2 is offloaded to that tnl-port table, its tunnel matches are translated to outer-header matches, followed by the inner-header ones. The actions start with an implicit DECAP action followed by the flow's actions. The DECAP is done in flow #2. If it was done in flow #1, the outer headers of the packets would have been lost, and they could not have been matched in flow #2. Furthermore, once the HW processing path is composed of a multi table processing, there is a need to handle a case where the processing starts in HW, but is not completed in HW. For example, only flow #1 is offloaded while flow #2 doesn't exist. For that, the MARK value set in the tnl_pop action is received in SW, the packet is recovered by the mapped vport, and processing continues in SW. As vports are virtual and cannot have rte_flows, offloading a vport generates rte_flows for every PF in the system, as we cannot know from which one the packets arrive from. This series adds support for IPv6, tunnel push actions, and the multi-table model for the decap processing. v1 Travis passed: https://travis-ci.org/elibritstein/OVS/builds/639484233 Eli Britstein (14): dpif-netdev: Add mega ufid in flow add log netdev-offload-dpdk: Remove pre-validate of patterns function netdev-offload-dpdk: Add IPv6 pattern matching netdev-offload-dpdk: Support offload of clone tnl_push/output actions netdev-offload-dpdk: Support tnl/push using vxlan encap attribute netdev-offload: Don't use zero flow mark netdev-offload-dpdk: Introduce map APIs for table id and miss context netdev-offload-dpdk: Implement HW miss packet recover for vport netdev-offload-dpdk: Refactor disassociate ufid function netdev-offload-dpdk: Support tunnel pop action netdev-offload-dpdk: Implement flow dump create/destroy APIs netdev-dpdk: Getter function for dpdk devargs API netdev-dpdk: Introduce get netdev by devargs function netdev-dpdk-offload: Add vxlan pattern matching function Ilya Maximets (4): netdev: Allow storing dpif type into netdev structure. netdev-offload: Use dpif type instead of class. netdev-offload: Allow offloading to netdev without ifindex. netdev-offload: Disallow offloading to unrelated tunneling vports. Ophir Munk (6): dpif-netdev: Make mark allocation public API dpif-netdev: Add HW miss packet state recover logic netdev-dpdk: Introduce an API to query if a dpdk port is an uplink port netdev-dpdk-offload: Infrastructure for multiple rte_flows per UFID netdev-dpdk: Add flow_api support for netdev vxlan vports netdev-offload-dpdk: Support offload for vxlan vport Oz Shlomo (1): netdev-offload: Add HW miss packet state recover API Documentation/howto/dpdk.rst | 5 +- NEWS | 6 +- lib/dpif-netdev.c | 70 +-- lib/dpif-netlink.c | 23 +- lib/dpif.c | 21 +- lib/netdev-dpdk.c | 68 +++ lib/netdev-dpdk.h | 6 + lib/netdev-offload-dpdk.c | 1275 +++++++++++++++++++++++++++++++++++------ lib/netdev-offload-provider.h | 6 + lib/netdev-offload-tc.c | 11 +- lib/netdev-offload.c | 115 ++-- lib/netdev-offload.h | 23 +- lib/netdev-provider.h | 3 +- lib/netdev.c | 16 + lib/netdev.h | 2 + ofproto/ofproto-dpif-upcall.c | 5 +- tests/dpif-netdev.at | 14 +- tests/ofproto-macros.at | 3 +- 18 files changed, 1394 insertions(+), 278 deletions(-)