From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B564BA00BE; Wed, 8 Jul 2020 09:32:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 80A6B1DA1C; Wed, 8 Jul 2020 09:32:32 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00051.outbound.protection.outlook.com [40.107.0.51]) by dpdk.org (Postfix) with ESMTP id 7E27B1DA11 for ; Wed, 8 Jul 2020 09:32:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SB3d/REP34Eg4545VdFIZrGIbrM+7qjmbiCbvcLJFgwEOfTXT2N+iL7JTOaRXH8yK01ZLCTicQ7FwtcslsF3fIQvcPR528LbXYB0l9Km7lBC7C31g9L+MEKMhTEXPB3e9+yRGM3y2Ct2kmNr9gp5hlbHzq1k9CVJLY8EqAVCs7M2F3z3rSVksmodInEwTelCnjYLHuVZPeDJGFBsA3x+6uazIg5rwX4fJzVEGdPwVykV7yyBfIQO9mSAUhQwxicyMGNQdFd1kwrTBcnjITNFYffuWgnfuUqbFYTa3kKriiSxO4X+dOkbsv0fBtsdwWqu2jksLwa/DqTr1yW7rOnvNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wm6oWlt4dKUYIKyRWbGtjXKz2wBSHGN2sfXMUo2HT/o=; b=duPZRWCcx3cl+HP3Sis6iyx2gQ5jU32UNrU1ESEWM4nmlndJkd6d9qtxBS8n/wsz9ZapqpNrBjZzrXnK2dOxzyscSiVIF4fwt1HII5QQr5skPZbJZS0mCoaSgLPP2Behuzwp82cQtrvV5/nxNVgddHgQG0htwNj1RHqY/pBusM6yDvc9Is5fPaZNkN9iF8H2hi6QQ8FSXzDTdnrI+gU8HTzGhvYrtMwsdtxhZ/yvHUFXQWrUc3LfkYss+/ZoQztG7QO+0gnVDNCCUMoMyxtrIav7m1b3ysHB5aLhKRw0W2ApyCzfBoqn+USrElT4b05e2hcIr70Ml10KjuayFfgy+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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=wm6oWlt4dKUYIKyRWbGtjXKz2wBSHGN2sfXMUo2HT/o=; b=CacKWYkwPf9tCMOGQNG79iLOxKRLGVBb/6LnfI1pfRAmDuocgr9C9BwNxZxR3SQzbmCuh4cAgMgqsOhnm82AbGwkK4XzJj6uFHxS8uFS+TkZZo7qhMlh47IebVIeRO0oDKPm45BkcDz2CrArUyR+eAX+l7equnq7Q2GghlYBOF4= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (2603:10a6:205:8::26) by AM0PR05MB6084.eurprd05.prod.outlook.com (2603:10a6:208:134::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.27; Wed, 8 Jul 2020 07:32:30 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::194e:dc46:7543:50ed]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::194e:dc46:7543:50ed%2]) with mapi id 15.20.3174.022; Wed, 8 Jul 2020 07:32:30 +0000 From: Slava Ovsiienko To: Ori Kam , "jerinj@marvell.com" , "xiang.w.wang@intel.com" , Matan Azrad , Shahaf Shuler , Ray Kinsella , Neil Horman CC: "guyk@marvell.com" , "dev@dpdk.org" , "pbhagavatula@marvell.com" , "hemant.agrawal@nxp.com" , Opher Reviv , Alex Rosenbaum , "dovrat@marvell.com" , "pkapoor@marvell.com" , "nipun.gupta@nxp.com" , "bruce.richardson@intel.com" , "yang.a.hong@intel.com" , "harry.chang@intel.com" , "gu.jian1@zte.com.cn" , "shanjiangh@chinatelecom.cn" , "zhangy.yun@chinatelecom.cn" , "lixingfu@huachentel.com" , "wushuai@inspur.com" , "yuyingxia@yxlink.com" , "fanchenggang@sunyainfo.com" , "davidfgao@tencent.com" , "liuzhong1@chinaunicom.cn" , "zhaoyong11@huawei.com" , "oc@yunify.com" , "jim@netgate.com" , "hongjun.ni@intel.com" , "deri@ntop.org" , "fc@napatech.com" , "arthur.su@lionic.com" , Thomas Monjalon , Ori Kam , Raslan Darawsheh Thread-Topic: [PATCH 07/20] common/mlx5: add rxp database set cmd Thread-Index: AQHWUq4iWRNJIa0dFkujD2I0oFa866j9Tnyg Date: Wed, 8 Jul 2020 07:32:29 +0000 Message-ID: References: <1593941027-86651-1-git-send-email-orika@mellanox.com> <1593941027-86651-8-git-send-email-orika@mellanox.com> In-Reply-To: <1593941027-86651-8-git-send-email-orika@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [95.164.10.10] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: b18be3d0-bab5-450c-ea64-08d82311123c x-ms-traffictypediagnostic: AM0PR05MB6084: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:655; x-forefront-prvs: 04583CED1A x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DOL0vXP95TT1fG7ao70J2soqi2OlETUw7EU60davXX93T0x/21yfrj2OWa2Df6woLBCbihkl7GHtUF/3r8TxzGe3YPp8RM8Oh047Q7cAkvmZ/ZJiM6CsjyXRDtdkj/C1v9KEAS3pIDwnRqRGnfetuGYCg1lETfTbzcU+wgAJH2AQp8/6Iter5bgqJy6ZUdJ61kQ/g8oHX6tyVIWZ0usKCU2o7ri0j3s51cHKkCCsxM/701pAgEXJmH3vuqatNSSEraG8BE4xre9u4N3u7OcVPQ8pMJUj6acqGpIgoJGK3+rBZUHI7aNjXXKO6kq+3g3ZK9FOoFgVS5Nmn25ep4X9xT92g9ZrT7UvF+AYXLjbtqbepZw2JbUPwXIA939cH2Ef x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM4PR05MB3265.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(366004)(136003)(376002)(346002)(396003)(71200400001)(5660300002)(26005)(33656002)(107886003)(8936002)(316002)(54906003)(110136005)(478600001)(186003)(6506007)(7416002)(8676002)(7406005)(53546011)(7696005)(2906002)(66446008)(83380400001)(52536014)(9686003)(55016002)(76116006)(64756008)(66556008)(4326008)(86362001)(66946007)(66476007)(130980200001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: +Uy6eQrvHHJiYHWfNFkC9mULAHbLS8SmPj/azEiWSCjWr2xAWU46q6lX1IiloQ53XI/KawiOROEnOnYbs9mnWrheM86wZzv8OvFdaH9InPJ9y/jFdnHI4FBpGLWbBQ5FUpS8oOziyQqHRjJikIH+SUQ6WEi6QxfSn+qQDnYJpRWMtoSPsbZPmFpT7B+lFUFIs98hM8Oso684ze/Fqdd83f45DZ22fPjy0kUWAxPNC5kJP8yHMHK47AgoO8svmuKkDGbSxMKrfT3CyBzq3Umt3c3Q/BcOOz+uPV1kCs8v+lNITj9Kzvns80SYDEuBhUl4TE/Zb0EIqOJNjIiTWrlkvyajhFTP58HfA6RCFqqNFdDKVtJPaQEw60ZOIFEZLLO31BAy2epY5jCccM5BRJWDDdAK2BOUWudZP5b4+aYZE67dC80L6Y6mgixjOuYAd1Lb3y0tk3dHVFCXbva4NXEndU3hqA4FDHgq9Ey3oSJFGl0= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM4PR05MB3265.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b18be3d0-bab5-450c-ea64-08d82311123c X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2020 07:32:29.8134 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: znakHE44jasATHLoWxDTOlioyQVx9QLxRrSXen4VG//7zKeHL9ILpVYOGm8LlCTNv5z1UIyHv/DJTrdqUh7C1u+eHy2SQsI0WOmUCg7fRFw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6084 Subject: Re: [dpdk-dev] [PATCH 07/20] common/mlx5: add rxp database set cmd 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Acked-by: Viacheslav Ovsiienko > -----Original Message----- > From: Ori Kam > Sent: Sunday, July 5, 2020 12:24 > To: jerinj@marvell.com; xiang.w.wang@intel.com; Matan Azrad > ; Slava Ovsiienko ; > Shahaf Shuler ; Ray Kinsella ; > Neil Horman > Cc: guyk@marvell.com; dev@dpdk.org; pbhagavatula@marvell.com; > hemant.agrawal@nxp.com; Opher Reviv ; Alex > Rosenbaum ; dovrat@marvell.com; > pkapoor@marvell.com; nipun.gupta@nxp.com; > bruce.richardson@intel.com; yang.a.hong@intel.com; > harry.chang@intel.com; gu.jian1@zte.com.cn; > shanjiangh@chinatelecom.cn; zhangy.yun@chinatelecom.cn; > lixingfu@huachentel.com; wushuai@inspur.com; yuyingxia@yxlink.com; > fanchenggang@sunyainfo.com; davidfgao@tencent.com; > liuzhong1@chinaunicom.cn; zhaoyong11@huawei.com; oc@yunify.com; > jim@netgate.com; hongjun.ni@intel.com; deri@ntop.org; > fc@napatech.com; arthur.su@lionic.com; Thomas Monjalon > ; Ori Kam ; Raslan > Darawsheh > Subject: [PATCH 07/20] common/mlx5: add rxp database set cmd >=20 > This commit adds the database set command for the RXP engine. >=20 > Signed-off-by: Ori Kam > --- > drivers/common/mlx5/mlx5_devx_cmds.c | 104 > ++++++++++++++++++++++++ > drivers/common/mlx5/mlx5_devx_cmds.h | 8 +- > drivers/common/mlx5/rte_common_mlx5_version.map | 3 + > 3 files changed, 114 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c > b/drivers/common/mlx5/mlx5_devx_cmds.c > index 74df035..f8760e6 100644 > --- a/drivers/common/mlx5/mlx5_devx_cmds.c > +++ b/drivers/common/mlx5/mlx5_devx_cmds.c > @@ -1616,3 +1616,107 @@ struct mlx5_devx_obj * > invalid_buffer); > return ret; > } > + > +/** > + * Issue the RXP stop database command. > + * > + * @param[in] ctx > + * Context returned from mlx5 open_device() glue function. > + * @param[in] engine > + * The engine to stop. > + * > + * @return > + * 0 on success, a negative errno value otherwise and rte_errno is set= . > + */ > +int > +mlx5_devx_regex_database_stop(void *ctx, uint8_t engine) { > + uint32_t out[DEVX_ST_SZ_DW(set_regexp_params_out)] =3D {}; > + uint32_t in[DEVX_ST_SZ_DW(set_regexp_params_in)] =3D {}; > + int ret; > + > + DEVX_SET(set_regexp_params_in, in, opcode, > MLX5_CMD_SET_REGEX_PARAMS); > + DEVX_SET(set_regexp_params_in, in, engine_id, engine); > + DEVX_SET(set_regexp_params_in, in, regexp_params.stop_engine, > 1); > + DEVX_SET(set_regexp_params_in, in, field_select.stop_engine, 1); > + ret =3D mlx5_glue->devx_general_cmd(ctx, in, sizeof(in), out, > + sizeof(out)); > + if (ret) { > + DRV_LOG(ERR, "Database stop failed %d", ret); > + rte_errno =3D errno; > + return -errno; > + } > + return 0; > +} > + > +/** > + * Issue the RXP resume database command. > + * > + * @param[in] ctx > + * Context returned from mlx5 open_device() glue function. > + * @param[in] engine > + * The engine to start. > + * > + * @return > + * 0 on success, a negative errno value otherwise and rte_errno is set= . > + */ > +int > +mlx5_devx_regex_database_resume(void *ctx, uint8_t engine) { > + uint32_t out[DEVX_ST_SZ_DW(set_regexp_params_out)] =3D {}; > + uint32_t in[DEVX_ST_SZ_DW(set_regexp_params_in)] =3D {}; > + int ret; > + > + DEVX_SET(set_regexp_params_in, in, opcode, > MLX5_CMD_SET_REGEX_PARAMS); > + DEVX_SET(set_regexp_params_in, in, engine_id, engine); > + DEVX_SET(set_regexp_params_in, in, regexp_params.stop_engine, > 0); > + DEVX_SET(set_regexp_params_in, in, field_select.stop_engine, 1); > + ret =3D mlx5_glue->devx_general_cmd(ctx, in, sizeof(in), out, > + sizeof(out)); > + if (ret) { > + DRV_LOG(ERR, "Database start failed %d", ret); > + rte_errno =3D errno; > + return -errno; > + } > + return 0; > +} > + > +/** > + * Issue the RXP program database command. > + * > + * @param[in] ctx > + * Context returned from mlx5 open_device() glue function. > + * @param[in] engine > + * The engine to program. > + * @param[in] umem_id > + * The umem id to use. > + * @param[in] umem_offset > + * The offset in the umem to start copying from. > + * > + * @return > + * 0 on success, a negative errno value otherwise and rte_errno is set= . > + */ > +int > +mlx5_devx_regex_database_program(void *ctx, uint8_t engine, uint32_t > umem_id, > + uint64_t umem_offset) > +{ > + uint32_t out[DEVX_ST_SZ_DW(set_regexp_params_out)] =3D {}; > + uint32_t in[DEVX_ST_SZ_DW(set_regexp_params_in)] =3D {}; > + int ret; > + > + DEVX_SET(set_regexp_params_in, in, opcode, > MLX5_CMD_SET_REGEX_PARAMS); > + DEVX_SET(set_regexp_params_in, in, engine_id, engine); > + DEVX_SET(set_regexp_params_in, in, regexp_params.db_umem_id, > umem_id); > + DEVX_SET64(set_regexp_params_in, in, > regexp_params.db_umem_offset, > + umem_offset); > + DEVX_SET(set_regexp_params_in, in, field_select.db_umem_id, 1); > + ret =3D mlx5_glue->devx_general_cmd(ctx, in, sizeof(in), out, > + sizeof(out)); > + if (ret) { > + DRV_LOG(ERR, "Database program failed %d", ret); > + rte_errno =3D errno; > + return -errno; > + } > + return 0; > +} > + > diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h > b/drivers/common/mlx5/mlx5_devx_cmds.h > index bb14ca5..655e31f 100644 > --- a/drivers/common/mlx5/mlx5_devx_cmds.h > +++ b/drivers/common/mlx5/mlx5_devx_cmds.h > @@ -401,5 +401,11 @@ int mlx5_devx_cmd_modify_rqt(struct > mlx5_devx_obj *rqt, __rte_internal int > mlx5_devx_cmd_query_virtio_q_counters(struct mlx5_devx_obj > *couners_obj, > struct mlx5_devx_virtio_q_couners_attr > *attr); > - > +__rte_internal > +int mlx5_devx_regex_database_stop(void *ctx, uint8_t engine); > +__rte_internal int mlx5_devx_regex_database_resume(void *ctx, uint8_t > +engine); __rte_internal int mlx5_devx_regex_database_program(void *ctx, > +uint8_t engine, > + uint32_t umem_id, uint64_t > umem_offset); > #endif /* RTE_PMD_MLX5_DEVX_CMDS_H_ */ > diff --git a/drivers/common/mlx5/rte_common_mlx5_version.map > b/drivers/common/mlx5/rte_common_mlx5_version.map > index ae57ebd..6054d39 100644 > --- a/drivers/common/mlx5/rte_common_mlx5_version.map > +++ b/drivers/common/mlx5/rte_common_mlx5_version.map > @@ -35,6 +35,9 @@ INTERNAL { > mlx5_devx_cmd_query_virtio_q_counters; > mlx5_devx_cmd_query_virtq; > mlx5_devx_get_out_command_status; > + mlx5_devx_regex_database_program; > + mlx5_devx_regex_database_resume; > + mlx5_devx_regex_database_stop; >=20 > mlx5_get_ifname_sysfs; > mlx5_get_dbr; > -- > 1.8.3.1