From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20074.outbound.protection.outlook.com [40.107.2.74]) by dpdk.org (Postfix) with ESMTP id 830592C2B for ; Wed, 3 Oct 2018 08:59:22 +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=/bVQrNP3nDlr+4jZA+NqDjH+aZQ0ivPmdyuCR2Tva2Y=; b=UuBmO0YUnIEJ/EwZaIzUhDPmhX7j0a8LyhFz7xetufgFlGSnoXQqCH3NmsO/eGx8PxkkXsArgvv3AHOdngg3MKwjHFtQX+qSkev5FQiMDW+HWJrMI4pPvty0cA4QQezO4eshXjUChoFOHMLY4hK7rKtmjpx4gh4gca6tk9BLJBA= Received: from VI1PR05MB4224.eurprd05.prod.outlook.com (52.133.12.13) by VI1PR05MB5133.eurprd05.prod.outlook.com (20.178.11.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.24; Wed, 3 Oct 2018 06:59:21 +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 06:59:21 +0000 From: Dekel Peled To: Yongseok Koh CC: "dev@dpdk.org" , Shahaf Shuler , Ori Kam Thread-Topic: [PATCH 1/4] net/mlx5: add flow action functions to glue Thread-Index: AQHUVnG4Vf72LvPgVEqK6sj4q+YWjaULKk4AgAHx8kA= Date: Wed, 3 Oct 2018 06:59:21 +0000 Message-ID: References: <1538059845-35896-1-git-send-email-dekelp@mellanox.com> <1538059845-35896-2-git-send-email-dekelp@mellanox.com> <20181002010223.GA10028@mtidpdk.mti.labs.mlnx> In-Reply-To: <20181002010223.GA10028@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; VI1PR05MB5133; 6:z62kn820RqxYF4u6k7htMKlXyo4BDcYlVlm6C4gT4PFbfrKOGD2XXXrW9OH/PowJg0gLB3ixzk5DP2V/7kgTmjplW5jZTEWD7lQW2ECjVUn2PE3FYwsW3Im634ErNCz+WJHfVu1pUBdY6oAxolOUJGpsRI30d6kf18sKpfg61qZeldI1VE+DWfgwBWGVWpEAw70PSDHFXdHn/a+aHzIQOk4XLBLpfOsCvk1QblceJBnDiLQv7GsSilOxaVwuz4IvaruOCwx4U0eD86TJsPkTdKQ+O5B4GilNr/jUoIVOSHbYDikmyFt8LSEJ4INf/sRE1YknQ5AoMY22cz/HMVi4brLh+Ljo79pPASPO4SmYhXq3m4fMQZKRrlR3BRZnG2tayKi7mE4eLTUmZvArbqZxPvWMXMdZxD/quN7ofxr6Lt9s6wVamkzb1uJWfOC/MkEnGpXdylJg+NMHBgaZOKEdOg==; 5:a7uXfnq1CRFC0U0lmdziGwhIX0DiFtrmwI3k4Q0GP3hpnx96U7td+Boi8mXXLdFb1hseDyyCGdq5XNz7PeOLM4NrR+7q9uOTCaYUj1pDvUQeldJCM0yM3g/gTodMkNkEcQ8hrSUsjrdSrHz7M02e781j/UJR3MknKnrijztR+74=; 7:x9KRjuhgkGHYfrzgcZDqOgx/eNw3PzhsIpsifQ8N4sMAlK4aMz8Bnboi9C+FLG7lLg8lvn/nf6VpUzs2imo+qfC4MHGwbBG+0jd2HzjFTSMXKbDzIBTOTGKipWDwoTYkQB+w9zIeST77NCjRNJSMbcbtZ6txZV7hWRoTN2kS1DuVl7cb/mbPJB0xfDOEsS+Bh5bXnf0WJZb2awOapqnvQSY4L6eu8KlGrf3ERvq0Z3BZCBnh9sXM7jeTsuy1suD/ x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 6205d355-5c84-46d0-116a-08d628fdbece 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:VI1PR05MB5133; x-ms-traffictypediagnostic: VI1PR05MB5133: 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)(93006095)(93001095)(10201501046)(3231355)(944501410)(52105095)(3002001)(6055026)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201708071742011)(7699051); SRVR:VI1PR05MB5133; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB5133; x-forefront-prvs: 0814A2C7A3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(39860400002)(396003)(366004)(376002)(13464003)(199004)(189003)(4326008)(9686003)(2906002)(305945005)(316002)(55016002)(25786009)(74316002)(6636002)(86362001)(107886003)(53936002)(54906003)(33656002)(7736002)(6862004)(6246003)(66066001)(7696005)(76176011)(53546011)(5660300001)(6506007)(229853002)(71200400001)(71190400001)(8676002)(81166006)(81156014)(8936002)(99286004)(106356001)(6436002)(105586002)(5250100002)(26005)(102836004)(2900100001)(14454004)(186003)(256004)(486006)(476003)(446003)(11346002)(97736004)(6116002)(68736007)(3846002)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB5133; 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: mxGS1ij2/ehXVmKeEXrqzTrjYQjcAkDi1C5+OSTKHtKfrCwdrUEG+7jMF+kn3hvq55khCFyDh9qVtcyYrac/g425aGFH5mP9eS7okaCFZCM5vgqfUmlVSEg6n3CpFOgeO255xyRwcQHLUHaEPqzmsgdlyo52578JnJoDa9ZuqQPMqQItexeMsu0zNoB72yyUe6L+tateo/uiP2+TZCADcE+NEYNgYMM3cnE51q8sxzH7VtbnZoDla8yVqIAlXOtLUxHWMNuCnd9RBdusouGhwIR+B1KKFm36Y595QhtUsNE3gUMrCTGvlQ95JSLZKsjSmnaHH5f0QPdQEvUJCx+FOaK3i7rxOjy6hvTZDHu88XQ= 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: 6205d355-5c84-46d0-116a-08d628fdbece X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2018 06:59:21.1891 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5133 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: Wed, 03 Oct 2018 06:59:22 -0000 Thanks, PSB. > -----Original Message----- > From: Yongseok Koh > Sent: Tuesday, October 2, 2018 4:03 AM > To: Dekel Peled > Cc: dev@dpdk.org; Shahaf Shuler ; Ori Kam > > Subject: Re: [PATCH 1/4] net/mlx5: add flow action functions to glue >=20 > 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. > > > > Signed-off-by: Dekel Peled > > --- > > drivers/net/mlx5/mlx5_glue.c | 33 > +++++++++++++++++++++++++++++++++ > > drivers/net/mlx5/mlx5_glue.h | 7 +++++++ > > 2 files changed, 40 insertions(+) > > > > 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); > > } > > > > +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 } > > > > +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) >=20 > 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. Done. >=20 > > +{ > > +#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); > > }; > > > > const struct mlx5_glue *mlx5_glue; > > -- > > 1.8.3.1 > >