From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00072.outbound.protection.outlook.com [40.107.0.72]) by dpdk.org (Postfix) with ESMTP id 61D571B5BC for ; Sun, 5 Aug 2018 08:41:01 +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=HmD1OcZzBaI2SGmBXalT1PS6MlQN8aCmg7QAFUViZcY=; b=u1vSCOf7f1lmRseLnxhtHu1kUF8ML115EBIGaZ0WN22aAZkPBVKeCK0XDkfKkK/ZaI1mcdPkBb/4vzwMSxXYG2t/YWaWtTWJoQk2nPb0qSPsd4LXZEETOuHJiMdCuABBP9TkrgpvSOy5YNI+QidbzPlINo3BtpCfBsCi/ixdsk4= Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com (52.133.41.11) by AM0PR0502MB3780.eurprd05.prod.outlook.com (52.133.47.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Sun, 5 Aug 2018 06:41:00 +0000 Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::9d98:d47f:5b50:1f49]) by AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::9d98:d47f:5b50:1f49%2]) with mapi id 15.20.1017.018; Sun, 5 Aug 2018 06:41:00 +0000 From: Matan Azrad To: Yongseok Koh , Shahaf Shuler CC: "dev@dpdk.org" , Yongseok Koh Thread-Topic: [dpdk-dev] [PATCH] net/mlx5: fix sanity check for MPLS-in-GRE Thread-Index: AQHUK3WGBne9H3/5RkW9k3fM8nxYe6Sws5jg Date: Sun, 5 Aug 2018 06:41:00 +0000 Message-ID: References: <20180803220056.22840-1-yskoh@mellanox.com> In-Reply-To: <20180803220056.22840-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; AM0PR0502MB3780; 6:Mq5RevmA2v5eNxzquYpd6WzudgDgR/bYvHIj3m6lT0wPePP4wTKPdPdBWYJwIGvLQHEk/PbGl/y5sg22EsP7UasesIB7t8BiO8twACHGh/lW1HPsb9KNSc1tTlwrN0KIptotZLTXGNEPz49EhmKurTyH/okOIRUl23AB1IkaI8/E9oZ5gbDS4/J5p9U8EDJJPIZM9XBoWEF7LP/p7I8600E2d7xhEYidbOXJIz6oRbhTbGJQOoSonzjqad72YbLVy6Y2tOC5z47LjPraV9hjAiq7la7UzYpQOF7MWgMr/y2vmoGbul59X1zg7xE5XQ4nciN6guHpOX1yAzsoSW6wiwzQmuOgfU0W1Rk7KVS2y7YXDtMtAZUOnViLkAjVq/7trNYZGW03LBEIBTybvDmE2Xl2f49bcQBYnugoTiFYrkQwxNTMO2/ehWYB9kH+t/IZYaVb8TVhs65ZXVJ3ZfK8Bg==; 5:gjveULlJUtsOso1ursiTBHTBvqwICbNXAfNYDH/5d+MdUFXLOpfiAiRX/5yZ02C8y59nIy/MzwmLlRsTsb+H+kxp5BjrWeIUNA6k4J/78XBic75vgQwPxlw6HYWPqZzWBQyM17UV4NC7805vnRgtFWZOOCDqR8bYYl9yP46sQHY=; 7:ZlBTupQw0Fp2OhHK+YLwzAKPGWKtjt8cZelGmm+IA5ZKzwg0y7FA22emJ/qBPua3t7yJnxD/SfVr5gV3qoN+3MhxwrA+lYyI+ta4iArQHq2NKsHO3szaMXmcTebYtrZFAMK26e5RqI1PkDhc10a2NWXsknJyjtx00TnE+Gd/lraljVNbl4RhpDIOQkSGbN3HOtUqQdMarGC+CjhGbcgIJjlOTUo/z8w4uZiaXRPwFePuSzRgKFNbUqj56lRfZ+Vc x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 4475a9d3-4fa5-41e5-5b5a-08d5fa9e6848 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR0502MB3780; x-ms-traffictypediagnostic: AM0PR0502MB3780: 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)(8121501046)(5005006)(3231311)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:AM0PR0502MB3780; BCL:0; PCL:0; RULEID:; SRVR:AM0PR0502MB3780; x-forefront-prvs: 0755F54DD9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(346002)(366004)(39860400002)(136003)(189003)(199004)(229853002)(25786009)(5660300001)(74316002)(7736002)(446003)(6246003)(81156014)(68736007)(54906003)(476003)(11346002)(6636002)(316002)(33656002)(66066001)(2900100001)(486006)(107886003)(110136005)(8676002)(305945005)(14454004)(81166006)(14444005)(2906002)(26005)(6506007)(256004)(102836004)(478600001)(86362001)(6436002)(8936002)(53936002)(106356001)(105586002)(55016002)(9686003)(6116002)(3846002)(76176011)(7696005)(97736004)(5250100002)(99286004)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3780; H:AM0PR0502MB4019.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: dO5Cn7tUm4i9Cl65044zWPjqOHaR2wObWDgNhwK3xFrf2BH2Urqqs32lHbMKnU4a5sM9LfFUpJObUq2eg4gZkaEELf1AYYbr71HBjmkjdQlspcr042JvfdXbBrg2t/IGdwCW0RxqtWOzxTWDDWGDw1XAB4L6HOblqd8Qj9StWVih0HHaF6TnsI1UQwXqdhTudp4b79FvxJYn8LMOFfYWp9qsYoYA32+2DsUX+56NYQdZoKK1dzgid154b0LePi9RmTRNWnVLinUEb7UMU9sBk1OqKdtvtVKsBLY6eBMpQssdn45BiCzoy2IvTbHAsswMMr98Y9UN7Gr/9bNhbIUGTUhwJp6R1epI/TGHBJeYPeU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4475a9d3-4fa5-41e5-5b5a-08d5fa9e6848 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Aug 2018 06:41:00.3401 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3780 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix sanity check for MPLS-in-GRE 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: Sun, 05 Aug 2018 06:41:01 -0000 Hi Koh From: Yongseok Koh > Multiple tunnel isn't allowed but MPLS over GRE should be accepted. >=20 > Fixes: a4a5cd21d20a ("net/mlx5: add flow MPLS item") >=20 > Signed-off-by: Yongseok Koh > --- > drivers/net/mlx5/mlx5_flow.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c = index > b7500ec9d6..ca4625b699 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -1778,7 +1778,9 @@ mlx5_flow_item_mpls(const struct rte_flow_item > *item __rte_unused, > item, > "protocol filtering not compatible" > " with MPLS layer"); > - if (flow->layers & MLX5_FLOW_LAYER_TUNNEL) > + /* Multi-tunnel isn't allowed but MPLS over GRE is an exception. */ > + if (flow->layers & MLX5_FLOW_LAYER_TUNNEL && > + (flow->layers & MLX5_FLOW_LAYER_GRE) !=3D This check is not fully correct because the GRE item must be the last valid= item before the mpls, so the next flow eth / ipv4 / gre / ipv4 / mpls is not valid. But the next flows are valid: eth / ipv4 / gre / mpls eth / ipv4 / gre / void / mpls eth / ipv4 / gre / void / void / void / mpls > MLX5_FLOW_LAYER_GRE) > return rte_flow_error_set(error, ENOTSUP, > RTE_FLOW_ERROR_TYPE_ITEM, > item, > -- > 2.11.0