From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id AE02CA04AF;
	Thu, 20 Aug 2020 16:57:55 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id D3AF41C0BC;
	Thu, 20 Aug 2020 16:57:54 +0200 (CEST)
Received: from GBR01-LO2-obe.outbound.protection.outlook.com
 (mail-eopbgr100134.outbound.protection.outlook.com [40.107.10.134])
 by dpdk.org (Postfix) with ESMTP id EF1991C0B0
 for <dev@dpdk.org>; Thu, 20 Aug 2020 16:57:53 +0200 (CEST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=R+Yyi51jnlujCBSh9abwRrqxV0VVjZpmS4LpRymraA8wVIthOlDnZmQFqmLpjdpuVG1g2iylBsgKTwOyxBn9mWJzoarHxGK4h4W1SYOD61I0Ymr62CP2xKTDFguT4Ein60EJoIrWJsngsZ2irlLrBW6iKKSbuHynfuBHeHNVxakqj3kGSF3oWbO2omda6JivDDE8NvFfwDFmaVSNucH/wiWpUuTfCvCRBtIs0msfS69mhB7dArKyXFG807Mk4L1Y8zLduEEnT2nyC6oqMr+HQGrutnN7mnN+iZTjhS6Q28YOadTfugPcrHaFSwcb9xQkqTc9LdR/FE6LE43jVyMwLQ==
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=p2cwqTzzBi3C7q12JzgISS2BP5e4kSzu4XYgsZiPqsg=;
 b=H9rzfULywpWQJyDUayQY8oROza2sfVmG6PcxdvSD9m4Yh7EHX6M4XnIyHuBboqGeZZzQREOKNv4aHtmp97YjpZ4iaRYVT7Er+fQGEy/j21zJoBN/uS+o86HD08w3hjQSrTspY/imxsYjdSt26ykjqFHgis3EtwTjnClCiDF8zNKYZ748r0a+N5++zGhK+AEvJ+KgVvzi3q7d8m/AWQBXiQRLE34+VJVHf1exJzOh9TUHpEtHrWpPi98I9JIJoohl9jsRimpg6CTBW1jIGYdCZ/AXlPaVJgnOXq2kUpbGaHBVw1BrmwOweZpMm8kUsXUevc6XcgaxFRDTeHxpWHz29g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=accelercomm.com; dmarc=pass action=none
 header.from=accelercomm.com; dkim=pass header.d=accelercomm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=accelercomm.onmicrosoft.com; s=selector1-accelercomm-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=p2cwqTzzBi3C7q12JzgISS2BP5e4kSzu4XYgsZiPqsg=;
 b=JK+9PERLJxuG3mV/7WShDg5d3/zpXnKBjDZPmE5PDvYP8Wu38Y5Bh5l2ebIavd+qPPHvbDRvav4XDtEu3PATXaCTXPQ3SEx+NKQ+ZV8U3VYiUrbkVl/0yEfDT3qiPWZ4YZxWcPPThIoDx+2fgHD7Q8Aewh/1OWvgNk8ozuVfCBc=
Received: from LOYP265MB2174.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:114::11)
 by LO3P265MB1881.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:fe::15) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.24; Thu, 20 Aug
 2020 14:57:52 +0000
Received: from LOYP265MB2174.GBRP265.PROD.OUTLOOK.COM
 ([fe80::fd8e:7ab4:840b:fbcb]) by LOYP265MB2174.GBRP265.PROD.OUTLOOK.COM
 ([fe80::fd8e:7ab4:840b:fbcb%3]) with mapi id 15.20.3305.025; Thu, 20 Aug 2020
 14:57:52 +0000
From: Dave Burley <dave.burley@accelercomm.com>
To: "Chautru, Nicolas" <nicolas.chautru@intel.com>, "dev@dpdk.org"
 <dev@dpdk.org>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
Thread-Topic: [dpdk-dev] [PATCH v3 05/11] baseband/acc100: add LDPC processing
 functions
Thread-Index: AQHWdb+qCjhvM2dNJ06knjdffc9KoalBEyHMgAAEgoCAAACspQ==
Date: Thu, 20 Aug 2020 14:57:52 +0000
Message-ID: <LOYP265MB217494F86B41F29776C3F8CDEB5A0@LOYP265MB2174.GBRP265.PROD.OUTLOOK.COM>
References: <1597796731-57841-1-git-send-email-nicolas.chautru@intel.com>,
 <1597796731-57841-6-git-send-email-nicolas.chautru@intel.com>
 <LOYP265MB217410714FE31461B1E23B55EB5A0@LOYP265MB2174.GBRP265.PROD.OUTLOOK.COM>,
 <BY5PR11MB4451E2B64A4F4A0F70E0DBEEF85A0@BY5PR11MB4451.namprd11.prod.outlook.com>
In-Reply-To: <BY5PR11MB4451E2B64A4F4A0F70E0DBEEF85A0@BY5PR11MB4451.namprd11.prod.outlook.com>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
authentication-results: intel.com; dkim=none (message not signed)
 header.d=none;intel.com; dmarc=none action=none header.from=accelercomm.com;
x-originating-ip: [2a00:23c4:cf2d:a200:6023:b810:2491:c6a9]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: d7acb17f-0dfa-461d-3687-08d8451969c7
x-ms-traffictypediagnostic: LO3P265MB1881:
x-microsoft-antispam-prvs: <LO3P265MB18815AE66556343C12409746EB5A0@LO3P265MB1881.GBRP265.PROD.OUTLOOK.COM>
x-ms-oob-tlc-oobclassifiers: OLM:2043;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: /r8c1Cvb4vVaAoW/0/yj9lOnIax/UwyVAOSUIhrTHCJTpjX2K34+TF87WmdibswS1RUIGrdGDWC7qjoBlJ4dzkP3orcF2X07q9JLQx0UZ6SAJ0tmaCFlAgbv2w7krWpNFtpviYgzojuPf4ZinihgGltCHTgvSpm2GX3x+8NIS6XlcAQWHxdRuFbs2HGABtPan9AJyZF4fpbZi3D2H/V90L0JsHUR5CBCNb6TFLIuZbcrW1yXyJQ4p+U5dxdq3Cx0N87p3dxtwkCv3It/FEDyd1syynoPgbkfk1VzJnDRlReesf21WaMEt+FXn7EOIsoM2JJ31xgnlC/AZLbSadM8VB2pFXvK/so8b/0IjeLix6GIEw62B5xGJybzjzTrqdEm
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:LOYP265MB2174.GBRP265.PROD.OUTLOOK.COM; PTR:; CAT:NONE;
 SFS:(39830400003)(136003)(396003)(376002)(346002)(366004)(4326008)(86362001)(30864003)(71200400001)(5660300002)(52536014)(478600001)(66476007)(64756008)(66556008)(66446008)(76116006)(66946007)(9686003)(110136005)(2906002)(186003)(316002)(7696005)(6506007)(55016002)(53546011)(8936002)(44832011)(33656002)(83380400001)(461764006)(559001)(579004);
 DIR:OUT; SFP:1102; 
x-ms-exchange-antispam-messagedata: 3cwsS0+7b2vLOUR+armB/XhQE6ZqH+HwvkX14lKtz5FLdIkrdF3fYdZymQvogaRY3GFZGK7qtBNapP8AcfaImNa394TIR1jyx5SgMkUpKkK5z1M7kp/xKUUPeM/lZRXEKi6vkPU11x7Aa2S6Bm8Tg0NP0KeqS9RPWjUEXyu/xPXmm+8/M5yupxager3mvnXl80xKHAulNPdHhhYTDP81eIDLh0tWnuo+to2ycExuyeir11wsKiQe67jUIlnrO1Jr8vkpPhrgX4PThsBIIYgJ8R7VIlmr3bSqpEe3+6kx9pEcqJNkjnlTQ+Gqy1KSlqnVdEky5wC+secQHD72huIHLpXLFuT64Pr/h8WEP+q3AygTtJxOHpxLDAa756kuURRZo8PDxjTSSEszm/u8susC0HyuKSJ3CSa0+vPSyek8MMx/x5mlT+UYRtNEFI7JyfeUiruqcyHD8094S8mXZjWZiReJlLzcl2Hbrx0Wx8jHfAAf8yFYSBnNDkw75RjcllAo9iS1oP/Dvs0gxsqsPlcFzWDpS5chTMoq3FiXg225P7fvakxsLu9wZTwVk7lfcZC4vrY3HYMfLVlc9jvhBxJVAi8hOG8affnSx0b7eFl45cRtx4O3saEVzLD2XK52f3z2FyxJEhWxNQ37B+G2vUhRNmypLAQQ1mgfMl+SPRJy/pRvjj+fJlaKWm5VlV226zCrvNgZamHTz0NIKtAHLub6cw==
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: accelercomm.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: LOYP265MB2174.GBRP265.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: d7acb17f-0dfa-461d-3687-08d8451969c7
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Aug 2020 14:57:52.3390 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: a4aefd0f-62ef-4258-bd2b-0b6f6112bf2c
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: U8q1DqXZi01LMPngFnJgASd52sTZhxJTPrOCaZ91gltvzZiGBrN0GEaVEPSbG6C6I1EZQB/e0yHAF7Vkf/BTKbaSE05cKxhJA+lPjMVcYGs=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO3P265MB1881
Subject: Re: [dpdk-dev] [PATCH v3 05/11] baseband/acc100: add LDPC
	processing	functions
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

