From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00066.outbound.protection.outlook.com [40.107.0.66]) by dpdk.org (Postfix) with ESMTP id 2080D1B118 for ; Wed, 3 Oct 2018 13:35:41 +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=VICO67iPFmPXYmoebjxF1q7d03HvzdQJIzOAXFn+4gw=; b=KtVxU1dT7xq3SI6y31RrS2Tme3N1Z5fjXZCLs2VJdsym2mWFBIMri32ok46dZAhobtVEsSU3h5ajpYZTYFRxX1hn5dL8c/yNdMF5GgquuRpbj7RvBZRklrsxXW+02Xx75zssnXmdw5SGkmRt2PHf6UKPGLap1Yhujq697nFaZJs= Received: from VI1PR05MB4224.eurprd05.prod.outlook.com (52.133.12.13) by VI1PR05MB1855.eurprd05.prod.outlook.com (10.166.44.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.23; Wed, 3 Oct 2018 11:35:39 +0000 Received: from VI1PR05MB4224.eurprd05.prod.outlook.com ([fe80::f911:fe8:927d:400b]) by VI1PR05MB4224.eurprd05.prod.outlook.com ([fe80::f911:fe8:927d:400b%3]) with mapi id 15.20.1207.018; Wed, 3 Oct 2018 11:35:39 +0000 From: Dekel Peled To: Yongseok Koh CC: "dev@dpdk.org" , Shahaf Shuler , Ori Kam Thread-Topic: [PATCH 3/4] net/mlx5: add DV encap L2 and L3 operations Thread-Index: AQHUWuZ81hz3HEl6d0WhwfOEWORtC6UNJfewgAAcWwCAACH/wA== Date: Wed, 3 Oct 2018 11:35:39 +0000 Message-ID: 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> <20181003093245.GC21743@mtidpdk.mti.labs.mlnx> In-Reply-To: <20181003093245.GC21743@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=dekelp@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR05MB1855; 6:Eqews5RUN1KTpbm8WWKrnmdgoXWKTIn5BQkLiK4c6vtsQJ8wH+mMU22lfgMJQgSWN+QNfs2JI+rltbYFA93ozMxXI3whjB9aP88whdyUJZi3IuR0i2Ye+eD0r97CqxD2ry6uJSr39H004v6bxQVpozioO2Ki+R90DtHU4RrJfGpsdBivskmFR1dCYSskaOa6JpIglT0NIksvWD7FZAd8kDQwLnCZRnQoPTjts0cAC6nT5yBlKLl+Nxv0WMPpt++yfO+npyqL4zMWy6qoQ3Ty/TryFONUYiBLW9wFVhIycPL4KLZ3NnzS+AzPy3EOlWreSK3mJhsL1goRmEa3sfFgvywWiwKTID1+hwPAuqL2uck1jAQu0oVNlRyoJYbSCBgxlVoE/D4ciKSA4m9ILXtE0U1FHUOafjosgQwBRxHZD8LGy9ZdyMDgsA8K/mkcsyQGQz5ydbMQb6EXrWiB57d1AQ==; 5:VVk0liksqcc1c7QI+nZlTV2PheTSvuhhWYum8gQHCIJ3Cxpa+xdVRMIpSCCTZmmzqKYqgvJuVl91WzS/zEGSKx+cgQYuUGWXF0dbNcr5Y8MO/wE/OqNKjEd/JqIxVH/kaIt8hXV27ayuZslHJfYij2pAyP98mcXtV+t2zieXbcM=; 7:WbbMHw3nXRTntr3gvke+8VDmwMwxB3SbKwqFOVUrOOgxsZOmOvRbGkrACbG019qKht2u9ob0MY1cYd2Vns0YH7AkM7XuLjM1sO6ZEZKZ6SXVfuTOJG5hSZjkTEYLsB8YATwpP3Pye9sOT7OqD9iZC76NKAYrfyq2N6Av9G7rXb5Nps6errt6RyeDxD7M1WOKzdP7klOE26Mny79azdUekWA99u76i91oiJOC5nkdRQI1u1GzgO3GeYqVCv0BHTZU x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: dc8b59d2-6981-4227-206e-08d62924582f 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:VI1PR05MB1855; x-ms-traffictypediagnostic: VI1PR05MB1855: 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)(10201501046)(3002001)(93006095)(93001095)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:VI1PR05MB1855; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB1855; x-forefront-prvs: 0814A2C7A3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(136003)(346002)(396003)(39860400002)(13464003)(199004)(189003)(93886005)(105586002)(106356001)(33656002)(14454004)(2906002)(478600001)(68736007)(8936002)(6116002)(316002)(81166006)(81156014)(3846002)(305945005)(8676002)(74316002)(7736002)(6246003)(97736004)(2900100001)(5250100002)(53936002)(229853002)(55016002)(9686003)(6436002)(6636002)(71200400001)(71190400001)(4326008)(107886003)(6862004)(5660300001)(25786009)(76176011)(102836004)(11346002)(446003)(86362001)(53546011)(26005)(186003)(476003)(486006)(54906003)(99286004)(256004)(7696005)(66066001)(6506007); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB1855; H:VI1PR05MB4224.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: BPDujcSMIt25C/TWSPBOSbnIgWLco/ZqJUMbFQ34ndtBfVFPvC9/LUHmsYUFsDSg7Y8ocIoExEpPEiZveyLnBCP4xywv02/kMOcLbBTw4/dnmmX6ejOuNf0U1i5NKQjm1jbvEsz8pWn2fCUT96G4F2NQyHO4vUqGSvBeUOaKEoz3Qt7PBrduGl/QtZARkY2ZpN1PbiGwmMRhf0bvrAQx4opx+PQqGmDJ6npiWQHPkh8xEr8nBj5ACsCP+5SctbCHJxoDQtrwLZ6CV58nzmC0FAYPuoOQPXF2Uwi2jBKCZlVpUD1yWMwV1eJ+BZV4HVEyiyQQlbx7GISx7jePNjkH8Kk0tTHSb+HJvX2mM5v04W8= 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: dc8b59d2-6981-4227-206e-08d62924582f X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2018 11:35:39.2986 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB1855 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 11:35:41 -0000 Thanks, PSB. > -----Original Message----- > From: Yongseok Koh > Sent: Wednesday, October 3, 2018 12:33 PM > 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 Wed, Oct 03, 2018 at 01:35:16AM -0700, Dekel Peled wrote: > > Thanks, PSB. > > > > > -----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 > > > > > > On Thu, Sep 27, 2018 at 05:50:44PM +0300, Dekel Peled wrote: > > > > This patch adds support for Direct Verbs encap operations, L2 and L= 3. > > > > > > > > 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); > > > > > > Indentation. > > > > I'm using very long MLX5DV_... names defined in rdma-core. > > If I use the required indentation I get illegal line length. >=20 > The following was my suggestion and it is compliant. >=20 > encap_verb =3D mlx5_glue->dv_create_flow_action_packet_reformat > (ctx, encap_data->size, > encap_data->size ? encap_data->buf : NULL, >=20 > MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L2_TUNNEL, > MLX5DV_FLOW_TABLE_TYPE_NIC_TX); >=20 > Please make the same change to others. Done. >=20 > [...] > > > > @@ -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, > > > > > > If it is just priv->ctx, it would be better to get dev as an arg and > > > make mlx5_flow_dv_create_encap*(dev, ...) gets priv->ctx from dev. > > > > I considered it during implementation, but preferred to give the functi= ons > only what they need. >=20 > Two reasons. >=20 > 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. >=20 > 2) extensibility. What if flow_dv_create_action() needs more fields of pr= iv > when adding another new action in the future? Done. >=20 > Thanks, > Yongseok