From patchwork Fri Aug 31 09:57:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrien Mazarguil X-Patchwork-Id: 44080 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1F7212C55; Fri, 31 Aug 2018 11:57:44 +0200 (CEST) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 65D452BA3 for ; Fri, 31 Aug 2018 11:57:42 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id y2-v6so4651050wma.1 for ; Fri, 31 Aug 2018 02:57:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=yYMDfXlHRUxIh+hzXDEsiMz5akPSO37Mdkhdr/AEwWw=; b=pZmIOCXylCt6XrOxaRo1nPatyt3/1J+iMEnKq7POYiz06TlVO44LRdy9TPHneXxYUN aBIm7jcU2j3n5fWQjOJTvRiqCV41y39M1MG8Pb47+DWqIGngz9j9z+4AawBOgtA2FnsI qmbMvHJ6n96XWdruFUXRngoVzbGGHOJ1C9M5jxipTnEgNOMNDtgsNmaskK1qv5kC9b7L m9Sm1tSFNFlu6ErWaGu5dG3YG3VM/TOXgn73YBd+O0JYZbaUPNBELwXRMMz6MyPr0IIX vdhcec9iTXHD5vTAzfy76I5helMCaIVLD3nCNaXSb8AkbkFFX7+3yeiaco1TpnIbyLdi TMrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=yYMDfXlHRUxIh+hzXDEsiMz5akPSO37Mdkhdr/AEwWw=; b=i5fe0/yvygAJQqgZciHEiLqSnZI9RQyTjGhIXa9yj2Ps8P/8o2lRw43bxGHsTsROAb aVDbXNbtx+wLV9JyUelBpxjWhlEu/e2TEsigkQ2DhNolbPeTecNlZoAp9zJF1OAA7/np 4Cg26fFUc1+DE4dKkTGHwNtz8aLF4F8Aljpy6cam/aimXoTlK9PNIEoK9X9z9v3aEdhN geUeBwRihUZJNPz3FhsMDH6tV56O8aZ+qcJVjLA6V9JR2Mrf8G9G85m7L997r0zkKkRr SB5q2ngaUkY0+CWo8/xcCQ3XR76ajkwnQCHanWCbauq53o6mXOcd+WGdFRqb+16pHNLG D+3g== X-Gm-Message-State: APzg51DRENrpMPf99yNDjlY5kBvQWYFi1uGfDdVy+0DFOGlFoEya4XE9 MVhiXUz+QtUdO2HjTXWDeiHYOA== X-Google-Smtp-Source: ANB0VdbU2CZUXc5ct4XJahShjsLqBBfJN6Un413F+YzWkpbEGtb7L2ezJ9uPCyDay+cVR/VGhya11Q== X-Received: by 2002:a1c:888e:: with SMTP id k136-v6mr4448436wmd.6.1535709462208; Fri, 31 Aug 2018 02:57:42 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id s131-v6sm5115453wmf.2.2018.08.31.02.57.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 02:57:41 -0700 (PDT) Date: Fri, 31 Aug 2018 11:57:25 +0200 From: Adrien Mazarguil To: Shahaf Shuler , Yongseok Koh , Slava Ovsiienko Cc: dev@dpdk.org Message-ID: <20180831092038.23051-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH 0/8] net/mlx5: add switch offload for VXLAN encap/decap X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This series adds support for RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP and RTE_FLOW_ACTION_TYPE_VXLAN_DECAP to mlx5. Since these actions are supported at the switch level, the "transfer" attribute must be set on such flow rules. They must also be combined with a port redirection action to make sense. A typical use case is port representors in switchdev mode, with VXLAN traffic encapsulation performed on traffic coming *from* a representor and decapsulation on traffic going *to* that representor, in order to transparently assign a given VXLAN to VF traffic. Since only ingress is supported, encapsulation flow rules are normally applied on a physical port and emit traffic to a port representor. The opposite order is used for decapsulation. Like other mlx5 switch flow rule actions, these are implemented through Linux's TC flower API. Since the Linux interface for VXLAN encap/decap involves virtual network devices (i.e. ip link add type vxlan [...]), the PMD automatically spawns them on a needed basis through Netlink calls. The added complexity necessarily results in a rather convoluted PMD implementation. This series relies on "ethdev: add flow API object converter" [1] which should applied first since testpmd does not provide a means to test VXLAN encap otherwise. [1] https://patches.dpdk.org/project/dpdk/list/?series=1123 Adrien Mazarguil (8): net/mlx5: speed up interface index retrieval for flow rules net/mlx5: clean up redundant interface name getters net/mlx5: rename internal function net/mlx5: enhance TC flow rule send/ack function net/mlx5: prepare switch flow rule parser for encap offloads net/mlx5: add convenience macros to switch flow rule engine net/mlx5: add VXLAN encap support to switch flow rules net/mlx5: add VXLAN decap support to switch flow rules drivers/net/mlx5/Makefile | 75 ++ drivers/net/mlx5/mlx5.c | 74 +- drivers/net/mlx5/mlx5.h | 28 +- drivers/net/mlx5/mlx5_ethdev.c | 188 ++-- drivers/net/mlx5/mlx5_flow.c | 16 +- drivers/net/mlx5/mlx5_nl.c | 9 +- drivers/net/mlx5/mlx5_nl_flow.c | 1763 ++++++++++++++++++++++++++++++++-- 7 files changed, 1871 insertions(+), 282 deletions(-)