From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0081.outbound.protection.outlook.com [104.47.1.81]) by dpdk.org (Postfix) with ESMTP id 0F5A21B296; Mon, 6 Aug 2018 22:02: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=8GJIUoEk+J18OL+9n5rBKYrXs29WFK/xfucx9263z1w=; b=M+wdPQCVCOvbrrRfPpCPamw3onNKwe3vhWISkQ+XLTal0VTiMDjusQnIU2JZ9U0iYbusHT8793RHIHyIPDhCUGKVcDcKxIajUjkkDgCvKnN4oYRBN0gXgYeRTjuQGZJLm3Ablt2W52bDh8ftXUc7rCq2CWF/BZBhmZze1R4dr1I= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from yongseok-MBP.local (209.116.155.178) by AM5PR0501MB2034.eurprd05.prod.outlook.com (2603:10a6:203:1a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Mon, 6 Aug 2018 20:02:00 +0000 Date: Mon, 6 Aug 2018 13:01:45 -0700 From: Yongseok Koh To: Matan Azrad Cc: Shahaf Shuler , "dev@dpdk.org" , "stable@dpdk.org" Message-ID: <20180806200144.GB7392@yongseok-MBP.local> References: <20180802205400.10316-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: MWHPR1201CA0014.namprd12.prod.outlook.com (2603:10b6:301:4a::24) To AM5PR0501MB2034.eurprd05.prod.outlook.com (2603:10a6:203:1a::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d5c625a8-a254-4adc-1d7d-08d5fbd77957 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM5PR0501MB2034; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2034; 3:pGYMHvT+Ru4FVqcZ9E3JOzCpm+cAEJ2vmk7intDE2s97OpL1lhEyCLPmqtjrUlKvEn4ClRRqNCUvjN7H/D19LLy5KRJRPMfsZ9k9YjoWzpnMAmLwopyg+HjhdDfasMUfT7JbbyWUTLTMr+0qDTtlqVZ7YHfVPLe6epGooyxMHL78e81fJInm+dHyPsMDed5tuWiyHWt9LsCVNeSlFSs0uvrS3cVch9J0tlvHw/j1egvBy/7pYfgqA9aFCzSG+a/d; 25:9xOGLrysC01IujPizbQ9XvQWhqLjoiGyJYaJ/RtvYBa52uJwakGzwlZnoj2XbTRXzR771qKNiOewbbpZcVd8SktbFkAJ/q47EB8Usmq/5E+GcxiPIqewkFgXy0aD6UH4FM3OXzC4pYImL1nvzH9zFWeQp+0kUJfJgJrtLjOpxS3d2l88HQ2yU20t339942BCFn8rgWz8S1uZaTDHfoe9vagELBinjAPSXsz6FZpmm4yKm8kRmv5Gcxp1y6aH8CtnffHm7TL5ysMXLjMmCVtJtc/nMX4O6/1WD8Gi52LDGdc719EslbmhVrMcw/VCdDr4mecNERJZi6KTDRah3b+gnA==; 31:FHrtdGLMiUnOMNd9lHGLXfBGkXDaxeCiXk0OkGurA3Zqt3SV/1PqM7O1OMsqQnJ6iHShLI9sx+DkjV+KNYJ1L/BYLt0b91uEyzjLqSq1JCpRChqmo2G96GYFDW4Ntj8s3NnxQaU1Y8cLIqDp3eiE6gW8+RYf1UPvJd5SmgFxHdcds3R10orWi6US8y//I3p3gYrwSEeYEp50ew7eqPLrw0DoO/35UbeZgL+/FaXAEGA= X-MS-TrafficTypeDiagnostic: AM5PR0501MB2034: X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2034; 20:RoknlGyD/VgqP1e2AOKF/Mv4Uc3UxG+GC9Fpl/k2j2DaZTuf9BTfY/izrqqMmXCqQ4RZSpUl181+vjTUpO8o7+o45qlXbp1F+5ig/PpGXXiJzxlWC8xm/vVprJ0+YeDl6PJWL/+i8cwZiXyXLlZvLaDb19uco1ZC6NzyGM5SiSNVdG3SDA3CQI0ZwDJ1vbItiWjgH8Qpq7ofGnxaKzwFSD3mAaoxc51MFEnon9Zs+2DgjbRc0sLTOn230q6go6nc7s1gaMOsQM+u41lzfCAeGuOoMli0qBxjGI1dxKbCYjmEzBhaKncCMK4d6UhIZbYoCnPbOXPq4OapcmBWROd4AJ0eM2z9MVu5UUfdSTdWYKhq2tUbaQ4MY6q5Cb/N/EvJL43D6GYE3/ZctTazKIDlw+cFdGvZo7V/1YfRP3XIQfAhJy2Gt5S2JrYvAyWKX3fQq7gKRBoW3RE2sKzTEL1BAij/+NI80D1Ye9V/Vaw3iFM0qLodzzdhtk9EXhnPKuvC; 4:AWe6mY43+y2/vGSYHKGSZQQvrmuW39ZKXzFPRZdTmyDRAmLp2pjG9PFrWN5r8E92LMNB6/oHRN7Wq8JbuhvJLVUjU2ZSpO8t0RNnNQ0OCHmqO3hXUZ2GvpVuo0WPAKMJ29BRGUy7sN/c9+YlK59L/r6y5IRZM31927iIiZM8fD/1nArLQ7bu00EMAmn7cCsiTvj8oW3sq7TPt8/ClQD8FXsH6Oh+7Yn7es7POSFr+ZdkYdRmCLrYXEHx9U2iRKnn8mtJjKD6DbZLOp0pM+D3CQ== 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)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:AM5PR0501MB2034; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0501MB2034; X-Forefront-PRVS: 07562C22DA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(396003)(376002)(366004)(346002)(189003)(199004)(316002)(58126008)(229853002)(16586007)(33656002)(6246003)(6666003)(6116002)(68736007)(6636002)(3846002)(450100002)(97736004)(5660300001)(25786009)(106356001)(478600001)(6306002)(9686003)(2906002)(966005)(55016002)(53936002)(6862004)(50466002)(1076002)(98436002)(23726003)(8936002)(66066001)(47776003)(86362001)(7696005)(52116002)(76176011)(4326008)(956004)(11346002)(476003)(486006)(16526019)(14444005)(446003)(81166006)(81156014)(54906003)(33896004)(6506007)(386003)(305945005)(7736002)(26005)(105586002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0501MB2034; H:yongseok-MBP.local; 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-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0501MB2034; 23:kYfRWy5TSxX9uAztWpbPD5QIeLHjFkzd9xZFc3L?= =?us-ascii?Q?jHHwRE7QWxRR8bGNE7daU8bQrMoIMR/VSeRxwvSOEDPHcuH2xVxx1LIlyKRd?= =?us-ascii?Q?7DeCb2tWF+rz3ntYlTNjL3IgZWK9MfOI7CVHNoxWZwRs/TivUaZi2OdpZPOg?= =?us-ascii?Q?7/septNvqFxdk5Llr2d1f+t+sAwQHNTN/mSC0abF/rjWxVE+8ImX5jI8K6R3?= =?us-ascii?Q?sv9AAs0I7Rdi72gIq0op1Xce2omVEoAiko2v1lwBIZBK+67Y4MAmyExDiPrn?= =?us-ascii?Q?G3Snov13kAC+14+31m5HK/CnTRCUKYIKQJSonsf0PCdBZrHB570qkJ9YWBEm?= =?us-asc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N6Z3yIHUZJQ==; 5:HcB0nnccM6IHMTt4OIeFD6CtgEEfH0N2eZUrOuX3fVqEKXTip19KwVDIvPv31I0b2xc8HK1jGNWLjKyZheRdCTP7lC/1wcfD2zQtV9/tg3kxramF7yjn1JvYqx2ftzqMqYzkkU13YE5FHcOaY68mSu4xcLLMnZoUzqoB86TwLnA=; 7:qmbxG7HC4psmnGl09HhPJZ/kyNj0fPQ6G9ubDlkkYhrceCuNukoa3VlI0xXudz6wQgmlTWwPFjnGiWB/qG1U9tjAw8BVM/n8FHpluJhl3THBQXr/p+T/93L0cklYGizZlWKmK3bQhritmV5MrMGymplCJpICDR9NPwn+F+QJ9MBntj0d/eJJPs7ktP8yjRvUlefQHsyrAHNV/VpYjjD7/ZTux4gHbQY185j0mfWo4FqNDafrc9ViaFUe4FtypH0D SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2018 20:02:00.4317 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d5c625a8-a254-4adc-1d7d-08d5fbd77957 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0501MB2034 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] net/mlx5: prohibit wildcard match for GRE protocol X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 20:02:03 -0000 On Sun, Aug 05, 2018 at 12:01:01AM -0700, Matan Azrad wrote: > Hi > More info below... > > From: Matan Azrad > > Hi Koh > > > > 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 = &rte_flow_item_gre_mask; > > > + if (!mask || mask->protocol != 0xffff) > > > > Why do you check !mask again, I think it's redundant.. no? > > > > I think we can support also mask->protocol = 0: > > In this case we just need to not specify a spec. Right. My original intention is to force users to use 'is' or 'spec' with full mask being specified not depending on the default mask. But error message isn't enough. And users know what the default mask is. > Just to be more accurate: > > The case of !mask led to mask->protocol = 0xffff before this patch, so it's ok and should be supported. > In addition, we can support also mask->protocol = 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 = &rte_flow_item_gre_mask; > if (mask->protocol == 0) > spec = NULL; This shouldn't work. If spec is null, ibv_flow_spec_gre will have zeroed val and mask. And this will lead to protocol being zero with full mask in the driver. Also, we have one lacking validation check here - driver doesn't support c_ks_res0_ver yet. > else if (mask->protocol != 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). I figured out the reason for your false positive. This issue has already been fixed in the latest MOFED release and the patch is pending for upstream [1]. We should void this temp patch but document it appropriately instead as it can work well with the MOFED release but not with upstream kernel. Let's take it offline. [1] https://patchwork.kernel.org/patch/10498671/ Thanks, Yongseok