From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 61992A034C; Wed, 31 Aug 2022 10:57:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05DD041153; Wed, 31 Aug 2022 10:57:41 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 90EF240F17 for ; Tue, 30 Aug 2022 04:20:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661826001; x=1693362001; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=+AWADnyfbYF6HUJEUt8eQQO+JSUNRqAGyFpEWrAsS8Y=; b=NnJIvrbKX3e9UpKx2JAwLIcAbfaVX6QAljdBHz3NDljDbeV8yHWt0DeC 7B6K7pfZ6uSBa2DPUYDCoDLXa4esKzB2eS5UidB2po8mizjO8veDHy44v mRs8eSLtrUTW9zgHzslUsugq0ct7H7dY7CLJAfBHqFw9O6/PYE76kiNk5 /qB8CBLajmhI7vcxxmaRwv4hhuU5rNdnL8Zr2N8U5pww3bve/IJ4ZI6FW hclGD51rChzvMVqcDQ9ImUqLQ0VklE2wPYp+uHysOvmBWfbnKwz2S7CLA wwQOssB22AfKFIwSTjkniq5v8YUcFT2R3duObhL9r0P6Sfnl6OLNjYbli A==; X-IronPort-AV: E=McAfee;i="6500,9779,10454"; a="296334983" X-IronPort-AV: E=Sophos;i="5.93,274,1654585200"; d="scan'208";a="296334983" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2022 19:20:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,274,1654585200"; d="scan'208";a="715118452" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga002.fm.intel.com with ESMTP; 29 Aug 2022 19:20:00 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 29 Aug 2022 19:19:59 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 29 Aug 2022 19:19:59 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Mon, 29 Aug 2022 19:19:59 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.46) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Mon, 29 Aug 2022 19:19:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eovFUM5u4+5XkZ0YoHT8+mO6TKjTJr8Dk314GG3WFBk5y7BOtRm3HPzSYl8+F0mjWd6EDdlxyKQKsFEACOgtqTL7lreOFIXlyfK5Mji3bKuynALZr/H1FXZ9HDnI5EecVk3it/6Q4IhM3NdmZGx69ouuqVm0p7je1YG4EEp0LZr4nrguSqgqWvxRP/mm2d4I2DsRmMmzZmH/ab9IrwxFKgq9UGRRrtszj3bFQcV2ewN+le85zmBiXMpfYEXCkBCIRlZIPX7wsrR3aynrnmu/hpY8KxhMuI5yiuOH/6nciYkevzzcuGWlWaY/FXECTg9SuYDzzmnTx/vSFJj9jpi/gw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xYcUHTTeTSeOwhTj4JPIkWqWSvRNuGQ22D/gahVkInA=; b=LirMhGHE7Q+4sgXpROzCFGmkvthYDeDcgdz/xrfFNlmw+/TL29ttoUhDGsLT/dORtSseZtYg221tKVE59XRFxynwzzy8M00WJ4CWRIv0JZMP/UV6M/QrD/YWOa9oGj9bdotqg9IfsEFY049obPy4Y7UYSySKP3LH8WZB4GRGNTnKAh4vhjDxvTVjoI/49Cf/8H73ua/CrfZ8eXnpjgT8EtUoiJFM241VRWiPxZcZQuWw8x6+B0YpoM+Dywh/tgOWnlUrRL32Js97ImoXIIxgpBgh7RF5AV2WrS30YL37w+X3vFDbVl8cRL8pJN29cBegrEdnQpUQhMGex2mJnTI6KA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM6PR11MB3804.namprd11.prod.outlook.com (2603:10b6:5:13c::14) by BN0PR11MB5757.namprd11.prod.outlook.com (2603:10b6:408:165::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Tue, 30 Aug 2022 02:19:36 +0000 Received: from DM6PR11MB3804.namprd11.prod.outlook.com ([fe80::39d1:fb56:829a:f7f0]) by DM6PR11MB3804.namprd11.prod.outlook.com ([fe80::39d1:fb56:829a:f7f0%6]) with mapi id 15.20.5566.021; Tue, 30 Aug 2022 02:19:35 +0000 From: "Zhang, Mingshan" To: "Chautru, Nicolas" , "dev@dpdk.org" , "thomas@monjalon.net" , "gakhil@marvell.com" , "hemant.agrawal@nxp.com" CC: "maxime.coquelin@redhat.com" , "trix@redhat.com" , "mdr@ashroe.eu" , "Richardson, Bruce" , "david.marchand@redhat.com" , "stephen@networkplumber.org" Subject: RE: [PATCH v7 2/7] bbdev: add device status info Thread-Topic: [PATCH v7 2/7] bbdev: add device status info Thread-Index: AQHYu9UheWCSzJXpg0OnMcH0OglCoK3GtgoA Date: Tue, 30 Aug 2022 02:19:35 +0000 Message-ID: References: <1655491040-183649-6-git-send-email-nicolas.chautru@intel.com> <1661796438-204861-1-git-send-email-nicolas.chautru@intel.com> <1661796438-204861-3-git-send-email-nicolas.chautru@intel.com> In-Reply-To: <1661796438-204861-3-git-send-email-nicolas.chautru@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.500.17 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ae0207e9-7986-4b1d-1db9-08da8a2e1551 x-ms-traffictypediagnostic: BN0PR11MB5757:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5XW7Nr9R1tC7SyYCsxZukpWHNKfZm0p1QQY84S5DJV7M8wU4YG4vlTQ1CZkA3bIcHj04YZDRTLYfjdT0Ud2dsQcbTB8BPFjaYe0D6U+6MWxzObfxywsVrO7tmUe5C2hQaIz4l94qn67onwDGdcqvJkI1qYe6ZBGSSKe9ImrbMAETC43vXkv2u5ZycZqx06U1hYDMYmaee2RTqJJkFIYXNHNjLLDRbvf7n3tjCBVf8sacw7g9E1Cmx6dHtheJuv9es4Rxbz36rg4DWms7Kydac/VRrc/PK5LREy8n+DH7ZBJKftHoInEl85zcv98w1jO3V2rAFnJaLXIcLljWzNOHnEeuA1PcK5GIGy++UjOS2ZGs84qxBp+fWRlgUUmtjF6lnOooyZ5Yhpj6kTH3ISBbZz8d8OUJTGjPpGenh0xyUdPja9SsRK0Hbpb5OG7C4TttWKsg5vx0/e5oHJTEX/MR8CFvCLrud5t9c1fgNjBbaAAxAD5qWfNdsTkm9dshKT6fnUoU97U1K9Xi5KV+8eFQ2uWL7dt5Grp7my8ZWYMRQGnP0s8YoVcy2SoKVZ/9ZxUe/YPbxMZ/lLngeN0nPCb3hMXuKcxlDLkvyTk7oIrRsz/4Lo6LmwJxB96I4TIv9pGL2/B5VvTpoR7Ms7lQB9fEF0Xh8MrOnvxCk9jjoud4d+dH9AYOVQgBy7Ad8MmlamDs+stBOXSxnDyuyiKeIcslT8DCD5FbnYYuPOT8+DTO2djoKd19Nv7xlQMRoGx3oLFQRXlDO3ltTIwcBw1/q1t3SQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3804.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(376002)(39860400002)(396003)(366004)(136003)(346002)(9686003)(53546011)(86362001)(71200400001)(478600001)(55016003)(7696005)(6506007)(41300700001)(26005)(186003)(82960400001)(122000001)(38100700002)(38070700005)(83380400001)(54906003)(66946007)(66446008)(66556008)(5660300002)(110136005)(64756008)(8676002)(8936002)(52536014)(4326008)(66476007)(2906002)(316002)(76116006)(33656002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?niFlLUnK4mwOLZmsHx3gHPAeYdVl/Qn2U2FmXC2hZb0hQGh99qfIbI6Rf3QU?= =?us-ascii?Q?U156h8Y7Bnwu06F/PUPRkA/fV7zxjT7bWDx5y/PRPgMyPXcmPZBJTqf5lt07?= =?us-ascii?Q?1cOkKT307jdT4pfBkql3gU3Hrp+WvndCrNFsXGf5bdlxY9mDvkqjP+yi637T?= =?us-ascii?Q?tEaUgNlHqXztI6hEqiDVdH/vLp29wd1n90UfnhNSXgWAOkFokMwb+wYJgzsc?= =?us-ascii?Q?oHZGgpMokQ1Vamy+CFyC/m94/ZmRLQkatJRlMiplT11QoeMb/kwQyMW5YHqJ?= =?us-ascii?Q?CSmueFdlEYCAb2YjzzMsi5Rl/9EVymhJE4/6MFOz2BtxS+Ebjc2I87D/aFBL?= =?us-ascii?Q?Y+RDx+SyKOYH9Vlk/c+REjG053xFWuo2Sar+ex2/v+LrFp40Marnygdm9BFo?= =?us-ascii?Q?k5xopJ8FDVPcUSthBDBWjiecCK6gnylmzMIWqpCjpVXjJASVkhg3GZ0c67gL?= =?us-ascii?Q?fV9h70x11xMJth0i+pBMgsrhV4LUSHf9AjcQNmUGwpMoeu12OFXjzf4C38yq?= =?us-ascii?Q?xXblFFa34te4nIGGoU48Pc7vNF9TIYb0Tl5mQOeBsZ+cSGxY8yrqLN6ESB2v?= =?us-ascii?Q?A2MfgKAlIBsq5TzHFOT9J+r2cUsS9Uuihb4JiQSuUwofsX7/DG3YIxnqZcWZ?= =?us-ascii?Q?BjfDV5AFOAXVDgm6GHA8wxULZ1s5+B/9kcSXcF1/LCDSVCibdHDwkQ7E0xnO?= =?us-ascii?Q?9suENBUGGMzqGeEKegTzKfXrEF2Jf0DwIHUPS/6uwcV9SoZf8JFhvZ/d2pVj?= =?us-ascii?Q?qKyuBPNZzymG3aWX4F530Ja8gmcYrSqdQY+BAM1fqCUVUbTFXm6chpUi8rR6?= =?us-ascii?Q?AudvPNU52axr/ghmfK1ztKkbjseuw5okgoGfD+fWsE9/+LcwCyb1y6JJ6JLt?= =?us-ascii?Q?0hsV9VjY7zFB8lowN/KdUy3IV3y/TvJecbWo14eqxbbHGSA4QbQXWwu3op0U?= =?us-ascii?Q?7Uxr8OBXVdNbLun+mNClgdMUFmmjvbxIREgoz/n5eu9JCUO9Zbtlb6juZeTa?= =?us-ascii?Q?UU//wqOQh61dkhSa6e4iDB/klAwO8EcAgBGsHD+ZIxCgunvIb9Rj2vP/nUX4?= =?us-ascii?Q?SrDEJRM0cBcBmjs7Jx67Y+LthUVi2HcI8UXputBmb+jL52rnT13wUKtXTJ9v?= =?us-ascii?Q?PPrkMDx542dVN7N/zHyeZd1kr48H5kGLgfX45OuqS9/sBpSjqe0Oz6BkOeuq?= =?us-ascii?Q?EWb91odx6rbq0OVCX9DQu/7HcQkdImPt3SuRhneUxS5H9u71CF+fSOJ7liId?= =?us-ascii?Q?JHoTldWUAbjktXcIQcoyZ8oZdTN3pRheP0WKkMLVDJeSuPrtE4P3cY6c3umU?= =?us-ascii?Q?nS+5k0FQ3QuPkOTlfU6dvwjDago0wqoRDZKqHzACICKpAqWO3zrcHo2EU0Ya?= =?us-ascii?Q?FRn3AoXigVhMZw4Mb96714mxwAPk6VyebAj9jrdJoIK1nG27dhfpOP3l4itP?= =?us-ascii?Q?9tft4PCDXR/wDx8n12lxXapKpT3Fj/78DZYwyHJkeSauq2U96RXg8pokjsYx?= =?us-ascii?Q?7oU5N0bVB9F8lHwwHH/iQPpqXD7s8OUuqzdek4VBnF6XDTiLDfITqmyQRTZr?= =?us-ascii?Q?9m2hcCc5qlT0Atxm7cVy5GDZkpKTGwU0TKe/+dgG?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3804.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae0207e9-7986-4b1d-1db9-08da8a2e1551 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Aug 2022 02:19:35.6956 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: aYOT33ypyDFfTToa9fHpoZWcp4Jvycc5EDGQKIancAgxMoJJQ1c+zSPm4AO0QfDeJkrDfZDY8kMV8et/nvN4fLJwZqpiBsvHJKMNuTSGwfc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR11MB5757 X-OriginatorOrg: intel.com X-Mailman-Approved-At: Wed, 31 Aug 2022 10:57:38 +0200 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Acked-by: Mingshan Zhang > -----Original Message----- > From: Chautru, Nicolas > Sent: Tuesday, August 30, 2022 2:07 AM > To: dev@dpdk.org; thomas@monjalon.net; gakhil@marvell.com; > hemant.agrawal@nxp.com > Cc: maxime.coquelin@redhat.com; trix@redhat.com; mdr@ashroe.eu; > Richardson, Bruce ; > david.marchand@redhat.com; stephen@networkplumber.org; Zhang, > Mingshan ; Chautru, Nicolas > > Subject: [PATCH v7 2/7] bbdev: add device status info >=20 > Added device status information, so that the PMD can expose information > related to the underlying accelerator device status. > Minor order change in structure to fit into padding hole. >=20 > Signed-off-by: Nicolas Chautru > --- > drivers/baseband/acc100/rte_acc100_pmd.c | 1 + > drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 1 + > drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 1 + > drivers/baseband/la12xx/bbdev_la12xx.c | 1 + > drivers/baseband/null/bbdev_null.c | 1 + > drivers/baseband/turbo_sw/bbdev_turbo_software.c | 1 + > lib/bbdev/rte_bbdev.c | 22 ++++++++++++++ > lib/bbdev/rte_bbdev.h | 35 ++++++++++++++++= ++++-- > lib/bbdev/version.map | 7 +++++ > 9 files changed, 68 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c > b/drivers/baseband/acc100/rte_acc100_pmd.c > index de7e4bc..17ba798 100644 > --- a/drivers/baseband/acc100/rte_acc100_pmd.c > +++ b/drivers/baseband/acc100/rte_acc100_pmd.c > @@ -1060,6 +1060,7 @@ >=20 > /* Read and save the populated config from ACC100 registers */ > fetch_acc100_config(dev); > + dev_info->device_status =3D RTE_BBDEV_DEV_NOT_SUPPORTED; >=20 > /* This isn't ideal because it reports the maximum number of queues > but > * does not provide info on how many can be uplink/downlink or > different diff --git a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c > b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c > index 82ae6ba..57b12af 100644 > --- a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c > +++ b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c > @@ -369,6 +369,7 @@ > dev_info->capabilities =3D bbdev_capabilities; > dev_info->cpu_flag_reqs =3D NULL; > dev_info->data_endianness =3D RTE_LITTLE_ENDIAN; > + dev_info->device_status =3D RTE_BBDEV_DEV_NOT_SUPPORTED; >=20 > /* Calculates number of queues assigned to device */ > dev_info->max_num_queues =3D 0; > diff --git a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c > b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c > index 21d3529..2a330c4 100644 > --- a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c > +++ b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c > @@ -645,6 +645,7 @@ struct __rte_cache_aligned fpga_queue { > dev_info->capabilities =3D bbdev_capabilities; > dev_info->cpu_flag_reqs =3D NULL; > dev_info->data_endianness =3D RTE_LITTLE_ENDIAN; > + dev_info->device_status =3D RTE_BBDEV_DEV_NOT_SUPPORTED; >=20 > /* Calculates number of queues assigned to device */ > dev_info->max_num_queues =3D 0; > diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c > b/drivers/baseband/la12xx/bbdev_la12xx.c > index 4d1bd16..c1f88c6 100644 > --- a/drivers/baseband/la12xx/bbdev_la12xx.c > +++ b/drivers/baseband/la12xx/bbdev_la12xx.c > @@ -100,6 +100,7 @@ struct bbdev_la12xx_params { > dev_info->capabilities =3D bbdev_capabilities; > dev_info->cpu_flag_reqs =3D NULL; > dev_info->min_alignment =3D 64; > + dev_info->device_status =3D RTE_BBDEV_DEV_NOT_SUPPORTED; >=20 > rte_bbdev_log_debug("got device info from %u", dev->data- > >dev_id); } diff --git a/drivers/baseband/null/bbdev_null.c > b/drivers/baseband/null/bbdev_null.c > index 248e129..94a1976 100644 > --- a/drivers/baseband/null/bbdev_null.c > +++ b/drivers/baseband/null/bbdev_null.c > @@ -82,6 +82,7 @@ struct bbdev_queue { > * here for code completeness. > */ > dev_info->data_endianness =3D RTE_LITTLE_ENDIAN; > + dev_info->device_status =3D RTE_BBDEV_DEV_NOT_SUPPORTED; >=20 > rte_bbdev_log_debug("got device info from %u", dev->data- > >dev_id); } diff --git > a/drivers/baseband/turbo_sw/bbdev_turbo_software.c > b/drivers/baseband/turbo_sw/bbdev_turbo_software.c > index af7bc41..dbc5524 100644 > --- a/drivers/baseband/turbo_sw/bbdev_turbo_software.c > +++ b/drivers/baseband/turbo_sw/bbdev_turbo_software.c > @@ -254,6 +254,7 @@ struct turbo_sw_queue { > dev_info->min_alignment =3D 64; > dev_info->harq_buffer_size =3D 0; > dev_info->data_endianness =3D RTE_LITTLE_ENDIAN; > + dev_info->device_status =3D RTE_BBDEV_DEV_NOT_SUPPORTED; >=20 > rte_bbdev_log_debug("got device info from %u\n", dev->data- > >dev_id); } diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c > index 4da8047..38630a2 100644 > --- a/lib/bbdev/rte_bbdev.c > +++ b/lib/bbdev/rte_bbdev.c > @@ -1133,3 +1133,25 @@ struct rte_mempool * > rte_bbdev_log(ERR, "Invalid operation type"); > return NULL; > } > + > +const char * > +rte_bbdev_device_status_str(enum rte_bbdev_device_status status) { > + static const char * const dev_sta_string[] =3D { > + "RTE_BBDEV_DEV_NOSTATUS", > + "RTE_BBDEV_DEV_NOT_SUPPORTED", > + "RTE_BBDEV_DEV_RESET", > + "RTE_BBDEV_DEV_CONFIGURED", > + "RTE_BBDEV_DEV_ACTIVE", > + "RTE_BBDEV_DEV_FATAL_ERR", > + "RTE_BBDEV_DEV_RESTART_REQ", > + "RTE_BBDEV_DEV_RECONFIG_REQ", > + "RTE_BBDEV_DEV_CORRECT_ERR", > + }; > + > + if (status < sizeof(dev_sta_string) / sizeof(char *)) > + return dev_sta_string[status]; > + > + rte_bbdev_log(ERR, "Invalid device status"); > + return NULL; > +} > diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h index > b88c881..9b1ffa4 100644 > --- a/lib/bbdev/rte_bbdev.h > +++ b/lib/bbdev/rte_bbdev.h > @@ -223,6 +223,21 @@ struct rte_bbdev_queue_conf { int > rte_bbdev_queue_stop(uint16_t dev_id, uint16_t queue_id); >=20 > +/** > + * Flags indicate the status of the device */ enum > +rte_bbdev_device_status { > + RTE_BBDEV_DEV_NOSTATUS, /**< Nothing being reported */ > + RTE_BBDEV_DEV_NOT_SUPPORTED, /**< Device status is not > supported on the PMD */ > + RTE_BBDEV_DEV_RESET, /**< Device in reset and un- > configured state */ > + RTE_BBDEV_DEV_CONFIGURED, /**< Device is configured and > ready to use */ > + RTE_BBDEV_DEV_ACTIVE, /**< Device is configured and VF is > being used */ > + RTE_BBDEV_DEV_FATAL_ERR, /**< Device has hit a fatal > uncorrectable error */ > + RTE_BBDEV_DEV_RESTART_REQ, /**< Device requires application > to restart */ > + RTE_BBDEV_DEV_RECONFIG_REQ, /**< Device requires application > to reconfigure queues */ > + RTE_BBDEV_DEV_CORRECT_ERR, /**< Warning of a correctable > error event happened */ > +}; > + > /** Device statistics. */ > struct rte_bbdev_stats { > uint64_t enqueued_count; /**< Count of all operations enqueued > */ @@ -285,12 +300,14 @@ struct rte_bbdev_driver_info { > /** Set if device supports per-queue interrupts */ > bool queue_intr_supported; > /** Minimum alignment of buffers, in bytes */ > - uint16_t min_alignment; > - /** HARQ memory available in kB */ > + /** Device Status */ > + enum rte_bbdev_device_status device_status; > uint32_t harq_buffer_size; > /** Byte endianness (RTE_BIG_ENDIAN/RTE_LITTLE_ENDIAN) > supported > * for input/output data > */ > + uint16_t min_alignment; > + /** HARQ memory available in kB */ > uint8_t data_endianness; > /** Default queue configuration used if none is supplied */ > struct rte_bbdev_queue_conf default_queue_conf; @@ -827,6 > +844,20 @@ typedef void (*rte_bbdev_cb_fn)(uint16_t dev_id, > rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, in= t > op, > void *data); >=20 > +/** > + * Converts device status from enum to string > + * > + * @param status > + * Device status as enum > + * > + * @returns > + * Operation type as string or NULL if op_type is invalid > + * > + */ > +__rte_experimental > +const char* > +rte_bbdev_device_status_str(enum rte_bbdev_device_status status); > + > #ifdef __cplusplus > } > #endif > diff --git a/lib/bbdev/version.map b/lib/bbdev/version.map index > cce3f3c..f0a072e 100644 > --- a/lib/bbdev/version.map > +++ b/lib/bbdev/version.map > @@ -39,3 +39,10 @@ DPDK_22 { >=20 > local: *; > }; > + > +EXPERIMENTAL { > + global: > + > + # added in 22.11 > + rte_bbdev_device_status_str; > +}; > -- > 1.8.3.1