From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30087.outbound.protection.outlook.com [40.107.3.87]) by dpdk.org (Postfix) with ESMTP id DCDE11B5B9; Sun, 5 Aug 2018 09:01:03 +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=qGTqpElWFTTi161yDZXCdG+W0Ff0Lz9hEbBQNVnBkpc=; b=s35q02yw1cwxF6Tomh41nFTrw+2k8ISoE64XwJcTl4JoQobign9FiVm6uUu/tolQfrSEmRDQEK7MHZuFp60SI0IMAyuAO1OpSAYSi5YrAUOyCbgT7e/uYssBcg8UnpolG4DDAuCdkpNRAu7lvEsL34cHutEhCPomRr54g6uVh4Q= Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com (52.133.41.11) by AM0PR0502MB3826.eurprd05.prod.outlook.com (52.133.47.140) 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 07:01:01 +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 07:01:01 +0000 From: Matan Azrad To: Matan Azrad , Yongseok Koh , Shahaf Shuler CC: "dev@dpdk.org" , Yongseok Koh , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/mlx5: prohibit wildcard match for GRE protocol Thread-Index: AQHULIoRDphtgjfSx0iXCVjFn6SCMw== Date: Sun, 5 Aug 2018 07:01:01 +0000 Message-ID: References: <20180802205400.10316-1-yskoh@mellanox.com> In-Reply-To: Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0PR0502MB3826; 6:JQ45blRDyed8E69qxszQUp4LdcwXmAXphm3oS7XyL8onwojMbzeVWZCyj0k+dNXhlq9lMHVHcF5JOyC5rI700tZqiwo3BlrzTvdk2Sxlb2N9MfZtOX5TieHUVJwkrxiQ0W2q3m+qsYjv0OF8Z/CxHIy6kWMjamhZTdukdvI82bayBqfJwTIiuPLJCr9qCeUTuzVsUASCBuhJ2UX/ct7QV4pXkp8gbX/6aHEUYgPsc0Tu65b3WGBv4iHVFnKfAyKW2FVEeA9oQCQ7DLUPEfaqhNuJd8tyBQo06zPqYQb3KPmAgDhJIm+8cgYTwda9H9Y+NMo3rLvSo4bekGEI4ijvjdpF4WQ/gzKJZu6eTe00hAXhSYD68u+CNqUK60ZjVcOX3tncuPjunlMk8jqCDGyKQneTql33+/l2rkcOmzjojdjw9jBS/JS91J6yQayfi7a4soPxaXydwhHI/zIb21I1+A==; 5:QnWzjm/3YuNOqhk+dwvazdhNRQhVR4eZxXzO6O+BHHeXCGHuAlxUTqx5AmJk1VXN0RXNsm5pnRtOXZsOv/XeI/QU/8yLbft0RYkx8Y83mnMP/EB9Hi2cpL3lr5YixqIMApkdzRr0yL8LF7+iqDSMejBmPa6VfIwyhwy00k1KeKI=; 7:/OBbyz/xxmPijgmqeNjaJpLOOmuSeD34ML66oa+puxn7T0HOM8eaOAv2UlMV8wsgw4MfJfr4xd1CnODmOZOYwJLxN7PWCOT4QP5yAXA9UHp0vBKVT2x7arVzSRyGmUAFjTgTvfccrxO2Sr529bXYd9PyxiKhPicVXG07h7eEViMA/Js4hSp8Bz7zEWIAspgNuULZo5j9sQf8qupfpcIv1XD1TdB4feNz+Ww/kU7CtBZVPCWvDQYoLabCUxG9umjL x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 62ba1fc2-a8dd-4ce0-1c37-08d5faa13444 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR0502MB3826; x-ms-traffictypediagnostic: AM0PR0502MB3826: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; 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)(3231311)(944501410)(52105095)(3002001)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:AM0PR0502MB3826; BCL:0; PCL:0; RULEID:; SRVR:AM0PR0502MB3826; x-forefront-prvs: 0755F54DD9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(396003)(39860400002)(376002)(136003)(346002)(366004)(199004)(189003)(105586002)(106356001)(7736002)(14454004)(11346002)(53936002)(446003)(486006)(6116002)(66066001)(476003)(6436002)(9686003)(55016002)(5660300001)(6636002)(305945005)(229853002)(74316002)(3846002)(68736007)(76176011)(8936002)(81166006)(2906002)(478600001)(81156014)(99286004)(5250100002)(256004)(25786009)(450100002)(2940100002)(4326008)(6246003)(102836004)(97736004)(54906003)(110136005)(26005)(7696005)(6506007)(316002)(2900100001)(33656002)(86362001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3826; H:AM0PR0502MB4019.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Zo1Q1OGkrv+C4nk04nbOQtzbm5SimVr1ybX7oLjLHTKNQiSPYvhXynJZyYThP82GpJlkEnTIxuZ+AeyrJ7NOdTKqNRrQeOFcxcVF+oSKi08b5Lr/Iq+7uJdjL920Clnl22QFuQDQQfncEXdcWSeuqZ3f8QPGdOTzDcf9GRizRdW9Osnt5CRsO2GCwjwsJd8rDaL8lEbwP1DABpzma//Go4yMssCfuyFHAx4Yggn8HyEqy3ACKBGthpObjyTCRfE5DBSvDpXYSt9QeanymfC8lCdqhjxP6Jb1LOUvNe3O1W54DD9p8TtcJkdHZQWSoTT2Lz0OBDIZcCey0kWmzZaqPFdYjJCZeJNKpp4590/DOB0= 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: 62ba1fc2-a8dd-4ce0-1c37-08d5faa13444 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Aug 2018 07:01:01.5520 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3826 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: prohibit wildcard match for GRE protocol 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 07:01:04 -0000 Hi More info below... From: Matan Azrad > Hi Koh >=20 > From: Yongseok Koh > > Currently, driver sets full mask (0xffff) for GRE protocol to device. > > Until it is changed, PMD can't support wildcard match. > > > > Fixes: f4b901a46aec ("net/mlx5: add flow GRE item") > > Cc: stable@dpdk.org > > > > Signed-off-by: Yongseok Koh > > --- > > drivers/net/mlx5/mlx5_flow.c | 8 ++++++-- > > 1 file changed, 6 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/net/mlx5/mlx5_flow.c > > b/drivers/net/mlx5/mlx5_flow.c index > > b7500ec9d6..83ac6cbb85 100644 > > --- a/drivers/net/mlx5/mlx5_flow.c > > +++ b/drivers/net/mlx5/mlx5_flow.c > > @@ -1690,8 +1690,12 @@ mlx5_flow_item_gre(const struct rte_flow_item > > *item, > > RTE_FLOW_ERROR_TYPE_ITEM, > > item, > > "L3 Layer is missing"); > > - if (!mask) > > - mask =3D &rte_flow_item_gre_mask; > > + if (!mask || mask->protocol !=3D 0xffff) >=20 > Why do you check !mask again, I think it's redundant.. no? >=20 > I think we can support also mask->protocol =3D 0: > In this case we just need to not specify a spec. Just to be more accurate: The case of !mask led to mask->protocol =3D 0xffff before this patch, so it= 's ok and should be supported. In addition, we can support also mask->protocol =3D 0 (means match all the = gre protocol values) by remaining empty spec\mask to the verbs. It can be something like this; if (!mask) mask =3D &rte_flow_item_gre_mask; if (mask->protocol =3D=3D 0) spec =3D NULL; else if (mask->protocol !=3D 0xffff) ERROR! I checked the next flow: eth / ipv4 / gre It matched all the gre traffic(MLNX_OFED_LINUX-4.4-2.0.4.0). =20 > > + return rte_flow_error_set(error, ENOTSUP, > > + RTE_FLOW_ERROR_TYPE_ITEM, > > + item, > > + "wildcard match is not supported" > > + " for protocol field of GRE"); > > ret =3D mlx5_flow_item_acceptable > > (item, (const uint8_t *)mask, > > (const uint8_t *)&rte_flow_item_gre_mask, > > -- > > 2.11.0