Message ID | 20180713092910.26276-1-adrien.mazarguil@6wind.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> 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 827B42F4F; Fri, 13 Jul 2018 11:40:53 +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 C793D2BFA for <dev@dpdk.org>; Fri, 13 Jul 2018 11:40:52 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id s9-v6so869555wmh.3 for <dev@dpdk.org>; Fri, 13 Jul 2018 02:40:52 -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:references:mime-version :content-disposition:in-reply-to; bh=ZCrDcYYHpVXorjSoNz1WGWRX4qGYVF1LAOHCur08Wb4=; b=DjfaRDVbTAcjft9huMMhG1lOzcANDWkWX1ifMf3xop0tH9A3ed6KGy8r8g89tlV9+r HpuuS4Yp1+iHVTsXdPzmusKChRACZ0OnEdYyrTIi8UjRwfhy2NVeLiAyOemHmkdXQxI7 L9G18AdIsBPzV2SNEuE32mbbnhL0+xjdMrV6MFThIhiYaUOZ/ylchHE0uzYTdbN2ue4J HF4p48AGZ1k7XZ2kyDdQjmdV9prHoJsUTJ/rnh8saWefciTmfIQSm3/CVuhN7YEC7Wap rRP+piUf/6lwmTsq9qKgCboEi0+DH9ogyeJGmWaiMl4uIuYjPLl/+3bw0BbvKqNddexv fKBw== 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:references :mime-version:content-disposition:in-reply-to; bh=ZCrDcYYHpVXorjSoNz1WGWRX4qGYVF1LAOHCur08Wb4=; b=OLKHzlAZQI/+0blzulO7tAk4XDbWk6IGZq5hkBmXakq8+R+56EpO8flJaNkU/H6KBq Jg8erWkG9QO+vGYo8hviz+CQdvuq74N0Tqh8AmxW1xmyXgSl9gmIpJbfAyXLCPpTRXIN gRnRo5dt3kf/TQ8SrCfVFKIAYJ4xrBAs+6CzaKdFm70F5vb9+fqwzHogZY6gbCuq9teN N9NanTGV0rXvkzcHKpKAJPB7s+q0yNDsbglaY8kMKu0wzBgXeCc4DnPZCMsLov/iUiqS WLPXPPWyIsG75i3SDik3LbkftC3mU4jXYP7DA2oDo6uonftEWOQzmz1KhmRZrZJcTD6R RBoA== X-Gm-Message-State: AOUpUlGYdPhJ7DIhylZlKvCXNaFUxrjItiLqtFYUajMhNYioOxylhckx z5rCGrm35W7549gnu0Gu5/FuuA== X-Google-Smtp-Source: AAOMgpfsDZeYYmEY0Y2LMFHPScDMHaOprIwVmF5dJC/F6dcbBocfph9zJkAauJHi8ns0M9eL63Funw== X-Received: by 2002:a1c:180e:: with SMTP id 14-v6mr3570131wmy.120.1531474852566; Fri, 13 Jul 2018 02:40:52 -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 i125-v6sm3188340wmd.11.2018.07.13.02.40.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jul 2018 02:40:51 -0700 (PDT) Date: Fri, 13 Jul 2018 11:40:35 +0200 From: Adrien Mazarguil <adrien.mazarguil@6wind.com> To: Shahaf Shuler <shahafs@mellanox.com> Cc: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>, Yongseok Koh <yskoh@mellanox.com>, dev@dpdk.org Message-ID: <20180713092910.26276-1-adrien.mazarguil@6wind.com> References: <20180627173355.4718-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180627173355.4718-1-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH v2 0/6] net/mlx5: add support for switch flow rules X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series |
net/mlx5: add support for switch flow rules
|
|
Message
Adrien Mazarguil
July 13, 2018, 9:40 a.m. UTC
This series adds support for switch flow rules, that is, rte_flow rules applied to mlx5 devices at the switch level. It allows applications to offload traffic redirection between DPDK ports in hardware, while optionally modifying it (e.g. performing encap/decap). For this to work, involved DPDK ports must be part of the same switch domain, as is the case with port representors, and the transfer attribute must be requested on flow rules. Also since the mlx5 switch is controlled through Netlink instead of Verbs, and given how tedious formatting Netlink messages is, a new dependency is added to mlx5: libmnl. See relevant patch. v2 changes: - Mostly compilation fixes for missing Netlink definitions on older systems. - Reduced stack consumption. - Adapted series to rely on mlx5_dev_to_port_id() instead of mlx5_dev_to_domain_id(). - See relevant patches for more information. Adrien Mazarguil (6): net/mlx5: lay groundwork for switch offloads net/mlx5: add framework for switch flow rules net/mlx5: add fate actions to switch flow rules net/mlx5: add L2-L4 pattern items to switch flow rules net/mlx5: add VLAN item and actions to switch flow rules net/mlx5: add port ID pattern item to switch flow rules drivers/net/mlx5/Makefile | 142 ++++ drivers/net/mlx5/mlx5.c | 32 + drivers/net/mlx5/mlx5.h | 28 + drivers/net/mlx5/mlx5_flow.c | 111 +++ drivers/net/mlx5/mlx5_nl_flow.c | 1247 ++++++++++++++++++++++++++++++++++ mk/rte.app.mk | 2 +- 6 files changed, 1561 insertions(+), 1 deletion(-) create mode 100644 drivers/net/mlx5/mlx5_nl_flow.c
Comments
Hi Adrien, Friday, July 13, 2018 12:41 PM, Adrien Mazarguil: > Subject: [PATCH v2 0/6] net/mlx5: add support for switch flow rules > > This series adds support for switch flow rules, that is, rte_flow rules applied > to mlx5 devices at the switch level. > > It allows applications to offload traffic redirection between DPDK ports in > hardware, while optionally modifying it (e.g. performing encap/decap). > > For this to work, involved DPDK ports must be part of the same switch > domain, as is the case with port representors, and the transfer attribute > must be requested on flow rules. > > Also since the mlx5 switch is controlled through Netlink instead of Verbs, and > given how tedious formatting Netlink messages is, a new dependency is > added to mlx5: libmnl. See relevant patch. There are some checkpatch[1] warning, but those are safe to ignore. Adrien, one thing which is missing is a documentation update for mlx5 doc on the new dependency of libmnl. Just like rdma-core: how to get it, how to install it, version required.. I won't postpone the series acceptance due to this (since I want to avoid big changes after the rc2), but we must have such doc before 18.08 release. Series applied to next-net-mlx, thanks! [1] ### net/mlx5: add framework for switch flow rules ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses #307: FILE: drivers/net/mlx5/mlx5_nl_flow.c:60: +#define PATTERN_COMMON \ + ITEM_VOID, ACTIONS ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses #309: FILE: drivers/net/mlx5/mlx5_nl_flow.c:62: +#define ACTIONS_COMMON \ + ACTION_VOID, END total: 2 errors, 0 warnings, 0 checks, 537 lines checked ### net/mlx5: add fate actions to switch flow rules ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses #55: FILE: drivers/net/mlx5/mlx5_nl_flow.c:68: +#define ACTIONS_FATE \ + ACTION_PORT_ID, ACTION_DROP ERROR:ASSIGN_IN_IF: do not use assignment in if condition #136: FILE: drivers/net/mlx5/mlx5_nl_flow.c:277: + if (!mnl_attr_put_check(buf, size, TCA_MIRRED_PARMS, ERROR:ASSIGN_IN_IF: do not use assignment in if condition #159: FILE: drivers/net/mlx5/mlx5_nl_flow.c:300: + if (!mnl_attr_put_check(buf, size, TCA_GACT_PARMS, total: 3 errors, 0 warnings, 0 checks, 134 lines checked ### net/mlx5: add VLAN item and actions to switch flow rules ERROR:ASSIGN_IN_IF: do not use assignment in if condition #367: FILE: drivers/net/mlx5/mlx5_nl_flow.c:930: + if (!mnl_attr_put_check(buf, size, TCA_VLAN_PARMS, total: 1 errors, 0 warnings, 0 checks, 358 lines checked > > v2 changes: > > - Mostly compilation fixes for missing Netlink definitions on older systems. > - Reduced stack consumption. > - Adapted series to rely on mlx5_dev_to_port_id() instead of > mlx5_dev_to_domain_id(). > - See relevant patches for more information. > > Adrien Mazarguil (6): > net/mlx5: lay groundwork for switch offloads > net/mlx5: add framework for switch flow rules > net/mlx5: add fate actions to switch flow rules > net/mlx5: add L2-L4 pattern items to switch flow rules > net/mlx5: add VLAN item and actions to switch flow rules > net/mlx5: add port ID pattern item to switch flow rules > > drivers/net/mlx5/Makefile | 142 ++++ > drivers/net/mlx5/mlx5.c | 32 + > drivers/net/mlx5/mlx5.h | 28 + > drivers/net/mlx5/mlx5_flow.c | 111 +++ > drivers/net/mlx5/mlx5_nl_flow.c | 1247 > ++++++++++++++++++++++++++++++++++ > mk/rte.app.mk | 2 +- > 6 files changed, 1561 insertions(+), 1 deletion(-) create mode 100644 > drivers/net/mlx5/mlx5_nl_flow.c > > -- > 2.11.0