From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matan Azrad Subject: Re: [PATCH] net/mlx5: fix GRE flow rule Date: Wed, 23 May 2018 05:36:43 +0000 Message-ID: References: <20180523015157.35716-1-yskoh@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , Yongseok Koh , "stable@dpdk.org" To: Yongseok Koh , Shahaf Shuler , Adrien Mazarguil , =?iso-8859-1?Q?N=E9lio_Laranjeiro?= Return-path: In-Reply-To: <20180523015157.35716-1-yskoh@mellanox.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Yongseok From: Yongseok Koh > Creating a flow having pattern from the middle of a packet is allowed. Fo= r > example, >=20 > testpmd> flow create 0 ingress pattern vxlan vni is 20 / end actions ..= . >=20 > 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. >=20 > 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 >=20 > Signed-off-by: Yongseok Koh > --- > drivers/net/mlx5/mlx5_flow.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > 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[] =3D { static const struct mlx5_flow_items mlx5_flow_item= s[] =3D { > [RTE_FLOW_ITEM_TYPE_END] =3D { > .items =3D ITEMS(RTE_FLOW_ITEM_TYPE_ETH, > +#ifdef HAVE_IBV_DEVICE_MPLS_SUPPORT The GRE item was here even before the MPLSoGRE support so I think that this= is not the correct fix and even that it can hurt the support of GRE for th= e current customers use it. Looks like you must specify at least 1 spec in the GRE to apply it correctl= y as you did for VXLAN, Can you try empty vxlan and fully gre (with protocol field)? > + 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] =3D { > .items =3D ITEMS(RTE_FLOW_ITEM_TYPE_VLAN,