Hi Nic=0A=
=0A=
Thank you - it would be useful to have further documentation for clarificat=
ion as the data format isn't explicitly documented in BBDEV.=0A=
Best Regards=0A=
=0A=
Dave=0A=
=0A=
=0A=
From: Chautru, Nicolas <nicolas.chautru@intel.com>=0A=
Sent: 20 August 2020 15:52=0A=
To: Dave Burley <dave.burley@accelercomm.com>; dev@dpdk.org <dev@dpdk.org>=
=0A=
Cc: Richardson, Bruce <bruce.richardson@intel.com>=0A=
Subject: RE: [dpdk-dev] [PATCH v3 05/11] baseband/acc100: add LDPC processi=
ng functions =0A=
=A0=0A=
Hi Dave, =0A=
This is assuming 6 bits LLR compression packing (ie. first 2 MSB dropped). =
Similar to HARQ compression.=0A=
Let me know if unclear, I can clarify further in documentation if not expli=
cit enough.=0A=
Thanks=0A=
Nic=0A=
=0A=
> -----Original Message-----=0A=
> From: Dave Burley <dave.burley@accelercomm.com>=0A=
> Sent: Thursday, August 20, 2020 7:39 AM=0A=
> To: Chautru, Nicolas <nicolas.chautru@intel.com>; dev@dpdk.org=0A=
> Cc: Richardson, Bruce <bruce.richardson@intel.com>=0A=
> Subject: Re: [dpdk-dev] [PATCH v3 05/11] baseband/acc100: add LDPC=0A=
> processing functions=0A=
> =0A=
> Hi Nic,=0A=
> =0A=
> As you've now specified the use of RTE_BBDEV_LDPC_LLR_COMPRESSION for=0A=
> this PMB, please could you confirm what the packed format of the LLRs in=
=0A=
> memory looks like?=0A=
> =0A=
> Best Regards=0A=
> =0A=
> Dave Burley=0A=
> =0A=
> =0A=
> From: dev <dev-bounces@dpdk.org> on behalf of Nicolas Chautru=0A=
> <nicolas.chautru@intel.com>=0A=
> Sent: 19 August 2020 01:25=0A=
> To: dev@dpdk.org <dev@dpdk.org>; akhil.goyal@nxp.com=0A=
> <akhil.goyal@nxp.com>=0A=
> Cc: bruce.richardson@intel.com <bruce.richardson@intel.com>; Nicolas=0A=
> Chautru <nicolas.chautru@intel.com>=0A=
> Subject: [dpdk-dev] [PATCH v3 05/11] baseband/acc100: add LDPC processing=
=0A=
> functions=0A=
> =0A=
> Adding LDPC decode and encode processing operations=0A=
> =0A=
> Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>=0A=
> ---=0A=
> =A0drivers/baseband/acc100/rte_acc100_pmd.c | 1625=0A=
> +++++++++++++++++++++++++++++-=0A=
> =A0drivers/baseband/acc100/rte_acc100_pmd.h |=A0=A0=A0 3 +=0A=
> =A02 files changed, 1626 insertions(+), 2 deletions(-)=0A=
> =0A=
> diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c=0A=
> b/drivers/baseband/acc100/rte_acc100_pmd.c=0A=
> index 7a21c57..5f32813 100644=0A=
> --- a/drivers/baseband/acc100/rte_acc100_pmd.c=0A=
> +++ b/drivers/baseband/acc100/rte_acc100_pmd.c=0A=
> @@ -15,6 +15,9 @@=0A=
> =A0#include <rte_hexdump.h>=0A=
> =A0#include <rte_pci.h>=0A=
> =A0#include <rte_bus_pci.h>=0A=
> +#ifdef RTE_BBDEV_OFFLOAD_COST=0A=
> +#include <rte_cycles.h>=0A=
> +#endif=0A=
> =0A=
> =A0#include <rte_bbdev.h>=0A=
> =A0#include <rte_bbdev_pmd.h>=0A=
> @@ -449,7 +452,6 @@=0A=
> =A0=A0=A0=A0=A0=A0=A0=A0 return 0;=0A=
> =A0}=0A=
> =0A=
> -=0A=
> =A0/**=0A=
> =A0 * Report a ACC100 queue index which is free=0A=
> =A0 * Return 0 to 16k for a valid queue_idx or -1 when no queue is availa=
ble=0A=
> @@ -634,6 +636,46 @@=0A=
> =A0=A0=A0=A0=A0=A0=A0=A0 struct acc100_device *d =3D dev->data->dev_priva=
te;=0A=
> =0A=
> =A0=A0=A0=A0=A0=A0=A0=A0 static const struct rte_bbdev_op_cap bbdev_capab=
ilities[] =3D {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 .type=
=A0=A0 =3D RTE_BBDEV_OP_LDPC_ENC,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 .cap.=
ldpc_enc =3D {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 .capability_flags =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_RATE_MATCH |=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_CRC_24B_ATTACH |=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_INTERLEAVER_BYPAS=
S,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 .num_buffers_src =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_BBDE=
V_LDPC_MAX_CODE_BLOCKS,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 .num_buffers_dst =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_BBDE=
V_LDPC_MAX_CODE_BLOCKS,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 }=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 },=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 .type=
=A0=A0 =3D RTE_BBDEV_OP_LDPC_DEC,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 .cap.=
ldpc_dec =3D {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 .capa=
bility_flags =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK |=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP |=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE |=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE |=0A=
> +#ifdef ACC100_EXT_MEM=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABL=0A=
> E |=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENA=0A=
> BLE |=0A=
> +#endif=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE |=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS |=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_DECODE_BYPASS |=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_DEC_SCATTER_GATHER |=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION |=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_LLR_COMPRESSION,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 .llr_=
size =3D 8,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 .llr_=
decimals =3D 1,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 .num_=
buffers_src =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 .num_=
buffers_hard_out =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 .num_=
buffers_soft_out =3D 0,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 }=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 },=0A=
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_BBDEV_END_OF_CAPABIL=
ITIES_LIST()=0A=
> =A0=A0=A0=A0=A0=A0=A0=A0 };=0A=
> =0A=
> @@ -669,9 +711,14 @@=0A=
> =A0=A0=A0=A0=A0=A0=A0=A0 dev_info->cpu_flag_reqs =3D NULL;=0A=
> =A0=A0=A0=A0=A0=A0=A0=A0 dev_info->min_alignment =3D 64;=0A=
> =A0=A0=A0=A0=A0=A0=A0=A0 dev_info->capabilities =3D bbdev_capabilities;=
=0A=
> +#ifdef ACC100_EXT_MEM=0A=
> =A0=A0=A0=A0=A0=A0=A0=A0 dev_info->harq_buffer_size =3D d->ddr_size;=0A=
> +#else=0A=
> +=A0=A0=A0=A0=A0=A0 dev_info->harq_buffer_size =3D 0;=0A=
> +#endif=0A=
> =A0}=0A=
> =0A=
> +=0A=
> =A0static const struct rte_bbdev_ops acc100_bbdev_ops =3D {=0A=
> =A0=A0=A0=A0=A0=A0=A0=A0 .setup_queues =3D acc100_setup_queues,=0A=
> =A0=A0=A0=A0=A0=A0=A0=A0 .close =3D acc100_dev_close,=0A=
> @@ -696,6 +743,1577 @@=0A=
> =A0=A0=A0=A0=A0=A0=A0=A0 {.device_id =3D 0},=0A=
> =A0};=0A=
> =0A=
> +/* Read flag value 0/1 from bitmap */=0A=
> +static inline bool=0A=
> +check_bit(uint32_t bitmap, uint32_t bitmask)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 return bitmap & bitmask;=0A=
> +}=0A=
> +=0A=
> +static inline char *=0A=
> +mbuf_append(struct rte_mbuf *m_head, struct rte_mbuf *m, uint16_t len)=
=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 if (unlikely(len > rte_pktmbuf_tailroom(m)))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return NULL;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 char *tail =3D (char *)m->buf_addr + m->data_off + m-=
>data_len;=0A=
> +=A0=A0=A0=A0=A0=A0 m->data_len =3D (uint16_t)(m->data_len + len);=0A=
> +=A0=A0=A0=A0=A0=A0 m_head->pkt_len=A0 =3D (m_head->pkt_len + len);=0A=
> +=A0=A0=A0=A0=A0=A0 return tail;=0A=
> +}=0A=
> +=0A=
> +/* Compute value of k0.=0A=
> + * Based on 3GPP 38.212 Table 5.4.2.1-2=0A=
> + * Starting position of different redundancy versions, k0=0A=
> + */=0A=
> +static inline uint16_t=0A=
> +get_k0(uint16_t n_cb, uint16_t z_c, uint8_t bg, uint8_t rv_index)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 if (rv_index =3D=3D 0)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return 0;=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t n =3D (bg =3D=3D 1 ? N_ZC_1 : N_ZC_2) * z_c;=
=0A=
> +=A0=A0=A0=A0=A0=A0 if (n_cb =3D=3D n) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (rv_index =3D=3D 1)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 retur=
n (bg =3D=3D 1 ? K0_1_1 : K0_1_2) * z_c;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 else if (rv_index =3D=3D 2)=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 retur=
n (bg =3D=3D 1 ? K0_2_1 : K0_2_2) * z_c;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 else=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 retur=
n (bg =3D=3D 1 ? K0_3_1 : K0_3_2) * z_c;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=A0=A0=A0=A0=A0=A0 /* LBRM case - includes a division by N */=0A=
> +=A0=A0=A0=A0=A0=A0 if (rv_index =3D=3D 1)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return (((bg =3D=3D 1 ? K0_1_=
1 : K0_1_2) * n_cb)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 / n) * z_c;=0A=
> +=A0=A0=A0=A0=A0=A0 else if (rv_index =3D=3D 2)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return (((bg =3D=3D 1 ? K0_2_=
1 : K0_2_2) * n_cb)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 / n) * z_c;=0A=
> +=A0=A0=A0=A0=A0=A0 else=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return (((bg =3D=3D 1 ? K0_3_=
1 : K0_3_2) * n_cb)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 / n) * z_c;=0A=
> +}=0A=
> +=0A=
> +/* Fill in a frame control word for LDPC encoding. */=0A=
> +static inline void=0A=
> +acc100_fcw_le_fill(const struct rte_bbdev_enc_op *op,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct acc100_fcw_le *fcw, in=
t num_cb)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->qm =3D op->ldpc_enc.q_m;=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->nfiller =3D op->ldpc_enc.n_filler;=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->BG =3D (op->ldpc_enc.basegraph - 1);=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->Zc =3D op->ldpc_enc.z_c;=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->ncb =3D op->ldpc_enc.n_cb;=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->k0 =3D get_k0(fcw->ncb, fcw->Zc, op->ldpc_enc.ba=
segraph,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 op->l=
dpc_enc.rv_index);=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->rm_e =3D op->ldpc_enc.cb_params.e;=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->crc_select =3D check_bit(op->ldpc_enc.op_flags,=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_B=
BDEV_LDPC_CRC_24B_ATTACH);=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->bypass_intlv =3D check_bit(op->ldpc_enc.op_flags=
,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_B=
BDEV_LDPC_INTERLEAVER_BYPASS);=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->mcb_count =3D num_cb;=0A=
> +}=0A=
> +=0A=
> +/* Fill in a frame control word for LDPC decoding. */=0A=
> +static inline void=0A=
> +acc100_fcw_ld_fill(const struct rte_bbdev_dec_op *op, struct acc100_fcw_=
ld=0A=
> *fcw,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 union acc100_harq_layout_data=
 *harq_layout)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t harq_out_length, harq_in_length, ncb_p, k0_p=
, parity_offset;=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t harq_index;=0A=
> +=A0=A0=A0=A0=A0=A0 uint32_t l;=0A=
> +=A0=A0=A0=A0=A0=A0 bool harq_prun =3D false;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->qm =3D op->ldpc_dec.q_m;=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->nfiller =3D op->ldpc_dec.n_filler;=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->BG =3D (op->ldpc_dec.basegraph - 1);=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->Zc =3D op->ldpc_dec.z_c;=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->ncb =3D op->ldpc_dec.n_cb;=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->k0 =3D get_k0(fcw->ncb, fcw->Zc, op->ldpc_dec.ba=
segraph,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 op->l=
dpc_dec.rv_index);=0A=
> +=A0=A0=A0=A0=A0=A0 if (op->ldpc_dec.code_block_mode =3D=3D 1)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->rm_e =3D op->ldpc_dec.cb=
_params.e;=0A=
> +=A0=A0=A0=A0=A0=A0 else=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->rm_e =3D (op->ldpc_dec.t=
b_params.r <=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 op->ldpc_dec.tb_params.cab) ?=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 op->ldpc=
_dec.tb_params.ea :=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 op->ldpc=
_dec.tb_params.eb;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->hcin_en =3D check_bit(op->ldpc_dec.op_flags,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_B=
BDEV_LDPC_HQ_COMBINE_IN_ENABLE);=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->hcout_en =3D check_bit(op->ldpc_dec.op_flags,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_B=
BDEV_LDPC_HQ_COMBINE_OUT_ENABLE);=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->crc_select =3D check_bit(op->ldpc_dec.op_flags,=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_B=
BDEV_LDPC_CRC_TYPE_24B_CHECK);=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->bypass_dec =3D check_bit(op->ldpc_dec.op_flags,=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_B=
BDEV_LDPC_DECODE_BYPASS);=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->bypass_intlv =3D check_bit(op->ldpc_dec.op_flags=
,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_B=
BDEV_LDPC_DEINTERLEAVER_BYPASS);=0A=
> +=A0=A0=A0=A0=A0=A0 if (op->ldpc_dec.q_m =3D=3D 1) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->bypass_intlv =3D 1;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->qm =3D 2;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->hcin_decomp_mode =3D check_bit(op->ldpc_dec.op_f=
lags,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_B=
BDEV_LDPC_HARQ_6BIT_COMPRESSION);=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->hcout_comp_mode =3D check_bit(op->ldpc_dec.op_fl=
ags,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_B=
BDEV_LDPC_HARQ_6BIT_COMPRESSION);=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->llr_pack_mode =3D check_bit(op->ldpc_dec.op_flag=
s,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_B=
BDEV_LDPC_LLR_COMPRESSION);=0A=
> +=A0=A0=A0=A0=A0=A0 harq_index =3D op->ldpc_dec.harq_combined_output.offs=
et /=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ACC10=
0_HARQ_OFFSET;=0A=
> +#ifdef ACC100_EXT_MEM=0A=
> +=A0=A0=A0=A0=A0=A0 /* Limit cases when HARQ pruning is valid */=0A=
> +=A0=A0=A0=A0=A0=A0 harq_prun =3D ((op->ldpc_dec.harq_combined_output.off=
set %=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ACC10=
0_HARQ_OFFSET) =3D=3D 0) &&=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (op->=
ldpc_dec.harq_combined_output.offset <=3D UINT16_MAX=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 * ACC=
100_HARQ_OFFSET);=0A=
> +#endif=0A=
> +=A0=A0=A0=A0=A0=A0 if (fcw->hcin_en > 0) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 harq_in_length =3D op->ldpc_d=
ec.harq_combined_input.length;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (fcw->hcin_decomp_mode > 0=
)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 harq_=
in_length =3D harq_in_length * 8 / 6;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 harq_in_length =3D RTE_ALIGN(=
harq_in_length, 64);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if ((harq_layout[harq_index].=
offset > 0) & harq_prun) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_b=
bdev_log_debug("HARQ IN offset unexpected for now\n");=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->=
hcin_size0 =3D harq_layout[harq_index].size0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->=
hcin_offset =3D harq_layout[harq_index].offset;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->=
hcin_size1 =3D harq_in_length -=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 harq_layout[harq_index].offset;=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 } else {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->=
hcin_size0 =3D harq_in_length;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->=
hcin_offset =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->=
hcin_size1 =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 }=0A=
> +=A0=A0=A0=A0=A0=A0 } else {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->hcin_size0 =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->hcin_offset =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->hcin_size1 =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->itmax =3D op->ldpc_dec.iter_max;=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->itstop =3D check_bit(op->ldpc_dec.op_flags,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_B=
BDEV_LDPC_ITERATION_STOP_ENABLE);=0A=
> +=A0=A0=A0=A0=A0=A0 fcw->synd_precoder =3D fcw->itstop;=0A=
> +=A0=A0=A0=A0=A0=A0 /*=0A=
> +=A0=A0=A0=A0=A0=A0=A0 * These are all implicitly set=0A=
> +=A0=A0=A0=A0=A0=A0=A0 * fcw->synd_post =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0 * fcw->so_en =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0 * fcw->so_bypass_rm =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0 * fcw->so_bypass_intlv =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0 * fcw->dec_convllr =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0 * fcw->hcout_convllr =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0 * fcw->hcout_size1 =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0 * fcw->so_it =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0 * fcw->hcout_offset =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0 * fcw->negstop_th =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0 * fcw->negstop_it =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0 * fcw->negstop_en =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0 * fcw->gain_i =3D 1;=0A=
> +=A0=A0=A0=A0=A0=A0=A0 * fcw->gain_h =3D 1;=0A=
> +=A0=A0=A0=A0=A0=A0=A0 */=0A=
> +=A0=A0=A0=A0=A0=A0 if (fcw->hcout_en > 0) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 parity_offset =3D (op->ldpc_d=
ec.basegraph =3D=3D 1 ? 20 : 8)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 * op-=
>ldpc_dec.z_c - op->ldpc_dec.n_filler;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 k0_p =3D (fcw->k0 > parity_of=
fset) ?=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 fcw->k0 - op->ldpc_dec.n_filler : fcw->k0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ncb_p =3D fcw->ncb - op->ldpc=
_dec.n_filler;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 l =3D k0_p + fcw->rm_e;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 harq_out_length =3D (uint16_t=
) fcw->hcin_size0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 harq_out_length =3D RTE_MIN(R=
TE_MAX(harq_out_length, l), ncb_p);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 harq_out_length =3D (harq_out=
_length + 0x3F) & 0xFFC0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if ((k0_p > fcw->hcin_size0 +=
 ACC100_HARQ_OFFSET_THRESHOLD)=0A=
> &&=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 harq_prun) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->=
hcout_size0 =3D (uint16_t) fcw->hcin_size0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->=
hcout_offset =3D k0_p & 0xFFC0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->=
hcout_size1 =3D harq_out_length - fcw->hcout_offset;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 } else {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->=
hcout_size0 =3D harq_out_length;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->=
hcout_size1 =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->=
hcout_offset =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 }=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 harq_layout[harq_index].offse=
t =3D fcw->hcout_offset;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 harq_layout[harq_index].size0=
 =3D fcw->hcout_size0;=0A=
