From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00046.outbound.protection.outlook.com [40.107.0.46]) by dpdk.org (Postfix) with ESMTP id 2B91B493D for ; Mon, 5 Nov 2018 07:08:46 +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=5moBx6R9UgVvz5MteSpmL7jh4KHwEZPIAi+7c5JRPI4=; b=o+Mbf3qFDUE2Aoc+fw3ZSLDLijGymQY9fSX+PzxbSaMfsDAHh3PCY7FYPNuEN9P8G6QFkbpFnUwnpmMo/RXvhN3FslVb8Z7WRFcdmBi2YihQaFqj13lh+iopn+9j6ef4mZ6w8LIvMOk8yqdnqpX4mNHqe5eBI0VWsEw+3O/ZTk4= Received: from AM4PR05MB3425.eurprd05.prod.outlook.com (10.171.187.142) by AM4PR05MB1649.eurprd05.prod.outlook.com (10.165.245.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.31; Mon, 5 Nov 2018 06:08:44 +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.028; Mon, 5 Nov 2018 06:08:43 +0000 From: Ori Kam To: Yongseok Koh CC: Shahaf Shuler , "dev@dpdk.org" Thread-Topic: [PATCH 2/3] net/mlx5: fix Direct Verbs flow tunnel Thread-Index: AQHUcvAws3tOlmaxm06IGU+90kEXhaU/R93AgAFlmgCAAAQ3kA== Date: Mon, 5 Nov 2018 06:08:43 +0000 Message-ID: References: <20181102210801.28370-1-yskoh@mellanox.com> <20181102210801.28370-2-yskoh@mellanox.com> <20181105053732.GE15737@mtidpdk.mti.labs.mlnx> In-Reply-To: <20181105053732.GE15737@mtidpdk.mti.labs.mlnx> 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; AM4PR05MB1649; 6:RIgPMpLxrp3fQuSTp8JvRXYABnRl3B6Cs+HvO1Rh7nY67szJwxCKPHiH/xwcDAgU1yjLs7o+/1X0PudXnwbP25Dk1oZOs2n38t/LVU0MpYRQnj3KWEzdhN2yEP+SaMI3kVOk89laMT5IY7nPNZWAVfiDxdSvlqnsouiP8ToOO8SxeyxXIxRxx1PPcXDPTTgLbILXFWnJPTuESWGPr+qaYNSAcaRTfnVpSwf/5oFMb7lLJEFy3vChxmpgeMJGCNtigdbUCLrCQgSPuNstSHLV+5GFr8ue/zTyTdsX/kQehtICvuRldlk1bRpfcn895kWE7bz2YHK49p9G80+RY58q9cCySNKt1YrvrRjGS3LuX9aXfFOwmi3y0An625YeSRS21Y+ZqLmZxYKc3+DPSZoZhjpSyyTKG25iNa9A0xc3sfmmHgLYhg9dpbOruuf3uphT6BmX6GsN6LKhmWt/6ixh1w==; 5:vBq+t8oeyPVgd/0OOh124gnFyTDNclDY1AchMd9v3HpZXV8uNh/bDSb0eJgvLEAoDbd/52anA7ktI6pW9yGcKvfQHgW2JcgBpVnfPpLLuyPfCYfKJ9UpLrpX9otLmfv/0EvGVjboRGLQLKqJInElBVm2/B9RDg/tXOKFBNSeBKQ=; 7:ksDRPhcNMPvctudWBFYlr4+/6ozrWN2tEmaipuV6A3BTLnZzCb4i8KNEGpVJwWvsjjCh/kb2jTZuueb0D9hgwHXe81+de0D6HSVEz/1uMDalbJfWcl2f8sRHQXF2FbPZKiAZJwzPvCggFoU2Lwpw8Q== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: db0139cb-a7ae-44c5-a378-08d642e52416 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM4PR05MB1649; x-ms-traffictypediagnostic: AM4PR05MB1649: 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)(3231382)(944501410)(52105095)(3002001)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM4PR05MB1649; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB1649; x-forefront-prvs: 08476BC6EF x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(396003)(376002)(366004)(346002)(13464003)(199004)(189003)(25786009)(476003)(66066001)(4326008)(486006)(2900100001)(6636002)(14454004)(93886005)(316002)(11346002)(6246003)(186003)(53546011)(6506007)(8936002)(446003)(102836004)(68736007)(26005)(6862004)(54906003)(478600001)(33656002)(81166006)(2906002)(76176011)(71190400001)(86362001)(71200400001)(5660300001)(53936002)(8676002)(81156014)(74316002)(99286004)(9686003)(7696005)(14444005)(229853002)(55016002)(305945005)(105586002)(7736002)(256004)(97736004)(106356001)(6436002)(6116002)(3846002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB1649; H:AM4PR05MB3425.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: JmitVHsLlZfhBh0Ua7RSJIEiPOSbvR7rDpX//msexHX8U/2yMerMlCoi1b7bxzPtoMiYo9VBl+FLnJwNUTIRSmmYUVpIhX3LjDdjQ3HAmQ13qXfDHUiVgrt8O8Olbl0IRmSEjaPAtIS0Pkcewjt4DWrvpK/el+27i9OvEmj5yDvuEBS2bI4H76IJsKuKbp5k4pM94KME05a8Sjw2VRykjx0q7Lj4nMxMJnHeF3XSJCM2mauzSrMXEyyY1LRP+9W+K/+s058U10N88qyfSp+d1EyAUkRfKv6cTN6B+C133dCgR8O8IUJASVJx5IQdBwUHOz2ymb686NHBufGDSQYdETVcWOc5IhnhbyGLNUyepzU= 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: db0139cb-a7ae-44c5-a378-08d642e52416 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Nov 2018 06:08:43.8940 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB1649 Subject: Re: [dpdk-dev] [PATCH 2/3] net/mlx5: fix Direct Verbs flow tunnel 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, 05 Nov 2018 06:08:46 -0000 > -----Original Message----- > From: Yongseok Koh > Sent: Monday, November 5, 2018 7:38 AM > To: Ori Kam > Cc: Shahaf Shuler ; dev@dpdk.org > Subject: Re: [PATCH 2/3] net/mlx5: fix Direct Verbs flow tunnel >=20 > On Sun, Nov 04, 2018 at 01:22:34AM -0700, Ori Kam wrote: > > > > > -----Original Message----- > > > From: Yongseok Koh > > > Sent: Friday, November 2, 2018 11:08 PM > > > To: Shahaf Shuler > > > Cc: dev@dpdk.org; Yongseok Koh ; Ori Kam > > > > > > Subject: [PATCH 2/3] net/mlx5: fix Direct Verbs flow tunnel > > > > > > 1) Fix layer parsing > > > In translation of tunneled flows, dev_flow->layers must not be used t= o > > > check tunneled layer as it contains all the layers parsed from > > > flow_drv_prepare(). Checking tunneled layer is needed to distinguish > > > between outer and inner item. This should be based on dynamic parsing= . > With > > > dev_flow->layers on a tunneled flow, items will always be interpreted= as > > > inner as dev_flow->layer already has all the items. Dynamic parsing > > > (item_flags) is added as there's no such code. > > > > > > 2) Refactoring code > > > - flow_dv_create_item() and flow_dv_create_action() are merged into > > > flow_dv_translate() for consistency with Verbs and *_validate(). > > > > I don't like the idea of combining 2 distinct functions into one. > > I think a function should be as short as possible and do only one thing= , > > if there is no good reason why two functions should be combined they sh= ould > not > > be combined. > > If you want to align both the Direct Verbs and Verbs I think we can sp= lit the > Verbs > > code. >=20 > Look at the other lengthy switch-case clauses in validate/prepare/transla= te in > each driver. This DV translate is the only exception. I'd rather like to = ask > why. I didn't like the lengthy function from the beginning but you wanted= to > keep it. Of course, I considered to split the Verbs one but that's the re= ason > why I chose to merge DV code. If we feel this lengthy func is really comp= lex and > gets error prone, then we can refactor all the code at once later. Or, I = still > prefer the graph approach. That would be simpler. >=20 I agree with you that all functions should have been split( No excuse also = kept the basic structure as it was), specific in this one I had extra reason to make the s= plit since creation of items also need adding matcher so it was different. In any case I agree that we should have consistency with other functions so= ether we change them all or just this one. I think do to time let's do what you suggested a= nd change only this one or just leave it as is.=20 Regarding the graph approach I think we should wait to see if the current a= pproach is good enough and in next releases maybe switch to the graph approach. > Thanks, > Yongseok Thanks, Ori