From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00073.outbound.protection.outlook.com [40.107.0.73]) by dpdk.org (Postfix) with ESMTP id 7831E695D for ; Wed, 3 Oct 2018 11:32:55 +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=cRsPqCs+3QpJoVYp7jC6nB3LaUQW8Vd5HnsAX+m7gPk=; b=CU5F7+zoL0tK4nwNzjvp4aiYslyP4V3c0bc7ViFi8SxXw3QbEZ+VBf4MG8QSZUr/SNM787M0hEteH9Gb2C6Pb/8QHWDDF+dgCEJuyp30uwBjvHaSSkDwqPcs82cuMFl9mlE5xY4ClP8djqYa+EvEIxgKiDUsXK/I25HwCGWlpyQ= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB3977.eurprd05.prod.outlook.com (52.134.70.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1164.22; Wed, 3 Oct 2018 09:32:54 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::1cb0:661b:ecab:6045]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::1cb0:661b:ecab:6045%2]) with mapi id 15.20.1185.024; Wed, 3 Oct 2018 09:32:54 +0000 From: Yongseok Koh To: Dekel Peled CC: "dev@dpdk.org" , Shahaf Shuler , Ori Kam Thread-Topic: [PATCH 3/4] net/mlx5: add DV encap L2 and L3 operations Thread-Index: AQHUVnHb/3Y5788/wEyRhIVdU53mo6UMqq+AgACQcgCAABAQAA== Date: Wed, 3 Oct 2018 09:32:54 +0000 Message-ID: <20181003093245.GC21743@mtidpdk.mti.labs.mlnx> References: <1538059845-35896-1-git-send-email-dekelp@mellanox.com> <1538059845-35896-4-git-send-email-dekelp@mellanox.com> <20181003065817.GD10028@mtidpdk.mti.labs.mlnx> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BN6PR03CA0009.namprd03.prod.outlook.com (2603:10b6:404:23::19) 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; DB3PR0502MB3977; 6:LBDD3Su8AU9EJpqshKHTHs2dLpJsdHQXCCIlOcp5MsFSYnbGuhbTKEGz7tsJvJy2dSEc6v6R2bJ1DHxm0wApviH6Q392eGlZQFs2fErBPUQ6+vzrWhLU8PXjjJ2Vofa7tOzEDRzwyjaiG1+9GlKKMSnfpWoSfTGl2lUxyImgwb8KgGoZ7kc+I4TvixVszb0IrB+kv6YlhthXSs+IVg9IoVERe/TxXruF5cwGaWkdXlZOALL1dwq8ajQ0SzqK78lZDkvg6UCbjPlRMGze8+q9q2UUzVEhc0kv7w2imragqf/TvaelGvkiM7WuiCB0k8L5qm3IWa4bihLCpS286mCpRr5yfWqzryysSdoqPCGrQKd5MigiFglH8eRJJjzsXEV25wZFUJxXBii2pjuoy8QG1CjbzLd+xJWkMOUWlCpCHCpXGHTrysLCwggEM4FmPKqm2ZahOb+tQJ3Frg7/s9jXQQ==; 5:WjLYqZyXaAEsH34TMp/cOuBLbOqyCE8Y+mW6hpe5gDjL85QRsemCpTVrpQS9njk62GN48Y81rOn+EIFyXCTunFN9SBVMz4msj/UhKFrCZKuajhuAHLHAkBa47xeRHOeHX4P3jH4r2QGx8qBgz0+WuEZFK1FaYs9JnZPNmeKY9/8=; 7:FB3PHT7T1QvP17AGwUTNSLRvlr5NYyRH+pKEA+fIqmUK5dQRKLXUPZ4OVi6QVgHyn77i9siiqcqwx9ImeIl1LCwG6ijVFXVHz7fUrDamezmKETUpTLKM6EEOz3i++vVhBCRh9fuZ5RkKTNTlqWNFEQs8cUtdPioUJ/SAs0J3eH2tXwq70J1hyFQ4Qg3vpV9GetGSPxKEvwR0VEG+534dxrQcU06GYTwZOGYt3l8G5b/CfkQsixwq9GXSN4y7Hvmv x-ms-office365-filtering-correlation-id: ddfa0616-3dbd-4b46-7d38-08d6291331d7 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:DB3PR0502MB3977; x-ms-traffictypediagnostic: DB3PR0502MB3977: 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)(3002001)(10201501046)(93006095)(93001095)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(201708071742011)(7699051); SRVR:DB3PR0502MB3977; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB3977; x-forefront-prvs: 0814A2C7A3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(39860400002)(376002)(346002)(396003)(189003)(199004)(13464003)(33656002)(316002)(14454004)(478600001)(54906003)(2900100001)(6862004)(6436002)(6486002)(1076002)(107886003)(4326008)(6512007)(256004)(71200400001)(53936002)(3846002)(9686003)(71190400001)(446003)(68736007)(7736002)(25786009)(6246003)(305945005)(476003)(11346002)(6116002)(186003)(5660300001)(26005)(66066001)(2906002)(486006)(86362001)(102836004)(99286004)(93886005)(229853002)(76176011)(5250100002)(52116002)(8676002)(8936002)(105586002)(81156014)(6506007)(97736004)(386003)(106356001)(53546011)(81166006)(33896004)(6636002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3977; H:DB3PR0502MB3980.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: bvPN7Bl4Pzd3RCDx8tvIeyWi4bX4Rn5eJIcPjrf4Q8Nc6GfhNp+8IV75piMVMLw1H9zjF1CQB5hZEhnBLHjvoiKDhWo/CelThkjslo0J/QiemKx6c31jJw+uq9AhQRLGTkAMyAFFgKV6SdoviMYP1P7WQteCq0L0aDBed5QD4qIT4BN4RL3myDf7fQ2J/zwYrQP8Z6R7PsSg0LX4bnb/wFAm7NPO64SqVqFuTGMmy0xLXULU16EZIysYEOpHimypebJaozL8hppUKGcnnFpDqucjQWUTSncw3lYJC8/f2hzOMncDPTSmteXAub5cEfsJz2ljexFmjlwcVcJloJ+L6x9fBl07p4yaBMnm1ldtSMU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <5DF1D9262480CD46A4148F5E0A38A846@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: ddfa0616-3dbd-4b46-7d38-08d6291331d7 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2018 09:32:54.2461 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3977 Subject: Re: [dpdk-dev] [PATCH 3/4] net/mlx5: add DV encap L2 and L3 operations 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: Wed, 03 Oct 2018 09:32:55 -0000 On Wed, Oct 03, 2018 at 01:35:16AM -0700, Dekel Peled wrote: > Thanks, PSB. >=20 > > -----Original Message----- > > From: Yongseok Koh > > Sent: Wednesday, October 3, 2018 9:58 AM > > To: Dekel Peled > > Cc: dev@dpdk.org; Shahaf Shuler ; Ori Kam > > > > Subject: Re: [PATCH 3/4] net/mlx5: add DV encap L2 and L3 operations > >=20 > > On Thu, Sep 27, 2018 at 05:50:44PM +0300, Dekel Peled wrote: > > > This patch adds support for Direct Verbs encap operations, L2 and L3. > > > > > > Signed-off-by: Dekel Peled > > > --- > > > drivers/net/mlx5/mlx5_flow_dv.c | 249 > > > +++++++++++++++++++++++++++++++++++++++- > > > 1 file changed, 244 insertions(+), 5 deletions(-) > > > > > > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > > > b/drivers/net/mlx5/mlx5_flow_dv.c index 1f3fcb8..50925ac 100644 > > > --- a/drivers/net/mlx5/mlx5_flow_dv.c > > > +++ b/drivers/net/mlx5/mlx5_flow_dv.c [...] > > > + struct ibv_context *ctx, > > > + struct rte_flow_error *error) > > > +{ > > > + struct ibv_flow_action *encap_verb =3D NULL; > > > + const struct rte_flow_action_tunnel_encap *encap_data; > > > + > > > + encap_data =3D (const struct rte_flow_action_tunnel_encap *)action- > > >conf; > > > + encap_verb =3D mlx5_glue- > > >dv_create_flow_action_packet_reformat(ctx, > > > + encap_data->size, > > > + encap_data->size ? encap_data->buf : > > > + NULL, > > > + > > MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L2_TU > > NNEL, > > > + MLX5DV_FLOW_TABLE_TYPE_NIC_TX); > >=20 > > Indentation. >=20 > I'm using very long MLX5DV_... names defined in rdma-core. > If I use the required indentation I get illegal line length. The following was my suggestion and it is compliant. encap_verb =3D mlx5_glue->dv_create_flow_action_packet_reformat (ctx, encap_data->size, encap_data->size ? encap_data->buf : NULL, MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L2_TUNNEL, MLX5DV_FLOW_TABLE_TYPE_NIC_TX); Please make the same change to others. [...] > > > @@ -1047,10 +1239,19 @@ > > > * Flow action to translate. > > > * @param[in, out] dev_flow > > > * Pointer to the mlx5_flow. > > > + * @param[in] ctx > > > + * Verbs context. > > > + * @param[out] error > > > + * Pointer to the error structure. > > > + * > > > + * @return > > > + * 0 on success, a negative errno value otherwise and rte_ernno is= set. > > > */ > > > -static void > > > +static int > > > flow_dv_create_action(const struct rte_flow_action *action, > > > - struct mlx5_flow *dev_flow) > > > + struct mlx5_flow *dev_flow, > > > + struct ibv_context *ctx, > >=20 > > If it is just priv->ctx, it would be better to get dev as an arg and ma= ke > > mlx5_flow_dv_create_encap*(dev, ...) gets priv->ctx from dev. >=20 > I considered it during implementation, but preferred to give the function= s only what they need. Two reasons. 1) having dev gets better matched with other existing ones. E.g., flow_dv_matcher_register() takes dev and it refers to priv->matchers and priv->ctx. 2) extensibility. What if flow_dv_create_action() needs more fields of priv= when adding another new action in the future? Thanks, Yongseok