> +=A0=A0=A0=A0=A0=A0 } else {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->hcout_size0 =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->hcout_size1 =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw->hcout_offset =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +}=0A=
> +=0A=
> +/**=0A=
> + * Fills descriptor with data pointers of one block type.=0A=
> + *=0A=
> + * @param desc=0A=
> + *=A0=A0 Pointer to DMA descriptor.=0A=
> + * @param input=0A=
> + *=A0=A0 Pointer to pointer to input data which will be encoded. It can =
be changed=0A=
> + *=A0=A0 and points to next segment in scatter-gather case.=0A=
> + * @param offset=0A=
> + *=A0=A0 Input offset in rte_mbuf structure. It is used for calculating =
the point=0A=
> + *=A0=A0 where data is starting.=0A=
> + * @param cb_len=0A=
> + *=A0=A0 Length of currently processed Code Block=0A=
> + * @param seg_total_left=0A=
> + *=A0=A0 It indicates how many bytes still left in segment (mbuf) for fu=
rther=0A=
> + *=A0=A0 processing.=0A=
> + * @param op_flags=0A=
> + *=A0=A0 Store information about device capabilities=0A=
> + * @param next_triplet=0A=
> + *=A0=A0 Index for ACC100 DMA Descriptor triplet=0A=
> + *=0A=
> + * @return=0A=
> + *=A0=A0 Returns index of next triplet on success, other value if length=
s of=0A=
> + *=A0=A0 pkt and processed cb do not match.=0A=
> + *=0A=
> + */=0A=
> +static inline int=0A=
> +acc100_dma_fill_blk_type_in(struct acc100_dma_req_desc *desc,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct rte_mbuf **input, uint=
32_t *offset, uint32_t cb_len,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint32_t *seg_total_left, int=
 next_triplet)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 uint32_t part_len;=0A=
> +=A0=A0=A0=A0=A0=A0 struct rte_mbuf *m =3D *input;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 part_len =3D (*seg_total_left < cb_len) ? *seg_total_=
left : cb_len;=0A=
> +=A0=A0=A0=A0=A0=A0 cb_len -=3D part_len;=0A=
> +=A0=A0=A0=A0=A0=A0 *seg_total_left -=3D part_len;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet].address =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_p=
ktmbuf_iova_offset(m, *offset);=0A=
> +=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet].blen =3D part_len;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet].blkid =3D ACC100_DMA_BL=
KID_IN;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet].last =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet].dma_ext =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 *offset +=3D part_len;=0A=
> +=A0=A0=A0=A0=A0=A0 next_triplet++;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 while (cb_len > 0) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (next_triplet < ACC100_DMA=
_MAX_NUM_POINTERS &&=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 m->next !=3D NULL) {=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 m =3D=
 m->next;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 *seg_=
total_left =3D rte_pktmbuf_data_len(m);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 part_=
len =3D (*seg_total_left < cb_len) ?=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 *seg_total_left :=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 cb_len;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc-=
>data_ptrs[next_triplet].address =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_pktmbuf_mtophys(m);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc-=
>data_ptrs[next_triplet].blen =3D part_len;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc-=
>data_ptrs[next_triplet].blkid =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ACC100_DMA_BLKID_IN;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc-=
>data_ptrs[next_triplet].last =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc-=
>data_ptrs[next_triplet].dma_ext =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 cb_le=
n -=3D part_len;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 *seg_=
total_left -=3D part_len;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* In=
itializing offset for next segment (mbuf) */=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 *offs=
et =3D part_len;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 next_=
triplet++;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 } else {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_b=
bdev_log(ERR,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 "Some data still left for processing: "=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 "data_left: %u, next_triplet: %u, next_mbuf: %p",=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 cb_len, next_triplet, m->next);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 retur=
n -EINVAL;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 }=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=A0=A0=A0=A0=A0=A0 /* Storing new mbuf as it could be changed in scatter=
-gather case*/=0A=
> +=A0=A0=A0=A0=A0=A0 *input =3D m;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 return next_triplet;=0A=
> +}=0A=
> +=0A=
> +/* Fills descriptor with data pointers of one block type.=0A=
> + * Returns index of next triplet on success, other value if lengths of=
=0A=
> + * output data and processed mbuf do not match.=0A=
> + */=0A=
> +static inline int=0A=
> +acc100_dma_fill_blk_type_out(struct acc100_dma_req_desc *desc,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct rte_mbuf *output, uint=
32_t out_offset,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint32_t output_len, int next=
_triplet, int blk_id)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet].address =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_p=
ktmbuf_iova_offset(output, out_offset);=0A=
> +=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet].blen =3D output_len;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet].blkid =3D blk_id;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet].last =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet].dma_ext =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 next_triplet++;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 return next_triplet;=0A=
> +}=0A=
> +=0A=
> +static inline int=0A=
> +acc100_dma_desc_le_fill(struct rte_bbdev_enc_op *op,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct acc100_dma_req_desc *d=
esc, struct rte_mbuf **input,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct rte_mbuf *output, uint=
32_t *in_offset,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint32_t *out_offset, uint32_=
t *out_length,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint32_t *mbuf_total_left, ui=
nt32_t *seg_total_left)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 int next_triplet =3D 1; /* FCW already done */=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t K, in_length_in_bits, in_length_in_bytes;=0A=
> +=A0=A0=A0=A0=A0=A0 struct rte_bbdev_op_ldpc_enc *enc =3D &op->ldpc_enc;=
=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 desc->word0 =3D ACC100_DMA_DESC_TYPE;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->word1 =3D 0; /**< Timestamp could be disabled *=
/=0A=
> +=A0=A0=A0=A0=A0=A0 desc->word2 =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->word3 =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->numCBs =3D 1;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 K =3D (enc->basegraph =3D=3D 1 ? 22 : 10) * enc->z_c;=
=0A=
> +=A0=A0=A0=A0=A0=A0 in_length_in_bits =3D K - enc->n_filler;=0A=
> +=A0=A0=A0=A0=A0=A0 if ((enc->op_flags & RTE_BBDEV_LDPC_CRC_24A_ATTACH) |=
|=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (enc-=
>op_flags & RTE_BBDEV_LDPC_CRC_24B_ATTACH))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 in_length_in_bits -=3D 24;=0A=
> +=A0=A0=A0=A0=A0=A0 in_length_in_bytes =3D in_length_in_bits >> 3;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 if (unlikely((*mbuf_total_left =3D=3D 0) ||=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (*mbu=
f_total_left < in_length_in_bytes))) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_bbdev_log(ERR,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 "Mismatch between mbuf length and included CB sizes:=0A=
> mbuf len %u, cb len %u",=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 *mbuf_total_left, in_length_in_bytes);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -1;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 next_triplet =3D acc100_dma_fill_blk_type_in(desc, in=
put, in_offset,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 in_le=
ngth_in_bytes,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 seg_t=
otal_left, next_triplet);=0A=
> +=A0=A0=A0=A0=A0=A0 if (unlikely(next_triplet < 0)) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_bbdev_log(ERR,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 "Mismatch between data to process and mbuf data length=
=0A=
> in bbdev_op: %p",=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 op);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -1;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet - 1].last =3D 1;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->m2dlen =3D next_triplet;=0A=
> +=A0=A0=A0=A0=A0=A0 *mbuf_total_left -=3D in_length_in_bytes;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Set output length */=0A=
> +=A0=A0=A0=A0=A0=A0 /* Integer round up division by 8 */=0A=
> +=A0=A0=A0=A0=A0=A0 *out_length =3D (enc->cb_params.e + 7) >> 3;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 next_triplet =3D acc100_dma_fill_blk_type_out(desc, o=
utput, *out_offset,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 *out_=
length, next_triplet, ACC100_DMA_BLKID_OUT_ENC);=0A=
> +=A0=A0=A0=A0=A0=A0 if (unlikely(next_triplet < 0)) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_bbdev_log(ERR,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 "Mismatch between data to process and mbuf data length=
=0A=
> in bbdev_op: %p",=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 op);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -1;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=A0=A0=A0=A0=A0=A0 op->ldpc_enc.output.length +=3D *out_length;=0A=
> +=A0=A0=A0=A0=A0=A0 *out_offset +=3D *out_length;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet - 1].last =3D 1;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet - 1].dma_ext =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->d2mlen =3D next_triplet - desc->m2dlen;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 desc->op_addr =3D op;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 return 0;=0A=
> +}=0A=
> +=0A=
> +static inline int=0A=
> +acc100_dma_desc_ld_fill(struct rte_bbdev_dec_op *op,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct acc100_dma_req_desc *d=
esc,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct rte_mbuf **input, stru=
ct rte_mbuf *h_output,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint32_t *in_offset, uint32_t=
 *h_out_offset,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint32_t *h_out_length, uint3=
2_t *mbuf_total_left,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint32_t *seg_total_left,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct acc100_fcw_ld *fcw)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 struct rte_bbdev_op_ldpc_dec *dec =3D &op->ldpc_dec;=
=0A=
> +=A0=A0=A0=A0=A0=A0 int next_triplet =3D 1; /* FCW already done */=0A=
> +=A0=A0=A0=A0=A0=A0 uint32_t input_length;=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t output_length, crc24_overlap =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t sys_cols, K, h_p_size, h_np_size;=0A=
> +=A0=A0=A0=A0=A0=A0 bool h_comp =3D check_bit(dec->op_flags,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_B=
BDEV_LDPC_HARQ_6BIT_COMPRESSION);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 desc->word0 =3D ACC100_DMA_DESC_TYPE;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->word1 =3D 0; /**< Timestamp could be disabled *=
/=0A=
> +=A0=A0=A0=A0=A0=A0 desc->word2 =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->word3 =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->numCBs =3D 1;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 if (check_bit(op->ldpc_dec.op_flags,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_B=
BDEV_LDPC_CRC_TYPE_24B_DROP))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 crc24_overlap =3D 24;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Compute some LDPC BG lengths */=0A=
> +=A0=A0=A0=A0=A0=A0 input_length =3D dec->cb_params.e;=0A=
> +=A0=A0=A0=A0=A0=A0 if (check_bit(op->ldpc_dec.op_flags,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 RTE_B=
BDEV_LDPC_LLR_COMPRESSION))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 input_length =3D (input_lengt=
h * 3 + 3) / 4;=0A=
> +=A0=A0=A0=A0=A0=A0 sys_cols =3D (dec->basegraph =3D=3D 1) ? 22 : 10;=0A=
> +=A0=A0=A0=A0=A0=A0 K =3D sys_cols * dec->z_c;=0A=
> +=A0=A0=A0=A0=A0=A0 output_length =3D K - dec->n_filler - crc24_overlap;=
=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 if (unlikely((*mbuf_total_left =3D=3D 0) ||=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (*mbu=
f_total_left < input_length))) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_bbdev_log(ERR,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 "Mismatch between mbuf length and included CB sizes:=0A=
> mbuf len %u, cb len %u",=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 *mbuf_total_left, input_length);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -1;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 next_triplet =3D acc100_dma_fill_blk_type_in(desc, in=
put,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 in_of=
fset, input_length,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 seg_t=
otal_left, next_triplet);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 if (unlikely(next_triplet < 0)) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_bbdev_log(ERR,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 "Mismatch between data to process and mbuf data length=
=0A=
> in bbdev_op: %p",=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 op);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -1;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 if (check_bit(op->ldpc_dec.op_flags,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE)) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 h_p_size =3D fcw->hcin_size0 =
+ fcw->hcin_size1;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (h_comp)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 h_p_s=
ize =3D (h_p_size * 3 + 3) / 4;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet]=
.address =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 dec->harq_combined_input.offset;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet]=
.blen =3D h_p_size;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet]=
.blkid =3D=0A=
> ACC100_DMA_BLKID_IN_HARQ;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet]=
.dma_ext =3D 1;=0A=
> +#ifndef ACC100_EXT_MEM=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 acc100_dma_fill_blk_type_out(=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 desc,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 op->ldpc_dec.harq_combined_input.data,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 op->ldpc_dec.harq_combined_input.offset,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 h_p_size,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 next_triplet,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 ACC100_DMA_BLKID_IN_HARQ);=0A=
> +#endif=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 next_triplet++;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet - 1].last =3D 1;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->m2dlen =3D next_triplet;=0A=
> +=A0=A0=A0=A0=A0=A0 *mbuf_total_left -=3D input_length;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 next_triplet =3D acc100_dma_fill_blk_type_out(desc, h=
_output,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 *h_ou=
t_offset, output_length >> 3, next_triplet,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ACC10=
0_DMA_BLKID_OUT_HARD);=0A=
> +=A0=A0=A0=A0=A0=A0 if (unlikely(next_triplet < 0)) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_bbdev_log(ERR,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 "Mismatch between data to process and mbuf data length=
=0A=
> in bbdev_op: %p",=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 op);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -1;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 if (check_bit(op->ldpc_dec.op_flags,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE)) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Pruned size of the HARQ */=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 h_p_size =3D fcw->hcout_size0=
 + fcw->hcout_size1;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Non-Pruned size of the HAR=
Q */=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 h_np_size =3D fcw->hcout_offs=
et > 0 ?=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 fcw->hcout_offset + fcw->hcout_size1 :=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 h_p_size;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (h_comp) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 h_np_=
size =3D (h_np_size * 3 + 3) / 4;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 h_p_s=
ize =3D (h_p_size * 3 + 3) / 4;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 }=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 dec->harq_combined_output.len=
gth =3D h_np_size;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet]=
.address =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 dec->harq_combined_output.offset;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet]=
.blen =3D h_p_size;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet]=
.blkid =3D=0A=
> ACC100_DMA_BLKID_OUT_HARQ;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet]=
.dma_ext =3D 1;=0A=
> +#ifndef ACC100_EXT_MEM=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 acc100_dma_fill_blk_type_out(=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 desc,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 dec->harq_combined_output.data,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 dec->harq_combined_output.offset,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 h_p_size,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 next_triplet,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 ACC100_DMA_BLKID_OUT_HARQ);=0A=
> +#endif=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 next_triplet++;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 *h_out_length =3D output_length >> 3;=0A=
> +=A0=A0=A0=A0=A0=A0 dec->hard_output.length +=3D *h_out_length;=0A=
> +=A0=A0=A0=A0=A0=A0 *h_out_offset +=3D *h_out_length;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet - 1].last =3D 1;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->d2mlen =3D next_triplet - desc->m2dlen;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 desc->op_addr =3D op;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 return 0;=0A=
> +}=0A=
> +=0A=
> +static inline void=0A=
> +acc100_dma_desc_ld_update(struct rte_bbdev_dec_op *op,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct acc100_dma_req_desc *d=
esc,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct rte_mbuf *input, struc=
t rte_mbuf *h_output,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint32_t *in_offset, uint32_t=
 *h_out_offset,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint32_t *h_out_length,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 union acc100_harq_layout_data=
 *harq_layout)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 int next_triplet =3D 1; /* FCW already done */=0A=
