From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40046.outbound.protection.outlook.com [40.107.4.46]) by dpdk.org (Postfix) with ESMTP id D62072C52 for ; Mon, 5 Nov 2018 06:37:43 +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=S43FVZ2KnghH+3RF8PSS8ERhxyGBHD4UyJbs6kLk/7g=; b=sLGWmAzbYadWY4TBRnblrLciP1pZK1ji2MEaysnMWWVj6d4qYH2G2VquDomuhlsK2hAKDqJEDxFOjrC5bJMvo39AE593qNj4pPKGntzne0mJeZM6UeKdqPQSf+elHE2iqUoV1v3fNYnyr22fJ3Fq4zJ/U8g5F8z+AG3qQKWbEms= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB4027.eurprd05.prod.outlook.com (52.134.66.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Mon, 5 Nov 2018 05:37:42 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::58e7:97d8:f9c1:4323]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::58e7:97d8:f9c1:4323%3]) with mapi id 15.20.1294.028; Mon, 5 Nov 2018 05:37:42 +0000 From: Yongseok Koh To: Ori Kam CC: Shahaf Shuler , "dev@dpdk.org" Thread-Topic: [PATCH 2/3] net/mlx5: fix Direct Verbs flow tunnel Thread-Index: AQHUcvAvOimJ0t337kOQbAoxlFooYaU/STIAgAFkOQA= Date: Mon, 5 Nov 2018 05:37:42 +0000 Message-ID: <20181105053732.GE15737@mtidpdk.mti.labs.mlnx> References: <20181102210801.28370-1-yskoh@mellanox.com> <20181102210801.28370-2-yskoh@mellanox.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR01CA0063.prod.exchangelabs.com (2603:10b6:a03:94::40) To DB3PR0502MB3980.eurprd05.prod.outlook.com (2603:10a6:8:10::27) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [209.116.155.178] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB3PR0502MB4027; 6:nbdwOYdxOovAhuBl4rq60QhZqlixGjIIkNhMONiiQWpw3/EqtjA1/gAanLQbvIG4t9hQbdp8u5FQJ78uWnd5BXxWjeyi/F6FMbOXAeyw3FhgWChK1+xtjCcUaIM1gdre7zQLyVtMKonbwez4GvJRr7gRLZMzZkz+A/a7SSW9uDIZeNw6Iis0cOlYTl9lOvbSY25Bv+D0dl1UhSMB9LoVQP3+wS781tYHDguwinnaKUjXfoGJ8cT/Va2B66pDO+qolIvLcFta+/IQrd4WN1BgDdXXVzlBYKT54t/Pf14yzLQ6Xf4mfEOo9YmjqjmbG7r9Nd6WOazylx3Q6MdZHoXG2lgDQNTOn9LJ19tMAgprmODFoBjRsI1kPd6zDaL9V21AaWq2yMPx/rQC2CSw7/sdUfFj3In8hLtY76xWhWxcUaILTZf2wP8aEJAUjtPe7dCOWjFa2Hu2jSCPt3GXF0njeg==; 5:V7ExUxPOmIFPimCiSBb/gMQwDoPHxz9ln0wQiLMylEQcf7WN8AgVE97HGM8tGS4FwN6gqOa9lWy/DKb0mJnonPCH8/C3SvnMdL99VwoBWQCok69NUILttLRf0ezChIBkD1SwcMIe3yZ+0VGNu3p256DeaojORMk0i4wnE80zaRI=; 7:Y1RpIsH737ilIgfKhBRGH77987Fv4ziNFOCRqP41ixOFDTuDLModFF4qIm2pwcwQ/Lz44dPB1k8QuaiUJMvBF3DUuDTcIYn+QXU9c6DLUv9Ud/nb++gAtaSS6U9h536fuJwxKqnyJEKPdYYNFYrnZQ== x-ms-office365-filtering-correlation-id: 4b48604f-4648-48db-d7a2-08d642e0ce48 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DB3PR0502MB4027; x-ms-traffictypediagnostic: DB3PR0502MB4027: 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)(3231382)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:DB3PR0502MB4027; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB4027; x-forefront-prvs: 08476BC6EF x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(366004)(376002)(39860400002)(396003)(13464003)(199004)(189003)(102836004)(33896004)(68736007)(81166006)(305945005)(81156014)(53936002)(26005)(6116002)(3846002)(1076002)(186003)(71190400001)(71200400001)(229853002)(6862004)(2906002)(7736002)(256004)(6636002)(14444005)(8936002)(11346002)(446003)(476003)(5660300001)(6486002)(486006)(97736004)(14454004)(478600001)(6436002)(6246003)(316002)(4326008)(76176011)(106356001)(105586002)(8676002)(53546011)(66066001)(386003)(6506007)(99286004)(86362001)(54906003)(2900100001)(33656002)(52116002)(6512007)(25786009)(9686003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB4027; H:DB3PR0502MB3980.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: 9N6OR6egy0TWaqeDO0gVaUllpzCuk1LXvEKRuIT7JeOGB7feZZUiLOc0WImg7sQr+dHN7an2eN8j+67Rstu/YvPhxtz0g64EB3rm7fgR1nEa8QQvZhIBBt668eiyZoE8h5ux54xWk9xPds37nEO1tYjg0WPQOzfxBsulAnT6BRdwuYCEXR0Hip+iujR8lRhpslGx++f1qfiRE4+JQaw/XHQRp11C+qZe2djiOJQ5xX3RLO865B4hw0YOytG5SuvGlb1s8PSL9jLm8xEjveqk1F7dpVIZxT4xL5+OzEuoezyFdGDL7CFGd7hMAiIIlb7UBdq0pxYF5YVbpsfRlILDySlpWe79NmzcNhmaYobdZLo= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b48604f-4648-48db-d7a2-08d642e0ce48 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Nov 2018 05:37:42.5491 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB4027 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 05:37:44 -0000 On Sun, Nov 04, 2018 at 01:22:34AM -0700, Ori Kam wrote: >=20 > > -----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 > >=20 > > 1) Fix layer parsing > > In translation of tunneled flows, dev_flow->layers must not be used to > > 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 a= s > > inner as dev_flow->layer already has all the items. Dynamic parsing > > (item_flags) is added as there's no such code. > >=20 > > 2) Refactoring code > > - flow_dv_create_item() and flow_dv_create_action() are merged into > > flow_dv_translate() for consistency with Verbs and *_validate(). >=20 > 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 shou= ld not > be combined. > If you want to align both the Direct Verbs and Verbs I think we can spli= t the Verbs > code. Look at the other lengthy switch-case clauses in validate/prepare/translate= in each driver. This DV translate is the only exception. I'd rather like to as= k why. I didn't like the lengthy function from the beginning but you wanted t= o keep it. Of course, I considered to split the Verbs one but that's the reas= on why I chose to merge DV code. If we feel this lengthy func is really comple= x and gets error prone, then we can refactor all the code at once later. Or, I st= ill prefer the graph approach. That would be simpler. Thanks, Yongseok