From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0052.outbound.protection.outlook.com [104.47.2.52]) by dpdk.org (Postfix) with ESMTP id D966E1B59B for ; Tue, 9 Oct 2018 20:49:57 +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=S575WDlN7b+kLgJZF7u0UCmP/aIK/ZV4ysmPv/v4trs=; b=FnwT7bWU0PzFiwytWmz6SxHNSZl/FpG+pG85NVdG556fQ72tQAhOZuRXvlqQfrI2hdtT05j3z6u9J3ha/IENXJEliAT4qP83jPoZ07XM3zW9LWHP+s2J9GZ7FiWnFlmXPeFvp+Iw1ZdKvfndwcdga6nc1P7ipw2n1IdNqQq26Ek= Received: from VI1PR05MB4224.eurprd05.prod.outlook.com (52.133.12.13) by VI1PR05MB4736.eurprd05.prod.outlook.com (20.176.4.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.22; Tue, 9 Oct 2018 18:49:56 +0000 Received: from VI1PR05MB4224.eurprd05.prod.outlook.com ([fe80::f911:fe8:927d:400b]) by VI1PR05MB4224.eurprd05.prod.outlook.com ([fe80::f911:fe8:927d:400b%4]) with mapi id 15.20.1228.020; Tue, 9 Oct 2018 18:49:56 +0000 From: Dekel Peled To: Yongseok Koh CC: Shahaf Shuler , "dev@dpdk.org" , Ori Kam Thread-Topic: [PATCH v2 1/4] net/mlx5: add flow action functions to glue Thread-Index: AQHUXknVWgczpvolmUeaztg7JTy3rKUVwbuAgAGCtLA= Date: Tue, 9 Oct 2018 18:49:56 +0000 Message-ID: References: <1538059845-35896-1-git-send-email-dekelp@mellanox.com> <1538922308-9516-2-git-send-email-dekelp@mellanox.com> <20181008194306.GB7844@mtidpdk.mti.labs.mlnx> In-Reply-To: <20181008194306.GB7844@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; VI1PR05MB4736; 6:i23S+AEKCMmQRojIf9riBL9FIxat7Om41lns7A3pOAyr/s76aGta2Z0GL1aZI6mPPJRCvsz+vjoQ7AIehteHQjz48oD543pEhpw27lPaDOjQSjPQOGU8y6NO9ttpP28ZV0eLT/pZh+jMw5NA9VltC9EcZNTUeH04HzV+WIUx1uLy/b7nmFaM69ktg1k6t9Mg4uBCi1dnkLck0+ep8Y/qTKI7mW8NEzPTgWlU8zaEU7UAFs8zDLG6eDmOY3IiSvCB/xQ4MnWEg86MQKXMYBE4A/RrLYlt5nS+E5xRhekC2Ot9CLADlgvwfSV6S6B80nn3SSEz9EvzXzcRhw8WmjcYs5VRRkvCoBVLqmeM6DV9crpz+Da5dikXoo6+lzDB6lecHda9R3zWY8WmAJYBM2ucAY3ZRA8Wdf8tFkZmCHcnhqXEVUW7h6d5p+5iVMXUQrrB77akyBGUm0ehcE3chD4swQ==; 5:oEQPW8tM0a15f0MOKZ7q3aSnxNN/HC/tss6TwOIamTKWZF4T+d14miSD1kQFWz1AXMnsZcuPkBCVAn8aYsQ5cZqi+yzq4rMRPiyKpWnr14hqRlzA5vOrqpoha8QkrU+PiUC64S5Ug8e6YhwE53+Mg6DvipP2Rr3519E9xo3wkw0=; 7:SNF+Jy9e0zUOItznRz8Mx8LRwEoJt0SrS+ixSH7SzDcLczVoIOfVy32PV7Zzq65qndovTBavioaLFNQPQC6pwLMgVPwTeR2mK3qJOk38s48PshGPrqVMQ8bL7gretB/kAXOdf0uVH63NJHmgKB3veMChwDqgQPxSu+thJ+3bEM1qjAJ13+Gdfap6jR4enxy9qH3i7E4MEJs4Tp7J2HQV1Thy0O5+924t24bB4qmvyEoVAMNxyOkWCrFcjhNCLTC6 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: c3734399-cf7f-4ab7-2078-08d62e1801c2 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:VI1PR05MB4736; x-ms-traffictypediagnostic: VI1PR05MB4736: 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)(20161123562045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051)(76991055); SRVR:VI1PR05MB4736; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4736; x-forefront-prvs: 08200063E9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(396003)(346002)(136003)(376002)(13464003)(199004)(189003)(14454004)(33656002)(446003)(11346002)(229853002)(476003)(486006)(97736004)(4326008)(86362001)(25786009)(55016002)(2900100001)(6246003)(9686003)(107886003)(105586002)(106356001)(53936002)(6636002)(186003)(26005)(5250100002)(478600001)(305945005)(7736002)(6862004)(74316002)(102836004)(6436002)(68736007)(8676002)(2906002)(256004)(66066001)(7696005)(76176011)(316002)(3846002)(6116002)(71200400001)(54906003)(53546011)(99286004)(71190400001)(81166006)(81156014)(8936002)(5660300001)(6506007); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4736; 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: 9UVBgQUlxYZqNmoJuTaEEL3/KRxgo+733vJsL/vgCXv1f4ifaHzCSyGrb06PLJYB8yFEjLP1sBalFpaqJAHZ6ZvI9iHkolNI3QYUijCh4yERTi5XS2F3Hy6Jc52uY4oaPVXphmQ6l3a8z1PLQvlVHrYEUVlIt0xsXP4rJD9/MVQULa9VRQSMeFLgGJAeBTgOtlp/vVlZ02ORJIrZnLwxcPPE7RdRATClp3KamWGCfy6vuRAYUR2o9m/aAiuNl2h/k9nw9grul81e875gLno9LjLNkFQKHvsWTAAP+ioIcRf3aVrxXCWpXXoA3akt+ZF9J5Z6qKqutBIBkQZC/CBWVevMVlSIzm8JribEr+PpMQA= 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: c3734399-cf7f-4ab7-2078-08d62e1801c2 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Oct 2018 18:49:56.1795 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4736 Subject: Re: [dpdk-dev] [PATCH v2 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, 09 Oct 2018 18:49:58 -0000 Thanks, PSB. > -----Original Message----- > From: Yongseok Koh > Sent: Monday, October 8, 2018 10:43 PM > To: Dekel Peled > Cc: Shahaf Shuler ; dev@dpdk.org; Ori Kam > > Subject: Re: [PATCH v2 1/4] net/mlx5: add flow action functions to glue >=20 > On Sun, Oct 07, 2018 at 05:25:05PM +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 > > --- >=20 > I'm not still able to compile this patch on my host, which is RH7.4 with = MOFED > MLNX_OFED_LINUX-4.4-2.0.4.0. >=20 > > drivers/net/mlx5/mlx5_glue.c | 33 > +++++++++++++++++++++++++++++++++ > > drivers/net/mlx5/mlx5_glue.h | 9 +++++++++ > > 2 files changed, 42 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); } >=20 > Shouldn't this be under HAVE_IBV_FLOW_DV_SUPPORT? My host doesn't > have it either > - ibv_destroy_flow_action() and ibv_flow_action. >=20 > > + > > 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) { #ifdef > > +HAVE_IBV_FLOW_DV_SUPPORT >=20 > I don't think your change can be protected by this. According to the git = logs of > rdma-core, HAVE_IBV_FLOW_DV_SUPPORT is to mark the following patch of > Yishai Hadas, >=20 > mlx5: Introduce mlx5dv_create_flow >=20 > While, the flow action has been added by another patchset of Mark Bloch > later, >=20 > mlx5: Add packet reformat flow action >=20 > So, it seems to need another macro, doesn't it? > E.g. HAVE_IBV_FLOW_ACTION_DV_SUPPORT Will add it according to your suggestion. >=20 > > + 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..8ef4fcc 100644 > > --- a/drivers/net/mlx5/mlx5_glue.h > > +++ b/drivers/net/mlx5/mlx5_glue.h > > @@ -44,6 +44,8 @@ > > struct mlx5dv_flow_matcher_attr; > > struct mlx5dv_flow_action_attr; > > struct mlx5dv_flow_match_parameters; > > +enum mlx5dv_flow_action_packet_reformat_type; > > +enum mlx5dv_flow_table_type; > > #endif > > > > /* LIB_GLUE_VERSION must be updated every time this structure is > > modified. */ @@ -85,6 +87,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 +140,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 > >