> +=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet].address =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_p=
ktmbuf_iova_offset(input, *in_offset);=0A=
> +=A0=A0=A0=A0=A0=A0 next_triplet++;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 if (check_bit(op->ldpc_dec.op_flags,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE)) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct rte_bbdev_op_data hi =
=3D op->ldpc_dec.harq_combined_input;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet]=
.address =3D hi.offset;=0A=
> +#ifndef ACC100_EXT_MEM=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet]=
.address =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 rte_pktmbuf_iova_offset(hi.data, hi.offset);=0A=
> +#endif=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 next_triplet++;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet].address =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_p=
ktmbuf_iova_offset(h_output, *h_out_offset);=0A=
> +=A0=A0=A0=A0=A0=A0 *h_out_length =3D desc->data_ptrs[next_triplet].blen;=
=0A=
> +=A0=A0=A0=A0=A0=A0 next_triplet++;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 if (check_bit(op->ldpc_dec.op_flags,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE)) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet]=
.address =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 op->ldpc_dec.harq_combined_output.offset;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Adjust based on previous o=
peration */=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct rte_bbdev_dec_op *prev=
_op =3D desc->op_addr;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 op->ldpc_dec.harq_combined_ou=
tput.length =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 prev_op->ldpc_dec.harq_combined_output.length;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 int16_t hq_idx =3D op->ldpc_d=
ec.harq_combined_output.offset /=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 ACC100_HARQ_OFFSET;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 int16_t prev_hq_idx =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 prev_op->ldpc_dec.harq_combined_output.offset=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 / ACC100_HARQ_OFFSET;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 harq_layout[hq_idx].val =3D h=
arq_layout[prev_hq_idx].val;=0A=
> +#ifndef ACC100_EXT_MEM=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct rte_bbdev_op_data ho =
=3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 op->ldpc_dec.harq_combined_output;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->data_ptrs[next_triplet]=
.address =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 rte_pktmbuf_iova_offset(ho.data, ho.offset);=0A=
> +#endif=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 next_triplet++;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 op->ldpc_dec.hard_output.length +=3D *h_out_length;=
=0A=
> +=A0=A0=A0=A0=A0=A0 desc->op_addr =3D op;=0A=
> +}=0A=
> +=0A=
> +=0A=
> +/* Enqueue a number of operations to HW and update software rings */=0A=
> +static inline void=0A=
> +acc100_dma_enqueue(struct acc100_queue *q, uint16_t n,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct rte_bbdev_stats *queue=
_stats)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 union acc100_enqueue_reg_fmt enq_req;=0A=
> +#ifdef RTE_BBDEV_OFFLOAD_COST=0A=
> +=A0=A0=A0=A0=A0=A0 uint64_t start_time =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 queue_stats->acc_offload_cycles =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 RTE_SET_USED(queue_stats);=0A=
> +#else=0A=
> +=A0=A0=A0=A0=A0=A0 RTE_SET_USED(queue_stats);=0A=
> +#endif=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 enq_req.val =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 /* Setting offset, 100b for 256 DMA Desc */=0A=
> +=A0=A0=A0=A0=A0=A0 enq_req.addr_offset =3D ACC100_DESC_OFFSET;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Split ops into batches */=0A=
> +=A0=A0=A0=A0=A0=A0 do {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 union acc100_dma_desc *desc;=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint16_t enq_batch_size;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint64_t offset;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_iova_t req_elem_addr;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 enq_batch_size =3D RTE_MIN(n,=
 MAX_ENQ_BATCH_SIZE);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Set flag on last descripto=
r in a batch */=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc =3D q->ring_addr + ((q->=
sw_ring_head + enq_batch_size - 1) &=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 q->sw_ring_wrap_mask);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->req.last_desc_in_batch =
=3D 1;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Calculate the 1st descript=
or's address */=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 offset =3D ((q->sw_ring_head =
& q->sw_ring_wrap_mask) *=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 sizeof(union acc100_dma_desc));=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 req_elem_addr =3D q->ring_add=
r_phys + offset;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Fill enqueue struct */=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 enq_req.num_elem =3D enq_batc=
h_size;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* low 6 bits are not needed =
*/=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 enq_req.req_elem_addr =3D (ui=
nt32_t)(req_elem_addr >> 6);=0A=
> +=0A=
> +#ifdef RTE_LIBRTE_BBDEV_DEBUG=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_memdump(stderr, "Req sdon=
e", desc, sizeof(*desc));=0A=
> +#endif=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_bbdev_log_debug(=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 "Enqueue %u reqs (phys %#"PRIx64") to reg %p",=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 enq_batch_size,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 req_elem_addr,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 (void *)q->mmio_reg_enqueue);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_wmb();=0A=
> +=0A=
> +#ifdef RTE_BBDEV_OFFLOAD_COST=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Start time measurement for=
 enqueue function offload. */=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 start_time =3D rte_rdtsc_prec=
ise();=0A=
> +#endif=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_bbdev_log(DEBUG, "Debug :=
 MMIO Enqueue");=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 mmio_write(q->mmio_reg_enqueu=
