From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140048.outbound.protection.outlook.com [40.107.14.48]) by dpdk.org (Postfix) with ESMTP id 129B5201 for ; Mon, 12 Nov 2018 10:52:42 +0100 (CET) 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=e6JQFjtcKfmNOh3Tf3c40e5QUdqPww24AgJtVq4/9qI=; b=AmaMwtIY90i1eluJtJGa5j60bF8/gZQ5deVynHYIy3NPUDalenyLSQbLEu7JgGeMz/qedc/9hFcE7uoYCPI5YPlsLogsjJ3dkyKsJBjBiHqHSpUnvdFVSjDkUtt2XFk5Ezj3uBmFTODRRtNLewtDK6FQ+ptEPtzwibeVhEfeILM= Received: from AM4PR05MB3425.eurprd05.prod.outlook.com (10.171.187.142) by AM4PR05MB3297.eurprd05.prod.outlook.com (10.171.186.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.38; Mon, 12 Nov 2018 09:52:41 +0000 Received: from AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::61ec:ffec:5ebf:7bd6]) by AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::61ec:ffec:5ebf:7bd6%3]) with mapi id 15.20.1294.044; Mon, 12 Nov 2018 09:52:40 +0000 From: Ori Kam To: Dekel Peled , Yongseok Koh , Shahaf Shuler CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/mlx5: fix MPLS item validation Thread-Index: AQHUemkbQDyUGfNtGE2ILs6vREFx+6VL5OqA Date: Mon, 12 Nov 2018 09:52:40 +0000 Message-ID: References: <1542014408-12853-1-git-send-email-dekelp@mellanox.com> In-Reply-To: <1542014408-12853-1-git-send-email-dekelp@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=orika@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR05MB3297; 6:Uu6ECM9jCdHaEhhh5g/144Jg0oyZU05m3dPxbL10eribhWCVOwpPqHbyamuBe6jkh5pL0dDAl3a31rsvNv8hoRWi93VMinv9/Xo92/YsHUHrJvS6dQwufGvyRYs3NNjGdbNVZ1dVtlricaW67QLcl+mvWAbC2a486n6+oIS8JAbNePUv5GqNH7u75Omr5gfYQEvWgP50Xl+/DJdNAcQHDdOKLEwHPbBCjWiba8CW6pbMXv+gQgrxuYt8k3zmvz3Mrq2Ril6DHfO0NI+C8zNawYZrbYjW19UCeZBS/xP7qnW3G0COpxMVT04O0z0W3wWxq1DVIW+VaiadhsWbv1m5bMf5dpt3nbb0l8auGXaFOgZ7YS9iyRGwMeMVrbuZppUFPCZo+UkxQMFJa9hdu+LGLgwO2MJA9qzVMVnlyJjMIuDkrsk1MoxL8bmP8EHjJtkUYtCH+QGmAEF3JuBnoKCS4g==; 5:yZw8jvNVDA3Q14hRhs/2OWj/HOzsSezDZDeQigaMJMQk3ecS9xt8T2UjPHqMJQE/X360agtsl4lkXf6239YjXhnFugQGB7Kh5Q3HZYW8JzUnpOrAp9Cz9GEIzImKH+MJVswtync7bkNhsY9sK2pUxSpkMaImBmxPhtyz6odEdM4=; 7:1N6xJ3lbXs7HA/rqkrz+n8nxNJvfVBf57YVdsRMGdt6lCzmhiw8pH/0eCKYcJz3MSzZp9HW18G6nKA4q5yHwn78ttO5K2GsKTqHIG+T9J7WDpECwKb8iREhc3RcleIYWN1FMBJUXqCiQDjwYwnKGQw== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 980519c5-aa6c-4f0d-20b1-08d648849609 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM4PR05MB3297; x-ms-traffictypediagnostic: AM4PR05MB3297: 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)(10201501046)(93006095)(93001095)(3002001)(3231402)(944501410)(52105112)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:AM4PR05MB3297; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB3297; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(376002)(39860400002)(396003)(346002)(366004)(13464003)(189003)(199004)(2900100001)(81166006)(229853002)(9686003)(486006)(446003)(6116002)(71190400001)(71200400001)(66066001)(7696005)(76176011)(74316002)(81156014)(14454004)(55016002)(4326008)(476003)(8936002)(6636002)(3846002)(86362001)(99286004)(110136005)(316002)(33656002)(7736002)(305945005)(97736004)(25786009)(53936002)(5660300001)(14444005)(6436002)(256004)(11346002)(6506007)(478600001)(186003)(26005)(53546011)(102836004)(105586002)(68736007)(106356001)(2906002)(8676002)(6246003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3297; H:AM4PR05MB3425.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: 33nPF8i2S/qHzdcLx4nIaNL/sI6AxXrvC6N1OBNmOomMaxDlKgDNiVreaUhX8JaYsIH9BJXb60TQCoXo8Hyw+bdI2s6VfN1ZsXJPMQesRb1DoXX8NzlXvaCDNFSP5VLSDRAmPgpAjU5bM+M8f/Be6EaSUDqOHwh6HlSRv69EZrOWyFsNE3ngAn4H4qXhA41yIq6qQfRPPiaKRU67kl79+PtV05LbPh06RGAba1s+eTrECNe0z0tLqt4Dm7fMeemyrOa9J/FTEybsxpk2ahiTssYNWwLn65afGfhhZXYHNRk8IuXWFXGbItwahQDjUybeM5OItmDIa4sSh4prBvXl27Z3mRwUHpRkyRur5HvuPtY= 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: 980519c5-aa6c-4f0d-20b1-08d648849609 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 09:52:40.8436 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3297 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix MPLS item validation 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: Mon, 12 Nov 2018 09:52:42 -0000 PSB > -----Original Message----- > From: dev On Behalf Of Dekel Peled > Sent: Monday, November 12, 2018 11:20 AM > To: Yongseok Koh ; Shahaf Shuler > > Cc: dev@dpdk.org; Ori Kam > Subject: [dpdk-dev] [PATCH] net/mlx5: fix MPLS item validation >=20 > Update the mlx5_flow_validate_item_mpls() function to allow > MPLS over UDP as well as MPLS over IP. >=20 > Fixes: 84c406e74524 ("net/mlx5: add flow translate function") > Cc: orika@mellanox.com >=20 > Signed-off-by: Dekel Peled > --- > 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 21d65f4..0db862b 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -1626,7 +1626,9 @@ uint32_t mlx5_flow_adjust_priority(struct > rte_eth_dev *dev, int32_t priority, > const struct rte_flow_item_mpls *mask =3D item->mask; > int ret; >=20 > - if (target_protocol !=3D 0xff && target_protocol !=3D IPPROTO_MPLS) > + /* MPLS over IP and MPLS over UDP is allowed */ > + if (target_protocol !=3D 0xff && target_protocol !=3D IPPROTO_MPLS && > + target_protocol !=3D IPPROTO_UDP) I don' t think this is the solution.=20 First before MPLS we can have GRE so this also need to be tested. Second I don't think that the validation should use the target_protocol=20 since it holds value that is not relevant to the question. For example if=20 a user inserted the following rule eth / ipv4 proto =3D udp / mpls=20 The flow will be O.K which clearly it is not. > return rte_flow_error_set(error, EINVAL, > RTE_FLOW_ERROR_TYPE_ITEM, > item, > "protocol filtering not compatible" > -- > 1.8.3.1 Best, Ori