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 5C365A00BE; Wed, 8 Jul 2020 09:33:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 20F901DA28; Wed, 8 Jul 2020 09:32:38 +0200 (CEST) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140044.outbound.protection.outlook.com [40.107.14.44]) by dpdk.org (Postfix) with ESMTP id E499E1D9C3 for ; Wed, 8 Jul 2020 09:32:36 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LSRAVyLUrXm9m/103R6kKE4dAyD6Jmuy4KBqiezKxwe1A7NwJ5jm0BtPD7h4zeMLJ6xJ4+6+6Hei+Mkoq5E3etqX4DnHMdYiJpn/e697z27n2xEVfMCN0jAsov6QC5zr4NuhKdNjV0MhgTY5ytnnCg8Ze2VRMwma7FRUqc9TThO/3BJfR4fJRBCKaVyIWjKNfMa5oIeu44SU2e7wxy75q1vj+rYTitKNSBTtoEBHSrIMNHob6EqONpkG6PRBRaZZRaLwcO9uIZHQAIaoVJmMSRIHREYAQSmvYsRJlf93CY2PSXKh5OaXiIrNVHagpIQT/6XG9WRxYRK8fq1nfXhNGQ== 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=ESiwH4ovRsrksAoiqQwMJ2SnKb1wUndeIeYNsTBjtwY=; b=WZJw5AFt53P7hH17PSeS7eVmPBg8kVy6FGmY3dd1oln9SCiJ3sGUTXdl2ouucyKJtywCB80K12TpQ7/zazA0/F4IXsLyZE0mYiMJFtmunzx/itNs2yg/gOzYorJjYKZKG/6QZM1a+wdVTItZwaCApda4NCix2eLravr18ScH9wFMHTrYDdrdvoXEBY8cP9D/mgxpuQX8C8A8xubru0HoAJd1Fp+BOtJuSXsxW7dNZRIgyGFMdjbwZI9ybkMBvnLaHR5RIJcUfPLGhxLY0ycvuxG96xbuLuwN6fcv7HIpxnmNx/WASGQW2eHaAY3635AMMZy6vNP1pu2LhrLWQY8t7g== 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=ESiwH4ovRsrksAoiqQwMJ2SnKb1wUndeIeYNsTBjtwY=; b=nD4meODH0CupwP/7nR5yIKl5ASbRETYgwBnu/0evPYexsyvoKxaIjmTyS9UfJYBQzkWH08XIj6pKoyiRPUezoK627YMH8sLBp7aCsCEN7jzVudUlEpgLbcXrW7RBG1bIc+IPt+hIWzrv76FXqrxdGNL2gSLuiW/JKPOSaXC8knE= 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:35 +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:35 +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 09/20] common/mlx5: add write and read RXP registers Thread-Index: AQHWUq4kutE9vKqHyUSZLa9wNqPIb6j9ToTw Date: Wed, 8 Jul 2020 07:32:35 +0000 Message-ID: References: <1593941027-86651-1-git-send-email-orika@mellanox.com> <1593941027-86651-10-git-send-email-orika@mellanox.com> In-Reply-To: <1593941027-86651-10-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: 94fd4952-7032-4b9c-fd68-08d82311155d 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:6108; x-forefront-prvs: 04583CED1A x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MUUF+AeQNHEnVw9oSBHE4eyNhxvi7YZsHSlx+QV48LRRm0DJRu5db+DVRh42hrt/WKDt/JBt12A4drbecvtjBkpT1LEhdF957OWSsaHpMHSNdF9BYqOhwINP4M3Txv8rwGG7rV0owqiyn9OCNRZS5rMTzr2nRiU3nzcSeTwavfkEJk+N/E9cXFx2POq08MVZBI/VFWdDO9jQhWX2dOh7gZIlp9V/Lk3gGHdeGAeXmLowNsdi8ZH9ejTJetP/KYUCpteMnFbc9S6/CAJKmxbB6mvoBlr/+8mPkqeLPnm8sZEv66ADfSubDaQ8w5T8z8O4+q9eOJ2xUMfj7NjPJN4L2Q== 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); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: qNJJkYVWqARTYadS622vpgqy1o9XQ4aAtpgEAXhOtXPxog1uDEcKLebSKzRrkuY9az5+2LCsQ60KLpw9YowX5in5jf4zsFBdkKI+jJpreOrnr4b2N1zHfgno2uu8Wi842B3lZsSSl10n37ugfn+lZz2OoRwCZAJcsQ7DDD9ovhX1yj7bgj7NFhJ0nRYcPS5eSJrddox+GeNFc1vpOrdNm/Ealsfew62+Ydwqw25CNR9vPoOgcr3qAMEnUmMnbDsnEYSiS9+5Ezmbsa32/b4OYBtEWOd2hqfe7z5QT/OPzjuMGn2NP8w1/pdZZlvnu9ORzTYnhQmRyBZ3+VVRmsRvII123fttSZOJzLAfgwmxk2CMAeJHvCaeGnSWALvKivZYmM7DbjLMbmPIkVc91jTrY3PZ72X6XhKbY9LvzocQy9b+9WZR/H2qbH391S6ef6Vnt31qKmv1Yu8llpvVZ3J85wNuIk1BFl+sp9nFuD5prBI= 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: 94fd4952-7032-4b9c-fd68-08d82311155d X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2020 07:32:35.1103 (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: h6vJoZxe2bt2fetpAJ+6X8n+fs42OgnLtO0Na9BZxZKuMaD1JNWV0+gOY0JTn7hOUGoTiRCVZ3eHW+8V1JCcwQq3M7N4AskKT1tspjlzWqY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6084 Subject: Re: [dpdk-dev] [PATCH 09/20] common/mlx5: add write and read RXP registers 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 09/20] common/mlx5: add write and read RXP registers >=20 > This commits add the write and read RXP registers functionality. >=20 > Signed-off-by: Ori Kam > --- > drivers/common/mlx5/mlx5_devx_cmds.c | 78 > +++++++++++++++++++++++++ > drivers/common/mlx5/mlx5_devx_cmds.h | 10 ++++ > drivers/common/mlx5/rte_common_mlx5_version.map | 2 + > 3 files changed, 90 insertions(+) >=20 > diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c > b/drivers/common/mlx5/mlx5_devx_cmds.c > index f8760e6..4fad7cd 100644 > --- a/drivers/common/mlx5/mlx5_devx_cmds.c > +++ b/drivers/common/mlx5/mlx5_devx_cmds.c > @@ -1720,3 +1720,81 @@ struct mlx5_devx_obj * > return 0; > } >=20 > +/** > + * Write to RXP registers. > + * > + * @param ctx > + * ibv device handle > + * @param engine_id > + * Chooses on which engine the register will be written.. > + * @param addr > + * Register address. > + * @param data > + * Data to be written to the register. > + * > + * @return > + * 0 on success, a negative errno value otherwise and rte_errno is set= . > + */ > +int > +mlx5_devx_regex_register_write(struct ibv_context *ctx, int engine_id, > + uint32_t addr, uint32_t data) { > + uint32_t out[DEVX_ST_SZ_DW(set_regexp_register_out)] =3D {}; > + uint32_t in[DEVX_ST_SZ_DW(set_regexp_register_in)] =3D {}; > + int ret; > + > + DEVX_SET(set_regexp_register_in, in, opcode, > + MLX5_CMD_SET_REGEX_REGISTERS); > + DEVX_SET(set_regexp_register_in, in, engine_id, engine_id); > + DEVX_SET(set_regexp_register_in, in, register_address, addr); > + DEVX_SET(set_regexp_register_in, in, register_data, data); > + > + ret =3D mlx5_glue->devx_general_cmd(ctx, in, sizeof(in), out, > + sizeof(out)); > + if (ret) { > + DRV_LOG(ERR, "Set regexp register failed %d", ret); > + rte_errno =3D errno; > + return -errno; > + } > + return 0; > +} > + > + > +/** > + * Read from RXP registers > + * > + * @param ctx > + * ibv device handle > + * @param engine_id > + * Chooses from which engine to read. > + * @param addr > + * Register address. > + * @param data > + * Output containing the pointer to the data.. > + * > + * @return > + * 0 on success, a negative errno value otherwise and rte_errno is set= . > + */ > +int > +mlx5_devx_regex_register_read(struct ibv_context *ctx, int engine_id, > + uint32_t addr, uint32_t *data) { > + uint32_t out[DEVX_ST_SZ_DW(query_regexp_register_out)] =3D {}; > + uint32_t in[DEVX_ST_SZ_DW(query_regexp_register_in)] =3D {}; > + int ret; > + > + DEVX_SET(query_regexp_register_in, in, opcode, > + MLX5_CMD_QUERY_REGEX_REGISTERS); > + DEVX_SET(query_regexp_register_in, in, engine_id, engine_id); > + DEVX_SET(query_regexp_register_in, in, register_address, addr); > + > + ret =3D mlx5_glue->devx_general_cmd(ctx, in, sizeof(in), out, > + sizeof(out)); > + if (ret) { > + DRV_LOG(ERR, "Query regexp register failed %d", ret); > + rte_errno =3D errno; > + return -errno; > + } > + *data =3D DEVX_GET(query_regexp_register_out, out, register_data); > + return 0; > +} > diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h > b/drivers/common/mlx5/mlx5_devx_cmds.h > index 655e31f..a2a9045 100644 > --- a/drivers/common/mlx5/mlx5_devx_cmds.h > +++ b/drivers/common/mlx5/mlx5_devx_cmds.h > @@ -374,6 +374,10 @@ int mlx5_devx_cmd_modify_qp_state(struct > mlx5_devx_obj *qp, __rte_internal int mlx5_devx_cmd_modify_rqt(struct > mlx5_devx_obj *rqt, > struct mlx5_devx_rqt_attr *rqt_attr); > +int mlx5_devx_regex_register_write(struct ibv_context *ctx, int engine_i= d, > + uint32_t addr, uint32_t data); > +int mlx5_devx_regex_register_read(struct ibv_context *ctx, int engine_id= , > + uint32_t addr, uint32_t *data); >=20 > /** > * Create virtio queue counters object DevX API. > @@ -408,4 +412,10 @@ int mlx5_devx_cmd_query_virtio_q_counters(struct > mlx5_devx_obj *couners_obj, __rte_internal int > mlx5_devx_regex_database_program(void *ctx, uint8_t engine, > uint32_t umem_id, uint64_t > umem_offset); > +__rte_internal > +int mlx5_devx_regex_register_read(struct ibv_context *ctx, int engine_id= , > + uint32_t addr, uint32_t *data); > +__rte_internal > +int mlx5_devx_regex_register_write(struct ibv_context *ctx, int engine_i= d, > + uint32_t addr, uint32_t data); > #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 6054d39..138719d 100644 > --- a/drivers/common/mlx5/rte_common_mlx5_version.map > +++ b/drivers/common/mlx5/rte_common_mlx5_version.map > @@ -38,6 +38,8 @@ INTERNAL { > mlx5_devx_regex_database_program; > mlx5_devx_regex_database_resume; > mlx5_devx_regex_database_stop; > + mlx5_devx_regex_register_read; > + mlx5_devx_regex_register_write; >=20 > mlx5_get_ifname_sysfs; > mlx5_get_dbr; > -- > 1.8.3.1