From patchwork Tue Oct 31 15:51:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?N=C3=A9lio_Laranjeiro?= X-Patchwork-Id: 31056 X-Patchwork-Delegate: ferruh.yigit@amd.com 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 C0B031B23A; Tue, 31 Oct 2017 16:51:30 +0100 (CET) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 165E81B22D for ; Tue, 31 Oct 2017 16:51:26 +0100 (CET) Received: by mail-wm0-f65.google.com with SMTP id t139so24238312wmt.1 for ; Tue, 31 Oct 2017 08:51:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=CUauH5sj7KmEU4pzufnmefiayznZX3qpZdlRCDvU8hg=; b=SS5V5OcMcD7frBjpxar/AVZN2WVlw2+wMp1ZAHrdny7tDBJDmunUkXmuFkDZTFlQuc gWKWhFhy77LMBfiEJ72uTuETG6lYwpwptChTSXHXwrSglPA2t5OZ/7h9nlFHxIYyP91n GYIgcBkhjvamH4XMn/U7s+KIBmbth8hzVeZcEtkdg0/TLDDiwniLA7eBXmsKCTwkOA+U +9tK/a2KOJvT244tN/6/C73byLYalE2gor9sXZ3TWIeIKCHU9CgKQb1rXx+dsRhFsUst kXjjNa250/eJozj6OoZgBfUVyD02VX46rdejUPpVJgtyNZGjzcHMqwcJsSbe2nbvIaGa 7F2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=CUauH5sj7KmEU4pzufnmefiayznZX3qpZdlRCDvU8hg=; b=N2zIm/KLgxn+uQITBjJ9xDrM7s9ysUYgBU7RpUyZWW6DW1QyR+YEuS9LJMCvm4A2g7 qpH5eaEIrJnTaJdsrtOCZYK1j51gaRD1Yts77P3rryNJdQSME1A6glQXM7kYUva8Yw28 SjFPlJXpryOaMefm9fYoHI7VZMGJLFSO4bqLkQf1k5DBsEJnGZXImnIWRt9RQcjYNmfC 1I0cpPWYDZQhxaJRQppjz1fYJW1/ZxN26iA2ioPWzq1cRdP4C4yRsmjCjdZKrvoGmfKl d82suQ+b2lUBv3OKowT3H97fK0S6e02zBJHTGhPp86m+VrEe8ykym1EpB3gYw7WIGMgB Tqfg== X-Gm-Message-State: AMCzsaXBggsoyiTG4lpNp5MbJHztMauzFyp/rjEw+vVaX6aG+tnGFWy8 Eu0l0V7bG+bCYRkfVs/ggNH0LRfG8g== X-Google-Smtp-Source: ABhQp+TpwHMN/tGC5dYm8B1EYbLzmdGVczc++ytbhcqOYl+8nr2l1y8jjzZKHOgyDTTEqHSG/euZYw== X-Received: by 10.80.188.18 with SMTP id j18mr3483142edh.189.1509465085599; Tue, 31 Oct 2017 08:51:25 -0700 (PDT) Received: from laranjeiro-vm.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 33sm1709003edt.75.2017.10.31.08.51.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Oct 2017 08:51:25 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Cc: Yongseok Koh , Adrien Mazarguil , stable@dpdk.org Date: Tue, 31 Oct 2017 16:51:11 +0100 Message-Id: <464965d321547eeccd97701ebdb9444cd0aba392.1509464921.git.nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH 2/5] net/mlx5: fix flows when VXLAN tunnel is 0 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" Fix a strange behavior from the NIC, when the flow starts with a VXLAN layer with a VNI equals to zero all the traffic will match within this rule. Fixes: 2e709b6aa0f5 ("net/mlx5: support VXLAN flow item") Cc: stable@dpdk.org Signed-off-by: Nelio Laranjeiro Acked-by: Yongseok Koh --- doc/guides/nics/mlx5.rst | 2 ++ drivers/net/mlx5/mlx5_flow.c | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst index cdb880a4c..19da9f1ed 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst @@ -129,6 +129,8 @@ Limitations is set to multi-packet send or Enhanced multi-packet send. Otherwise it must have less than 50 segments. - Count action for RTE flow is only supported in Mellanox OFED 4.2. +- Flows with a VXLAN Network Identifier equal (or ends to be equal) + to 0 are not supported. Configuration ------------- diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 68cc8bff5..a7864871c 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1158,7 +1158,7 @@ priv_flow_convert(struct priv *priv, cur_item->mask), parser); if (ret) { - rte_flow_error_set(error, ENOTSUP, + rte_flow_error_set(error, ret, RTE_FLOW_ERROR_TYPE_ITEM, items, "item not supported"); goto exit_free; @@ -1605,6 +1605,16 @@ mlx5_flow_create_vxlan(const struct rte_flow_item *item, /* Remove unwanted bits from values. */ vxlan.val.tunnel_id &= vxlan.mask.tunnel_id; } + /* + * Tunnel id 0 is equivalent as not adding a VXLAN layer, if only this + * layer is defined in the Verbs specification it is interpreted as + * wildcard and all packets will match this rule, if it follows a full + * stack layer (ex: eth / ipv4 / udp), all packets matching the layers + * before will also match this rule. + * To avoid such situation, VNI 0 is currently refused. + */ + if (!vxlan.val.tunnel_id) + return EINVAL; mlx5_flow_create_copy(parser, &vxlan, size); return 0; }