DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix GRE flow rule
@ 2018-05-23  1:51 Yongseok Koh
  2018-05-23  5:36 ` Matan Azrad
  2018-05-24 17:56 ` [dpdk-dev] [PATCH v2] " Yongseok Koh
  0 siblings, 2 replies; 9+ messages in thread
From: Yongseok Koh @ 2018-05-23  1:51 UTC (permalink / raw)
  To: shahafs, adrien.mazarguil, nelio.laranjeiro; +Cc: dev, Yongseok Koh, stable

Creating a flow having pattern from the middle of a packet is allowed. For
example,

  testpmd> flow create 0 ingress pattern vxlan vni is 20 / end actions ...

Device can parse GRE header but without proper support from library and
firmware (HAVE_IBV_DEVICE_MPLS_SUPPORT), a field in GRE header can't be
specified when creating a rule. As a result, the following rule will be
interpreted as a wildcard rule, which always matches any packet.

  testpmd> flow create 0 ingress pattern gre / end actions ...

Fixes: 96c6c65a10d2 ("net/mlx5: support GRE tunnel flow")
Fixes: 1f106da2bf7b ("net/mlx5: support MPLS-in-GRE and MPLS-in-UDP")
Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 994be05be..526fe6b0e 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -330,9 +330,11 @@ static const enum rte_flow_action_type valid_actions[] = {
 static const struct mlx5_flow_items mlx5_flow_items[] = {
 	[RTE_FLOW_ITEM_TYPE_END] = {
 		.items = ITEMS(RTE_FLOW_ITEM_TYPE_ETH,
+#ifdef HAVE_IBV_DEVICE_MPLS_SUPPORT
+			       RTE_FLOW_ITEM_TYPE_GRE,
+#endif
 			       RTE_FLOW_ITEM_TYPE_VXLAN,
-			       RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
-			       RTE_FLOW_ITEM_TYPE_GRE),
+			       RTE_FLOW_ITEM_TYPE_VXLAN_GPE),
 	},
 	[RTE_FLOW_ITEM_TYPE_ETH] = {
 		.items = ITEMS(RTE_FLOW_ITEM_TYPE_VLAN,
-- 
2.11.0

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-06-19 23:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-23  1:51 [dpdk-dev] [PATCH] net/mlx5: fix GRE flow rule Yongseok Koh
2018-05-23  5:36 ` Matan Azrad
2018-05-23 10:01   ` Yongseok Koh
2018-05-23 11:45     ` Matan Azrad
2018-05-23 18:34       ` Yongseok Koh
2018-05-23 22:55         ` Xueming(Steven) Li
2018-05-24  6:34         ` Matan Azrad
2018-05-24 17:56 ` [dpdk-dev] [PATCH v2] " Yongseok Koh
2018-06-19 23:23   ` Yongseok Koh

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).