e, enq_req.val);=0A=
> +=0A=
> +#ifdef RTE_BBDEV_OFFLOAD_COST=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 queue_stats->acc_offload_cycl=
es +=3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 rte_rdtsc_precise() - start_time;=0A=
> +#endif=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 q->aq_enqueued++;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 q->sw_ring_head +=3D enq_batc=
h_size;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 n -=3D enq_batch_size;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 } while (n);=0A=
> +=0A=
> +=0A=
> +}=0A=
> +=0A=
> +/* Enqueue one encode operations for ACC100 device in CB mode */=0A=
> +static inline int=0A=
> +enqueue_ldpc_enc_n_op_cb(struct acc100_queue *q, struct=0A=
> rte_bbdev_enc_op **ops,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint16_t total_enqueued_cbs, =
int16_t num)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 union acc100_dma_desc *desc =3D NULL;=0A=
> +=A0=A0=A0=A0=A0=A0 uint32_t out_length;=0A=
> +=A0=A0=A0=A0=A0=A0 struct rte_mbuf *output_head, *output;=0A=
> +=A0=A0=A0=A0=A0=A0 int i, next_triplet;=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t=A0 in_length_in_bytes;=0A=
> +=A0=A0=A0=A0=A0=A0 struct rte_bbdev_op_ldpc_enc *enc =3D &ops[0]->ldpc_e=
nc;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t desc_idx =3D ((q->sw_ring_head + total_enque=
ued_cbs)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 & q->=
sw_ring_wrap_mask);=0A=
> +=A0=A0=A0=A0=A0=A0 desc =3D q->ring_addr + desc_idx;=0A=
> +=A0=A0=A0=A0=A0=A0 acc100_fcw_le_fill(ops[0], &desc->req.fcw_le, num);=
=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /** This could be done at polling */=0A=
> +=A0=A0=A0=A0=A0=A0 desc->req.word0 =3D ACC100_DMA_DESC_TYPE;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->req.word1 =3D 0; /**< Timestamp could be disabl=
ed */=0A=
> +=A0=A0=A0=A0=A0=A0 desc->req.word2 =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->req.word3 =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->req.numCBs =3D num;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 in_length_in_bytes =3D ops[0]->ldpc_enc.input.data->d=
ata_len;=0A=
> +=A0=A0=A0=A0=A0=A0 out_length =3D (enc->cb_params.e + 7) >> 3;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->req.m2dlen =3D 1 + num;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->req.d2mlen =3D num;=0A=
> +=A0=A0=A0=A0=A0=A0 next_triplet =3D 1;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 for (i =3D 0; i < num; i++) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->req.data_ptrs[next_trip=
let].address =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_p=
ktmbuf_iova_offset(ops[i]->ldpc_enc.input.data, 0);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->req.data_ptrs[next_trip=
let].blen =3D in_length_in_bytes;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 next_triplet++;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->req.data_ptrs[next_trip=
let].address =3D=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 rte_pktmbuf_iova_offset(=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 ops[i]->ldpc_enc.output.data, 0);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->req.data_ptrs[next_trip=
let].blen =3D out_length;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 next_triplet++;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ops[i]->ldpc_enc.output.lengt=
h =3D out_length;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 output_head =3D output =3D op=
s[i]->ldpc_enc.output.data;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 mbuf_append(output_head, outp=
ut, out_length);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 output->data_len =3D out_leng=
th;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 desc->req.op_addr =3D ops[0];=0A=
> +=0A=
> +#ifdef RTE_LIBRTE_BBDEV_DEBUG=0A=
> +=A0=A0=A0=A0=A0=A0 rte_memdump(stderr, "FCW", &desc->req.fcw_le,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 sizeo=
f(desc->req.fcw_le) - 8);=0A=
> +=A0=A0=A0=A0=A0=A0 rte_memdump(stderr, "Req Desc.", desc, sizeof(*desc))=
;=0A=
> +#endif=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* One CB (one op) was successfully prepared to enque=
ue */=0A=
> +=A0=A0=A0=A0=A0=A0 return num;=0A=
> +}=0A=
> +=0A=
> +/* Enqueue one encode operations for ACC100 device in CB mode */=0A=
> +static inline int=0A=
> +enqueue_ldpc_enc_one_op_cb(struct acc100_queue *q, struct=0A=
> rte_bbdev_enc_op *op,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint16_t total_enqueued_cbs)=
=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 union acc100_dma_desc *desc =3D NULL;=0A=
> +=A0=A0=A0=A0=A0=A0 int ret;=0A=
> +=A0=A0=A0=A0=A0=A0 uint32_t in_offset, out_offset, out_length, mbuf_tota=
l_left,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 seg_total_left;=0A=
> +=A0=A0=A0=A0=A0=A0 struct rte_mbuf *input, *output_head, *output;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t desc_idx =3D ((q->sw_ring_head + total_enque=
ued_cbs)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 & q->=
sw_ring_wrap_mask);=0A=
> +=A0=A0=A0=A0=A0=A0 desc =3D q->ring_addr + desc_idx;=0A=
> +=A0=A0=A0=A0=A0=A0 acc100_fcw_le_fill(op, &desc->req.fcw_le, 1);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 input =3D op->ldpc_enc.input.data;=0A=
> +=A0=A0=A0=A0=A0=A0 output_head =3D output =3D op->ldpc_enc.output.data;=
=0A=
> +=A0=A0=A0=A0=A0=A0 in_offset =3D op->ldpc_enc.input.offset;=0A=
> +=A0=A0=A0=A0=A0=A0 out_offset =3D op->ldpc_enc.output.offset;=0A=
> +=A0=A0=A0=A0=A0=A0 out_length =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 mbuf_total_left =3D op->ldpc_enc.input.length;=0A=
> +=A0=A0=A0=A0=A0=A0 seg_total_left =3D rte_pktmbuf_data_len(op->ldpc_enc.=
input.data)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 - in_=
offset;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 ret =3D acc100_dma_desc_le_fill(op, &desc->req, &inpu=
t, output,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 &in_o=
ffset, &out_offset, &out_length, &mbuf_total_left,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 &seg_=
total_left);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 if (unlikely(ret < 0))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return ret;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 mbuf_append(output_head, output, out_length);=0A=
> +=0A=
> +#ifdef RTE_LIBRTE_BBDEV_DEBUG=0A=
> +=A0=A0=A0=A0=A0=A0 rte_memdump(stderr, "FCW", &desc->req.fcw_le,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 sizeo=
f(desc->req.fcw_le) - 8);=0A=
> +=A0=A0=A0=A0=A0=A0 rte_memdump(stderr, "Req Desc.", desc, sizeof(*desc))=
;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Check if any data left after processing one CB */=
=0A=
> +=A0=A0=A0=A0=A0=A0 if (mbuf_total_left !=3D 0) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_bbdev_log(ERR,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 "Some date still left after processing one CB:=0A=
> mbuf_total_left =3D %u",=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 mbuf_total_left);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -EINVAL;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +#endif=0A=
> +=A0=A0=A0=A0=A0=A0 /* One CB (one op) was successfully prepared to enque=
ue */=0A=
> +=A0=A0=A0=A0=A0=A0 return 1;=0A=
> +}=0A=
> +=0A=
> +/** Enqueue one decode operations for ACC100 device in CB mode */=0A=
> +static inline int=0A=
> +enqueue_ldpc_dec_one_op_cb(struct acc100_queue *q, struct=0A=
> rte_bbdev_dec_op *op,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint16_t total_enqueued_cbs, =
bool same_op)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 int ret;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 union acc100_dma_desc *desc;=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t desc_idx =3D ((q->sw_ring_head + total_enque=
ued_cbs)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 & q->=
sw_ring_wrap_mask);=0A=
> +=A0=A0=A0=A0=A0=A0 desc =3D q->ring_addr + desc_idx;=0A=
> +=A0=A0=A0=A0=A0=A0 struct rte_mbuf *input, *h_output_head, *h_output;=0A=
> +=A0=A0=A0=A0=A0=A0 uint32_t in_offset, h_out_offset, h_out_length, mbuf_=
total_left;=0A=
> +=A0=A0=A0=A0=A0=A0 input =3D op->ldpc_dec.input.data;=0A=
> +=A0=A0=A0=A0=A0=A0 h_output_head =3D h_output =3D op->ldpc_dec.hard_outp=
ut.data;=0A=
> +=A0=A0=A0=A0=A0=A0 in_offset =3D op->ldpc_dec.input.offset;=0A=
> +=A0=A0=A0=A0=A0=A0 h_out_offset =3D op->ldpc_dec.hard_output.offset;=0A=
> +=A0=A0=A0=A0=A0=A0 mbuf_total_left =3D op->ldpc_dec.input.length;=0A=
> +#ifdef RTE_LIBRTE_BBDEV_DEBUG=0A=
> +=A0=A0=A0=A0=A0=A0 if (unlikely(input =3D=3D NULL)) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_bbdev_log(ERR, "Invalid m=
buf pointer");=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -EFAULT;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +#endif=0A=
> +=A0=A0=A0=A0=A0=A0 union acc100_harq_layout_data *harq_layout =3D q->d->=
harq_layout;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 if (same_op) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 union acc100_dma_desc *prev_d=
esc;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc_idx =3D ((q->sw_ring_hea=
d + total_enqueued_cbs - 1)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 & q->sw_ring_wrap_mask);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 prev_desc =3D q->ring_addr + =
desc_idx;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint8_t *prev_ptr =3D (uint8_=
t *) prev_desc;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint8_t *new_ptr =3D (uint8_t=
 *) desc;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Copy first 4 words and BDE=
SCs */=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_memcpy(new_ptr, prev_ptr,=
 16);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_memcpy(new_ptr + 36, prev=
_ptr + 36, 40);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->req.op_addr =3D prev_de=
sc->req.op_addr;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Copy FCW */=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_memcpy(new_ptr + ACC100_D=
ESC_FCW_OFFSET,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 prev_ptr + ACC100_DESC_FCW_OFFSET,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 ACC100_FCW_LD_BLEN);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 acc100_dma_desc_ld_update(op,=
 &desc->req, input, h_output,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 &in_offset, &h_out_offset,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 &h_out_length, harq_layout);=0A=
> +=A0=A0=A0=A0=A0=A0 } else {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct acc100_fcw_ld *fcw;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint32_t seg_total_left;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fcw =3D &desc->req.fcw_ld;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 acc100_fcw_ld_fill(op, fcw, h=
arq_layout);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Special handling when over=
using mbuf */=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (fcw->rm_e < MAX_E_MBUF)=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 seg_t=
otal_left =3D rte_pktmbuf_data_len(input)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 - in_offset;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 else=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 seg_t=
otal_left =3D fcw->rm_e;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ret =3D acc100_dma_desc_ld_fi=
ll(op, &desc->req, &input, h_output,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 &in_offset, &h_out_offset,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 &h_out_length, &mbuf_total_left,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 &seg_total_left, fcw);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (unlikely(ret < 0))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 retur=
n ret;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Hard output */=0A=
> +=A0=A0=A0=A0=A0=A0 mbuf_append(h_output_head, h_output, h_out_length);=
=0A=
> +#ifndef ACC100_EXT_MEM=0A=
> +=A0=A0=A0=A0=A0=A0 if (op->ldpc_dec.harq_combined_output.length > 0) {=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Push the HARQ output into =
host memory */=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct rte_mbuf *hq_output_he=
ad, *hq_output;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 hq_output_head =3D op->ldpc_d=
ec.harq_combined_output.data;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 hq_output =3D op->ldpc_dec.ha=
rq_combined_output.data;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 mbuf_append(hq_output_head, h=
q_output,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 op->ldpc_dec.harq_combined_output.length);=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +#endif=0A=
> +=0A=
> +#ifdef RTE_LIBRTE_BBDEV_DEBUG=0A=
> +=A0=A0=A0=A0=A0=A0 rte_memdump(stderr, "FCW", &desc->req.fcw_ld,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 sizeo=
f(desc->req.fcw_ld) - 8);=0A=
> +=A0=A0=A0=A0=A0=A0 rte_memdump(stderr, "Req Desc.", desc, sizeof(*desc))=
;=0A=
> +#endif=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* One CB (one op) was successfully prepared to enque=
ue */=0A=
> +=A0=A0=A0=A0=A0=A0 return 1;=0A=
> +}=0A=
> +=0A=
> +=0A=
> +/* Enqueue one decode operations for ACC100 device in TB mode */=0A=
> +static inline int=0A=
> +enqueue_ldpc_dec_one_op_tb(struct acc100_queue *q, struct=0A=
> rte_bbdev_dec_op *op,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint16_t total_enqueued_cbs, =
uint8_t cbs_in_tb)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 union acc100_dma_desc *desc =3D NULL;=0A=
> +=A0=A0=A0=A0=A0=A0 int ret;=0A=
> +=A0=A0=A0=A0=A0=A0 uint8_t r, c;=0A=
> +=A0=A0=A0=A0=A0=A0 uint32_t in_offset, h_out_offset,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 h_out_length, mbuf_total_left=
, seg_total_left;=0A=
> +=A0=A0=A0=A0=A0=A0 struct rte_mbuf *input, *h_output_head, *h_output;=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t current_enqueued_cbs =3D 0;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t desc_idx =3D ((q->sw_ring_head + total_enque=
ued_cbs)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 & q->=
sw_ring_wrap_mask);=0A=
> +=A0=A0=A0=A0=A0=A0 desc =3D q->ring_addr + desc_idx;=0A=
> +=A0=A0=A0=A0=A0=A0 uint64_t fcw_offset =3D (desc_idx << 8) + ACC100_DESC=
_FCW_OFFSET;=0A=
> +=A0=A0=A0=A0=A0=A0 union acc100_harq_layout_data *harq_layout =3D q->d->=
harq_layout;=0A=
> +=A0=A0=A0=A0=A0=A0 acc100_fcw_ld_fill(op, &desc->req.fcw_ld, harq_layout=
);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 input =3D op->ldpc_dec.input.data;=0A=
> +=A0=A0=A0=A0=A0=A0 h_output_head =3D h_output =3D op->ldpc_dec.hard_outp=
ut.data;=0A=
> +=A0=A0=A0=A0=A0=A0 in_offset =3D op->ldpc_dec.input.offset;=0A=
> +=A0=A0=A0=A0=A0=A0 h_out_offset =3D op->ldpc_dec.hard_output.offset;=0A=
> +=A0=A0=A0=A0=A0=A0 h_out_length =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 mbuf_total_left =3D op->ldpc_dec.input.length;=0A=
> +=A0=A0=A0=A0=A0=A0 c =3D op->ldpc_dec.tb_params.c;=0A=
> +=A0=A0=A0=A0=A0=A0 r =3D op->ldpc_dec.tb_params.r;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 while (mbuf_total_left > 0 && r < c) {=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 seg_total_left =3D rte_pktmbu=
f_data_len(input) - in_offset;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Set up DMA descriptor */=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc =3D q->ring_addr + ((q->=
sw_ring_head + total_enqueued_cbs)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 & q->sw_ring_wrap_mask);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->req.data_ptrs[0].addres=
s =3D q->ring_addr_phys + fcw_offset;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->req.data_ptrs[0].blen =
=3D ACC100_FCW_LD_BLEN;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ret =3D acc100_dma_desc_ld_fi=
ll(op, &desc->req, &input,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 h_output, &in_offset, &h_out_offset,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 &h_out_length,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 &mbuf_total_left, &seg_total_left,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 &desc->req.fcw_ld);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (unlikely(ret < 0))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 retur=
n ret;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Hard output */=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 mbuf_append(h_output_head, h_=
output, h_out_length);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Set total number of CBs in=
 TB */=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->req.cbs_in_tb =3D cbs_i=
n_tb;=0A=
> +#ifdef RTE_LIBRTE_BBDEV_DEBUG=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_memdump(stderr, "FCW", &d=
esc->req.fcw_td,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 sizeof(desc->req.fcw_td) - 8);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_memdump(stderr, "Req Desc=
.", desc, sizeof(*desc));=0A=
> +#endif=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (seg_total_left =3D=3D 0) =
{=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Go=
 to the next mbuf */=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 input=
 =3D input->next;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 in_of=
fset =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 h_out=
put =3D h_output->next;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 h_out=
_offset =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 }=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 total_enqueued_cbs++;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 current_enqueued_cbs++;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 r++;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 if (unlikely(desc =3D=3D NULL))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return current_enqueued_cbs;=
=0A=
> +=0A=
> +#ifdef RTE_LIBRTE_BBDEV_DEBUG=0A=
> +=A0=A0=A0=A0=A0=A0 /* Check if any CBs left for processing */=0A=
> +=A0=A0=A0=A0=A0=A0 if (mbuf_total_left !=3D 0) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_bbdev_log(ERR,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 "Some date still left for processing: mbuf_total_left =
=3D %u",=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 mbuf_total_left);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -EINVAL;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +#endif=0A=
> +=A0=A0=A0=A0=A0=A0 /* Set SDone on last CB descriptor for TB mode */=0A=
> +=A0=A0=A0=A0=A0=A0 desc->req.sdone_enable =3D 1;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->req.irq_enable =3D q->irq_enable;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 return current_enqueued_cbs;=0A=
> +}=0A=
> +=0A=
> +=0A=
> +/* Calculates number of CBs in processed encoder TB based on 'r' and inp=
ut=0A=
> + * length.=0A=
> + */=0A=
> +static inline uint8_t=0A=
> +get_num_cbs_in_tb_enc(struct rte_bbdev_op_turbo_enc *turbo_enc)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 uint8_t c, c_neg, r, crc24_bits =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t k, k_neg, k_pos;=0A=
> +=A0=A0=A0=A0=A0=A0 uint8_t cbs_in_tb =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 int32_t length;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 length =3D turbo_enc->input.length;=0A=
> +=A0=A0=A0=A0=A0=A0 r =3D turbo_enc->tb_params.r;=0A=
> +=A0=A0=A0=A0=A0=A0 c =3D turbo_enc->tb_params.c;=0A=
> +=A0=A0=A0=A0=A0=A0 c_neg =3D turbo_enc->tb_params.c_neg;=0A=
> +=A0=A0=A0=A0=A0=A0 k_neg =3D turbo_enc->tb_params.k_neg;=0A=
> +=A0=A0=A0=A0=A0=A0 k_pos =3D turbo_enc->tb_params.k_pos;=0A=
> +=A0=A0=A0=A0=A0=A0 crc24_bits =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 if (check_bit(turbo_enc->op_flags,=0A=
> RTE_BBDEV_TURBO_CRC_24B_ATTACH))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 crc24_bits =3D 24;=0A=
> +=A0=A0=A0=A0=A0=A0 while (length > 0 && r < c) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 k =3D (r < c_neg) ? k_neg : k=
_pos;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 length -=3D (k - crc24_bits) =
>> 3;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 r++;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 cbs_in_tb++;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 return cbs_in_tb;=0A=
> +}=0A=
> +=0A=
> +/* Calculates number of CBs in processed decoder TB based on 'r' and inp=
ut=0A=
> + * length.=0A=
> + */=0A=
> +static inline uint16_t=0A=
> +get_num_cbs_in_tb_dec(struct rte_bbdev_op_turbo_dec *turbo_dec)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 uint8_t c, c_neg, r =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t kw, k, k_neg, k_pos, cbs_in_tb =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 int32_t length;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 length =3D turbo_dec->input.length;=0A=
> +=A0=A0=A0=A0=A0=A0 r =3D turbo_dec->tb_params.r;=0A=
> +=A0=A0=A0=A0=A0=A0 c =3D turbo_dec->tb_params.c;=0A=
> +=A0=A0=A0=A0=A0=A0 c_neg =3D turbo_dec->tb_params.c_neg;=0A=
> +=A0=A0=A0=A0=A0=A0 k_neg =3D turbo_dec->tb_params.k_neg;=0A=
> +=A0=A0=A0=A0=A0=A0 k_pos =3D turbo_dec->tb_params.k_pos;=0A=
> +=A0=A0=A0=A0=A0=A0 while (length > 0 && r < c) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 k =3D (r < c_neg) ? k_neg : k=
_pos;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 kw =3D RTE_ALIGN_CEIL(k + 4, =
32) * 3;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 length -=3D kw;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 r++;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 cbs_in_tb++;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 return cbs_in_tb;=0A=
> +}=0A=
> +=0A=
> +/* Calculates number of CBs in processed decoder TB based on 'r' and inp=
ut=0A=
> + * length.=0A=
> + */=0A=
> +static inline uint16_t=0A=
> +get_num_cbs_in_tb_ldpc_dec(struct rte_bbdev_op_ldpc_dec *ldpc_dec)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t r, cbs_in_tb =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 int32_t length =3D ldpc_dec->input.length;=0A=
> +=A0=A0=A0=A0=A0=A0 r =3D ldpc_dec->tb_params.r;=0A=
> +=A0=A0=A0=A0=A0=A0 while (length > 0 && r < ldpc_dec->tb_params.c) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 length -=3D=A0 (r < ldpc_dec-=
>tb_params.cab) ?=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 ldpc_dec->tb_params.ea :=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 ldpc_dec->tb_params.eb;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 r++;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 cbs_in_tb++;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=A0=A0=A0=A0=A0=A0 return cbs_in_tb;=0A=
> +}=0A=
> +=0A=
> +/* Check we can mux encode operations with common FCW */=0A=
> +static inline bool=0A=
> +check_mux(struct rte_bbdev_enc_op **ops, uint16_t num) {=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t i;=0A=
> +=A0=A0=A0=A0=A0=A0 if (num =3D=3D 1)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return false;=0A=
> +=A0=A0=A0=A0=A0=A0 for (i =3D 1; i < num; ++i) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Only mux compatible code b=
locks */=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (memcmp((uint8_t *)(&ops[i=
]->ldpc_enc) + ENC_OFFSET,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 (uint8_t *)(&ops[0]->ldpc_enc) + ENC_OFFSET,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 CMP_ENC_SIZE) !=3D 0)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 retur=
n false;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=A0=A0=A0=A0=A0=A0 return true;=0A=
> +}=0A=
> +=0A=
> +/** Enqueue encode operations for ACC100 device in CB mode. */=0A=
> +static inline uint16_t=0A=
> +acc100_enqueue_ldpc_enc_cb(struct rte_bbdev_queue_data *q_data,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct rte_bbdev_enc_op **ops=
, uint16_t num)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 struct acc100_queue *q =3D q_data->queue_private;=0A=
> +=A0=A0=A0=A0=A0=A0 int32_t avail =3D q->sw_ring_depth + q->sw_ring_tail =
- q->sw_ring_head;=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t i =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 union acc100_dma_desc *desc;=0A=
> +=A0=A0=A0=A0=A0=A0 int ret, desc_idx =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 int16_t enq, left =3D num;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 while (left > 0) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (unlikely(avail - 1 < 0))=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 break=
;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 avail--;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 enq =3D RTE_MIN(left, MUX_5GD=
L_DESC);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (check_mux(&ops[i], enq)) =
{=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ret =
=3D enqueue_ldpc_enc_n_op_cb(q, &ops[i],=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc_idx, enq);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (r=
et < 0)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 break;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 i +=
=3D enq;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 } else {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ret =
=3D enqueue_ldpc_enc_one_op_cb(q, ops[i], desc_idx);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (r=
et < 0)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 break;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 i++;=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 }=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc_idx++;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 left =3D num - i;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 if (unlikely(i =3D=3D 0))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return 0; /* Nothing to enque=
ue */=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Set SDone in last CB in enqueued ops for CB mode*/=
=0A=
> +=A0=A0=A0=A0=A0=A0 desc =3D q->ring_addr + ((q->sw_ring_head + desc_idx =
- 1)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 & q->=
sw_ring_wrap_mask);=0A=
> +=A0=A0=A0=A0=A0=A0 desc->req.sdone_enable =3D 1;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->req.irq_enable =3D q->irq_enable;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 acc100_dma_enqueue(q, desc_idx, &q_data->queue_stats)=
;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Update stats */=0A=
> +=A0=A0=A0=A0=A0=A0 q_data->queue_stats.enqueued_count +=3D i;=0A=
> +=A0=A0=A0=A0=A0=A0 q_data->queue_stats.enqueue_err_count +=3D num - i;=
=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 return i;=0A=
> +}=0A=
> +=0A=
> +/* Enqueue encode operations for ACC100 device. */=0A=
> +static uint16_t=0A=
> +acc100_enqueue_ldpc_enc(struct rte_bbdev_queue_data *q_data,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct rte_bbdev_enc_op **ops=
, uint16_t num)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 if (unlikely(num =3D=3D 0))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return 0;=0A=
> +=A0=A0=A0=A0=A0=A0 return acc100_enqueue_ldpc_enc_cb(q_data, ops, num);=
=0A=
> +}=0A=
> +=0A=
> +/* Check we can mux encode operations with common FCW */=0A=
> +static inline bool=0A=
> +cmp_ldpc_dec_op(struct rte_bbdev_dec_op **ops) {=0A=
> +=A0=A0=A0=A0=A0=A0 /* Only mux compatible code blocks */=0A=
> +=A0=A0=A0=A0=A0=A0 if (memcmp((uint8_t *)(&ops[0]->ldpc_dec) + DEC_OFFSE=
T,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (uint=
8_t *)(&ops[1]->ldpc_dec) +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 DEC_O=
FFSET, CMP_DEC_SIZE) !=3D 0) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return false;=0A=
> +=A0=A0=A0=A0=A0=A0 } else=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return true;=0A=
> +}=0A=
> +=0A=
> +=0A=
> +/* Enqueue decode operations for ACC100 device in TB mode */=0A=
> +static uint16_t=0A=
> +acc100_enqueue_ldpc_dec_tb(struct rte_bbdev_queue_data *q_data,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct rte_bbdev_dec_op **ops=
, uint16_t num)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 struct acc100_queue *q =3D q_data->queue_private;=0A=
> +=A0=A0=A0=A0=A0=A0 int32_t avail =3D q->sw_ring_depth + q->sw_ring_tail =
- q->sw_ring_head;=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t i, enqueued_cbs =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 uint8_t cbs_in_tb;=0A=
> +=A0=A0=A0=A0=A0=A0 int ret;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 for (i =3D 0; i < num; ++i) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 cbs_in_tb =3D get_num_cbs_in_=
tb_ldpc_dec(&ops[i]->ldpc_dec);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Check if there are availab=
le space for further processing */=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (unlikely(avail - cbs_in_t=
b < 0))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 break=
;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 avail -=3D cbs_in_tb;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ret =3D enqueue_ldpc_dec_one_=
op_tb(q, ops[i],=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 enqueued_cbs, cbs_in_tb);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (ret < 0)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 break=
;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 enqueued_cbs +=3D ret;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 acc100_dma_enqueue(q, enqueued_cbs, &q_data->queue_st=
ats);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Update stats */=0A=
> +=A0=A0=A0=A0=A0=A0 q_data->queue_stats.enqueued_count +=3D i;=0A=
> +=A0=A0=A0=A0=A0=A0 q_data->queue_stats.enqueue_err_count +=3D num - i;=
=0A=
> +=A0=A0=A0=A0=A0=A0 return i;=0A=
> +}=0A=
> +=0A=
> +/* Enqueue decode operations for ACC100 device in CB mode */=0A=
> +static uint16_t=0A=
> +acc100_enqueue_ldpc_dec_cb(struct rte_bbdev_queue_data *q_data,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct rte_bbdev_dec_op **ops=
, uint16_t num)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 struct acc100_queue *q =3D q_data->queue_private;=0A=
> +=A0=A0=A0=A0=A0=A0 int32_t avail =3D q->sw_ring_depth + q->sw_ring_tail =
- q->sw_ring_head;=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t i;=0A=
> +=A0=A0=A0=A0=A0=A0 union acc100_dma_desc *desc;=0A=
> +=A0=A0=A0=A0=A0=A0 int ret;=0A=
> +=A0=A0=A0=A0=A0=A0 bool same_op =3D false;=0A=
> +=A0=A0=A0=A0=A0=A0 for (i =3D 0; i < num; ++i) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Check if there are availab=
le space for further processing */=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (unlikely(avail - 1 < 0))=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 break=
;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 avail -=3D 1;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (i > 0)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 same_=
op =3D cmp_ldpc_dec_op(&ops[i-1]);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_bbdev_log(INFO, "Op %d %d=
 %d %d %d %d %d %d %d %d %d=0A=
> %d\n",=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 i, op=
s[i]->ldpc_dec.op_flags, ops[i]->ldpc_dec.rv_index,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ops[i=
]->ldpc_dec.iter_max, ops[i]->ldpc_dec.iter_count,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ops[i=
]->ldpc_dec.basegraph, ops[i]->ldpc_dec.z_c,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ops[i=
]->ldpc_dec.n_cb, ops[i]->ldpc_dec.q_m,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ops[i=
]->ldpc_dec.n_filler, ops[i]->ldpc_dec.cb_params.e,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 same_=
op);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ret =3D enqueue_ldpc_dec_one_=
op_cb(q, ops[i], i, same_op);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (ret < 0)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 break=
;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 if (unlikely(i =3D=3D 0))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return 0; /* Nothing to enque=
ue */=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Set SDone in last CB in enqueued ops for CB mode*/=
=0A=
> +=A0=A0=A0=A0=A0=A0 desc =3D q->ring_addr + ((q->sw_ring_head + i - 1)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 & q->=
sw_ring_wrap_mask);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 desc->req.sdone_enable =3D 1;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->req.irq_enable =3D q->irq_enable;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 acc100_dma_enqueue(q, i, &q_data->queue_stats);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Update stats */=0A=
> +=A0=A0=A0=A0=A0=A0 q_data->queue_stats.enqueued_count +=3D i;=0A=
> +=A0=A0=A0=A0=A0=A0 q_data->queue_stats.enqueue_err_count +=3D num - i;=
=0A=
> +=A0=A0=A0=A0=A0=A0 return i;=0A=
> +}=0A=
> +=0A=
> +/* Enqueue decode operations for ACC100 device. */=0A=
> +static uint16_t=0A=
> +acc100_enqueue_ldpc_dec(struct rte_bbdev_queue_data *q_data,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct rte_bbdev_dec_op **ops=
, uint16_t num)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 struct acc100_queue *q =3D q_data->queue_private;=0A=
> +=A0=A0=A0=A0=A0=A0 int32_t aq_avail =3D q->aq_depth +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (q->a=
q_dequeued - q->aq_enqueued) / 128;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 if (unlikely((aq_avail =3D=3D 0) || (num =3D=3D 0)))=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return 0;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 if (ops[0]->ldpc_dec.code_block_mode =3D=3D 0)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return acc100_enqueue_ldpc_de=
c_tb(q_data, ops, num);=0A=
> +=A0=A0=A0=A0=A0=A0 else=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return acc100_enqueue_ldpc_de=
c_cb(q_data, ops, num);=0A=
> +}=0A=
> +=0A=
> +=0A=
> +/* Dequeue one encode operations from ACC100 device in CB mode */=0A=
> +static inline int=0A=
> +dequeue_enc_one_op_cb(struct acc100_queue *q, struct rte_bbdev_enc_op=0A=
> **ref_op,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint16_t total_dequeued_cbs, =
uint32_t *aq_dequeued)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 union acc100_dma_desc *desc, atom_desc;=0A=
> +=A0=A0=A0=A0=A0=A0 union acc100_dma_rsp_desc rsp;=0A=
> +=A0=A0=A0=A0=A0=A0 struct rte_bbdev_enc_op *op;=0A=
> +=A0=A0=A0=A0=A0=A0 int i;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 desc =3D q->ring_addr + ((q->sw_ring_tail + total_deq=
ueued_cbs)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 & q->=
sw_ring_wrap_mask);=0A=
> +=A0=A0=A0=A0=A0=A0 atom_desc.atom_hdr =3D __atomic_load_n((uint64_t *)de=
sc,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 __ATO=
MIC_RELAXED);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Check fdone bit */=0A=
> +=A0=A0=A0=A0=A0=A0 if (!(atom_desc.rsp.val & ACC100_FDONE))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -1;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 rsp.val =3D atom_desc.rsp.val;=0A=
> +=A0=A0=A0=A0=A0=A0 rte_bbdev_log_debug("Resp. desc %p: %x", desc, rsp.va=
l);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Dequeue */=0A=
> +=A0=A0=A0=A0=A0=A0 op =3D desc->req.op_addr;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Clearing status, it will be set based on response =
*/=0A=
> +=A0=A0=A0=A0=A0=A0 op->status =3D 0;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 op->status |=3D ((rsp.input_err)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ? (1 =
<< RTE_BBDEV_DATA_ERROR) : 0);=0A=
> +=A0=A0=A0=A0=A0=A0 op->status |=3D ((rsp.dma_err) ? (1 << RTE_BBDEV_DRV_=
ERROR) : 0);=0A=
> +=A0=A0=A0=A0=A0=A0 op->status |=3D ((rsp.fcw_err) ? (1 << RTE_BBDEV_DRV_=
ERROR) : 0);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 if (desc->req.last_desc_in_batch) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (*aq_dequeued)++;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->req.last_desc_in_batch =
=3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=A0=A0=A0=A0=A0=A0 desc->rsp.val =3D ACC100_DMA_DESC_TYPE;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->rsp.add_info_0 =3D 0; /*Reserved bits */=0A=
> +=A0=A0=A0=A0=A0=A0 desc->rsp.add_info_1 =3D 0; /*Reserved bits */=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Flag that the muxing cause loss of opaque data */=
=0A=
> +=A0=A0=A0=A0=A0=A0 op->opaque_data =3D (void *)-1;=0A=
> +=A0=A0=A0=A0=A0=A0 for (i =3D 0 ; i < desc->req.numCBs; i++)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ref_op[i] =3D op;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* One CB (op) was successfully dequeued */=0A=
> +=A0=A0=A0=A0=A0=A0 return desc->req.numCBs;=0A=
> +}=0A=
> +=0A=
> +/* Dequeue one encode operations from ACC100 device in TB mode */=0A=
> +static inline int=0A=
> +dequeue_enc_one_op_tb(struct acc100_queue *q, struct rte_bbdev_enc_op=0A=
> **ref_op,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint16_t total_dequeued_cbs, =
uint32_t *aq_dequeued)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 union acc100_dma_desc *desc, *last_desc, atom_desc;=
=0A=
> +=A0=A0=A0=A0=A0=A0 union acc100_dma_rsp_desc rsp;=0A=
> +=A0=A0=A0=A0=A0=A0 struct rte_bbdev_enc_op *op;=0A=
> +=A0=A0=A0=A0=A0=A0 uint8_t i =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t current_dequeued_cbs =3D 0, cbs_in_tb;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 desc =3D q->ring_addr + ((q->sw_ring_tail + total_deq=
ueued_cbs)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 & q->=
sw_ring_wrap_mask);=0A=
> +=A0=A0=A0=A0=A0=A0 atom_desc.atom_hdr =3D __atomic_load_n((uint64_t *)de=
sc,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 __ATO=
MIC_RELAXED);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Check fdone bit */=0A=
> +=A0=A0=A0=A0=A0=A0 if (!(atom_desc.rsp.val & ACC100_FDONE))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -1;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Get number of CBs in dequeued TB */=0A=
> +=A0=A0=A0=A0=A0=A0 cbs_in_tb =3D desc->req.cbs_in_tb;=0A=
> +=A0=A0=A0=A0=A0=A0 /* Get last CB */=0A=
> +=A0=A0=A0=A0=A0=A0 last_desc =3D q->ring_addr + ((q->sw_ring_tail=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 + tot=
al_dequeued_cbs + cbs_in_tb - 1)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 & q->=
sw_ring_wrap_mask);=0A=
> +=A0=A0=A0=A0=A0=A0 /* Check if last CB in TB is ready to dequeue (and th=
us=0A=
> +=A0=A0=A0=A0=A0=A0=A0 * the whole TB) - checking sdone bit. If not retur=
n.=0A=
> +=A0=A0=A0=A0=A0=A0=A0 */=0A=
> +=A0=A0=A0=A0=A0=A0 atom_desc.atom_hdr =3D __atomic_load_n((uint64_t *)la=
st_desc,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 __ATO=
MIC_RELAXED);=0A=
> +=A0=A0=A0=A0=A0=A0 if (!(atom_desc.rsp.val & ACC100_SDONE))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -1;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Dequeue */=0A=
> +=A0=A0=A0=A0=A0=A0 op =3D desc->req.op_addr;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Clearing status, it will be set based on response =
*/=0A=
> +=A0=A0=A0=A0=A0=A0 op->status =3D 0;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 while (i < cbs_in_tb) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc =3D q->ring_addr + ((q->=
sw_ring_tail=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 + total_dequeued_cbs)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 & q->sw_ring_wrap_mask);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 atom_desc.atom_hdr =3D __atom=
ic_load_n((uint64_t *)desc,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 __ATOMIC_RELAXED);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rsp.val =3D atom_desc.rsp.val=
;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_bbdev_log_debug("Resp. de=
sc %p: %x", desc,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 rsp.val);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 op->status |=3D ((rsp.input_e=
rr)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 ? (1 << RTE_BBDEV_DATA_ERROR) : 0);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 op->status |=3D ((rsp.dma_err=
) ? (1 << RTE_BBDEV_DRV_ERROR) : 0);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 op->status |=3D ((rsp.fcw_err=
) ? (1 << RTE_BBDEV_DRV_ERROR) : 0);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (desc->req.last_desc_in_ba=
tch) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (*aq_=
dequeued)++;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc-=
>req.last_desc_in_batch =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 }=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->rsp.val =3D ACC100_DMA_=
DESC_TYPE;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->rsp.add_info_0 =3D 0;=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->rsp.add_info_1 =3D 0;=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 total_dequeued_cbs++;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 current_dequeued_cbs++;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 i++;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 *ref_op =3D op;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 return current_dequeued_cbs;=0A=
> +}=0A=
> +=0A=
> +/* Dequeue one decode operation from ACC100 device in CB mode */=0A=
> +static inline int=0A=
> +dequeue_dec_one_op_cb(struct rte_bbdev_queue_data *q_data,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct acc100_queue *q, struc=
t rte_bbdev_dec_op **ref_op,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint16_t dequeued_cbs, uint32=
_t *aq_dequeued)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 union acc100_dma_desc *desc, atom_desc;=0A=
> +=A0=A0=A0=A0=A0=A0 union acc100_dma_rsp_desc rsp;=0A=
> +=A0=A0=A0=A0=A0=A0 struct rte_bbdev_dec_op *op;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 desc =3D q->ring_addr + ((q->sw_ring_tail + dequeued_=
cbs)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 & q->=
sw_ring_wrap_mask);=0A=
> +=A0=A0=A0=A0=A0=A0 atom_desc.atom_hdr =3D __atomic_load_n((uint64_t *)de=
sc,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 __ATO=
MIC_RELAXED);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Check fdone bit */=0A=
> +=A0=A0=A0=A0=A0=A0 if (!(atom_desc.rsp.val & ACC100_FDONE))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -1;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 rsp.val =3D atom_desc.rsp.val;=0A=
> +=A0=A0=A0=A0=A0=A0 rte_bbdev_log_debug("Resp. desc %p: %x", desc, rsp.va=
l);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Dequeue */=0A=
> +=A0=A0=A0=A0=A0=A0 op =3D desc->req.op_addr;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Clearing status, it will be set based on response =
*/=0A=
> +=A0=A0=A0=A0=A0=A0 op->status =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 op->status |=3D ((rsp.input_err)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ? (1 =
<< RTE_BBDEV_DATA_ERROR) : 0);=0A=
> +=A0=A0=A0=A0=A0=A0 op->status |=3D ((rsp.dma_err) ? (1 << RTE_BBDEV_DRV_=
ERROR) : 0);=0A=
> +=A0=A0=A0=A0=A0=A0 op->status |=3D ((rsp.fcw_err) ? (1 << RTE_BBDEV_DRV_=
ERROR) : 0);=0A=
> +=A0=A0=A0=A0=A0=A0 if (op->status !=3D 0)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 q_data->queue_stats.dequeue_e=
rr_count++;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* CRC invalid if error exists */=0A=
> +=A0=A0=A0=A0=A0=A0 if (!op->status)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 op->status |=3D rsp.crc_statu=
s << RTE_BBDEV_CRC_ERROR;=0A=
> +=A0=A0=A0=A0=A0=A0 op->turbo_dec.iter_count =3D (uint8_t) rsp.iter_cnt /=
 2;=0A=
