From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0066.outbound.protection.outlook.com [104.47.1.66]) by dpdk.org (Postfix) with ESMTP id 8D23D1D7; Wed, 23 May 2018 07:36:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wtJ5jDMKAVi1beRfdj65GU96lAblumOP4oZTmkgiTzE=; b=EeZtdd5hk+S8AY6ya/oFsLSIQCi24qdxqJGky3rL5keYC7dHK+JNyPuU0hq7NXw9IQ4oYu+C/t2b4OlvDXe7YqxBz1AvOGvnf/DAzQSMAjFV6dCDtkbtY6TUzpW842LzUj5629j2qeX/nUYaagQdxQiTDx8IBMN21YYanoqWjBA= Received: from VI1PR0501MB2608.eurprd05.prod.outlook.com (10.168.137.20) by VI1PR0501MB2125.eurprd05.prod.outlook.com (10.167.196.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.776.11; Wed, 23 May 2018 05:36:43 +0000 Received: from VI1PR0501MB2608.eurprd05.prod.outlook.com ([fe80::1035:58f9:b94c:2180]) by VI1PR0501MB2608.eurprd05.prod.outlook.com ([fe80::1035:58f9:b94c:2180%18]) with mapi id 15.20.0776.015; Wed, 23 May 2018 05:36:43 +0000 From: Matan Azrad To: Yongseok Koh , Shahaf Shuler , Adrien Mazarguil , =?iso-8859-1?Q?N=E9lio_Laranjeiro?= CC: "dev@dpdk.org" , Yongseok Koh , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/mlx5: fix GRE flow rule Thread-Index: AQHT8ji4UdW7+yaJAE27AdV43Ftbk6Q8wtFA Date: Wed, 23 May 2018 05:36:43 +0000 Message-ID: References: <20180523015157.35716-1-yskoh@mellanox.com> In-Reply-To: <20180523015157.35716-1-yskoh@mellanox.com> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0501MB2125; 7:PGEcjpxRrxeJk64SKk9Y3yGKuOTgY2vB8NXRZGE8b+aBFWxnDq2cCbKmKxNt156vaZJMu/XyxU/j+S4DdSrzt+i8yN5+rTi28GNucMM9lKRKoUdNLw6jLJg4pvdCpyxY4JIxG2HS8VvZkZG+j++qaGLXT66f9S9r7JK8b0i03ZTeMAqRW2XwpS0fsQq4DNKBbSgKB3hiy2Zec1fA8JzcIZ+vQowCIgMGa2pBiS+HD2W6kLVf9pqE6PoK+pwpQd4G x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:VI1PR0501MB2125; x-ms-traffictypediagnostic: VI1PR0501MB2125: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231254)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:VI1PR0501MB2125; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2125; x-forefront-prvs: 06818431B9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(366004)(346002)(396003)(39380400002)(51444003)(189003)(199004)(102836004)(105586002)(53936002)(6436002)(446003)(106356001)(3660700001)(6246003)(478600001)(3280700002)(4326008)(6506007)(26005)(229853002)(316002)(2900100001)(33656002)(55016002)(5250100002)(99286004)(68736007)(81166006)(81156014)(8676002)(305945005)(54906003)(8936002)(66066001)(76176011)(86362001)(3846002)(575784001)(14454004)(74316002)(476003)(7696005)(486006)(6116002)(2906002)(11346002)(110136005)(25786009)(97736004)(7736002)(5660300001)(9686003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2125; H:VI1PR0501MB2608.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: ttH9PD8oVdhRsD41bg23ohjxCm1fyMWV7dG4IN4peIdPhtbtZa/8pRaMs1Fko22xiuWtLXp0A3BwqIYhc1vx38EDFVIoA8SxpGSEnSZfrWz13MpEx7zF3NkUIchxFcYD0RblPHlswFJioNUcGjvebweI5kUCRiQwlJbRWz23QcV9AQwWIg86Bm0NyVlFOnRP spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: eb770a0e-d946-4325-229c-08d5c06f2ae5 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: eb770a0e-d946-4325-229c-08d5c06f2ae5 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 May 2018 05:36:43.5886 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2125 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix GRE flow rule 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: , X-List-Received-Date: Wed, 23 May 2018 05:36:46 -0000 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,