From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0041.outbound.protection.outlook.com [104.47.1.41]) by dpdk.org (Postfix) with ESMTP id 60E1758C4 for ; Tue, 2 Oct 2018 03:02:34 +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=zEye7T2/5i9Xi+1LaOLv+0HtDOkBt8JR57+ruOEI+Ow=; b=Pl2RubFMgT12INvkJqYY5+f2mLhCH50KEN9r82kVpF9RZQxc+sRnwmrrLS3D41w9Khg5ZgY+JI1cT09pkmhf5MjcmmnIRbBgMczKTj7ochDmj6lA2My/xLvfG3/chbcmmXiqXpGsBwyUbl8XpeoXGTKNhN2qDTVMioYiGXOIL6g= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB4073.eurprd05.prod.outlook.com (52.134.68.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.24; Tue, 2 Oct 2018 01:02:32 +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; Tue, 2 Oct 2018 01:02:32 +0000 From: Yongseok Koh To: Dekel Peled CC: "dev@dpdk.org" , Shahaf Shuler , Ori Kam Thread-Topic: [PATCH 1/4] net/mlx5: add flow action functions to glue Thread-Index: AQHUVnHZpbFmYeT+akGT43qub7RZP6ULKkQA Date: Tue, 2 Oct 2018 01:02:32 +0000 Message-ID: <20181002010223.GA10028@mtidpdk.mti.labs.mlnx> References: <1538059845-35896-1-git-send-email-dekelp@mellanox.com> <1538059845-35896-2-git-send-email-dekelp@mellanox.com> In-Reply-To: <1538059845-35896-2-git-send-email-dekelp@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BN6PR2001CA0032.namprd20.prod.outlook.com (2603:10b6:405:16::18) 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; DB3PR0502MB4073; 6:6XdH//BFWEP8CrPgAqLW8Wv8+BVDFZRZ/YSejeefM1UbyIZuQlqnvftpI5cogLywMmhAv9NPf+l3YqIomXdYmAMlgzZ9q5pM4P00qxPMi7NRyFRrzVUkFg06pbWLeaLNB8nstabEdEU+cB3CUb6nSRHWcwg+RhWAXJU908YI9qBKGKPcmtigUXPELhU7fQzHC9rbePUYctlLYVFUygszzAorVZ3/UZEE60zsCfx/H3qrYyscc5mBtkIdtZOGH0iCXaAIF0k9Y3JUc/2ht899PkxAjUb9e8018Ac6y+EDOME2AdPDn/ZI9P2smn+eZJrnyHKMftR/1Ispklc11baT0/jAKqQ676ssoTxAyporLgr3/DBexFjSW91bJNwYqnUtNG3XCncqrhlDjM8kCZygE3RmJvosTMwp05JT/VdM3q7DJW6pvlXQ+8gcUk4kvIiTnOg0si4YR80VCa2IJ63UGQ==; 5:b/TzsyTaaFC6vdCFaa/6k3hDY1uhw1SfipSwdbsxI2XFrf6ReU7SJB+qF4LhMl22kCa0DG0ofTlKa2kK1IvHUjXKmWMTdY6TdTrjDrWKlt5D1or78FZrfvdOe01hKmXVn0ZZ9+wXR48HtINap3o+Jw+xQ/cUl4X8XkelzMm9ug4=; 7:GaEQIjqxJRnQety6I6fcIeWH/obJZX2SIydBIs3898gfDY2nvL1bql4yAq8PdJOtcnivxL8pcXxj/7nxGMcfIWKwxxIBVfVMwaBGoKsLH68IRKCid9jQJi6BjXbW7yCVQ0zAeKF8/OPRERvEuUYwbXe2aE4RDr9RR6lePMeEhblElnNVpvkM4apv1agjFMe2vMsyJqbSP1yEJBH1attf1Oanl9O1BNFnHTYxwQ6DqS1sEY1FlgkneEzRcnkriTCF x-ms-office365-filtering-correlation-id: 57edf93c-63af-4297-6f14-08d62802bb8a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB3PR0502MB4073; x-ms-traffictypediagnostic: DB3PR0502MB4073: 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)(3231355)(944501410)(52105095)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051); SRVR:DB3PR0502MB4073; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB4073; x-forefront-prvs: 0813C68E65 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(346002)(136003)(376002)(366004)(199004)(189003)(25786009)(66066001)(5250100002)(86362001)(2900100001)(229853002)(53936002)(8936002)(81156014)(97736004)(6862004)(81166006)(4326008)(6436002)(8676002)(6512007)(106356001)(107886003)(478600001)(6246003)(76176011)(52116002)(68736007)(6486002)(105586002)(99286004)(71190400001)(71200400001)(2906002)(305945005)(316002)(7736002)(1076002)(256004)(9686003)(6636002)(5660300001)(102836004)(54906003)(14454004)(26005)(476003)(446003)(486006)(6506007)(11346002)(386003)(33896004)(3846002)(6116002)(33656002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB4073; 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: BvFLe3jY5t+8oA0QiqO42dsyPdiin8NM51Q/GhocvT11c0CgqOEOkhNtLiT4qx26svOcxAsEtcZ4HrLOAWK3+nouZ/t/xGFcFRSjGAoST7wxiyzGXrkIzH8GPLdDvZPgyAfzOAk+ixrYk4Wuunh6PINgP1HnM+rcYW+XjAuNciQWYqmwi5imwnv6kWMv+gnzDflgSVU5bnZVSuVmtM7/9Sli0naE6nXhUrR/7L/2owbq+ejV7JLqIVBMiX4LuP9KBnrTC48lTPJUpcB7xxhmK5+uszMbBhHPGHWPve3drOhgDx7P1mp2ADM/GrToZQhasQXT238veyr2AU23vCbs7UdV7bTpfZ3H88NB1Buareo= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <3B002CE40B81B644A3A4784827BFC115@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57edf93c-63af-4297-6f14-08d62802bb8a X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Oct 2018 01:02:32.6395 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB4073 Subject: Re: [dpdk-dev] [PATCH 1/4] net/mlx5: add flow action functions to glue 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: Tue, 02 Oct 2018 01:02:35 -0000 On Thu, Sep 27, 2018 at 05:50:42PM +0300, Dekel Peled wrote: > This patch adds glue functions for operations: > - Create packet reformat (encap/decap) flow action. > - Destroy flow action. >=20 > Signed-off-by: Dekel Peled > --- > drivers/net/mlx5/mlx5_glue.c | 33 +++++++++++++++++++++++++++++++++ > drivers/net/mlx5/mlx5_glue.h | 7 +++++++ > 2 files changed, 40 insertions(+) >=20 > diff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c > index 48590df..caa4c34 100644 > --- a/drivers/net/mlx5/mlx5_glue.c > +++ b/drivers/net/mlx5/mlx5_glue.c > @@ -174,6 +174,12 @@ > return ibv_destroy_flow(flow_id); > } > =20 > +static int > +mlx5_glue_destroy_flow_action(struct ibv_flow_action *action) > +{ > + return ibv_destroy_flow_action(action); > +} > + > static struct ibv_qp * > mlx5_glue_create_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *qp_init_= attr) > { > @@ -388,6 +394,30 @@ > #endif > } > =20 > +static struct ibv_flow_action * > +mlx5_glue_dv_create_flow_action_packet_reformat > + (struct ibv_context *ctx, > + size_t data_sz, > + void *data, > + enum mlx5dv_flow_action_packet_reformat_type reformat_type, > + enum mlx5dv_flow_table_type ft_type) Aren't these two structs also new? If so, you might have to declare it in mlx5_glue.h to avoid compilation error. Please refer to mlx5dv_flow_matcher= as an example. > +{ > +#ifdef HAVE_IBV_FLOW_DV_SUPPORT > + return mlx5dv_create_flow_action_packet_reformat(ctx, > + data_sz, > + data, > + reformat_type, > + ft_type); > +#else > + (void)ctx; > + (void)data_sz; > + (void)data; > + (void)reformat_type; > + (void)ft_type; > + return NULL; > +#endif > +} > + > alignas(RTE_CACHE_LINE_SIZE) > const struct mlx5_glue *mlx5_glue =3D &(const struct mlx5_glue){ > .version =3D MLX5_GLUE_VERSION, > @@ -414,6 +444,7 @@ > .modify_wq =3D mlx5_glue_modify_wq, > .create_flow =3D mlx5_glue_create_flow, > .destroy_flow =3D mlx5_glue_destroy_flow, > + .destroy_flow_action =3D mlx5_glue_destroy_flow_action, > .create_qp =3D mlx5_glue_create_qp, > .create_qp_ex =3D mlx5_glue_create_qp_ex, > .destroy_qp =3D mlx5_glue_destroy_qp, > @@ -437,4 +468,6 @@ > .dv_create_flow_matcher =3D mlx5_glue_dv_create_flow_matcher, > .dv_destroy_flow_matcher =3D mlx5_glue_dv_destroy_flow_matcher, > .dv_create_flow =3D mlx5_glue_dv_create_flow, > + .dv_create_flow_action_packet_reformat =3D > + mlx5_glue_dv_create_flow_action_packet_reformat, > }; > diff --git a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h > index f6e4e38..7431f58 100644 > --- a/drivers/net/mlx5/mlx5_glue.h > +++ b/drivers/net/mlx5/mlx5_glue.h > @@ -85,6 +85,7 @@ struct mlx5_glue { > struct ibv_flow *(*create_flow)(struct ibv_qp *qp, > struct ibv_flow_attr *flow); > int (*destroy_flow)(struct ibv_flow *flow_id); > + int (*destroy_flow_action)(struct ibv_flow_action *action); > struct ibv_qp *(*create_qp)(struct ibv_pd *pd, > struct ibv_qp_init_attr *qp_init_attr); > struct ibv_qp *(*create_qp_ex) > @@ -137,6 +138,12 @@ struct mlx5_glue { > struct mlx5dv_flow_match_parameters *match_value, > size_t num_actions, > struct mlx5dv_flow_action_attr *actions_attr); > + struct ibv_flow_action *(*dv_create_flow_action_packet_reformat) > + (struct ibv_context *ctx, > + size_t data_sz, > + void *data, > + enum mlx5dv_flow_action_packet_reformat_type reformat_type, > + enum mlx5dv_flow_table_type ft_type); > }; > =20 > const struct mlx5_glue *mlx5_glue; > --=20 > 1.8.3.1 >=20