From: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
To: dev@dpdk.org
Cc: Yongseok Koh <yskoh@mellanox.com>,
Adrien Mazarguil <adrien.mazarguil@6wind.com>,
stable@dpdk.org
Subject: [dpdk-dev] [PATCH 2/5] net/mlx5: fix flows when VXLAN tunnel is 0
Date: Tue, 31 Oct 2017 16:51:11 +0100 [thread overview]
Message-ID: <464965d321547eeccd97701ebdb9444cd0aba392.1509464921.git.nelio.laranjeiro@6wind.com> (raw)
In-Reply-To: <cover.1509464921.git.nelio.laranjeiro@6wind.com>
In-Reply-To: <cover.1509464921.git.nelio.laranjeiro@6wind.com>
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 <nelio.laranjeiro@6wind.com>
---
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;
}
--
2.11.0
next prev parent reply other threads:[~2017-10-31 15:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-31 15:51 [dpdk-dev] [PATCH 0/5] net/mlx5: fixes Nelio Laranjeiro
2017-10-31 15:51 ` [dpdk-dev] [PATCH 1/5] net/mlx5: fix parser inner value Nelio Laranjeiro
2017-10-31 23:46 ` Yongseok Koh
2017-10-31 15:51 ` Nelio Laranjeiro [this message]
2017-11-01 18:56 ` [dpdk-dev] [PATCH 2/5] net/mlx5: fix flows when VXLAN tunnel is 0 Yongseok Koh
2017-10-31 15:51 ` [dpdk-dev] [PATCH 3/5] net/mlx5: fix RSS tunneled flow without outer Nelio Laranjeiro
2017-11-01 18:56 ` Yongseok Koh
2017-10-31 15:51 ` [dpdk-dev] [PATCH 4/5] net/mlx5: fix fdir flow removal Nelio Laranjeiro
2017-11-01 0:43 ` Yongseok Koh
2017-10-31 15:51 ` [dpdk-dev] [PATCH 5/5] net/mlx5: fix flow director TCPv6 filter Nelio Laranjeiro
2017-11-01 0:43 ` Yongseok Koh
2017-11-01 21:34 ` [dpdk-dev] [PATCH 0/5] net/mlx5: fixes Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=464965d321547eeccd97701ebdb9444cd0aba392.1509464921.git.nelio.laranjeiro@6wind.com \
--to=nelio.laranjeiro@6wind.com \
--cc=adrien.mazarguil@6wind.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
--cc=yskoh@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).