> +=A0=A0=A0=A0=A0=A0 /* Check if this is the last desc in batch (Atomic Qu=
eue) */=0A=
> +=A0=A0=A0=A0=A0=A0 if (desc->req.last_desc_in_batch) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (*aq_dequeued)++;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->req.last_desc_in_batch =
=3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=A0=A0=A0=A0=A0=A0 desc->rsp.val =3D ACC100_DMA_DESC_TYPE;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->rsp.add_info_0 =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->rsp.add_info_1 =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 *ref_op =3D op;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* One CB (op) was successfully dequeued */=0A=
> +=A0=A0=A0=A0=A0=A0 return 1;=0A=
> +}=0A=
> +=0A=
> +/* Dequeue one decode operations from ACC100 device in CB mode */=0A=
> +static inline int=0A=
> +dequeue_ldpc_dec_one_op_cb(struct rte_bbdev_queue_data *q_data,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct acc100_queue *q, struc=
t rte_bbdev_dec_op **ref_op,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint16_t dequeued_cbs, uint32=
_t *aq_dequeued)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 union acc100_dma_desc *desc, atom_desc;=0A=
> +=A0=A0=A0=A0=A0=A0 union acc100_dma_rsp_desc rsp;=0A=
> +=A0=A0=A0=A0=A0=A0 struct rte_bbdev_dec_op *op;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 desc =3D q->ring_addr + ((q->sw_ring_tail + dequeued_=
cbs)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 & q->=
sw_ring_wrap_mask);=0A=
> +=A0=A0=A0=A0=A0=A0 atom_desc.atom_hdr =3D __atomic_load_n((uint64_t *)de=
sc,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 __ATO=
MIC_RELAXED);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Check fdone bit */=0A=
> +=A0=A0=A0=A0=A0=A0 if (!(atom_desc.rsp.val & ACC100_FDONE))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -1;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 rsp.val =3D atom_desc.rsp.val;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Dequeue */=0A=
> +=A0=A0=A0=A0=A0=A0 op =3D desc->req.op_addr;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Clearing status, it will be set based on response =
*/=0A=
> +=A0=A0=A0=A0=A0=A0 op->status =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 op->status |=3D rsp.input_err << RTE_BBDEV_DATA_ERROR=
;=0A=
> +=A0=A0=A0=A0=A0=A0 op->status |=3D rsp.dma_err << RTE_BBDEV_DRV_ERROR;=
=0A=
> +=A0=A0=A0=A0=A0=A0 op->status |=3D rsp.fcw_err << RTE_BBDEV_DRV_ERROR;=
=0A=
> +=A0=A0=A0=A0=A0=A0 if (op->status !=3D 0)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 q_data->queue_stats.dequeue_e=
rr_count++;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 op->status |=3D rsp.crc_status << RTE_BBDEV_CRC_ERROR=
;=0A=
> +=A0=A0=A0=A0=A0=A0 if (op->ldpc_dec.hard_output.length > 0 && !rsp.synd_=
ok)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 op->status |=3D 1 << RTE_BBDE=
V_SYNDROME_ERROR;=0A=
> +=A0=A0=A0=A0=A0=A0 op->ldpc_dec.iter_count =3D (uint8_t) rsp.iter_cnt;=
=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Check if this is the last desc in batch (Atomic Qu=
eue) */=0A=
> +=A0=A0=A0=A0=A0=A0 if (desc->req.last_desc_in_batch) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (*aq_dequeued)++;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->req.last_desc_in_batch =
=3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 desc->rsp.val =3D ACC100_DMA_DESC_TYPE;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->rsp.add_info_0 =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 desc->rsp.add_info_1 =3D 0;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 *ref_op =3D op;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* One CB (op) was successfully dequeued */=0A=
> +=A0=A0=A0=A0=A0=A0 return 1;=0A=
> +}=0A=
> +=0A=
> +/* Dequeue one decode operations from ACC100 device in TB mode. */=0A=
> +static inline int=0A=
> +dequeue_dec_one_op_tb(struct acc100_queue *q, struct rte_bbdev_dec_op=0A=
> **ref_op,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 uint16_t dequeued_cbs, uint32=
_t *aq_dequeued)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 union acc100_dma_desc *desc, *last_desc, atom_desc;=
=0A=
> +=A0=A0=A0=A0=A0=A0 union acc100_dma_rsp_desc rsp;=0A=
> +=A0=A0=A0=A0=A0=A0 struct rte_bbdev_dec_op *op;=0A=
> +=A0=A0=A0=A0=A0=A0 uint8_t cbs_in_tb =3D 1, cb_idx =3D 0;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 desc =3D q->ring_addr + ((q->sw_ring_tail + dequeued_=
cbs)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 & q->=
sw_ring_wrap_mask);=0A=
> +=A0=A0=A0=A0=A0=A0 atom_desc.atom_hdr =3D __atomic_load_n((uint64_t *)de=
sc,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 __ATO=
MIC_RELAXED);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Check fdone bit */=0A=
> +=A0=A0=A0=A0=A0=A0 if (!(atom_desc.rsp.val & ACC100_FDONE))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -1;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Dequeue */=0A=
> +=A0=A0=A0=A0=A0=A0 op =3D desc->req.op_addr;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Get number of CBs in dequeued TB */=0A=
> +=A0=A0=A0=A0=A0=A0 cbs_in_tb =3D desc->req.cbs_in_tb;=0A=
> +=A0=A0=A0=A0=A0=A0 /* Get last CB */=0A=
> +=A0=A0=A0=A0=A0=A0 last_desc =3D q->ring_addr + ((q->sw_ring_tail=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 + deq=
ueued_cbs + cbs_in_tb - 1)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 & q->=
sw_ring_wrap_mask);=0A=
> +=A0=A0=A0=A0=A0=A0 /* Check if last CB in TB is ready to dequeue (and th=
us=0A=
> +=A0=A0=A0=A0=A0=A0=A0 * the whole TB) - checking sdone bit. If not retur=
n.=0A=
> +=A0=A0=A0=A0=A0=A0=A0 */=0A=
> +=A0=A0=A0=A0=A0=A0 atom_desc.atom_hdr =3D __atomic_load_n((uint64_t *)la=
st_desc,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 __ATO=
MIC_RELAXED);=0A=
> +=A0=A0=A0=A0=A0=A0 if (!(atom_desc.rsp.val & ACC100_SDONE))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -1;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Clearing status, it will be set based on response =
*/=0A=
> +=A0=A0=A0=A0=A0=A0 op->status =3D 0;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Read remaining CBs if exists */=0A=
> +=A0=A0=A0=A0=A0=A0 while (cb_idx < cbs_in_tb) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc =3D q->ring_addr + ((q->=
sw_ring_tail + dequeued_cbs)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 & q->sw_ring_wrap_mask);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 atom_desc.atom_hdr =3D __atom=
ic_load_n((uint64_t *)desc,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 __ATOMIC_RELAXED);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rsp.val =3D atom_desc.rsp.val=
;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_bbdev_log_debug("Resp. de=
sc %p: %x", desc,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 rsp.val);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 op->status |=3D ((rsp.input_e=
rr)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 ? (1 << RTE_BBDEV_DATA_ERROR) : 0);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 op->status |=3D ((rsp.dma_err=
) ? (1 << RTE_BBDEV_DRV_ERROR) : 0);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 op->status |=3D ((rsp.fcw_err=
) ? (1 << RTE_BBDEV_DRV_ERROR) : 0);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* CRC invalid if error exist=
s */=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (!op->status)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 op->s=
tatus |=3D rsp.crc_status << RTE_BBDEV_CRC_ERROR;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 op->turbo_dec.iter_count =3D =
RTE_MAX((uint8_t) rsp.iter_cnt,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 op->turbo_dec.iter_count);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 /* Check if this is the last =
desc in batch (Atomic Queue) */=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (desc->req.last_desc_in_ba=
tch) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (*aq_=
dequeued)++;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc-=
>req.last_desc_in_batch =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 }=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->rsp.val =3D ACC100_DMA_=
DESC_TYPE;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->rsp.add_info_0 =3D 0;=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 desc->rsp.add_info_1 =3D 0;=
=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 dequeued_cbs++;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 cb_idx++;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 *ref_op =3D op;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 return cb_idx;=0A=
> +}=0A=
> +=0A=
> +/* Dequeue LDPC encode operations from ACC100 device. */=0A=
> +static uint16_t=0A=
> +acc100_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct rte_bbdev_enc_op **ops=
, uint16_t num)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 struct acc100_queue *q =3D q_data->queue_private;=0A=
> +=A0=A0=A0=A0=A0=A0 uint32_t avail =3D q->sw_ring_head - q->sw_ring_tail;=
=0A=
> +=A0=A0=A0=A0=A0=A0 uint32_t aq_dequeued =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t dequeue_num, i, dequeued_cbs =3D 0, dequeued=
_descs =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 int ret;=0A=
> +=0A=
> +#ifdef RTE_LIBRTE_BBDEV_DEBUG=0A=
> +=A0=A0=A0=A0=A0=A0 if (unlikely(ops =3D=3D 0 && q =3D=3D NULL))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return 0;=0A=
> +#endif=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 dequeue_num =3D (avail < num) ? avail : num;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 for (i =3D 0; i < dequeue_num; i++) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ret =3D dequeue_enc_one_op_cb=
(q, &ops[dequeued_cbs],=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 dequeued_descs, &aq_dequeued);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (ret < 0)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 break=
;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 dequeued_cbs +=3D ret;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 dequeued_descs++;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (dequeued_cbs >=3D num)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 break=
;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 q->aq_dequeued +=3D aq_dequeued;=0A=
> +=A0=A0=A0=A0=A0=A0 q->sw_ring_tail +=3D dequeued_descs;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Update enqueue stats */=0A=
> +=A0=A0=A0=A0=A0=A0 q_data->queue_stats.dequeued_count +=3D dequeued_cbs;=
=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 return dequeued_cbs;=0A=
> +}=0A=
> +=0A=
> +/* Dequeue decode operations from ACC100 device. */=0A=
> +static uint16_t=0A=
> +acc100_dequeue_ldpc_dec(struct rte_bbdev_queue_data *q_data,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct rte_bbdev_dec_op **ops=
, uint16_t num)=0A=
> +{=0A=
> +=A0=A0=A0=A0=A0=A0 struct acc100_queue *q =3D q_data->queue_private;=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t dequeue_num;=0A=
> +=A0=A0=A0=A0=A0=A0 uint32_t avail =3D q->sw_ring_head - q->sw_ring_tail;=
=0A=
> +=A0=A0=A0=A0=A0=A0 uint32_t aq_dequeued =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t i;=0A=
> +=A0=A0=A0=A0=A0=A0 uint16_t dequeued_cbs =3D 0;=0A=
> +=A0=A0=A0=A0=A0=A0 struct rte_bbdev_dec_op *op;=0A=
> +=A0=A0=A0=A0=A0=A0 int ret;=0A=
> +=0A=
> +#ifdef RTE_LIBRTE_BBDEV_DEBUG=0A=
> +=A0=A0=A0=A0=A0=A0 if (unlikely(ops =3D=3D 0 && q =3D=3D NULL))=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return 0;=0A=
> +#endif=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 dequeue_num =3D (avail < num) ? avail : num;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 for (i =3D 0; i < dequeue_num; ++i) {=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 op =3D (q->ring_addr + ((q->s=
w_ring_tail + dequeued_cbs)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 & q->=
sw_ring_wrap_mask))->req.op_addr;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (op->ldpc_dec.code_block_m=
ode =3D=3D 0)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ret =
=3D dequeue_dec_one_op_tb(q, &ops[i], dequeued_cbs,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 &aq_dequeued);=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 else=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ret =
=3D dequeue_ldpc_dec_one_op_cb(=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 q_data, q, &ops[i], dequeued_cbs=
,=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 &aq_dequeued);=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (ret < 0)=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 break=
;=0A=
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 dequeued_cbs +=3D ret;=0A=
> +=A0=A0=A0=A0=A0=A0 }=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 q->aq_dequeued +=3D aq_dequeued;=0A=
> +=A0=A0=A0=A0=A0=A0 q->sw_ring_tail +=3D dequeued_cbs;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 /* Update enqueue stats */=0A=
> +=A0=A0=A0=A0=A0=A0 q_data->queue_stats.dequeued_count +=3D i;=0A=
> +=0A=
> +=A0=A0=A0=A0=A0=A0 return i;=0A=
> +}=0A=
> +=0A=
> =A0/* Initialization Function */=0A=
> =A0static void=0A=
> =A0acc100_bbdev_init(struct rte_bbdev *dev, struct rte_pci_driver *drv)=
=0A=
> @@ -703,6 +2321,10 @@=0A=
> =A0=A0=A0=A0=A0=A0=A0=A0 struct rte_pci_device *pci_dev =3D RTE_DEV_TO_PC=
I(dev->device);=0A=
> =0A=
> =A0=A0=A0=A0=A0=A0=A0=A0 dev->dev_ops =3D &acc100_bbdev_ops;=0A=
> +=A0=A0=A0=A0=A0=A0 dev->enqueue_ldpc_enc_ops =3D acc100_enqueue_ldpc_enc=
;=0A=
> +=A0=A0=A0=A0=A0=A0 dev->enqueue_ldpc_dec_ops =3D acc100_enqueue_ldpc_dec=
;=0A=
> +=A0=A0=A0=A0=A0=A0 dev->dequeue_ldpc_enc_ops =3D acc100_dequeue_ldpc_enc=
;=0A=
> +=A0=A0=A0=A0=A0=A0 dev->dequeue_ldpc_dec_ops =3D acc100_dequeue_ldpc_dec=
;=0A=
> =0A=
> =A0=A0=A0=A0=A0=A0=A0=A0 ((struct acc100_device *) dev->data->dev_private=
)->pf_device =3D=0A=
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =
!strcmp(drv->driver.name,=0A=
> @@ -815,4 +2437,3 @@ static int acc100_pci_remove(struct rte_pci_device=
=0A=
> *pci_dev)=0A=
> =A0RTE_PMD_REGISTER_PCI_TABLE(ACC100PF_DRIVER_NAME,=0A=
> pci_id_acc100_pf_map);=0A=
> =A0RTE_PMD_REGISTER_PCI(ACC100VF_DRIVER_NAME, acc100_pci_vf_driver);=0A=
> =A0RTE_PMD_REGISTER_PCI_TABLE(ACC100VF_DRIVER_NAME,=0A=
> pci_id_acc100_vf_map);=0A=
> -=0A=
> diff --git a/drivers/baseband/acc100/rte_acc100_pmd.h=0A=
> b/drivers/baseband/acc100/rte_acc100_pmd.h=0A=
> index 0e2b79c..78686c1 100644=0A=
> --- a/drivers/baseband/acc100/rte_acc100_pmd.h=0A=
> +++ b/drivers/baseband/acc100/rte_acc100_pmd.h=0A=
> @@ -88,6 +88,8 @@=0A=
> =A0#define TMPL_PRI_3=A0=A0=A0=A0=A0 0x0f0e0d0c=0A=
> =A0#define QUEUE_ENABLE=A0=A0=A0 0x80000000=A0 /* Bit to mark Queue as En=
abled */=0A=
> =A0#define WORDS_IN_ARAM_SIZE (128 * 1024 / 4)=0A=
> +#define ACC100_FDONE=A0=A0=A0 0x80000000=0A=
> +#define ACC100_SDONE=A0=A0=A0 0x40000000=0A=
> =0A=
> =A0#define ACC100_NUM_TMPL=A0 32=0A=
> =A0#define VF_OFFSET_QOS 16 /* offset in Memory Space specific to QoS Mon=
 */=0A=
> @@ -398,6 +400,7 @@ struct __rte_packed acc100_dma_req_desc {=0A=
> =A0union acc100_dma_desc {=0A=
> =A0=A0=A0=A0=A0=A0=A0=A0 struct acc100_dma_req_desc req;=0A=
> =A0=A0=A0=A0=A0=A0=A0=A0 union acc100_dma_rsp_desc rsp;=0A=
> +=A0=A0=A0=A0=A0=A0 uint64_t atom_hdr;=0A=
> =A0};=0A=
> =0A=
> =0A=
> --=0A=
> 1.8.3.1=