From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30080.outbound.protection.outlook.com [40.107.3.80]) by dpdk.org (Postfix) with ESMTP id 452751B440 for ; Mon, 8 Oct 2018 21:43:17 +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=ebEcACafTTG+d4UdaAl3HNoqUgf28OlbyX4hkOWOxIM=; b=qKhi2ne6V1sBV4LoqMJ6tZG9OsUfy1IREsKDAe5l3BjMIbIq1U26DObJz7XxLajlGIfmie3KL+C9N2aRNUVOiFBj90e/y2T167RTpWlqM3AwrOuo/0p05KwLJ9CfUel8b/SMrICwFzQpw2j6jvaX7Wx5x1edFSAvZq2Vw0v4AoA= 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.1207.26; Mon, 8 Oct 2018 19:43:16 +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.1207.024; Mon, 8 Oct 2018 19:43:16 +0000 From: Yongseok Koh To: Dekel Peled CC: Shahaf Shuler , "dev@dpdk.org" , Ori Kam Thread-Topic: [PATCH v2 1/4] net/mlx5: add flow action functions to glue Thread-Index: AQHUXknVTeYehxdigECctffBf7uGYaUVwbGA Date: Mon, 8 Oct 2018 19:43:15 +0000 Message-ID: <20181008194306.GB7844@mtidpdk.mti.labs.mlnx> References: <1538059845-35896-1-git-send-email-dekelp@mellanox.com> <1538922308-9516-2-git-send-email-dekelp@mellanox.com> In-Reply-To: <1538922308-9516-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: BN6PR2001CA0030.namprd20.prod.outlook.com (2603:10b6:405:16::16) 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:DiLIzd5BYF2h1xac5U/4hq3J+Mkn5xCUnHeOT/ppMkr3lCqcF7Jude6CiHNwUL7mJ+OPy1noGe0MY/LXHfZ5zGLeX4JIhEKiHsIzEPOL8QW55BiTjQ49VSoHFol96j+uwnyosvy7a0jbnvHNquW7GTpm4EUANdqGZLUm9k+DakEmzMfyTNPUA0WFt6P9FReluUvfxT/gH7SWCXYqw/eWmBPynus2WOenKb2hZQMAG6BHYlrlZR0kWxotxTyxgrvq/hUOJR+t2zhekwmQtnQ30vLjHA4dx0A0eyXGSt+YfpqIF9hOJoiIQrWr8c3CGWI3JiKi0E1VI6nZgNXNzj/0Rwk/jr/bl9s7WhGaZuJKor/e8e5CvXl+643EakIes9TNayOA0Np4t2tCQNjh1gK8yp9bSH64l79bitJZvkH8ylyTqfi/nKZzqi5an52w8QEmep8SwbTct++pg+VNhYvpqg==; 5:lMUiMB3aXGf86W1sUuEcy6JEIML7eD4Sm+lNwIs2y7vPGnJabNZ0iYZqPZ76Rl8HepyQdn5g0bB12+g0q8flcYg7E3qCS1egAXxsW953k1Ai4Uj+BRdqCHfzDmqGu87UwAA2JrwN+OF9mGMkbFnzWt69weaO/WuS63+CONJjGpg=; 7:N4tB7A/ONvvn8J6sRowiq+7ztueOYOKdFkQyzE/wU2vil+C1h8MGlYMSj9xlMWwpxj4wynHTvUyO/yFFpAh9i8qZzmxC26zpgMK43llk34oqWHZs0Jj9JazG5f/MX6uRl2lPxiG0IMEO/ztnldg1pVEx/0Cuo6M0zncT8xsoeRx8GmaUdPtI08BPG04WSw0kknSTNZSnaWIlT1pUZJYxd3l8QJXN7VvT3o9+AnvR8iKxy3Zzcq7nebxfLgokFnZf x-ms-office365-filtering-correlation-id: 569be15a-0896-4b96-a8f2-08d62d564a39 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)(5005006)(8121501046)(3002001)(3231355)(944501410)(52105095)(93006095)(93001095)(10201501046)(6055026)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:DB3PR0502MB3977; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB3977; x-forefront-prvs: 081904387B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(189003)(199004)(33656002)(99286004)(33896004)(386003)(6506007)(81156014)(229853002)(52116002)(81166006)(7736002)(66066001)(76176011)(8936002)(105586002)(106356001)(68736007)(478600001)(5250100002)(5660300001)(97736004)(102836004)(316002)(54906003)(186003)(8676002)(26005)(107886003)(486006)(256004)(1076002)(6862004)(71190400001)(6486002)(71200400001)(6246003)(3846002)(305945005)(2900100001)(6436002)(476003)(2906002)(9686003)(6512007)(6636002)(53936002)(11346002)(446003)(86362001)(4326008)(14454004)(6116002)(25786009); 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: UaxpmZRWMfWu1i0izIXK+9Fyxq2Y2qLHjQnsUjLrBAGFBVP0MzyvVQFcGepHEWyfp5x29DMymopUHTkpzcSYe8SSzkMDA9Sj7wKa73VYJ7L+ZKWQXnnFOI+OOGabOBvemF1TzLJhusP/Oqxo59pVGmQCX+qljks9ksJX73oaOmoHYz4qGeyeWhIv63TzcNzg4NcTTXnw+d9BAdB1H+ZRxQS/3/EDM5aQMwd2zlzVJhNyyZ7/wufoiG+DysVlnpczu9In7OMNrtLNLFf8CwVzzjei4zhVhFBMW1jPrc8DlIXepwuyazKF9qOHoWVbyjf3CPLtWuSMAF/QGSPrT+uAH8LA98jAyKFa3Mjg3OD1ezo= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <17D740D6F35DFD4993AC887BBF21A4E9@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 569be15a-0896-4b96-a8f2-08d62d564a39 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2018 19:43:15.9997 (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 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: Mon, 08 Oct 2018 19:43:17 -0000 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. >=20 > Signed-off-by: Dekel Peled > --- I'm not still able to compile this patch on my host, which is RH7.4 with MO= FED MLNX_OFED_LINUX-4.4-2.0.4.0. > drivers/net/mlx5/mlx5_glue.c | 33 +++++++++++++++++++++++++++++++++ > drivers/net/mlx5/mlx5_glue.h | 9 +++++++++ > 2 files changed, 42 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); > +} Shouldn't this be under HAVE_IBV_FLOW_DV_SUPPORT? My host doesn't have it e= ither - ibv_destroy_flow_action() and ibv_flow_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) > +{ > +#ifdef HAVE_IBV_FLOW_DV_SUPPORT I don't think your change can be protected by this. According to the git lo= gs of rdma-core, HAVE_IBV_FLOW_DV_SUPPORT is to mark the following patch of Yisha= i Hadas, mlx5: Introduce mlx5dv_create_flow While, the flow action has been added by another patchset of Mark Bloch lat= er, mlx5: Add packet reformat flow action So, it seems to need another macro, doesn't it? E.g. HAVE_IBV_FLOW_ACTION_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..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 > =20 > /* LIB_GLUE_VERSION must be updated every time this structure is modifie= d. */ > @@ -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); > }; > =20 > const struct mlx5_glue *mlx5_glue; > --=20 > 1.8.3.1 >=20