From patchwork Sun Sep 12 12:15:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 509484 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp2954925jai; Sun, 12 Sep 2021 05:15:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwf1SscB0DrKsNs+xsCXjTE6nrN9itKtEE1iutRVBw9HCDwBE4WyjfTd/z+9lapfpmELsDu X-Received: by 2002:a1c:9888:: with SMTP id a130mr6597865wme.102.1631448947739; Sun, 12 Sep 2021 05:15:47 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id y1si2619398wmi.226.2021.09.12.05.15.47; Sun, 12 Sep 2021 05:15:47 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=KY7AQiKs; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 481BB410EB; Sun, 12 Sep 2021 14:15:41 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2079.outbound.protection.outlook.com [40.107.21.79]) by mails.dpdk.org (Postfix) with ESMTP id EA8A740DF8 for ; Sun, 12 Sep 2021 14:15:39 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E3Etq4tWF3mnjrZX5DtoTnPVvLAETQYsYnysuKWGhmVQMKPOEFRXJSyQvnW7WEzjuqCk1f5HH5/1UbMcwDUS90Bx02jCbAHi0z25sv9Xq6yEFQYyRjFr2e3hwxubN9ELqMPsHPsYXx+bOS8y5bPDEd5EvEQut3+611EFoLedpnN+5xMD08sw/BIeneA2FIItVLTEXaCBTCAEgwQZ6Tn9P/ZjjHyaJcaYjbImIE84u65p9LHuHdS8Q7QdqUVZTUVIc59w4Or2XVIvkMkUDoN/dQ8bYgrZ8yaHDR6QOd/GNo2SzLru2n8GJzzHWIut4PL4IycU9TmCwA010eJ/JhxrHQ== 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; bh=acEioj7A9EGQ1CAJVTkKmUHV9RXK5FaBDppIbjFUOUU=; b=SwbCvjvcjnoFtOkkJNrgYdG5WRz0uibvid1b7o8daoeO4TCRbXP98C0v/SfN9iF74d7t0d9pvyY+6OYphdNWtMJbZjSf/OoTnHYhw0P7Py/XlUNypG3g8sRq9AcZMR6qkbRvZMRVl9emDZf80uazfGLVJthJrX+o9rcUwUOLgCD476tL6rvtHbbiwx7EWg1ZeY0vEnWufL3fy0xTBQoVOkm1RpD9uoEgRGFC2YA4XjzfRccgis2x66dscftALflD+DdGlP5cYF2nd6wxpNN0t5yTetlsE0JpfaEj3FBDxgOOeHCIhEcO8a7xgMaNXxqKGogJW6+KejLeUoV2DPEARg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=acEioj7A9EGQ1CAJVTkKmUHV9RXK5FaBDppIbjFUOUU=; b=KY7AQiKswq9YN7a5d5QuhH5U5sNy3vVvRwqm9Wmjto+ePbd2jHP4sx5d2TlL2P5AbD9ZNoNL390AV8ki/PDJflKtSofWxtju4FYesPgsJyV22F74Tt4SsroU8g+PenrT6NSfcm87QureCtAknMEKUOsfDWbSwu3YlToRRbtOruI= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) by DB7PR04MB4778.eurprd04.prod.outlook.com (2603:10a6:10:18::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.18; Sun, 12 Sep 2021 12:15:38 +0000 Received: from DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4]) by DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4%9]) with mapi id 15.20.4500.018; Sun, 12 Sep 2021 12:15:38 +0000 From: Nipun Gupta To: dev@dpdk.org, gakhil@marvell.com, nicolas.chautru@intel.com Cc: david.marchand@redhat.com, hemant.agrawal@nxp.com, Nipun Gupta Date: Sun, 12 Sep 2021 17:45:02 +0530 Message-Id: <20210912121510.22699-2-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210912121510.22699-1-nipun.gupta@nxp.com> References: <20210318063421.14895-1-hemant.agrawal@nxp.com> <20210912121510.22699-1-nipun.gupta@nxp.com> X-ClientProxiedBy: SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) To DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03274.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Sun, 12 Sep 2021 12:15:36 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4ecc9daa-39b5-43a8-a053-08d975e707fd X-MS-TrafficTypeDiagnostic: DB7PR04MB4778: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WUGoRWHke470b1kap5qO8v3a3lVA+OfAFd9rH3vxcRNhqnrfyOZCr4oUnwWCyriAniEbVIjjyJk6/bwcebMNN4BAoXpfOCRa1Ccv/r0GfNujouhIY1yBE/vG6SD8Z29uVR0o/A97MWMgcYZ5NIMxBrX21poL5gCUo1wnUk/I+nU6pwVw6tl8DkM55sTxZ1R+nBO4Pg+5xFRysRESNxH/cKM1hCadc7VSZMArwlUQ0/Eha2NokWX2o/JooB9DvBZjNZ2gVLxYU4BZ238zws/HWIm4uRXJoZhmeMIZgym3VamdlFIoaSPMe7cspPVL/LhedpUc8TQu+06kMEDyFOQYH/JFfzYHmA5Q3/Wy0/lG8lju4soF17lqb7+RNyM5ahzOMkuHwyfLb8qhBESJdR08KQvIMkWLVIRPWtlsdmiPcwTgCBNlS8CeSlLRlr6GWFUlzTcYK5hP9oxtwuiFWK+XGwjeTvEpvsn24pPEZQ/+YlKSbpX37PlQjTuEGt3wuVvCU7gyAj57U0U+3R9wS7lkphn8h02xAg8OVCjD2ML1XVV0/FE+FMVLomKwShKMtEJZnn+VxbaSIdwFcrUr+i3FwZwzq9Xd9INqGbkgkmgy/gVvMnOxwdG4wbhEXz71fo4CScq5s42Q+6yaooc9l169EPHd6c6Ho7d1BUBagAC1i+MttK1IVGOEtanTB2w5KyOj/M0QtG08NYpmfHgzk6laf68pMc57Bw0bYzgTtKV6w88= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR04MB8429.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(136003)(39860400002)(376002)(66946007)(36756003)(1076003)(66556008)(38350700002)(38100700002)(8676002)(8936002)(186003)(4326008)(956004)(2616005)(52116002)(6486002)(316002)(55236004)(86362001)(5660300002)(44832011)(478600001)(1006002)(6666004)(83380400001)(7696005)(2906002)(26005)(66476007)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hqbFAo/9JIW12LhdmnRT4YPaxhd3U5LkwR91d7ihQw+AxnbObCYBUYzbLd+Ly21bpev/AY1q/8KkgAogizmyce4CEvkH114iUN5+dLH9tq0CVph0jKM/j1Bb3qiLsAPD1W1VN+TTQKTIt//NGdxHTRF3PJiJiC+KHOlrz2lc1+1MgaQV+KUyh6HrdSP7y1S0vil1NTMQrzAIz6rx7hYExwNnGj9aXc+B7fhYexILsaR9wcSayf7E1nXNQADdfypQvxJ1Uu8d4YvPVymmeayGD31xJc3YZ5JAsB639WIJ2VzF+5Pk1ICyVN6HFpAkTbURehSnN4BcoyImZ3BvJbJ+wFiQS+MTtk1W4lLU2XmbRiX5OPQFPz6+qK9drJm1Fs8/QBya4d2urltSsUlQdvyhhL046d8jfAhH2zNeekoZ61N7rE9wr/YYQjHeE9qHTzJHs1zIbYXx7F0T3qyVrAhfsvG23rjhopaGQfI1KDorH6ZXxSJ+74rKfAB+BvCOCMgoStq9HrvUfqH9KF5nZYbxi7q4PDmuCDYFcmC7U+Y8FkKK439+D0B4gpbCH7dw7slcDATBwCN82y1+DbmO57ba/AjSAFhpHl7bLObhEsbb2UxsRnk6xrvfmaPIE5iGg7FDoLqDS+gudOd62AM2tjAJr33ng2TsHfadJd81OQMmiPvy6v2B1hLeugtXmq5bCf3AxGezztef3pl5PQ19rlouSFfnk/88/2Kvvfe1hHg0OLe6EXj1tUzAmBzyDC5kJpzVe5zVvFBjE4wKGsQfkD29RGZ9wNzenGHuTmKMt48Mi5OhlyMrhAozfFYwMgsUNCOe/bhkqguD9tmsBUZD78muqz7lclOz2PmsY9pVka+tP+jWn6pmXsDfIUJ8Rd6IMejeMwML1JxIsJ76t0Kjdw9d9OJ9XjDmktw+5d0uC9IvRXlglP1N0rzkCqLDSP+MeZ3xD/zChYkK5HQCZMfrG02qsPG6vn/0kHHl78fO8mXtHtqm+fti0LxIOp7xY4/PZ2GBDSxQHFHGZ1f3MvM+9biDn6fPgyvWxv5cqGOjFXxoLNSB3hoBF6FICcmZ3p3SBV+tBoODN6vhIIni94Fz8skNdtQVR7RAypnk2Juc4XZoApI/Qpln692T+d/7B9vPRK19jv8ZDO55oUfdIPPseop2WE0NO3if8q2TUjXzXz80UyVsxO9LZ/69PSJlRKZJsU2AK3pcdLzAGJfgsvd9fEMlCHut7hY8gekoHsxhCRbUdwp/Uiq+hFiwII1BYrFGnmno0oa68dtMY7Ct1BkljXkPoC97BB5q0XrTHjc98S0+cnIe5uBjqAFcLGgwefD77ABy X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4ecc9daa-39b5-43a8-a053-08d975e707fd X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8429.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2021 12:15:38.2977 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: l5XK5ayK/nIqdVlWBopFV2BBC1V4oHeUejMEWOwlilxHBsRCfY6L1H7Rv+2mcs/RWMhjXQyzwRiZ4iwG7xEGBg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4778 Subject: [dpdk-dev] [PATCH v5 1/9] bbdev: add big endian processing data capability X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch intoduces a new capability of the bbdev device to process the LDPC data in big endian order. Signed-off-by: Hemant Agrawal Signed-off-by: Nipun Gupta --- doc/guides/bbdevs/features/default.ini | 1 + doc/guides/prog_guide/bbdev.rst | 6 ++++++ lib/bbdev/rte_bbdev_op.h | 14 ++++++++++++-- 3 files changed, 19 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/doc/guides/bbdevs/features/default.ini b/doc/guides/bbdevs/features/default.ini index 5fe267a625..ae5aacf8f7 100644 --- a/doc/guides/bbdevs/features/default.ini +++ b/doc/guides/bbdevs/features/default.ini @@ -14,3 +14,4 @@ LLR/HARQ Compression = External DDR Access = HW Accelerated = BBDEV API = +Big Endian Processing = diff --git a/doc/guides/prog_guide/bbdev.rst b/doc/guides/prog_guide/bbdev.rst index 9619280ffc..6540b514bb 100644 --- a/doc/guides/prog_guide/bbdev.rst +++ b/doc/guides/prog_guide/bbdev.rst @@ -747,6 +747,9 @@ given below. |RTE_BBDEV_LDPC_ENC_CONCATENATION | | Set if a device supports concatenation of non byte aligned output | +--------------------------------------------------------------------+ +|RTE_BBDEV_LDPC_ENC_BIG_ENDIAN | +| Set if a device supports Big Endian data processing | ++--------------------------------------------------------------------+ The structure passed for each LDPC encode operation is given below, with the operation flags forming a bitmask in the ``op_flags`` field. @@ -942,6 +945,9 @@ given below. |RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK | | Set if a device supports loopback access to HARQ internal memory | +--------------------------------------------------------------------+ +|RTE_BBDEV_LDPC_DEC_BIG_ENDIAN | +| Set if a device supports Big Endian data processing | ++--------------------------------------------------------------------+ The structure passed for each LDPC decode operation is given below, with the operation flags forming a bitmask in the ``op_flags`` field. diff --git a/lib/bbdev/rte_bbdev_op.h b/lib/bbdev/rte_bbdev_op.h index f946842727..9e9b5be81f 100644 --- a/lib/bbdev/rte_bbdev_op.h +++ b/lib/bbdev/rte_bbdev_op.h @@ -186,7 +186,12 @@ enum rte_bbdev_op_ldpcdec_flag_bitmasks { * for HARQ memory. If not set, it is assumed the filler bits are not * in HARQ memory and handled directly by the LDPC decoder. */ - RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL << 18) + RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL << 18), + /** Set if a device supports Big Endian data processing. + * If not set Little Endian data processing is supported by + * default. + */ + RTE_BBDEV_LDPC_DEC_BIG_ENDIAN = (1ULL << 8) }; /** Flags for LDPC encoder operation and capability structure */ @@ -206,7 +211,12 @@ enum rte_bbdev_op_ldpcenc_flag_bitmasks { /** Set if a device supports scatter-gather functionality. */ RTE_BBDEV_LDPC_ENC_SCATTER_GATHER = (1ULL << 6), /** Set if a device supports concatenation of non byte aligned output */ - RTE_BBDEV_LDPC_ENC_CONCATENATION = (1ULL << 7) + RTE_BBDEV_LDPC_ENC_CONCATENATION = (1ULL << 7), + /** Set if a device supports Big Endian data processing + * If not set Little Endian data processing is supported by + * default. + */ + RTE_BBDEV_LDPC_ENC_BIG_ENDIAN = (1ULL << 8) }; /** Flags for the Code Block/Transport block mode */ From patchwork Sun Sep 12 12:15:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 509485 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp2954968jai; Sun, 12 Sep 2021 05:15:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKCVk/te6iIelFGy+Yz5NV0AuictT2oFFoCIkn83NyClkDMMWBxQ8S2xRLZjwtBgVH9ZWb X-Received: by 2002:adf:a197:: with SMTP id u23mr7198496wru.253.1631448953976; Sun, 12 Sep 2021 05:15:53 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id s12si1369145wrr.362.2021.09.12.05.15.53; Sun, 12 Sep 2021 05:15:53 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=pV7FGWhV; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 79498410F6; Sun, 12 Sep 2021 14:15:42 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2084.outbound.protection.outlook.com [40.107.21.84]) by mails.dpdk.org (Postfix) with ESMTP id 266F9410E7 for ; Sun, 12 Sep 2021 14:15:41 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gm6n6HPfkbGcQOvMkAyrEtARWH0e6eZjJ/EIn3nx1BaXjKd8HeGfVFrP/qFnLkRtuvC6YGkzFY/QkjOOoChfRbNkJ48EnQznotlCWkpA3vDGkAi7Ck6QISuGllaxJ0VBUOyNQrTXPLTy8Cb2NjpZ25YMfkJVgg2USvt69D/zOR3Qz4KvufGoaK5X8JHtoMruAsVuHxv/AePWBjK1pfyXERMFF4FURxms07U2OM5s3HdbBW5zqvG2WQH7puBG9D8pu+mqChSdzqsnYy3ZZs5s/h7MCCnNh6TomdDABlqNLijbKFICObzivrF24C3M8sx1H6bVy39kDwYieXPzSGHm+Q== 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; bh=KuZsJK4nC72f3vMwQwkHFcev2JfIfcp3N/uzpLQJ7Vk=; b=VGpBmWIZIL3A6EK20XayUHd9MMcxNoYJ+gAY8u5cd8cQnbtlRJBvmETbz2ARRB0W4Q9RzBQt09KH0agHehFPP161Iw3MJ4h/9gwlFIJOz66gBC0lKNYnFgGXT0RgLQ0BAVfyVMflhonVkvoD+u9rgfYQpLeN+vtVjU/ZI9nZyf6XZhECNa+scHXAnt1xWizCxAm9OOe81U4PSOkibGZ9k0H7PXlsT0Q76Zse8Nt1RWeKpBWNfKJI8l2VkSeZeOz6cPVxH1VNaaweVJgfPv4Ez61i4RXfb+wGwogDcg6w2H9bbFBe2s/1DN53By4FJoy3KlEc0bsYFveNMCHCI3tHUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KuZsJK4nC72f3vMwQwkHFcev2JfIfcp3N/uzpLQJ7Vk=; b=pV7FGWhVfAbwUdJMfA0v3wpMWqSDlg1DSmiQerH9q3Vz5vrDr+yNZ5HI7fs5LVBXkuQLwgeTM1+l9gELehDjVpqslq/0lo4VdtNxqtKLQ6naXXwPuxlqtFTnhxO1VP9qtltaQaR16Ks4a/4VLybAcQUAGiqsAzjl2Ie00eYQxFA= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) by DB7PR04MB4778.eurprd04.prod.outlook.com (2603:10a6:10:18::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.18; Sun, 12 Sep 2021 12:15:40 +0000 Received: from DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4]) by DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4%9]) with mapi id 15.20.4500.018; Sun, 12 Sep 2021 12:15:40 +0000 From: Nipun Gupta To: dev@dpdk.org, gakhil@marvell.com, nicolas.chautru@intel.com Cc: david.marchand@redhat.com, hemant.agrawal@nxp.com, Nipun Gupta Date: Sun, 12 Sep 2021 17:45:03 +0530 Message-Id: <20210912121510.22699-3-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210912121510.22699-1-nipun.gupta@nxp.com> References: <20210318063421.14895-1-hemant.agrawal@nxp.com> <20210912121510.22699-1-nipun.gupta@nxp.com> X-ClientProxiedBy: SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) To DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03274.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Sun, 12 Sep 2021 12:15:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 955e290d-c5c5-4333-91f7-08d975e7093d X-MS-TrafficTypeDiagnostic: DB7PR04MB4778: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qy4dz0wmE0I5ouitrGwngjbAghPVdFjcRmUQ9lkS7QhtlQCtaGrKfCq3AjoWt52ILmkpNvbKAMKoldApSGc3c5I3cUdCAXj1cUBT5CHdsl8Ls3pCU8cvg4MKB1ct+U3x9u4vVTP97K4Z9jILVziGXkpxsYMydkxtVVKgSetN75zCod9R2qHV9sIWHxSl8lnXyOJAY5cMJXrmd7sXomQlFg6RM22gXoW+ykcpk0gbUpdTb1yriwWj5EXiS6pFZZNAn7RrXlzhqHYdiUtSGMhrQJjhOa75yOlrcGD+TDVzXyIllyJ5YnvPjYSfoX5d2S5EuXqPCqNUG0Xk+0wciyBSKsZwSdUHv3HDeRjln/mDHQBF+QATifLtPzizum+F9o0xASiRG2FjjKoN4GWUcGsr+wQ3ODtjKb9AaMAv8MwdlQnbnVkZYBP2aYOo5hX6d+nwMfYTfp/gCECXQWLuZN41omy6RqgJeKYxAV7NeanEP6GXho6vcLdBlRfdu35C0AwoO07p3FICzU8sEpCBj1OwPjndEkBoN4kPOQGEk0/FFY467s3BrI4OCn5gBan0S+XCnUjyc7nuT1hg8n0GMZoM7TbHefag3owlKWx/imU7mZga424xl/u+rV9lY2C9qYKARIJinhHY3SynXoRWRXUbXO7k7uatAL14AD7DwojCsteC6enINiu9C4573RO8JxEYgkx+wVUN6xWZICNXCP/H8lBw5c+NuR4c1CxeFh4rLUJtMH5+tDIJp249sKPDzT/B X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR04MB8429.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(136003)(39860400002)(376002)(66946007)(36756003)(1076003)(66556008)(38350700002)(38100700002)(8676002)(8936002)(186003)(4326008)(956004)(2616005)(52116002)(6486002)(316002)(55236004)(86362001)(5660300002)(44832011)(478600001)(1006002)(6666004)(83380400001)(7696005)(2906002)(26005)(66476007)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xTjoDaLKWRgaN5W7PotSr1lgkljVSSblw8c+WTuK7MPw3q4VqJKDi9FGycSTP2/7TW7jUtJNuIV3fP9V8vqzm99D8RYNa5kS/e0BvKNlNeX+d5CEohJ1F501GNLl6mDmieiqOWaPDPLeRdpEKMT6g4A13zoPYUo1vCpOELBfY/6oDdDFC0266MdUXG+2xbdmHx1iK0VLV4DTxT8pWEN0Y8EBZC+95E4GOr/DbsHJ2nqYKIB2ht9KKeRT7kPL3AicOKg740ZzUJkaogKgwOcHTThPWOc7SO4YrF1JAkrJLqRqNXxXAf1zOzDQzM9pWBCfstRkQdksJfbNkQXysNlCmuzgptsFnzdYJvIBwgUpQS3AeF+D6q4AjMrDFs+b8maF2NJy6cUaxMLXUTLhOafJJRgjvaTUFS4sblvxyC0GSG0poA7bq2cDGPomkIYtuS9zjZYwwZwK4zfqEGFVf27eS+7gjr9sXT3f7ODFpKp3pAidDlmUNe/lnAzElegI4P64SOOqDDInnZDJ2L/a6KWsMHfGPe5xshQkqAOs98DcWnnhe0dozn7GRc5yPsW+PniklE0zbP0ipd0Sb1OuPcv9+1itzK0Pbb2sTZUT4BUnjepBMfuTfn7Vkv08eLU+7BsaT9Uamer3hcXD2XgWjI6T/gIE/ptdWy7ZBmkTkowBRCe26p7B7GAvGVwngQG7b4cFAtfXthZE7QLNsbt2MV17OQZ65M03kVBjj27dVz8CNaURhMp8B18m2fc+3NvmJhuifO7XGYcj/G1Q7wtmQvISce19pyeJ/7ZLlxuBNCDg6CyT9R5kgffItgls8FO6SGvi6pp7QBsUNnwccZWvBmk4XTG308W5FpCqDyEKrLkXhkEkUCBvIr7mSftrQjF5RKLVlnG+5xRv/uDralVNwMWac4Qex1PNiLT7r5ra14+XMgg2YE50FnPs70Ulwbi1RgYnLF1Tey9SUlY1QqbwlJSCjj5vvm3ZLatU/drc7CpSXOygmU0Y3Rvouuz47T0DMs4ZudrWESqWGZ5qV8eIDeaWGl9uBBpU/BEAVCqyaOxJevLqYGRAaniS3DkoaCAr+No3oknUEdWFl94YjjnZClZbf9T7nWDoJjEt3MRb10uMO7RqLaYoMKv7UFhjqJc578G7akk1TSA9CJXHweiRHCkRf/Ox8H7mYnCVbYkyV1Z6dZ/1LcRUfj2kLJ8a3ra5WXTssuWIzpc1Duxq4YOcrmLcaje4FEqYgGWcJ/zz4PzW4eI++0Ndbo0YeGEQGoOX+Tp7/4JTCryJhYel8P9zGeH9ECMcmCgzCB0jE3dpqfUeYd+3XRqi2EhvUqsxv56r4Kjn X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 955e290d-c5c5-4333-91f7-08d975e7093d X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8429.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2021 12:15:40.3845 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mXRiIRM4v7hcbgkb3KbzLfWOeRSsVbhlbEe6v3Ue6rcoYDdaDfMW+krqtnWRRPS5sH20u+bGuznG6ZUF0Xkt4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4778 Subject: [dpdk-dev] [PATCH v5 2/9] baseband: introduce NXP LA12xx driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Hemant Agrawal This patch introduce the baseband device drivers for NXP's LA1200 series software defined baseband modem. Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- MAINTAINERS | 9 ++ drivers/baseband/la12xx/bbdev_la12xx.c | 109 ++++++++++++++++++ .../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 26 +++++ drivers/baseband/la12xx/meson.build | 6 + drivers/baseband/la12xx/version.map | 3 + drivers/baseband/meson.build | 1 + 6 files changed, 154 insertions(+) create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.c create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h create mode 100644 drivers/baseband/la12xx/meson.build create mode 100644 drivers/baseband/la12xx/version.map -- 2.17.1 diff --git a/MAINTAINERS b/MAINTAINERS index 266f5ac1da..a63e672c9e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1288,6 +1288,15 @@ F: drivers/event/opdl/ F: doc/guides/eventdevs/opdl.rst +Baseband Drivers +---------------- + +NXP LA12xx driver +M: Hemant Agrawal +M: Nipun Gupta +F: drivers/baseband/la12xx/ + + Rawdev Drivers -------------- diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c new file mode 100644 index 0000000000..7050b17728 --- /dev/null +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -0,0 +1,109 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020-2021 NXP + */ + +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include + +#define DRIVER_NAME baseband_la12xx + +RTE_LOG_REGISTER(bbdev_la12xx_logtype, pmd.bb.la12xx, NOTICE); + +/* private data structure */ +struct bbdev_la12xx_private { + unsigned int max_nb_queues; /**< Max number of queues */ +}; +/* Create device */ +static int +la12xx_bbdev_create(struct rte_vdev_device *vdev) +{ + struct rte_bbdev *bbdev; + const char *name = rte_vdev_device_name(vdev); + + PMD_INIT_FUNC_TRACE(); + + bbdev = rte_bbdev_allocate(name); + if (bbdev == NULL) + return -ENODEV; + + bbdev->data->dev_private = rte_zmalloc(name, + sizeof(struct bbdev_la12xx_private), + RTE_CACHE_LINE_SIZE); + if (bbdev->data->dev_private == NULL) { + rte_bbdev_release(bbdev); + return -ENOMEM; + } + + bbdev->dev_ops = NULL; + bbdev->device = &vdev->device; + bbdev->data->socket_id = 0; + bbdev->intr_handle = NULL; + + /* register rx/tx burst functions for data path */ + bbdev->dequeue_enc_ops = NULL; + bbdev->dequeue_dec_ops = NULL; + bbdev->enqueue_enc_ops = NULL; + bbdev->enqueue_dec_ops = NULL; + + return 0; +} + +/* Initialise device */ +static int +la12xx_bbdev_probe(struct rte_vdev_device *vdev) +{ + const char *name; + + PMD_INIT_FUNC_TRACE(); + + if (vdev == NULL) + return -EINVAL; + + name = rte_vdev_device_name(vdev); + if (name == NULL) + return -EINVAL; + + return la12xx_bbdev_create(vdev); +} + +/* Uninitialise device */ +static int +la12xx_bbdev_remove(struct rte_vdev_device *vdev) +{ + struct rte_bbdev *bbdev; + const char *name; + + PMD_INIT_FUNC_TRACE(); + + if (vdev == NULL) + return -EINVAL; + + name = rte_vdev_device_name(vdev); + if (name == NULL) + return -EINVAL; + + bbdev = rte_bbdev_get_named_dev(name); + if (bbdev == NULL) + return -EINVAL; + + rte_free(bbdev->data->dev_private); + + return rte_bbdev_release(bbdev); +} + +static struct rte_vdev_driver bbdev_la12xx_pmd_drv = { + .probe = la12xx_bbdev_probe, + .remove = la12xx_bbdev_remove +}; + +RTE_PMD_REGISTER_VDEV(DRIVER_NAME, bbdev_la12xx_pmd_drv); diff --git a/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h new file mode 100644 index 0000000000..9dfa1cc458 --- /dev/null +++ b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020 NXP + */ + +#ifndef _BBDEV_LA12XX_PMD_LOGS_H_ +#define _BBDEV_LA12XX_PMD_LOGS_H_ + +#define rte_bbdev_log(level, fmt, ...) \ + rte_log(RTE_LOG_ ## level, bbdev_la12xx_logtype, fmt "\n", \ + ##__VA_ARGS__) + +#ifdef RTE_LIBRTE_BBDEV_DEBUG +#define rte_bbdev_log_debug(fmt, ...) \ + rte_bbdev_log(DEBUG, "la12xx_pmd: " fmt, \ + ##__VA_ARGS__) +#else +#define rte_bbdev_log_debug(fmt, ...) +#endif + +#define PMD_INIT_FUNC_TRACE() rte_bbdev_log_debug(">>") + +/* DP Logs, toggled out at compile time if level lower than current level */ +#define rte_bbdev_dp_log(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, fmt, ## args) + +#endif /* _BBDEV_LA12XX_PMD_LOGS_H_ */ diff --git a/drivers/baseband/la12xx/meson.build b/drivers/baseband/la12xx/meson.build new file mode 100644 index 0000000000..7a017dcffa --- /dev/null +++ b/drivers/baseband/la12xx/meson.build @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2020-2021 NXP + +deps += ['bbdev', 'bus_vdev', 'ring'] + +sources = files('bbdev_la12xx.c') diff --git a/drivers/baseband/la12xx/version.map b/drivers/baseband/la12xx/version.map new file mode 100644 index 0000000000..4a76d1d52d --- /dev/null +++ b/drivers/baseband/la12xx/version.map @@ -0,0 +1,3 @@ +DPDK_21 { + local: *; +}; diff --git a/drivers/baseband/meson.build b/drivers/baseband/meson.build index 5ee61d5323..ccd1eebc3b 100644 --- a/drivers/baseband/meson.build +++ b/drivers/baseband/meson.build @@ -11,6 +11,7 @@ drivers = [ 'fpga_lte_fec', 'null', 'turbo_sw', + 'la12xx', ] log_prefix = 'pmd.bb' From patchwork Sun Sep 12 12:15:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 509486 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp2955046jai; Sun, 12 Sep 2021 05:16:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwI3KPV60Xb+qQNZb/0ij/9gsDmf62O0klSO0vmQuFY0gzGI2Ew0BmCG0c7NnCbzhH2fWIV X-Received: by 2002:a1c:1cc:: with SMTP id 195mr6601002wmb.188.1631448961161; Sun, 12 Sep 2021 05:16:01 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id w9si4339643wrm.544.2021.09.12.05.16.00; Sun, 12 Sep 2021 05:16:01 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=BLLFK0Ak; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B3733410FC; Sun, 12 Sep 2021 14:15:45 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60064.outbound.protection.outlook.com [40.107.6.64]) by mails.dpdk.org (Postfix) with ESMTP id 972E3410FA for ; Sun, 12 Sep 2021 14:15:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QTmJQhoFPcyn9IPVXvKF6PVxCK9S8iQMZzOzT+V1WUj80RDFHEZMnmtM8F/8hyv6dl7qbarZRLiqV2mU3cdJ4dvcW8dXXXxDl8+HhWOe8ECVeXyos04seA+SUZN5dkVfGFL6cR1QX8AcsJtop2UUC4tRzcjawR6LcDE+QqjZBMmY2ocCtt9RLmq4zDu16z81Np2XISC5nivUTK+xvI+dmEeQZeCgXgfRC0V1RLaxAJl/Y4RqH0hUoTrrMBn012MHlgW3FE4togZE7L3PFZuzbHc33A7Jj8VkzocwljZdvRWYRs9pU8I0QEc1Gyw8AcTsOHbCX13ZnkP9NbYTDAR/rA== 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; bh=FvJL9IiWYUgBs97JOpP4njxSSv71FW1SSjl87BEMbdc=; b=JdeN/a3Gs0+KXQzGDagu1K0kpZcM2AjRFFxeBONtmvMWNXD4rnOw6ul/aLf+8BhgcWKa37Aquo3vkyIygkxz2dOcjqIsFXJ6ol5T4Ckv6wtkC1ICRX0/hzA141bvie9EO6z0t+HtBTPeN+khdHgNu6nUv0+eF7SzkYPCBXqHqnieeADut6/i+w35bojfwRCWnmxUOiZAVMwLeD/V25UiQoUjOneUFn17HH5DGdxvA3sG0EJatjBRvw2rzRCpgzjCWtJ+Ygl+jiKgRfPhqV9zt5WFy9JpJkfUI+D2d6Vp06LdFfeLTsxLdBTWVfVSjg5mep6p5RSYY456MPr4pbudYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FvJL9IiWYUgBs97JOpP4njxSSv71FW1SSjl87BEMbdc=; b=BLLFK0AkuUzJyuslemZo5Hl+4CYWzTE7FEbuW9HE996C7gN0cTOS/ApGvrv3eS9dx2EiijnoNsinv5XgCi+LYvRyU0o9asotR46xX8yb0aWwppgiDn+5pJYLlZDb+TokaLGKDmfafid6NJfwXcbrrLPP7Rj3dIW1epz4vmFql9I= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) by DB7PR04MB4778.eurprd04.prod.outlook.com (2603:10a6:10:18::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.18; Sun, 12 Sep 2021 12:15:42 +0000 Received: from DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4]) by DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4%9]) with mapi id 15.20.4500.018; Sun, 12 Sep 2021 12:15:42 +0000 From: Nipun Gupta To: dev@dpdk.org, gakhil@marvell.com, nicolas.chautru@intel.com Cc: david.marchand@redhat.com, hemant.agrawal@nxp.com, Nipun Gupta Date: Sun, 12 Sep 2021 17:45:04 +0530 Message-Id: <20210912121510.22699-4-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210912121510.22699-1-nipun.gupta@nxp.com> References: <20210318063421.14895-1-hemant.agrawal@nxp.com> <20210912121510.22699-1-nipun.gupta@nxp.com> X-ClientProxiedBy: SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) To DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03274.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Sun, 12 Sep 2021 12:15:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3d9f952a-3776-4f40-2233-08d975e70a77 X-MS-TrafficTypeDiagnostic: DB7PR04MB4778: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ophhfBLyiCae6/i/R9xRZkN2Z1qr2jTOjdLXrjw08BTRH8XMucOkzwDaZ3C8cGKQpAwCguNZwuCf9lTzqhKbvYUgZZz169LrsO8b97K4tA8ZUcPnjYek5LTVLQkLMAnx4zJohJ1Xvy+efxXpfFEMDSs/f65tU3286/86jKFhprK1P3rTeFacn1f3y5ju3zQCliR9EK81eD6mDKBoGw6z3LkcnyDbgfCTL7olA2nX4DbfhN5QjbNdXeDAurUfB7JIQqQ5L8uQHp9GIp86AjgNgKYN1uc6GiYZo/FwI0FeZ+DDb4ocVSual9kVDY6HnEwHgSXxpTc/OjjUPeric+iDkMORsKrNqwnvzotHG2rGzEBDvYOIPqX+yOzKoBXxWVjUH+ANPZl/slOCRznlx2DZ74T2agPtw+4WH4m4Pn5XcIOpCr6Q44nm6EHFCdboIVsjQrlc2jq97ZEJ00qU1aIY52OCHyZBzPap+YIB/PXDHo1/GG4p3XWvsiHHlKg86hiFLXeuY+ojxU1UF7hvgYAc50zzVElOixCoYqFOCK5OmX9letcqLfzs+6Nv3BjwaVU8ISp1K9G0eXrLICa0lghDmvNlGMejYstoJ3b6ctAdQw/iKBxRhZqrADjBQ7b6fuDN5fLOfa9XZfUa7b20jbvsBTYaSV5FtIozvJcGs4IksA1GPDxidLdCBz+gnFkzLPMArPyndGoSmm3ivTImiRWUhAafFi9OcqscLbPtuwMFu36tkhGmoOUoVhTFiJCmmpGU X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR04MB8429.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(136003)(39860400002)(376002)(66946007)(36756003)(1076003)(66556008)(38350700002)(38100700002)(8676002)(8936002)(186003)(4326008)(956004)(2616005)(52116002)(6486002)(316002)(55236004)(86362001)(5660300002)(44832011)(478600001)(1006002)(6666004)(83380400001)(7696005)(2906002)(26005)(66476007)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /4CqrRbFbliP2DdR13fC/dmNCq4Rk+Gtx+6SOb10IziMsikTULUXq8lSU468swr+KlnP7iAvIRNbZ1z8V1UdQ7lZgfyFhSa47lJGaaQ8mjPMPIoLhrcBX6/JOIMSl29mfwTwW0hcqg4mAjJpwlvEP75ufB9cnl4tpozJrRImGUpQWbwJFgV6aaf5dyi3LACjElQoIkZYSYJJP+M6i0GG6ospLJ6sUrdp7Jxn1CQvYBlYtzMfa8ELeJLcMEtfkVLaUy5iLNqZNVkijkZbWSSQWclQvyjO/W6FQiTHnCeehsOpMnw1G4kKJM+3I6RcYoTVbOOH2y8UJDa4d83blm+2Pi1iwvQQB4piDHFVw16mezVgt0wKLp7aInr42+5tubJ5zHkTgaYNged64Y/nAr0cnn584NWoDhw0Zch9hvUEN9gup37rgPus4UUdH5KD6hYFlhxD9eMt9LnB5UnA6S7W7dU3M91WBZgTUHKtfMeZvxy1jWIxaS9/GPIeodffcYZQftJDrZVgSH+kRulW+g/+PSjfXVj0GHXqvsnJd9iefFmqJKM3W3+D7LKPSkkaQhbr+fNYcsKaD7+wqTAsidnQii4E1yYA86b+t4ZWFhXj+ukq4wx8uC9TyOqkky5NLRnRxHokp/7kIJD0BzQi0OAo1octtauUZ6s2hozt3KHGUkQw1UdUZXXhreqEYEY9CNFVyR8Ebg6dq/Cl5/kxcyYc2/u6zWzPa3IZMF1o/QFB7VOlGsT4SJ3/bhW3dr7XGpYeEg8pOksVATgrcFsJTiF6J5p3Bpfpx+5hNHY7PzUMstKcNXbiY2U9iUWbIo2YteFEnB823ax08eh5lOcMZMy4tOoyXQmH4fP23dO0v960RHJa0ObVX/sgCm0qo2jExoHMfvuWccHWP2FddurGQR9lew67cR8eO8gsgxJaQA/LWm3t+LosfXfRTGzXkxDSPeyg0C2SCLzuuqRpe4mgo0A2aY+pVYbmyk/3MgxLCVt6GiAMkQ+hi7ziRrkm2ApSVERdkZV17kkbetN27VgZgKXwYzPXmLyzEUdLuR49V78nAN6sOxSiTGCVmQbpP2RR/k9YSKLWGGoQvUBNiVgLFlbH5CbuMiJjWW8pjO7x7zdN4cV+Nl0k13lvCGevAZTTWluQeFQf7LLy9cu76oghEQJfmv+uEv8fSrDVk9ZVP9VVJdWqy6BUlc745b2+QRtHCRHgHUH/Q1uTW0Sg9GIPJUM2YDAeKWjFPi8+hnin5TqUN9HbNVjOogB3vnTB+L7PLiZ3kJrLW9+0dBYBCxPKT4krpBLXuYFg0fwNiXfkwIaLIQ382mhG8y6qBchPX1o13MhU X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3d9f952a-3776-4f40-2233-08d975e70a77 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8429.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2021 12:15:42.4479 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7O0polKa8XacGEpMDYB6nZt6pli3NPgdj/08LX5NlXzLd9xGiYGrmLlCPU1HuGFMW5WNIj8APJKAEvM7xUJHPQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4778 Subject: [dpdk-dev] [PATCH v5 3/9] baseband/la12xx: add devargs for max queues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Hemant Agrawal This patch adds dev args to take max queues as input Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- drivers/baseband/la12xx/bbdev_la12xx.c | 72 +++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index 7050b17728..8886b35429 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -19,13 +19,72 @@ RTE_LOG_REGISTER(bbdev_la12xx_logtype, pmd.bb.la12xx, NOTICE); +/* Initialisation params structure that can be used by LA12xx BBDEV driver */ +struct bbdev_la12xx_params { + uint8_t queues_num; /*< LA12xx BBDEV queues number */ +}; + +#define LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" + +static const char * const bbdev_la12xx_valid_params[] = { + LA12XX_MAX_NB_QUEUES_ARG, +}; + /* private data structure */ struct bbdev_la12xx_private { unsigned int max_nb_queues; /**< Max number of queues */ }; +static inline int +parse_u16_arg(const char *key, const char *value, void *extra_args) +{ + uint16_t *u16 = extra_args; + + unsigned int long result; + if ((value == NULL) || (extra_args == NULL)) + return -EINVAL; + errno = 0; + result = strtoul(value, NULL, 0); + if ((result >= (1 << 16)) || (errno != 0)) { + rte_bbdev_log(ERR, "Invalid value %lu for %s", result, key); + return -ERANGE; + } + *u16 = (uint16_t)result; + return 0; +} + +/* Parse parameters used to create device */ +static int +parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, + const char *input_args) +{ + struct rte_kvargs *kvlist = NULL; + int ret = 0; + + if (params == NULL) + return -EINVAL; + if (input_args) { + kvlist = rte_kvargs_parse(input_args, + bbdev_la12xx_valid_params); + if (kvlist == NULL) + return -EFAULT; + + ret = rte_kvargs_process(kvlist, bbdev_la12xx_valid_params[0], + &parse_u16_arg, ¶ms->queues_num); + if (ret < 0) + goto exit; + + } + +exit: + if (kvlist) + rte_kvargs_free(kvlist); + return ret; +} + /* Create device */ static int -la12xx_bbdev_create(struct rte_vdev_device *vdev) +la12xx_bbdev_create(struct rte_vdev_device *vdev, + struct bbdev_la12xx_params *init_params __rte_unused) { struct rte_bbdev *bbdev; const char *name = rte_vdev_device_name(vdev); @@ -62,7 +121,11 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev) static int la12xx_bbdev_probe(struct rte_vdev_device *vdev) { + struct bbdev_la12xx_params init_params = { + 8 + }; const char *name; + const char *input_args; PMD_INIT_FUNC_TRACE(); @@ -73,7 +136,10 @@ la12xx_bbdev_probe(struct rte_vdev_device *vdev) if (name == NULL) return -EINVAL; - return la12xx_bbdev_create(vdev); + input_args = rte_vdev_device_args(vdev); + parse_bbdev_la12xx_params(&init_params, input_args); + + return la12xx_bbdev_create(vdev, &init_params); } /* Uninitialise device */ @@ -107,3 +173,5 @@ static struct rte_vdev_driver bbdev_la12xx_pmd_drv = { }; RTE_PMD_REGISTER_VDEV(DRIVER_NAME, bbdev_la12xx_pmd_drv); +RTE_PMD_REGISTER_PARAM_STRING(DRIVER_NAME, + LA12XX_MAX_NB_QUEUES_ARG"="); From patchwork Sun Sep 12 12:15:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 509487 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp2955141jai; Sun, 12 Sep 2021 05:16:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxB5dXDcLiQhq5uVWn8/+AiqHHyModXDmUONEmCQb46a98MS261wejZ+dsoVJgtT8ZBUvI/ X-Received: by 2002:a17:906:7802:: with SMTP id u2mr7245658ejm.325.1631448969418; Sun, 12 Sep 2021 05:16:09 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id kq12si4631689ejb.759.2021.09.12.05.16.09; Sun, 12 Sep 2021 05:16:09 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=Hp3IQCPQ; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1D1B64111B; Sun, 12 Sep 2021 14:15:48 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60047.outbound.protection.outlook.com [40.107.6.47]) by mails.dpdk.org (Postfix) with ESMTP id 25844410FA for ; Sun, 12 Sep 2021 14:15:45 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KqhNbF9bQrsyUCXYRVCSvPniJY1sM7Tje8nGtOrVz0bUsDMq2HXJTNqcr5v9fdNKamSEat/f6k5HLKHqVfNxLvZYuYgCWq0PlWjaWKrq3JpRs9oOae1PU3xxApDT/ZZ3cWZtQUREFGz/v835+GAaNVsFFqNheDkEKpZiJ3X6EweZFp4yTnazuf7pF/E082F8crCeMMSMEKKP2ZKrndyunlioqYiA028P7tU45t/XhPkgKqFtb8rFLIrEeV4nGWlJ0yXpxCjrt4bJDWiXYTCOcbR9Px1EHFPQ4pdwK7H1XjcmPHs9ciRgCFGzfw5/Af6HpaEprJ3cNXQNq82339iKAQ== 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; bh=WnfLokvV8enMVrZHgFFy/6/lSHJ2KfmNGDeNSy2Iz00=; b=J/HslgkldA6Pxril7uDCh31EK6ME1Dn0l0NY/6EzR3VnagtFwL8Uv7QCWvx9EOpYCQiyZ+Po+KS2djwmw81NS/7uTmzpHmbB3PAt36Hz5HfGosgOPuJAUM9iHxv7O7eB30mlitdCWbuUmfcN3JKiWjjiIc+NGfdvjbYAJWGwvneogLF5Vs/SBlTZTa7D+PVRmlir2CnnRg1rZjJXnDEQdJvAR6kHpAn4BxFazs5DJ0wKY6n6eEEnLDEjQ1Z5wSjER23b1rKuSWR9XJNXknd8KAvfpBwnLy6g9kcYJ9PLyH6Y73RfqnLxBiLSY2J2ZGjydDWSzYouZ/d+XLMkdZ1DIQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WnfLokvV8enMVrZHgFFy/6/lSHJ2KfmNGDeNSy2Iz00=; b=Hp3IQCPQzEG+/Yk0v7e/XpEoFCt8f1EQH0j+A0jNZikn+g29a3q5F5vB6pPLSfnj5YKtDLav2Pe8MDXZv2q8V8GHY5dO3GrGSsFBdZA2ytvPaTP9B3rQkuXqYMmv4pDumPPcfth63CRMHiY5KizdMCkRHdvzvQSEv878DqP7/GU= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) by DB7PR04MB4778.eurprd04.prod.outlook.com (2603:10a6:10:18::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.18; Sun, 12 Sep 2021 12:15:44 +0000 Received: from DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4]) by DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4%9]) with mapi id 15.20.4500.018; Sun, 12 Sep 2021 12:15:44 +0000 From: Nipun Gupta To: dev@dpdk.org, gakhil@marvell.com, nicolas.chautru@intel.com Cc: david.marchand@redhat.com, hemant.agrawal@nxp.com Date: Sun, 12 Sep 2021 17:45:05 +0530 Message-Id: <20210912121510.22699-5-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210912121510.22699-1-nipun.gupta@nxp.com> References: <20210318063421.14895-1-hemant.agrawal@nxp.com> <20210912121510.22699-1-nipun.gupta@nxp.com> X-ClientProxiedBy: SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) To DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03274.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Sun, 12 Sep 2021 12:15:42 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8fc9bd18-6a35-42a0-3313-08d975e70b95 X-MS-TrafficTypeDiagnostic: DB7PR04MB4778: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rOS+ryjwH97eKbOxnyLenpwyi1/6HOkm1LZtvEXpLKb/VSLqehvot9URd7qQT++2kuh00tQWtCk1fptHW/1ZKo43gigomRLma5HPAO31z5MG5wfiHIanoUQTlSgf8FBkNI9OjdVvQTO0429EMdstJqhk9wSap5EJgDOR0nNnC4zvQb6BuSZ/CyxF36FvhiGts5fcWODHJyNjRq/BKyRCmh4tud5NS2iWBTmRwzs1+s04CUufqZC47WXgWDEMDqiXXj6Wg2aX+Ub/oFcA+bh8rM1QvnCPN4fZ5Lez1h7IYoJ3I8Am8Xhr+AlB2ANoga4a2diBQUmi0hJ+UUks4l2Qz18WY1FzZ369i5h37dPddPfEhokkS/saSiS0QD/H6ZpK3Qxnn86XYFr3KORTk8uvipb6krx2rYNsPZAHsASftyjxl9OW74+TGDk07SB3XlmopDAQBmzSNGucpiCfN1/Dbs8iXb2xukPvOiJ0AEOHLeWq1/bUjz+GTvuhDXLHOb5F4ELpZ7dV4gquV+1ftrA76G8kTb0jqo1/B008NauZhJ9epTEnHHYSp7Iy/u5A6Hi93zgxovN2+XfxUoxxWOH/lxvK7hMUzCXd5gWwWZP7nH1nPoykI96JaZecsfla9vZkmw+y7g5lW0KhxbovBXaTx8pNJUtL24JgtdnULhDQco6y4YQQpMUifvcidiYQV1/KE8BRkspiYHN+M0I8rhkO1d6JX7eHX/CufyHuicfE7Bc= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR04MB8429.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(136003)(39860400002)(376002)(66946007)(36756003)(1076003)(66556008)(38350700002)(38100700002)(8676002)(8936002)(186003)(4326008)(956004)(2616005)(52116002)(6486002)(316002)(55236004)(86362001)(5660300002)(44832011)(478600001)(1006002)(6666004)(83380400001)(7696005)(2906002)(26005)(66476007)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zXNp5f467yO6u7/mLU6IyyNmMwDuatQFQPd4Jr6nrDEvVinhgOkY73mS+6UKvakhtIWfs/bEEUcINJMalVYDViTeByD2AAGI4wp03KuGiJjvDev1pKAvUh3pCFTGktxpsI46W9SLN8bB1JU4k7b3u8yyH1X5m84/9LVNKeXWB3WTQNPj5OLlSX6yUCPlB01r7JMW3m8VV+jNiV5FPxQpOeRcnrn9P79jj1HMOXbLAYlk4t8ldHRy4tSyXxFHEwXHtA9NenQA+Cy3rPbAIB+G8Bu9wB+EnGHx+Kl7Mr/NGHoMJBFQIK5uK5lUaUgzXbCHLn4c+Rw7wAha1A6bmPSAP86+6z61b9fZPIkNS1xXGmwYRW40Eec1RM09OoNRMp1pfcpcxUMt3ssahT37rCd3x8DkvR97LQh3FENc8dlQU6ZOuq02pqSN+ZWlcEwYr83lX8WtWBWF+IFXAN2SkN19grUKKzhtP47BDr+kqZDH5FlYT8VckX0BHOvPIVNfM4sMl0a5jtcYVIcE8VmK4tR/4ted91sZYkZQFPvWoAswplt+M0BLb2eb52VB0q2xIaZIOnABRS/jEfDDqYJQpzWYo5JLdgYh9YPBB9XW6fq/tTt5q40O/T5iBIjmEfQOfVtXKjYOCRam8amLQj2ngSujSd9KEOs9n2JRYppSTVdAhGOByBvzIEguKTfH266o7EFBkZIPAhKfMRFsx4d1fF4uYGLbwtzpTOUXoAdCLkoGDPMn+A6FjSwFiAtWZY0z5vSsqSi7FG5uKqdpQoKFt39hHMztdUfvPQq8badg3d+MFRe35cS7CYM7PlK91kJQYTxnzMsglFfQODF4DZEY60sICh7RDgz+AKkePZNfjkfR1rYOjIGZyv81dNYMPnTDGdWnBaLdWkBa+LFUYfCZBYlrrH6QYONxkyrBKVYVmZMKY006KbrHG2KqMnt5Sf24NmGYBRnhcO19dnABfNAST1YeyCi6A5TkrsxyeRvCXe+RA97nJ7TJIXQ7ExgCznFeSuzpT+3DOX3yxMuN9IxuQ2YrxuATNKzPI2/AeZ9ICBoseRzzWAbm41W0X6RVR4Bv6VtxG34942Tvng0VkNYfPYgMmgc7C49WuwNApA8Q/SYJ0wYXVRo0piazY1XCA5WbLwbMev3AR9mqEwHmcEAZ2TMKbZ99JkxcdWptahdBWf+/kBpGGLS/hOQFdVwPce5v1bh0cqKrTCfFnRyyBs7K6Ipp8w5/hMCncN20yUx1PrXfqSQLogW2IEtijnuSERPEkZw8d1d/fCmgt6A5vjqsW04uqgcyCRmjQQIkLDvkG+Rr83uLPNuTD1Ray7yzF/ss+fEL X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8fc9bd18-6a35-42a0-3313-08d975e70b95 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8429.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2021 12:15:44.3127 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wcRObpoA/MlCaHp7gsOpbPXxHMGcz/0ppUEN5o9tIEIgic5vDI/ds6UqgtHBcIfr137BhRPdjJ/yvNjjIwOTig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4778 Subject: [dpdk-dev] [PATCH v5 4/9] baseband/la12xx: add support for multiple modems X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Hemant Agrawal This patch add support for multiple modems by assigning a modem id as dev args in vdev creation. Signed-off-by: Hemant Agrawal --- drivers/baseband/la12xx/bbdev_la12xx.c | 64 +++++++++++++++++++--- drivers/baseband/la12xx/bbdev_la12xx.h | 56 +++++++++++++++++++ drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 20 +++++++ 3 files changed, 133 insertions(+), 7 deletions(-) create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.h create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_ipc.h -- 2.17.1 diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index 8886b35429..f26f3f2a08 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -14,6 +14,8 @@ #include #include +#include +#include #define DRIVER_NAME baseband_la12xx @@ -22,18 +24,18 @@ RTE_LOG_REGISTER(bbdev_la12xx_logtype, pmd.bb.la12xx, NOTICE); /* Initialisation params structure that can be used by LA12xx BBDEV driver */ struct bbdev_la12xx_params { uint8_t queues_num; /*< LA12xx BBDEV queues number */ + int8_t modem_id; /*< LA12xx modem instance id */ }; #define LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" +#define LA12XX_VDEV_MODEM_ID_ARG "modem" +#define LA12XX_MAX_MODEM 4 static const char * const bbdev_la12xx_valid_params[] = { LA12XX_MAX_NB_QUEUES_ARG, + LA12XX_VDEV_MODEM_ID_ARG, }; -/* private data structure */ -struct bbdev_la12xx_private { - unsigned int max_nb_queues; /**< Max number of queues */ -}; static inline int parse_u16_arg(const char *key, const char *value, void *extra_args) { @@ -52,6 +54,28 @@ parse_u16_arg(const char *key, const char *value, void *extra_args) return 0; } +/* Parse integer from integer argument */ +static int +parse_integer_arg(const char *key __rte_unused, + const char *value, void *extra_args) +{ + int i; + char *end; + + errno = 0; + + i = strtol(value, &end, 10); + if (*end != 0 || errno != 0 || i < 0 || i > LA12XX_MAX_MODEM) { + rte_bbdev_log(ERR, "Supported Port IDS are 0 to %d", + LA12XX_MAX_MODEM - 1); + return -EINVAL; + } + + *((uint32_t *)extra_args) = i; + + return 0; +} + /* Parse parameters used to create device */ static int parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, @@ -73,6 +97,16 @@ parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, if (ret < 0) goto exit; + ret = rte_kvargs_process(kvlist, + bbdev_la12xx_valid_params[1], + &parse_integer_arg, + ¶ms->modem_id); + + if (params->modem_id >= LA12XX_MAX_MODEM) { + rte_bbdev_log(ERR, "Invalid modem id, must be < %u", + LA12XX_MAX_MODEM); + goto exit; + } } exit: @@ -84,10 +118,11 @@ parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, /* Create device */ static int la12xx_bbdev_create(struct rte_vdev_device *vdev, - struct bbdev_la12xx_params *init_params __rte_unused) + struct bbdev_la12xx_params *init_params) { struct rte_bbdev *bbdev; const char *name = rte_vdev_device_name(vdev); + struct bbdev_la12xx_private *priv; PMD_INIT_FUNC_TRACE(); @@ -103,6 +138,20 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev, return -ENOMEM; } + priv = bbdev->data->dev_private; + priv->modem_id = init_params->modem_id; + /* if modem id is not configured */ + if (priv->modem_id == -1) + priv->modem_id = bbdev->data->dev_id; + + /* Reset Global variables */ + priv->num_ldpc_enc_queues = 0; + priv->num_ldpc_dec_queues = 0; + priv->num_valid_queues = 0; + priv->max_nb_queues = init_params->queues_num; + + rte_bbdev_log(INFO, "Setting Up %s: DevId=%d, ModemId=%d", + name, bbdev->data->dev_id, priv->modem_id); bbdev->dev_ops = NULL; bbdev->device = &vdev->device; bbdev->data->socket_id = 0; @@ -122,7 +171,7 @@ static int la12xx_bbdev_probe(struct rte_vdev_device *vdev) { struct bbdev_la12xx_params init_params = { - 8 + 8, -1, }; const char *name; const char *input_args; @@ -174,4 +223,5 @@ static struct rte_vdev_driver bbdev_la12xx_pmd_drv = { RTE_PMD_REGISTER_VDEV(DRIVER_NAME, bbdev_la12xx_pmd_drv); RTE_PMD_REGISTER_PARAM_STRING(DRIVER_NAME, - LA12XX_MAX_NB_QUEUES_ARG"="); + LA12XX_MAX_NB_QUEUES_ARG"=" + LA12XX_VDEV_MODEM_ID_ARG "= "); diff --git a/drivers/baseband/la12xx/bbdev_la12xx.h b/drivers/baseband/la12xx/bbdev_la12xx.h new file mode 100644 index 0000000000..5228502331 --- /dev/null +++ b/drivers/baseband/la12xx/bbdev_la12xx.h @@ -0,0 +1,56 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020-2021 NXP + */ + +#ifndef __BBDEV_LA12XX_H__ +#define __BBDEV_LA12XX_H__ + +#define BBDEV_IPC_ENC_OP_TYPE 1 +#define BBDEV_IPC_DEC_OP_TYPE 2 + +#define MAX_LDPC_ENC_FECA_QUEUES 4 +#define MAX_LDPC_DEC_FECA_QUEUES 4 + +#define MAX_CHANNEL_DEPTH 16 +/* private data structure */ +struct bbdev_la12xx_private { + void *ipc_priv; + uint8_t num_valid_queues; + uint8_t max_nb_queues; + uint8_t num_ldpc_enc_queues; + uint8_t num_ldpc_dec_queues; + int8_t modem_id; + struct bbdev_la12xx_q_priv *queues_priv[32]; +}; + +struct hugepage_info { + void *vaddr; + phys_addr_t paddr; + size_t len; +}; + +struct bbdev_la12xx_q_priv { + struct bbdev_la12xx_private *bbdev_priv; + uint32_t q_id; /**< Channel ID */ + uint32_t feca_blk_id; /** FECA block ID for processing */ + uint32_t feca_blk_id_be32; /**< FECA Block ID for this queue */ + uint8_t en_napi; /* 0: napi disabled, 1: napi enabled */ + uint16_t queue_size; /**< Queue depth */ + int32_t eventfd; /**< Event FD value */ + enum rte_bbdev_op_type op_type; /**< Operation type */ + uint32_t la12xx_core_id; + /* LA12xx core ID on which this will be scheduled */ + struct rte_mempool *mp; /**< Pool from where buffers would be cut */ + void *bbdev_op[MAX_CHANNEL_DEPTH]; + /**< Stores bbdev op for each index */ + void *msg_ch_vaddr[MAX_CHANNEL_DEPTH]; + /**< Stores msg channel addr for modem->host */ + uint32_t host_pi; /**< Producer_Index for HOST->MODEM */ + uint32_t host_ci; /**< Consumer Index for MODEM->HOST */ + host_ipc_params_t *host_params; /**< Host parameters */ +}; + +#define lower_32_bits(x) ((uint32_t)((uint64_t)x)) +#define upper_32_bits(x) ((uint32_t)(((uint64_t)(x) >> 16) >> 16)) + +#endif diff --git a/drivers/baseband/la12xx/bbdev_la12xx_ipc.h b/drivers/baseband/la12xx/bbdev_la12xx_ipc.h new file mode 100644 index 0000000000..9aa5562981 --- /dev/null +++ b/drivers/baseband/la12xx/bbdev_la12xx_ipc.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020-2021 NXP + */ +#ifndef __BBDEV_LA12XX_IPC_H__ +#define __BBDEV_LA12XX_IPC_H__ + +/** No. of max channel per instance */ +#define IPC_MAX_DEPTH (16) + +/* This shared memory would be on the host side which have copy of some + * of the parameters which are also part of Shared BD ring. Read access + * of these parameters from the host side would not be over PCI. + */ +typedef struct host_ipc_params { + volatile uint32_t pi; + volatile uint32_t ci; + volatile uint32_t modem_ptr[IPC_MAX_DEPTH]; +} __rte_packed host_ipc_params_t; + +#endif From patchwork Sun Sep 12 12:15:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 509488 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp2955200jai; Sun, 12 Sep 2021 05:16:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNXdtoY9PWavW52k5z7eK/bKvo/MH8JTjNytRrN5sDHPhlBiELvQlAHIhSRiz4b6bhHcVA X-Received: by 2002:a5d:4950:: with SMTP id r16mr5387012wrs.265.1631448975249; Sun, 12 Sep 2021 05:16:15 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id f4si4553594wmb.72.2021.09.12.05.16.15; Sun, 12 Sep 2021 05:16:15 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=K2pFyGkf; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 443FD410E9; Sun, 12 Sep 2021 14:15:51 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2083.outbound.protection.outlook.com [40.107.21.83]) by mails.dpdk.org (Postfix) with ESMTP id F173D410F5 for ; Sun, 12 Sep 2021 14:15:47 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y2+zXP9pVxDwvJXp0R8H/lKZeOjYrJo/SOsmvb622AVmhStPFPCnv9Oh+ecHeE82235/aHHnHts8PRsk1sH5Qm0TK79ZoLBJgeJ4BfuZquUTHqdqSrhCzMZ8vNAflz5csJpFhd77usdOkNd6McK6VLFNY1TWD0E2q3c+XzfazHXVyqkKmKH2hAHHkv+76UCVh5IPCiyW2NaFuEglVwt/shteQZx6ccYoDT09a+pLRQLKdjtr4fmnI6bFgx+FqNgG+DZmqQIMMNMGr69PzId2TmltaHoqbx8oV5tz7melvH9DM/zT4EFtHO/adqXe1qIiFl7JLnlPgbmfG/pUffgzBA== 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; bh=RnDbIpcfHCKEp3jPNnRwKsy+hoLm4oOCmSKqWTScfA4=; b=m9TqVSTLKdJmiqpMM+YzX8Ui4f1Kbv77BAkNHFWw/sBGCLlIHFpcwR9RHVN7V+5yTsSh81TYLOqT9wFsCotwh7gh/pJsYF1VPKOU90tO4dTnVBr9N51D4nz37ileXevSl/c5KFbbbwlWQZHfUO1ah7xwe4j6gciU1w6owESLEXZUHczqa8rSJnH2qGw1+aZ87/7U8ZqGXeDflSW0dCZcLSR7zPvxSKhpeYyb+B7DRtphbemBTwLSEPtC/U3LvCVsYHDOtQ5b7GAda8RXPNQ14Kt6CDeiGWReZe4pqywwu0cVoKAVgdbFJwgVyZbgld9yE6tqasQWI9topistIK0+nA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RnDbIpcfHCKEp3jPNnRwKsy+hoLm4oOCmSKqWTScfA4=; b=K2pFyGkfv8qgpqpGcrQAkx0dWsaemq7QYt/BxCEWAyVMxQQT27hp80kxsRbPq3tqODOaqsd1u0FUffzbnixWsV3BDDJYFXfMSPpP49m+3MXuNjlaJVB2vq7U6xyd70FXquFmKxIAJphMuDnsdp0O0KJg+XqtSCtjp6A0W9u70Rg= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) by DB7PR04MB4778.eurprd04.prod.outlook.com (2603:10a6:10:18::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.18; Sun, 12 Sep 2021 12:15:46 +0000 Received: from DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4]) by DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4%9]) with mapi id 15.20.4500.018; Sun, 12 Sep 2021 12:15:46 +0000 From: Nipun Gupta To: dev@dpdk.org, gakhil@marvell.com, nicolas.chautru@intel.com Cc: david.marchand@redhat.com, hemant.agrawal@nxp.com, Nipun Gupta Date: Sun, 12 Sep 2021 17:45:06 +0530 Message-Id: <20210912121510.22699-6-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210912121510.22699-1-nipun.gupta@nxp.com> References: <20210318063421.14895-1-hemant.agrawal@nxp.com> <20210912121510.22699-1-nipun.gupta@nxp.com> X-ClientProxiedBy: SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) To DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03274.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Sun, 12 Sep 2021 12:15:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c79998b2-0052-4f46-8290-08d975e70cd0 X-MS-TrafficTypeDiagnostic: DB7PR04MB4778: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:431; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zQn6zFtmuq2zENwcMkdirKhP/GLSIc8MpF4fREjuYc2RA/brnzO+qYahMSXJ+DvhSCM65ZD1xGzoeV2cM7O8gk7VYLnEakJF9rKi524NB9Pyc9nRLlrZRbs6rNh6HDjXPNeUi830dL88G7qdhWTwJA4vAJP5mZkhkcL8PzmBJ4xdeetyU08V+vHriCoWLHCn9n1WjV1uLq3s8VIEtARJeKxCmYQM/hreHG9SNfEAjMI7ZJQTe6HvMjx87EYnRl7mqnzwKntnWOmWMtEf9/DU6rtdeyPnoLPMOAahaSLUnF+Fs8HEJMGJM8PnQGYKcrnRh3Y0+3k2h1HA27CEiR+JYr3tRNjSODxl7JhSyPGvo765Gc0hqrp44lPuGhGXJ3NwKs+9rbRCWUvzfjGK79GK6abZIOLnf9WFzpuhtfXVcKVj0q5g3z4B4Ec4ALmRUECCL48QVfkZG4DfsUPdwV7JUErGygrjdpGqYI/7cRoGFLGJgnROR1sziKdFS2oJjgboZqv+H/I3gWQ3AbG9DS4tYq+bCUTnv/jfhrfJiX7ujFizrYnWH0P3xUCpdvHljRnq5wN95C6r3+TaGtL+s1gCCvkRROH7018B10y5apLRXwMwB2HbIN/2n90LRYA/NZnaJA9EkBLKcY1xc5/cIfkjbzYOM3OQuyTV3yInWRb4AXLQEMpqpeKltIDAve2C0EGOXLtvRjidWgUeRLb438zXj108LImT09C6OJlE1GZSMBhV9POgm697qbqKJ1AvMmEi+uyohfO2UIn+RifG0ke7y4ZlaKHDIYW2acfJoXANETg4oYvEUwLQCMydtOf8nNhF X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR04MB8429.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(136003)(39860400002)(376002)(66946007)(36756003)(1076003)(66556008)(38350700002)(38100700002)(8676002)(8936002)(186003)(4326008)(956004)(2616005)(52116002)(6486002)(316002)(55236004)(86362001)(5660300002)(44832011)(30864003)(478600001)(1006002)(6666004)(83380400001)(7696005)(2906002)(26005)(66476007)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DMIFb8q5g11gBvK3anRq1OF+kcysJpx8PxORD977njnY/O67G+sE5oQZPI3iUkgRiz4R2ysCtSuFpaS4HhCeHtfRugAESnGGL4f3L6xvgG0PnudxmVFz4ZQk57+LnsabE4l64HHv4DOWBTEFAHxV9h0LnISuilx7a14jtvaAhEbLETzVPUSjBWqlV9LEK4ttsQfxXKLzrCwgthlYb0N4xSvhWDCUn8QhMqeUDJWu86odBqKSQq869qQv7ESyBPFYCqSVsxZu5/NnS89QgmSuTNRxfW7D/6RTDp7B1p26Zuspe1PSKf//VLehpGT1ZB0mc62rc9g/uSLL/GIu3Vdg7NE13phu4xZILTJOqsmfeBGPHczUSPoLT8E2EncnH8lVAryp58EXiP2p+PD1Ofn0Utplm8FhFXCPjiuRQFsWAx1/Q14q9U5qQUjthvwyBHh129PQyyPiZggStWk1+MkfoJSYsl4duL+wOvsPluibMrSlWiN3FTPsCCfiOEWcEaYoYPESyS/bs7U6Fkh7efBmzRR06oWwpAAAHwWV5yQYEkkdSayItYwBgH9iOTfjc5uS41GQYzp4j72kshhJLdOzrA7H4kNTlIc0l884Edm8ac0Ly3ucblHDkLaibBo0u07xaWQyeHPlnQl27LUkAcsFE/nuPTycFlgeuLD1hhPlQeQV7JDHbM54PlcfsJCFeY2t0vF7x7JZL2oJ3NqhQyQdfGJjk5diIkQOvsv+p5cMErqVlWzAiQGg2nIYrGcOLPzcsVaJywbAm2G5AX0u7OxSeJSYn9b6ES7zdO7sW0yO8p7zxw+F7ZlXDH8hEbEiMmxo94IUH/vxRCdFtVSF0oIyJkeTKW6J3K/ohUAN3GFGj+7j95Xt07vdJ2yUJIQbm6dfLH3Nrfq/m8IsYcjzTOj05TSCLnMgkLYCZhqBBuy0Jr9CiCr0dqs/TM7g3qesY3mykdSTSq+I0g28V6Zpsd/5YP1duDUmm7xv51p87iCbHiovQeqPm/0vkZCFSt5l+voakxCMT7t+YKYBZnivXYgJ3AeodzQHYVLUTGI0ndVBjfpgwlEinn5Y380/Bq4ZQJxNTbeZjxrtO5+H+TIN3pvZ7HKl3Z4cNvbUnedQ156BX8KK1KyDilzzp+ygR6CH2ntcOgGBkRrYQg9i4wS90dM5e6eGh0MnpBXvZohy9kvZ+JwVCUmY1zebbfbjU/NgIssLXFMifspUHZ3iYaKCoZpX0PNwKyxT5/I658M9rIAKxAwM05IRhUUIygVrJfK2c58iXjAFk8tWIzAtF6+R3zlqpecCDe2HGBAOsVZMDePfws0OGLQuxMX+J/k0azRjb9SO X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c79998b2-0052-4f46-8290-08d975e70cd0 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8429.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2021 12:15:46.5131 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 76T0BzdIPbIsUulF86uWWjQMZwHYq6/Ps85QfRWQ/nHN0+f6454Yhn066cDQuLvR6w8JUbjC3MGGoUbw4+UUcA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4778 Subject: [dpdk-dev] [PATCH v5 5/9] baseband/la12xx: add queue and modem config support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Hemant Agrawal This patch add support for connecting with modem and creating the ipc channel as queues with modem for the exchange of data. Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- MAINTAINERS | 1 + doc/guides/bbdevs/index.rst | 1 + doc/guides/bbdevs/la12xx.rst | 81 +++ doc/guides/rel_notes/release_21_11.rst | 5 + drivers/baseband/la12xx/bbdev_la12xx.c | 553 ++++++++++++++++++++- drivers/baseband/la12xx/bbdev_la12xx.h | 11 +- drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 189 ++++++- 7 files changed, 831 insertions(+), 10 deletions(-) create mode 100644 doc/guides/bbdevs/la12xx.rst -- 2.17.1 diff --git a/MAINTAINERS b/MAINTAINERS index a63e672c9e..2c243c10fe 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1295,6 +1295,7 @@ NXP LA12xx driver M: Hemant Agrawal M: Nipun Gupta F: drivers/baseband/la12xx/ +F: doc/guides/bbdevs/la12xx.rst Rawdev Drivers diff --git a/doc/guides/bbdevs/index.rst b/doc/guides/bbdevs/index.rst index 4445cbd1b0..cedd706fa6 100644 --- a/doc/guides/bbdevs/index.rst +++ b/doc/guides/bbdevs/index.rst @@ -14,3 +14,4 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 + la12xx diff --git a/doc/guides/bbdevs/la12xx.rst b/doc/guides/bbdevs/la12xx.rst new file mode 100644 index 0000000000..3c9ac5c047 --- /dev/null +++ b/doc/guides/bbdevs/la12xx.rst @@ -0,0 +1,81 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright 2021 NXP + +NXP LA12xx Poll Mode Driver +======================================= + +The BBDEV LA12xx poll mode driver (PMD) supports an implementation for +offloading High Phy processing functions like LDPC Encode / Decode 5GNR wireless +acceleration function, using PCI based LA12xx Software defined radio. + +More information can be found at `NXP Official Website +`_. + +Features +-------- + +LA12xx PMD supports the following features: + +- Maximum of 8 UL queues +- Maximum of 8 DL queues +- PCIe Gen-3 x8 Interface +- MSI-X + +Installation +------------ + +Section 3 of the DPDK manual provides instructions on installing and compiling DPDK. + +DPDK requires hugepages to be configured as detailed in section 2 of the DPDK manual. + +Initialization +-------------- + +The device can be listed on the host console with: + + +Use the following lspci command to get the multiple LA12xx processor ids. The +device ID of the LA12xx baseband processor is "1c30". + +.. code-block:: console + + sudo lspci -nn + +... +0001:01:00.0 Power PC [0b20]: Freescale Semiconductor Inc Device [1957:1c30] ( +rev 10) +... +0002:01:00.0 Power PC [0b20]: Freescale Semiconductor Inc Device [1957:1c30] ( +rev 10) + + +Prerequisites +------------- + +Currently supported by DPDK: + +- NXP LA1224 BSP **1.0+**. +- NXP LA1224 PCIe Modem card connected to ARM host. + +- Follow the DPDK :ref:`Getting Started Guide for Linux ` to setup the basic DPDK environment. + +* Use dev arg option ``modem=0`` to identify the modem instance for a given + device. This is required only if more than 1 modem cards are attached to host. + this is optional and the default value is 0. + e.g. ``--vdev=baseband_la12xx,modem=0`` + +* Use dev arg option ``max_nb_queues=x`` to specify the maximum number of queues + to be used for communication with offload device i.e. modem. default is 16. + e.g. ``--vdev=baseband_la12xx,max_nb_queues=4`` + +Enabling logs +------------- + +For enabling logs, use the following EAL parameter: + +.. code-block:: console + + ./your_bbdev_application --log-level=la12xx: + +Using ``bb.la12xx`` as log matching criteria, all Baseband PMD logs can be +enabled which are lower than logging ``level``. diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index 675b573834..a0e0ebbeb8 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -62,6 +62,11 @@ New Features * Added bus-level parsing of the devargs syntax. * Kept compatibility with the legacy syntax as parsing fallback. +* **Added NXP LA12xx baseband PMD.** + + * Added a new baseband PMD driver for NXP LA12xx Software defined radio. + * See the :doc:`../bbdevs/la12xx` for more details. + Removed Items ------------- diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index f26f3f2a08..57e957a93a 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -3,6 +3,11 @@ */ #include +#include +#include +#include +#include +#include #include #include @@ -31,11 +36,550 @@ struct bbdev_la12xx_params { #define LA12XX_VDEV_MODEM_ID_ARG "modem" #define LA12XX_MAX_MODEM 4 +#define LA12XX_MAX_CORES 4 +#define LA12XX_LDPC_ENC_CORE 0 +#define LA12XX_LDPC_DEC_CORE 1 + +#define LA12XX_MAX_LDPC_ENC_QUEUES 4 +#define LA12XX_MAX_LDPC_DEC_QUEUES 4 + static const char * const bbdev_la12xx_valid_params[] = { LA12XX_MAX_NB_QUEUES_ARG, LA12XX_VDEV_MODEM_ID_ARG, }; +static const struct rte_bbdev_op_cap bbdev_capabilities[] = { + { + .type = RTE_BBDEV_OP_LDPC_ENC, + .cap.ldpc_enc = { + .capability_flags = + RTE_BBDEV_LDPC_CRC_24A_ATTACH | + RTE_BBDEV_LDPC_CRC_24B_ATTACH, + .num_buffers_src = + RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, + .num_buffers_dst = + RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, + } + }, + { + .type = RTE_BBDEV_OP_LDPC_DEC, + .cap.ldpc_dec = { + .capability_flags = + RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK | + RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK | + RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP, + .num_buffers_src = + RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, + .num_buffers_hard_out = + RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, + .llr_size = 8, + .llr_decimals = 1, + } + }, + RTE_BBDEV_END_OF_CAPABILITIES_LIST() +}; + +static struct rte_bbdev_queue_conf default_queue_conf = { + .queue_size = MAX_CHANNEL_DEPTH, +}; + +/* Get device info */ +static void +la12xx_info_get(struct rte_bbdev *dev __rte_unused, + struct rte_bbdev_driver_info *dev_info) +{ + PMD_INIT_FUNC_TRACE(); + + dev_info->driver_name = RTE_STR(DRIVER_NAME); + dev_info->max_num_queues = LA12XX_MAX_QUEUES; + dev_info->queue_size_lim = MAX_CHANNEL_DEPTH; + dev_info->hardware_accelerated = true; + dev_info->max_dl_queue_priority = 0; + dev_info->max_ul_queue_priority = 0; + dev_info->default_queue_conf = default_queue_conf; + dev_info->capabilities = bbdev_capabilities; + dev_info->cpu_flag_reqs = NULL; + dev_info->min_alignment = 64; + + rte_bbdev_log_debug("got device info from %u", dev->data->dev_id); +} + +/* Release queue */ +static int +la12xx_queue_release(struct rte_bbdev *dev, uint16_t q_id) +{ + RTE_SET_USED(dev); + RTE_SET_USED(q_id); + + PMD_INIT_FUNC_TRACE(); + + /* TODO: Implement */ + + return 0; +} + +#define HUGEPG_OFFSET(A) \ + ((uint64_t) ((unsigned long) (A) \ + - ((uint64_t)ipc_priv->hugepg_start.host_vaddr))) + +static int ipc_queue_configure(uint32_t channel_id, + ipc_t instance, struct bbdev_la12xx_q_priv *q_priv) +{ + ipc_userspace_t *ipc_priv = (ipc_userspace_t *)instance; + ipc_instance_t *ipc_instance = ipc_priv->instance; + ipc_ch_t *ch; + void *vaddr; + uint32_t i = 0; + uint32_t msg_size = sizeof(struct bbdev_ipc_enqueue_op); + + PMD_INIT_FUNC_TRACE(); + + rte_bbdev_log_debug("%x %p", ipc_instance->initialized, + ipc_priv->instance); + ch = &(ipc_instance->ch_list[channel_id]); + + rte_bbdev_log_debug("channel: %u, depth: %u, msg size: %u", + channel_id, q_priv->queue_size, msg_size); + + /* Start init of channel */ + ch->md.ring_size = rte_cpu_to_be_32(q_priv->queue_size); + ch->md.pi = 0; + ch->md.ci = 0; + ch->md.msg_size = msg_size; + for (i = 0; i < q_priv->queue_size; i++) { + vaddr = rte_malloc(NULL, msg_size, RTE_CACHE_LINE_SIZE); + if (!vaddr) + return IPC_HOST_BUF_ALLOC_FAIL; + /* Only offset now */ + ch->bd_h[i].modem_ptr = + rte_cpu_to_be_32(HUGEPG_OFFSET(vaddr)); + ch->bd_h[i].host_virt_l = lower_32_bits(vaddr); + ch->bd_h[i].host_virt_h = upper_32_bits(vaddr); + q_priv->msg_ch_vaddr[i] = vaddr; + /* Not sure use of this len may be for CRC*/ + ch->bd_h[i].len = 0; + } + ch->host_ipc_params = + rte_cpu_to_be_32(HUGEPG_OFFSET(q_priv->host_params)); + + rte_bbdev_log_debug("Channel configured"); + return IPC_SUCCESS; +} + +static int +la12xx_e200_queue_setup(struct rte_bbdev *dev, + struct bbdev_la12xx_q_priv *q_priv) +{ + struct bbdev_la12xx_private *priv = dev->data->dev_private; + ipc_userspace_t *ipc_priv = priv->ipc_priv; + struct gul_hif *mhif; + ipc_metadata_t *ipc_md; + ipc_ch_t *ch; + int instance_id = 0, i; + int ret; + + PMD_INIT_FUNC_TRACE(); + + switch (q_priv->op_type) { + case RTE_BBDEV_OP_LDPC_ENC: + q_priv->la12xx_core_id = LA12XX_LDPC_ENC_CORE; + break; + case RTE_BBDEV_OP_LDPC_DEC: + q_priv->la12xx_core_id = LA12XX_LDPC_DEC_CORE; + break; + default: + rte_bbdev_log(ERR, "Unsupported op type\n"); + return -1; + } + + mhif = (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; + /* offset is from start of PEB */ + ipc_md = (ipc_metadata_t *)((uint64_t)ipc_priv->peb_start.host_vaddr + + mhif->ipc_regs.ipc_mdata_offset); + ch = &ipc_md->instance_list[instance_id].ch_list[q_priv->q_id]; + + if (q_priv->q_id < priv->num_valid_queues) { + ipc_br_md_t *md = &(ch->md); + + q_priv->feca_blk_id = rte_cpu_to_be_32(ch->feca_blk_id); + q_priv->feca_blk_id_be32 = ch->feca_blk_id; + q_priv->host_pi = rte_be_to_cpu_32(md->pi); + q_priv->host_ci = rte_be_to_cpu_32(md->ci); + q_priv->host_params = (host_ipc_params_t *) + (rte_be_to_cpu_32(ch->host_ipc_params) + + ((uint64_t)ipc_priv->hugepg_start.host_vaddr)); + + for (i = 0; i < q_priv->queue_size; i++) { + uint32_t h, l; + + h = ch->bd_h[i].host_virt_h; + l = ch->bd_h[i].host_virt_l; + q_priv->msg_ch_vaddr[i] = (void *)join_32_bits(h, l); + } + + rte_bbdev_log(WARNING, + "Queue [%d] already configured, not configuring again", + q_priv->q_id); + return 0; + } + + rte_bbdev_log_debug("setting up queue %d", q_priv->q_id); + + /* Call ipc_configure_channel */ + ret = ipc_queue_configure(q_priv->q_id, ipc_priv, q_priv); + if (ret) { + rte_bbdev_log(ERR, "Unable to setup queue (%d) (err=%d)", + q_priv->q_id, ret); + return ret; + } + + /* Set queue properties for LA12xx device */ + switch (q_priv->op_type) { + case RTE_BBDEV_OP_LDPC_ENC: + if (priv->num_ldpc_enc_queues >= LA12XX_MAX_LDPC_ENC_QUEUES) { + rte_bbdev_log(ERR, + "num_ldpc_enc_queues reached max value"); + return -1; + } + ch->la12xx_core_id = + rte_cpu_to_be_32(LA12XX_LDPC_ENC_CORE); + ch->feca_blk_id = rte_cpu_to_be_32(priv->num_ldpc_enc_queues++); + break; + case RTE_BBDEV_OP_LDPC_DEC: + if (priv->num_ldpc_dec_queues >= LA12XX_MAX_LDPC_DEC_QUEUES) { + rte_bbdev_log(ERR, + "num_ldpc_dec_queues reached max value"); + return -1; + } + ch->la12xx_core_id = + rte_cpu_to_be_32(LA12XX_LDPC_DEC_CORE); + ch->feca_blk_id = rte_cpu_to_be_32(priv->num_ldpc_dec_queues++); + break; + default: + rte_bbdev_log(ERR, "Not supported op type\n"); + return -1; + } + ch->op_type = rte_cpu_to_be_32(q_priv->op_type); + ch->depth = rte_cpu_to_be_32(q_priv->queue_size); + + /* Store queue config here */ + q_priv->feca_blk_id = rte_cpu_to_be_32(ch->feca_blk_id); + q_priv->feca_blk_id_be32 = ch->feca_blk_id; + + return 0; +} + +/* Setup a queue */ +static int +la12xx_queue_setup(struct rte_bbdev *dev, uint16_t q_id, + const struct rte_bbdev_queue_conf *queue_conf) +{ + struct bbdev_la12xx_private *priv = dev->data->dev_private; + struct rte_bbdev_queue_data *q_data; + struct bbdev_la12xx_q_priv *q_priv; + int ret; + + PMD_INIT_FUNC_TRACE(); + + /* Move to setup_queues callback */ + q_data = &dev->data->queues[q_id]; + q_data->queue_private = rte_zmalloc(NULL, + sizeof(struct bbdev_la12xx_q_priv), 0); + if (!q_data->queue_private) { + rte_bbdev_log(ERR, "Memory allocation failed for qpriv"); + return -ENOMEM; + } + q_priv = q_data->queue_private; + q_priv->q_id = q_id; + q_priv->bbdev_priv = dev->data->dev_private; + q_priv->queue_size = queue_conf->queue_size; + q_priv->op_type = queue_conf->op_type; + + ret = la12xx_e200_queue_setup(dev, q_priv); + if (ret) { + rte_bbdev_log(ERR, "e200_queue_setup failed for qid: %d", + q_id); + return ret; + } + + /* Store queue config here */ + priv->num_valid_queues++; + + return 0; +} + +static int +la12xx_start(struct rte_bbdev *dev) +{ + struct bbdev_la12xx_private *priv = dev->data->dev_private; + ipc_userspace_t *ipc_priv = priv->ipc_priv; + int ready = 0; + struct gul_hif *hif_start; + + PMD_INIT_FUNC_TRACE(); + + hif_start = (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; + + /* Set Host Read bit */ + SET_HIF_HOST_RDY(hif_start, HIF_HOST_READY_IPC_APP); + + /* Now wait for modem ready bit */ + while (!ready) + ready = CHK_HIF_MOD_RDY(hif_start, HIF_MOD_READY_IPC_APP); + + return 0; +} + +static const struct rte_bbdev_ops pmd_ops = { + .info_get = la12xx_info_get, + .queue_setup = la12xx_queue_setup, + .queue_release = la12xx_queue_release, + .start = la12xx_start +}; +static struct hugepage_info * +get_hugepage_info(void) +{ + struct hugepage_info *hp_info; + struct rte_memseg *mseg; + + PMD_INIT_FUNC_TRACE(); + + /* TODO - find a better way */ + hp_info = rte_malloc(NULL, sizeof(struct hugepage_info), 0); + if (!hp_info) { + rte_bbdev_log(ERR, "Unable to allocate on local heap"); + return NULL; + } + + mseg = rte_mem_virt2memseg(hp_info, NULL); + hp_info->vaddr = mseg->addr; + hp_info->paddr = rte_mem_virt2phy(mseg->addr); + hp_info->len = mseg->len; + + return hp_info; +} + +static int open_ipc_dev(int modem_id) +{ + char dev_initials[16], dev_path[PATH_MAX]; + struct dirent *entry; + int dev_ipc = 0; + DIR *dir; + + dir = opendir("/dev/"); + if (!dir) { + rte_bbdev_log(ERR, "Unable to open /dev/"); + return -1; + } + + sprintf(dev_initials, "gulipcgul%d", modem_id); + + while ((entry = readdir(dir)) != NULL) { + if (!strncmp(dev_initials, entry->d_name, + sizeof(dev_initials) - 1)) + break; + } + + if (!entry) { + rte_bbdev_log(ERR, "Error: No gulipcgul%d device", modem_id); + return -1; + } + + sprintf(dev_path, "/dev/%s", entry->d_name); + dev_ipc = open(dev_path, O_RDWR); + if (dev_ipc < 0) { + rte_bbdev_log(ERR, "Error: Cannot open %s", dev_path); + return -errno; + } + + return dev_ipc; +} + +static int +setup_la12xx_dev(struct rte_bbdev *dev) +{ + struct bbdev_la12xx_private *priv = dev->data->dev_private; + ipc_userspace_t *ipc_priv = priv->ipc_priv; + struct hugepage_info *hp = NULL; + ipc_channel_us_t *ipc_priv_ch = NULL; + int dev_ipc = 0, dev_mem = 0, i; + ipc_metadata_t *ipc_md; + struct gul_hif *mhif; + uint32_t phy_align = 0; + int ret; + + PMD_INIT_FUNC_TRACE(); + + if (!ipc_priv) { + /* TODO - get a better way */ + /* Get the hugepage info against it */ + hp = get_hugepage_info(); + if (!hp) { + rte_bbdev_log(ERR, "Unable to get hugepage info"); + ret = -ENOMEM; + goto err; + } + + rte_bbdev_log_debug("%lx %p %lx", + hp->paddr, hp->vaddr, hp->len); + + ipc_priv = rte_zmalloc(0, sizeof(ipc_userspace_t), 0); + if (ipc_priv == NULL) { + rte_bbdev_log(ERR, + "Unable to allocate memory for ipc priv"); + ret = -ENOMEM; + goto err; + } + + for (i = 0; i < IPC_MAX_CHANNEL_COUNT; i++) { + ipc_priv_ch = rte_zmalloc(0, + sizeof(ipc_channel_us_t), 0); + if (ipc_priv_ch == NULL) { + rte_bbdev_log(ERR, + "Unable to allocate memory for channels"); + ret = -ENOMEM; + } + ipc_priv->channels[i] = ipc_priv_ch; + } + + dev_mem = open("/dev/mem", O_RDWR); + if (dev_mem < 0) { + rte_bbdev_log(ERR, "Error: Cannot open /dev/mem"); + ret = -errno; + goto err; + } + + ipc_priv->instance_id = 0; + ipc_priv->dev_mem = dev_mem; + + rte_bbdev_log_debug("hugepg input %lx %p %lx", + hp->paddr, hp->vaddr, hp->len); + + ipc_priv->sys_map.hugepg_start.host_phys = hp->paddr; + ipc_priv->sys_map.hugepg_start.size = hp->len; + + ipc_priv->hugepg_start.host_phys = hp->paddr; + ipc_priv->hugepg_start.host_vaddr = hp->vaddr; + ipc_priv->hugepg_start.size = hp->len; + + rte_free(hp); + } + + dev_ipc = open_ipc_dev(priv->modem_id); + if (dev_ipc < 0) { + rte_bbdev_log(ERR, "Error: open_ipc_dev failed"); + goto err; + } + ipc_priv->dev_ipc = dev_ipc; + + ret = ioctl(ipc_priv->dev_ipc, IOCTL_GUL_IPC_GET_SYS_MAP, + &ipc_priv->sys_map); + if (ret) { + rte_bbdev_log(ERR, + "IOCTL_GUL_IPC_GET_SYS_MAP ioctl failed"); + goto err; + } + + phy_align = (ipc_priv->sys_map.mhif_start.host_phys % 0x1000); + ipc_priv->mhif_start.host_vaddr = + mmap(0, ipc_priv->sys_map.mhif_start.size + phy_align, + (PROT_READ | PROT_WRITE), MAP_SHARED, ipc_priv->dev_mem, + (ipc_priv->sys_map.mhif_start.host_phys - phy_align)); + if (ipc_priv->mhif_start.host_vaddr == MAP_FAILED) { + rte_bbdev_log(ERR, "MAP failed:"); + ret = -errno; + goto err; + } + + ipc_priv->mhif_start.host_vaddr = (void *) ((uint64_t) + (ipc_priv->mhif_start.host_vaddr) + phy_align); + + phy_align = (ipc_priv->sys_map.peb_start.host_phys % 0x1000); + ipc_priv->peb_start.host_vaddr = + mmap(0, ipc_priv->sys_map.peb_start.size + phy_align, + (PROT_READ | PROT_WRITE), MAP_SHARED, ipc_priv->dev_mem, + (ipc_priv->sys_map.peb_start.host_phys - phy_align)); + if (ipc_priv->peb_start.host_vaddr == MAP_FAILED) { + rte_bbdev_log(ERR, "MAP failed:"); + ret = -errno; + goto err; + } + + ipc_priv->peb_start.host_vaddr = (void *)((uint64_t) + (ipc_priv->peb_start.host_vaddr) + phy_align); + + phy_align = (ipc_priv->sys_map.modem_ccsrbar.host_phys % 0x1000); + ipc_priv->modem_ccsrbar.host_vaddr = + mmap(0, ipc_priv->sys_map.modem_ccsrbar.size + phy_align, + (PROT_READ | PROT_WRITE), MAP_SHARED, ipc_priv->dev_mem, + (ipc_priv->sys_map.modem_ccsrbar.host_phys - phy_align)); + if (ipc_priv->modem_ccsrbar.host_vaddr == MAP_FAILED) { + rte_bbdev_log(ERR, "MAP failed:"); + ret = -errno; + goto err; + } + + ipc_priv->modem_ccsrbar.host_vaddr = (void *)((uint64_t) + (ipc_priv->modem_ccsrbar.host_vaddr) + phy_align); + + ipc_priv->hugepg_start.modem_phys = + ipc_priv->sys_map.hugepg_start.modem_phys; + + ipc_priv->mhif_start.host_phys = + ipc_priv->sys_map.mhif_start.host_phys; + ipc_priv->mhif_start.size = ipc_priv->sys_map.mhif_start.size; + ipc_priv->peb_start.host_phys = ipc_priv->sys_map.peb_start.host_phys; + ipc_priv->peb_start.size = ipc_priv->sys_map.peb_start.size; + + rte_bbdev_log(INFO, "peb %lx %p %x", + ipc_priv->peb_start.host_phys, + ipc_priv->peb_start.host_vaddr, + ipc_priv->peb_start.size); + rte_bbdev_log(INFO, "hugepg %lx %p %x", + ipc_priv->hugepg_start.host_phys, + ipc_priv->hugepg_start.host_vaddr, + ipc_priv->hugepg_start.size); + rte_bbdev_log(INFO, "mhif %lx %p %x", + ipc_priv->mhif_start.host_phys, + ipc_priv->mhif_start.host_vaddr, + ipc_priv->mhif_start.size); + mhif = (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; + + /* offset is from start of PEB */ + ipc_md = (ipc_metadata_t *)((uint64_t)ipc_priv->peb_start.host_vaddr + + mhif->ipc_regs.ipc_mdata_offset); + + if (sizeof(ipc_metadata_t) != mhif->ipc_regs.ipc_mdata_size) { + rte_bbdev_log(ERR, + "ipc_metadata_t =%lx, mhif->ipc_regs.ipc_mdata_size=%x", + sizeof(ipc_metadata_t), mhif->ipc_regs.ipc_mdata_size); + rte_bbdev_log(ERR, "--> mhif->ipc_regs.ipc_mdata_offset= %x", + mhif->ipc_regs.ipc_mdata_offset); + rte_bbdev_log(ERR, "gul_hif size=%lx", sizeof(struct gul_hif)); + return IPC_MD_SZ_MISS_MATCH; + } + + ipc_priv->instance = (ipc_instance_t *) + (&ipc_md->instance_list[ipc_priv->instance_id]); + + rte_bbdev_log_debug("finish host init"); + + priv->ipc_priv = ipc_priv; + + return 0; + +err: + rte_free(hp); + rte_free(ipc_priv); + rte_free(ipc_priv_ch); + if (dev_mem) + close(dev_mem); + if (dev_ipc) + close(dev_ipc); + + return ret; +} + static inline int parse_u16_arg(const char *key, const char *value, void *extra_args) { @@ -123,6 +667,7 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev, struct rte_bbdev *bbdev; const char *name = rte_vdev_device_name(vdev); struct bbdev_la12xx_private *priv; + int ret; PMD_INIT_FUNC_TRACE(); @@ -152,7 +697,13 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev, rte_bbdev_log(INFO, "Setting Up %s: DevId=%d, ModemId=%d", name, bbdev->data->dev_id, priv->modem_id); - bbdev->dev_ops = NULL; + ret = setup_la12xx_dev(bbdev); + if (ret) { + rte_bbdev_log(ERR, "IPC Setup failed for %s", name); + rte_free(bbdev->data->dev_private); + return ret; + } + bbdev->dev_ops = &pmd_ops; bbdev->device = &vdev->device; bbdev->data->socket_id = 0; bbdev->intr_handle = NULL; diff --git a/drivers/baseband/la12xx/bbdev_la12xx.h b/drivers/baseband/la12xx/bbdev_la12xx.h index 5228502331..49c37fe2fe 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.h +++ b/drivers/baseband/la12xx/bbdev_la12xx.h @@ -5,16 +5,10 @@ #ifndef __BBDEV_LA12XX_H__ #define __BBDEV_LA12XX_H__ -#define BBDEV_IPC_ENC_OP_TYPE 1 -#define BBDEV_IPC_DEC_OP_TYPE 2 - -#define MAX_LDPC_ENC_FECA_QUEUES 4 -#define MAX_LDPC_DEC_FECA_QUEUES 4 - #define MAX_CHANNEL_DEPTH 16 /* private data structure */ struct bbdev_la12xx_private { - void *ipc_priv; + ipc_userspace_t *ipc_priv; uint8_t num_valid_queues; uint8_t max_nb_queues; uint8_t num_ldpc_enc_queues; @@ -52,5 +46,6 @@ struct bbdev_la12xx_q_priv { #define lower_32_bits(x) ((uint32_t)((uint64_t)x)) #define upper_32_bits(x) ((uint32_t)(((uint64_t)(x) >> 16) >> 16)) - +#define join_32_bits(upper, lower) \ + ((size_t)(((uint64_t)(upper) << 32) | (uint32_t)(lower))) #endif diff --git a/drivers/baseband/la12xx/bbdev_la12xx_ipc.h b/drivers/baseband/la12xx/bbdev_la12xx_ipc.h index 9aa5562981..5f613fb087 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx_ipc.h +++ b/drivers/baseband/la12xx/bbdev_la12xx_ipc.h @@ -4,9 +4,182 @@ #ifndef __BBDEV_LA12XX_IPC_H__ #define __BBDEV_LA12XX_IPC_H__ +#define LA12XX_MAX_QUEUES 20 +#define HOST_RX_QUEUEID_OFFSET LA12XX_MAX_QUEUES + +/** No. of max channel per instance */ +#define IPC_MAX_CHANNEL_COUNT (64) + /** No. of max channel per instance */ #define IPC_MAX_DEPTH (16) +/** No. of max IPC instance per modem */ +#define IPC_MAX_INSTANCE_COUNT (1) + +/** Error codes */ +#define IPC_SUCCESS (0) /** IPC operation success */ +#define IPC_INPUT_INVALID (-1) /** Invalid input to API */ +#define IPC_CH_INVALID (-2) /** Channel no is invalid */ +#define IPC_INSTANCE_INVALID (-3) /** Instance no is invalid */ +#define IPC_MEM_INVALID (-4) /** Insufficient memory */ +#define IPC_CH_FULL (-5) /** Channel is full */ +#define IPC_CH_EMPTY (-6) /** Channel is empty */ +#define IPC_BL_EMPTY (-7) /** Free buffer list is empty */ +#define IPC_BL_FULL (-8) /** Free buffer list is full */ +#define IPC_HOST_BUF_ALLOC_FAIL (-9) /** DPDK malloc fail */ +#define IPC_MD_SZ_MISS_MATCH (-10) /** META DATA size in mhif miss matched*/ +#define IPC_MALLOC_FAIL (-11) /** system malloc fail */ +#define IPC_IOCTL_FAIL (-12) /** IOCTL call failed */ +#define IPC_MMAP_FAIL (-14) /** MMAP fail */ +#define IPC_OPEN_FAIL (-15) /** OPEN fail */ +#define IPC_EVENTFD_FAIL (-16) /** eventfd initialization failed */ +#define IPC_NOT_IMPLEMENTED (-17) /** IPC feature is not implemented yet*/ + +#define SET_HIF_HOST_RDY(hif, RDY_MASK) (hif->host_ready |= RDY_MASK) +#define CHK_HIF_MOD_RDY(hif, RDY_MASK) (hif->mod_ready & RDY_MASK) + +/* Host Ready bits */ +#define HIF_HOST_READY_HOST_REGIONS (1 << 0) +#define HIF_HOST_READY_IPC_LIB (1 << 12) +#define HIF_HOST_READY_IPC_APP (1 << 13) +#define HIF_HOST_READY_FECA (1 << 14) + +/* Modem Ready bits */ +#define HIF_MOD_READY_IPC_LIB (1 << 5) +#define HIF_MOD_READY_IPC_APP (1 << 6) +#define HIF_MOD_READY_FECA (1 << 7) + +typedef void *ipc_t; + +struct ipc_msg { + int chid; + void *addr; + uint32_t len; + uint8_t flags; +}; + +typedef struct { + uint64_t host_phys; + uint32_t modem_phys; + void *host_vaddr; + uint32_t size; +} mem_range_t; + +#define GUL_IPC_MAGIC 'R' + +#define IOCTL_GUL_IPC_GET_SYS_MAP _IOW(GUL_IPC_MAGIC, 1, struct ipc_msg *) +#define IOCTL_GUL_IPC_CHANNEL_REGISTER _IOWR(GUL_IPC_MAGIC, 4, struct ipc_msg *) +#define IOCTL_GUL_IPC_CHANNEL_DEREGISTER \ + _IOWR(GUL_IPC_MAGIC, 5, struct ipc_msg *) +#define IOCTL_GUL_IPC_CHANNEL_RAISE_INTERRUPT _IOW(GUL_IPC_MAGIC, 6, int *) + +/** buffer ring common metadata */ +typedef struct ipc_bd_ring_md { + volatile uint32_t pi; /**< Producer index and flag (MSB) + * which flip for each Ring wrapping + */ + volatile uint32_t ci; /**< Consumer index and flag (MSB) + * which flip for each Ring wrapping + */ + uint32_t ring_size; /**< depth (Used to roll-over pi/ci) */ + uint32_t msg_size; /**< Size of the each buffer */ +} __rte_packed ipc_br_md_t; + +/** IPC buffer descriptor */ +typedef struct ipc_buffer_desc { + union { + uint64_t host_virt; /**< msg's host virtual address */ + struct { + uint32_t host_virt_l; + uint32_t host_virt_h; + }; + }; + uint32_t modem_ptr; /**< msg's modem physical address */ + uint32_t len; /**< msg len */ +} __rte_packed ipc_bd_t; + +typedef struct ipc_channel { + uint32_t ch_id; /**< Channel id */ + ipc_br_md_t md; /**< Metadata for BD ring */ + ipc_bd_t bd_h[IPC_MAX_DEPTH]; /**< Buffer Descriptor on Host */ + ipc_bd_t bd_m[IPC_MAX_DEPTH]; /**< Buffer Descriptor on Modem */ + uint32_t op_type; /**< Type of the BBDEV operation + * supported on this channel + */ + uint32_t depth; /**< Channel depth */ + uint32_t feca_blk_id; /**< FECA Transport Block ID for processing */ + uint32_t la12xx_core_id;/**< LA12xx core ID on which this will be + * scheduled + */ + uint32_t feca_input_circ_size; /**< FECA transport block input + * circular buffer size + */ + uint32_t host_ipc_params; /**< Address for host IPC parameters */ +} __rte_packed ipc_ch_t; + +typedef struct ipc_instance { + uint32_t instance_id; /**< instance id, use to init this + * instance by ipc_init API + */ + uint32_t initialized; /**< Set in ipc_init */ + ipc_ch_t ch_list[IPC_MAX_CHANNEL_COUNT]; + /**< Channel descriptors in this instance */ +} __rte_packed ipc_instance_t; + +typedef struct ipc_metadata { + uint32_t ipc_host_signature; /**< IPC host signature, Set by host/L2 */ + uint32_t ipc_geul_signature; /**< IPC geul signature, Set by modem */ + ipc_instance_t instance_list[IPC_MAX_INSTANCE_COUNT]; +} __rte_packed ipc_metadata_t; + +typedef struct ipc_channel_us_priv { + int32_t eventfd; + uint32_t channel_id; + /* In flight packets status for buffer list. */ + uint8_t bufs_inflight[IPC_MAX_DEPTH]; +} ipc_channel_us_t; + +typedef struct { + uint64_t host_phys; + uint32_t modem_phys; + uint32_t size; +} mem_strt_addr_t; + +typedef struct { + mem_strt_addr_t modem_ccsrbar; + mem_strt_addr_t peb_start; /* PEB meta data */ + mem_strt_addr_t mhif_start; /* MHIF meta daat */ + mem_strt_addr_t hugepg_start; /* Modem to access hugepage */ +} sys_map_t; + +typedef struct ipc_priv_t { + int instance_id; + int dev_ipc; + int dev_mem; + sys_map_t sys_map; + mem_range_t modem_ccsrbar; + mem_range_t peb_start; + mem_range_t mhif_start; + mem_range_t hugepg_start; + ipc_channel_us_t *channels[IPC_MAX_CHANNEL_COUNT]; + ipc_instance_t *instance; + ipc_instance_t *instance_bk; +} ipc_userspace_t; + +/** Structure specifying enqueue operation (enqueue at LA1224) */ +struct bbdev_ipc_enqueue_op { + /** Status of operation that was performed */ + int32_t status; + /** CRC Status of SD operation that was performed */ + int32_t crc_stat_addr; + /** HARQ Output buffer memory length for Shared Decode. + * Filled by LA12xx. + */ + uint32_t out_len; + /** Reserved (for 8 byte alignment) */ + uint32_t rsvd; +}; + /* This shared memory would be on the host side which have copy of some * of the parameters which are also part of Shared BD ring. Read access * of these parameters from the host side would not be over PCI. @@ -14,7 +187,21 @@ typedef struct host_ipc_params { volatile uint32_t pi; volatile uint32_t ci; - volatile uint32_t modem_ptr[IPC_MAX_DEPTH]; + volatile uint32_t bd_m_modem_ptr[IPC_MAX_DEPTH]; } __rte_packed host_ipc_params_t; +struct hif_ipc_regs { + uint32_t ipc_mdata_offset; + uint32_t ipc_mdata_size; +} __rte_packed; + +struct gul_hif { + uint32_t ver; + uint32_t hif_ver; + uint32_t status; + volatile uint32_t host_ready; + volatile uint32_t mod_ready; + struct hif_ipc_regs ipc_regs; +} __rte_packed; + #endif From patchwork Sun Sep 12 12:15:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 509489 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp2955288jai; Sun, 12 Sep 2021 05:16:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz97gneto+P3gu+p1mBQ4Vry0z6cAgzZYQiL2ZPwHyTAnTysve48mJ1k12I05TiTx025EnW X-Received: by 2002:a1c:984c:: with SMTP id a73mr6339329wme.171.1631448981571; Sun, 12 Sep 2021 05:16:21 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id l4si4722209wmi.152.2021.09.12.05.16.21; Sun, 12 Sep 2021 05:16:21 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=lc1zZwB3; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B7FDD41123; Sun, 12 Sep 2021 14:15:52 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60049.outbound.protection.outlook.com [40.107.6.49]) by mails.dpdk.org (Postfix) with ESMTP id 009EB41102 for ; Sun, 12 Sep 2021 14:15:49 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JnOAyF9huYtWNd8IdubaxoALKPo16wbMui072L16pbvBo9Iv2EJH05l+Z9pVqUMAwtr5opUlXY0uIrH/gkohySqYu/tBvLkTcQvrkzDcmmFlDvH4pEmaKwD1QsBJHRWrWdMo3TbUZILvexYCGeYH2FhlskrHIaX+67U17CXDTlaCJnpTOEYu0j8O7/XcYulWpSG4bxrnQS4tA5JudupnlXmiAmh5Jfj3yEJio59paqLtXqfOqUg0q7gPcmQ0cu/FIlom0xiSuygENf5W3AIsg5cMhlS+jhI8VHYnkG0Z/iekCRreqsu9ApWnWR97vgUVlozXJ4PoTSe/d29A8y04UQ== 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; bh=R89deySwMqtcWmwSVxpgP2+c/62KSQBIkRWA0OAUd7c=; b=L6XBM2Br92X3LXjRwdhSq4jgG4+c7vVBvzOzMlcBn3GVDLBSvnM6Aq4RMTIwiqw1rYe5rHZl/SewQNSpgjXRwsFN2xx1sC+c+S/DQta6zoJELg5y3A7jZKgRwk3xnhMqWCKFZ4aGv3fbXe07+nYaa5RD+ppF8JMcVXZMwT/U64aNptqWJSrfh9XFC5E9WAF2P/ous9CO7AUKYrCIeIJ6vH7F+WTO8jlAfn5DqcCKU0p9lsEPzv1C+xJejxmv8PaNE5qx2TXewHahdb3okR7WHRFUZr5Q1K2pMn+UhfbaC/+LVLW71ON/Z409DdPGHMp9t+OO0h37e6YAWWjxKC22Sg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R89deySwMqtcWmwSVxpgP2+c/62KSQBIkRWA0OAUd7c=; b=lc1zZwB3DAEfYHCn0Lq4l5ez0wBCxPPFpOV4KCxJkwyJzLG7X01xkwyrMptHuoOyT/26ZByOJUwVx58keGCrut85IsyYgaGpH+iXSFLP08yJWV69X5YXkb8v0oIPcQCA+sOe2TSYt+sbQN1/Pz1gh5wbZrZink3sqBAmFwzgGik= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) by DB7PR04MB4778.eurprd04.prod.outlook.com (2603:10a6:10:18::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.18; Sun, 12 Sep 2021 12:15:49 +0000 Received: from DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4]) by DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4%9]) with mapi id 15.20.4500.018; Sun, 12 Sep 2021 12:15:49 +0000 From: Nipun Gupta To: dev@dpdk.org, gakhil@marvell.com, nicolas.chautru@intel.com Cc: david.marchand@redhat.com, hemant.agrawal@nxp.com, Nipun Gupta Date: Sun, 12 Sep 2021 17:45:07 +0530 Message-Id: <20210912121510.22699-7-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210912121510.22699-1-nipun.gupta@nxp.com> References: <20210318063421.14895-1-hemant.agrawal@nxp.com> <20210912121510.22699-1-nipun.gupta@nxp.com> X-ClientProxiedBy: SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) To DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03274.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Sun, 12 Sep 2021 12:15:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 33508e24-c75f-41fc-aaff-08d975e70e60 X-MS-TrafficTypeDiagnostic: DB7PR04MB4778: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1060; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uijDthhHa+pjNx5WUdcRYm1tg1U01MaDTpGmBfOcNBujt93QlIgswx+HW8yU5usTQnjyp9txDw6mT8fKU8XxopY5OlKFrLGFJoglvDcIV2HQpS5tUUmWXuU41E9uZUmXjrAj8lwO3vUCUAxx7+nlkJxyL2bkzr7apVagHcqMOnoecwIffbI0cKsdJXHi62XdbWep1bf1VVDDo9KC6h9NptKIyhGpRGJ867k/UN+73+zkFxiAiuCC23vKzXFAtJxSGaJvCaLtYGeoat37yKTwI+bTc6juXmPiNZwF+2XOHzpwKaQL9PpCi7BHBk7mbkZfNSYOo1oeJ2Te7Ig9iBpn4cuFnHik5kIIxS7bu6F06v5OaHAXQvPxDZ+J+GU1adnBNtc4/aFS1VAL1RzOWt/fC8NADTiMhCgrX/mCXzTMTkiq8y5uI+ViAYm4bDKHomklfOSScfs+qtDiJte9MO523NANiAR+Deni8pVzTOmLDcbj7rF26IPIgQqVYWsKabxD+gpX9iV3IFx8vmkUTZSotneLSkqyMEf9ZokEOrxLXJOwx/Ud4voaexJ3pNDbE7Q1kLQKJFkk8azHgT2EQCxtNsIySKVcx0S/dJWQzrHyo/pNyyaQ3+/yOyJlijXfAYq/9sDTSeV178Y++3N6FsUH20Lp/dlOhWuoRoAbqO9iPPW5c8zWjQV062HgfZZttQVt3OhKsXnRbW8wAMbu92V0nAV9rl4wO/T+NgubUEwm02k= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR04MB8429.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(136003)(39860400002)(376002)(66946007)(36756003)(1076003)(66556008)(38350700002)(38100700002)(8676002)(8936002)(186003)(4326008)(956004)(2616005)(52116002)(6486002)(316002)(55236004)(86362001)(5660300002)(44832011)(30864003)(478600001)(1006002)(6666004)(83380400001)(7696005)(2906002)(26005)(66476007)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ruK76/hJ882TDeVnGTFmqXrCH+aBZVi3Vtl/o/2aLICcRzlydLwc99kOQMqSXZ3aj5Y96oOFfC5BMP1+Y8JdDjVqf5vVzfvt/ZWuuTpT+xi8HeQg1U/jgpia0rD9/tHuqLtfrl4/u2k1EWocBkkUNik+UlG2lkt7zjN0vBEn47clU4XfENzD3t6G4o1BwAqR/k7051DFsmZcCAWINcTWOdoH7U4tsuSyY5BvYetCTs2vpIR2HKNqdTWkybdqAvycnRxBTD2YbiFINf4bRg+SROksHQmNdK+Mb6TEDfNoLVos6vbMsd37Vt7QxBsAiPkWHVNZcYWCdq8gmg1nM4McUh41ESUW84wB4EHT+kPlN1q7t7YM8CVwNUva8sexgMqrKlwYCG631wXJac5JP+YGgltZbcTdxr+4N1CJ5ciC4Wq1VqREy0/T1a5NOfL557PIf7ZNqT3fvE9UPgNJERofmULMYUDqDiiPoHgezHR/jSInPem1XQnqcNpL+tDGqIIVZ8j/qRQup4jDmdTjc+VRottKdO+vxODRNMN6G+Kr7aGAL8crykvdP0/IW8mInolYmUb/PA9wWXJ4iyunLtunCdRRdL33xxZ9K2pIdPyvX5P4DUU7SFs5WQBIed1Fz+gyvqAzDAD1pEp29d86NKveDM4IF0iE68NMz9p9qc6ZdxjcnbwqIHSG4EjjJqd0f/rhO2L9He3zdkCfY0wadupnFfUFTU92oN3VUdFt62+QWfL8fxBb7VHbScoldNis/6TchM/ZYSODRUmAMIl8GKd6Sh8jsO1jmSYR4JtKjALL3eiIaa6O/8+m7n4NkZ4DzIkE4Qq+A0UDUKpZm/rIsF/dn+Vj7+DNoOGJ7jckhBA3KHvrIIsb/vJYVVtOAHrBe8X/hlTMx/fLwWCH0ddtkB/XDzFpUaSyK73PVvm0LkPLLuZnE3AiKiITZImKiEjOauqXsh1nENVfz6IZCIqsyRSrnw8M0E9D6kDs9WUs6eT64O0TwpvNSIEuAokMIvY4hYYnG+z4ixegez3JCbOfbasou0IQQ4D/lZfq54rHox+VVifyljLdGsviDBKR4B0HHf7BUAI/LTdnSV366FRJEPnmQu8UwZ63GqVqB3dIJhYtdOjuQG+78SZe4W6jWM47PPZoqCieqs80JWteBtN5U6wef7f0f1lEIorzFpNsWcv4iK/37vCR2hbLTS5DmUKBvz3ZJmes8d5c0S91WbOVa/gTwthrOeCkuEwC2d/chvseLgX2VtPtxU6qMuHtw4+/Vt+4uj/vxFxIzh20Wrv3E5rL+Ovku9qizW/+Pej18nMp4HzLzie9UU/vTeM2pZRgbELT X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33508e24-c75f-41fc-aaff-08d975e70e60 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8429.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2021 12:15:49.0146 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fdN00yco0afcUzIbCazpB/NfmX64Y2l/eJuYc5UCDVHpFOAT1lZ/GkSynrO9AeHmH45UilNiTD8Qk8/NUYrqgg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4778 Subject: [dpdk-dev] [PATCH v5 6/9] baseband/la12xx: add enqueue and dequeue support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Hemant Agrawal Add support for enqueue and dequeue the LDPC enc/dec from the modem device. Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- doc/guides/bbdevs/features/la12xx.ini | 14 + doc/guides/bbdevs/la12xx.rst | 46 +++ drivers/baseband/la12xx/bbdev_la12xx.c | 334 ++++++++++++++++++++- drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 37 +++ 4 files changed, 425 insertions(+), 6 deletions(-) create mode 100644 doc/guides/bbdevs/features/la12xx.ini -- 2.17.1 diff --git a/doc/guides/bbdevs/features/la12xx.ini b/doc/guides/bbdevs/features/la12xx.ini new file mode 100644 index 0000000000..412af99bad --- /dev/null +++ b/doc/guides/bbdevs/features/la12xx.ini @@ -0,0 +1,14 @@ +; +; Supported features of the 'la12xx' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Turbo Decoder (4G) = N +Turbo Encoder (4G) = N +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = N +HW Accelerated = Y +BBDEV API = Y +Big Endian Processing = Y diff --git a/doc/guides/bbdevs/la12xx.rst b/doc/guides/bbdevs/la12xx.rst index 3c9ac5c047..c39be0e51f 100644 --- a/doc/guides/bbdevs/la12xx.rst +++ b/doc/guides/bbdevs/la12xx.rst @@ -16,6 +16,8 @@ Features LA12xx PMD supports the following features: +- LDPC Encode in the DL +- LDPC Decode in the UL - Maximum of 8 UL queues - Maximum of 8 DL queues - PCIe Gen-3 x8 Interface @@ -79,3 +81,47 @@ For enabling logs, use the following EAL parameter: Using ``bb.la12xx`` as log matching criteria, all Baseband PMD logs can be enabled which are lower than logging ``level``. + +Test Application +---------------- + +BBDEV provides a test application, ``test-bbdev.py`` and range of test data for testing +the functionality of LA12xx for FEC encode and decode, depending on the device +capabilities. The test application is located under app->test-bbdev folder and has the +following options: + +.. code-block:: console + + "-p", "--testapp-path": specifies path to the bbdev test app. + "-e", "--eal-params" : EAL arguments which are passed to the test app. + "-t", "--timeout" : Timeout in seconds (default=300). + "-c", "--test-cases" : Defines test cases to run. Run all if not specified. + "-v", "--test-vector" : Test vector path (default=dpdk_path+/app/test-bbdev/test_vectors/bbdev_null.data). + "-n", "--num-ops" : Number of operations to process on device (default=32). + "-b", "--burst-size" : Operations enqueue/dequeue burst size (default=32). + "-s", "--snr" : SNR in dB used when generating LLRs for bler tests. + "-s", "--iter_max" : Number of iterations for LDPC decoder. + "-l", "--num-lcores" : Number of lcores to run (default=16). + "-i", "--init-device" : Initialise PF device with default values. + + +To execute the test application tool using simple decode or encode data, +type one of the following: + +.. code-block:: console + + ./test-bbdev.py -e="--vdev=baseband_la12xx,socket_id=0,max_nb_queues=8" -c validation -n 64 -b 1 -v ./ldpc_dec_default.data + ./test-bbdev.py -e="--vdev=baseband_la12xx,socket_id=0,max_nb_queues=8" -c validation -n 64 -b 1 -v ./ldpc_enc_default.data + +The test application ``test-bbdev.py``, supports the ability to configure the PF device with +a default set of values, if the "-i" or "- -init-device" option is included. The default values +are defined in test_bbdev_perf.c. + + +Test Vectors +~~~~~~~~~~~~ + +In addition to the simple LDPC decoder and LDPC encoder tests, bbdev also provides +a range of additional tests under the test_vectors folder, which may be useful. The results +of these tests will depend on the LA12xx FEC capabilities which may cause some +testcases to be skipped, but no failure should be reported. diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index 57e957a93a..1f64ee9b1e 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -54,7 +54,8 @@ static const struct rte_bbdev_op_cap bbdev_capabilities[] = { .cap.ldpc_enc = { .capability_flags = RTE_BBDEV_LDPC_CRC_24A_ATTACH | - RTE_BBDEV_LDPC_CRC_24B_ATTACH, + RTE_BBDEV_LDPC_CRC_24B_ATTACH | + RTE_BBDEV_LDPC_ENC_BIG_ENDIAN, .num_buffers_src = RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, .num_buffers_dst = @@ -67,7 +68,8 @@ static const struct rte_bbdev_op_cap bbdev_capabilities[] = { .capability_flags = RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK | RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK | - RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP, + RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP | + RTE_BBDEV_LDPC_DEC_BIG_ENDIAN, .num_buffers_src = RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, .num_buffers_hard_out = @@ -122,6 +124,10 @@ la12xx_queue_release(struct rte_bbdev *dev, uint16_t q_id) ((uint64_t) ((unsigned long) (A) \ - ((uint64_t)ipc_priv->hugepg_start.host_vaddr))) +#define MODEM_P2V(A) \ + ((uint64_t) ((unsigned long) (A) \ + + (unsigned long)(ipc_priv->peb_start.host_vaddr))) + static int ipc_queue_configure(uint32_t channel_id, ipc_t instance, struct bbdev_la12xx_q_priv *q_priv) { @@ -336,6 +342,318 @@ static const struct rte_bbdev_ops pmd_ops = { .queue_release = la12xx_queue_release, .start = la12xx_start }; + +static inline int +is_bd_ring_full(uint32_t ci, uint32_t ci_flag, + uint32_t pi, uint32_t pi_flag) +{ + if (pi == ci) { + if (pi_flag != ci_flag) + return 1; /* Ring is Full */ + } + return 0; +} + +static inline int +prepare_ldpc_enc_op(struct rte_bbdev_enc_op *bbdev_enc_op, + struct bbdev_la12xx_q_priv *q_priv __rte_unused, + struct rte_bbdev_op_data *in_op_data __rte_unused, + struct rte_bbdev_op_data *out_op_data) +{ + struct rte_bbdev_op_ldpc_enc *ldpc_enc = &bbdev_enc_op->ldpc_enc; + uint32_t total_out_bits; + + total_out_bits = (ldpc_enc->tb_params.cab * + ldpc_enc->tb_params.ea) + (ldpc_enc->tb_params.c - + ldpc_enc->tb_params.cab) * ldpc_enc->tb_params.eb; + + ldpc_enc->output.length = (total_out_bits + 7)/8; + + rte_pktmbuf_append(out_op_data->data, ldpc_enc->output.length); + + return 0; +} + +static inline int +prepare_ldpc_dec_op(struct rte_bbdev_dec_op *bbdev_dec_op, + struct bbdev_ipc_dequeue_op *bbdev_ipc_op, + struct bbdev_la12xx_q_priv *q_priv __rte_unused, + struct rte_bbdev_op_data *out_op_data __rte_unused) +{ + struct rte_bbdev_op_ldpc_dec *ldpc_dec = &bbdev_dec_op->ldpc_dec; + uint32_t total_out_bits; + uint32_t num_code_blocks = 0; + uint16_t sys_cols; + + sys_cols = (ldpc_dec->basegraph == 1) ? 22 : 10; + if (ldpc_dec->tb_params.c == 1) { + total_out_bits = ((sys_cols * ldpc_dec->z_c) - + ldpc_dec->n_filler); + /* 5G-NR protocol uses 16 bit CRC when output packet + * size <= 3824 (bits). Otherwise 24 bit CRC is used. + * Adjust the output bits accordingly + */ + if (total_out_bits - 16 <= 3824) + total_out_bits -= 16; + else + total_out_bits -= 24; + ldpc_dec->hard_output.length = (total_out_bits / 8); + } else { + total_out_bits = (((sys_cols * ldpc_dec->z_c) - + ldpc_dec->n_filler - 24) * + ldpc_dec->tb_params.c); + ldpc_dec->hard_output.length = (total_out_bits / 8) - 3; + } + + num_code_blocks = ldpc_dec->tb_params.c; + + bbdev_ipc_op->num_code_blocks = rte_cpu_to_be_32(num_code_blocks); + + return 0; +} + +static int +enqueue_single_op(struct bbdev_la12xx_q_priv *q_priv, void *bbdev_op) +{ + struct bbdev_la12xx_private *priv = q_priv->bbdev_priv; + ipc_userspace_t *ipc_priv = priv->ipc_priv; + ipc_instance_t *ipc_instance = ipc_priv->instance; + struct bbdev_ipc_dequeue_op *bbdev_ipc_op; + struct rte_bbdev_op_ldpc_enc *ldpc_enc; + struct rte_bbdev_op_ldpc_dec *ldpc_dec; + uint32_t q_id = q_priv->q_id; + uint32_t ci, ci_flag, pi, pi_flag; + ipc_ch_t *ch = &(ipc_instance->ch_list[q_id]); + ipc_br_md_t *md = &(ch->md); + size_t virt; + char *huge_start_addr = + (char *)q_priv->bbdev_priv->ipc_priv->hugepg_start.host_vaddr; + struct rte_bbdev_op_data *in_op_data, *out_op_data; + char *data_ptr; + uint32_t l1_pcie_addr; + int ret; + + ci = IPC_GET_CI_INDEX(q_priv->host_ci); + ci_flag = IPC_GET_CI_FLAG(q_priv->host_ci); + + pi = IPC_GET_PI_INDEX(q_priv->host_pi); + pi_flag = IPC_GET_PI_FLAG(q_priv->host_pi); + + rte_bbdev_dp_log(DEBUG, "before bd_ring_full: pi: %u, ci: %u," + "pi_flag: %u, ci_flag: %u, ring size: %u", + pi, ci, pi_flag, ci_flag, q_priv->queue_size); + + if (is_bd_ring_full(ci, ci_flag, pi, pi_flag)) { + rte_bbdev_dp_log(DEBUG, "bd ring full for queue id: %d", q_id); + return IPC_CH_FULL; + } + + virt = MODEM_P2V(q_priv->host_params->bd_m_modem_ptr[pi]); + bbdev_ipc_op = (struct bbdev_ipc_dequeue_op *)virt; + q_priv->bbdev_op[pi] = bbdev_op; + + switch (q_priv->op_type) { + case RTE_BBDEV_OP_LDPC_ENC: + ldpc_enc = &(((struct rte_bbdev_enc_op *)bbdev_op)->ldpc_enc); + in_op_data = &ldpc_enc->input; + out_op_data = &ldpc_enc->output; + + ret = prepare_ldpc_enc_op(bbdev_op, q_priv, + in_op_data, out_op_data); + if (ret) { + rte_bbdev_log(ERR, "process_ldpc_enc_op fail, ret: %d", + ret); + return ret; + } + break; + + case RTE_BBDEV_OP_LDPC_DEC: + ldpc_dec = &(((struct rte_bbdev_dec_op *)bbdev_op)->ldpc_dec); + in_op_data = &ldpc_dec->input; + + out_op_data = &ldpc_dec->hard_output; + + ret = prepare_ldpc_dec_op(bbdev_op, bbdev_ipc_op, + q_priv, out_op_data); + if (ret) { + rte_bbdev_log(ERR, "process_ldpc_dec_op fail, ret: %d", + ret); + return ret; + } + break; + + default: + rte_bbdev_log(ERR, "unsupported bbdev_ipc op type"); + return -1; + } + + if (in_op_data->data) { + data_ptr = rte_pktmbuf_mtod(in_op_data->data, char *); + l1_pcie_addr = (uint32_t)GUL_USER_HUGE_PAGE_ADDR + + data_ptr - huge_start_addr; + bbdev_ipc_op->in_addr = l1_pcie_addr; + bbdev_ipc_op->in_len = in_op_data->length; + } + + if (out_op_data->data) { + data_ptr = rte_pktmbuf_mtod(out_op_data->data, char *); + l1_pcie_addr = (uint32_t)GUL_USER_HUGE_PAGE_ADDR + + data_ptr - huge_start_addr; + bbdev_ipc_op->out_addr = rte_cpu_to_be_32(l1_pcie_addr); + bbdev_ipc_op->out_len = rte_cpu_to_be_32(out_op_data->length); + } + + /* Move Producer Index forward */ + pi++; + /* Flip the PI flag, if wrapping */ + if (unlikely(q_priv->queue_size == pi)) { + pi = 0; + pi_flag = pi_flag ? 0 : 1; + } + + if (pi_flag) + IPC_SET_PI_FLAG(pi); + else + IPC_RESET_PI_FLAG(pi); + q_priv->host_pi = pi; + + /* Wait for Data Copy & pi_flag update to complete before updating pi */ + rte_mb(); + /* now update pi */ + md->pi = rte_cpu_to_be_32(pi); + + rte_bbdev_dp_log(DEBUG, "enter: pi: %u, ci: %u," + "pi_flag: %u, ci_flag: %u, ring size: %u", + pi, ci, pi_flag, ci_flag, q_priv->queue_size); + + return 0; +} + +/* Enqueue decode burst */ +static uint16_t +enqueue_dec_ops(struct rte_bbdev_queue_data *q_data, + struct rte_bbdev_dec_op **ops, uint16_t nb_ops) +{ + struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; + int nb_enqueued, ret; + + for (nb_enqueued = 0; nb_enqueued < nb_ops; nb_enqueued++) { + ret = enqueue_single_op(q_priv, ops[nb_enqueued]); + if (ret) + break; + } + + q_data->queue_stats.enqueue_err_count += nb_ops - nb_enqueued; + q_data->queue_stats.enqueued_count += nb_enqueued; + + return nb_enqueued; +} + +/* Enqueue encode burst */ +static uint16_t +enqueue_enc_ops(struct rte_bbdev_queue_data *q_data, + struct rte_bbdev_enc_op **ops, uint16_t nb_ops) +{ + struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; + int nb_enqueued, ret; + + for (nb_enqueued = 0; nb_enqueued < nb_ops; nb_enqueued++) { + ret = enqueue_single_op(q_priv, ops[nb_enqueued]); + if (ret) + break; + } + + q_data->queue_stats.enqueue_err_count += nb_ops - nb_enqueued; + q_data->queue_stats.enqueued_count += nb_enqueued; + + return nb_enqueued; +} + +/* Dequeue encode burst */ +static void * +dequeue_single_op(struct bbdev_la12xx_q_priv *q_priv, void *dst) +{ + void *op; + uint32_t ci, ci_flag; + uint32_t temp_ci; + + temp_ci = q_priv->host_params->ci; + if (temp_ci == q_priv->host_ci) + return NULL; + + ci = IPC_GET_CI_INDEX(q_priv->host_ci); + ci_flag = IPC_GET_CI_FLAG(q_priv->host_ci); + + rte_bbdev_dp_log(DEBUG, + "ci: %u, ci_flag: %u, ring size: %u", + ci, ci_flag, q_priv->queue_size); + + op = q_priv->bbdev_op[ci]; + + rte_memcpy(dst, q_priv->msg_ch_vaddr[ci], + sizeof(struct bbdev_ipc_enqueue_op)); + + /* Move Consumer Index forward */ + ci++; + /* Flip the CI flag, if wrapping */ + if (q_priv->queue_size == ci) { + ci = 0; + ci_flag = ci_flag ? 0 : 1; + } + if (ci_flag) + IPC_SET_CI_FLAG(ci); + else + IPC_RESET_CI_FLAG(ci); + + q_priv->host_ci = ci; + + rte_bbdev_dp_log(DEBUG, + "exit: ci: %u, ci_flag: %u, ring size: %u", + ci, ci_flag, q_priv->queue_size); + + return op; +} + +/* Dequeue decode burst */ +static uint16_t +dequeue_dec_ops(struct rte_bbdev_queue_data *q_data, + struct rte_bbdev_dec_op **ops, uint16_t nb_ops) +{ + struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; + struct bbdev_ipc_enqueue_op bbdev_ipc_op; + int nb_dequeued; + + for (nb_dequeued = 0; nb_dequeued < nb_ops; nb_dequeued++) { + ops[nb_dequeued] = dequeue_single_op(q_priv, &bbdev_ipc_op); + if (!ops[nb_dequeued]) + break; + ops[nb_dequeued]->status = bbdev_ipc_op.status; + } + q_data->queue_stats.dequeued_count += nb_dequeued; + + return nb_dequeued; +} + +/* Dequeue encode burst */ +static uint16_t +dequeue_enc_ops(struct rte_bbdev_queue_data *q_data, + struct rte_bbdev_enc_op **ops, uint16_t nb_ops) +{ + struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; + struct bbdev_ipc_enqueue_op bbdev_ipc_op; + int nb_enqueued; + + for (nb_enqueued = 0; nb_enqueued < nb_ops; nb_enqueued++) { + ops[nb_enqueued] = dequeue_single_op(q_priv, &bbdev_ipc_op); + if (!ops[nb_enqueued]) + break; + ops[nb_enqueued]->status = bbdev_ipc_op.status; + } + q_data->queue_stats.enqueued_count += nb_enqueued; + + return nb_enqueued; +} + static struct hugepage_info * get_hugepage_info(void) { @@ -709,10 +1027,14 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev, bbdev->intr_handle = NULL; /* register rx/tx burst functions for data path */ - bbdev->dequeue_enc_ops = NULL; - bbdev->dequeue_dec_ops = NULL; - bbdev->enqueue_enc_ops = NULL; - bbdev->enqueue_dec_ops = NULL; + bbdev->dequeue_enc_ops = dequeue_enc_ops; + bbdev->dequeue_dec_ops = dequeue_dec_ops; + bbdev->enqueue_enc_ops = enqueue_enc_ops; + bbdev->enqueue_dec_ops = enqueue_dec_ops; + bbdev->dequeue_ldpc_enc_ops = dequeue_enc_ops; + bbdev->dequeue_ldpc_dec_ops = dequeue_dec_ops; + bbdev->enqueue_ldpc_enc_ops = enqueue_enc_ops; + bbdev->enqueue_ldpc_dec_ops = enqueue_dec_ops; return 0; } diff --git a/drivers/baseband/la12xx/bbdev_la12xx_ipc.h b/drivers/baseband/la12xx/bbdev_la12xx_ipc.h index 5f613fb087..b6a7f677d0 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx_ipc.h +++ b/drivers/baseband/la12xx/bbdev_la12xx_ipc.h @@ -73,6 +73,25 @@ typedef struct { _IOWR(GUL_IPC_MAGIC, 5, struct ipc_msg *) #define IOCTL_GUL_IPC_CHANNEL_RAISE_INTERRUPT _IOW(GUL_IPC_MAGIC, 6, int *) +#define GUL_USER_HUGE_PAGE_OFFSET (0) +#define GUL_PCI1_ADDR_BASE (0x00000000ULL) + +#define GUL_USER_HUGE_PAGE_ADDR (GUL_PCI1_ADDR_BASE + GUL_USER_HUGE_PAGE_OFFSET) + +/* IPC PI/CI index & flag manipulation helpers */ +#define IPC_PI_CI_FLAG_MASK 0x80000000 /* (1<<31) */ +#define IPC_PI_CI_INDEX_MASK 0x7FFFFFFF /* ~(1<<31) */ + +#define IPC_SET_PI_FLAG(x) (x |= IPC_PI_CI_FLAG_MASK) +#define IPC_RESET_PI_FLAG(x) (x &= IPC_PI_CI_INDEX_MASK) +#define IPC_GET_PI_FLAG(x) (x >> 31) +#define IPC_GET_PI_INDEX(x) (x & IPC_PI_CI_INDEX_MASK) + +#define IPC_SET_CI_FLAG(x) (x |= IPC_PI_CI_FLAG_MASK) +#define IPC_RESET_CI_FLAG(x) (x &= IPC_PI_CI_INDEX_MASK) +#define IPC_GET_CI_FLAG(x) (x >> 31) +#define IPC_GET_CI_INDEX(x) (x & IPC_PI_CI_INDEX_MASK) + /** buffer ring common metadata */ typedef struct ipc_bd_ring_md { volatile uint32_t pi; /**< Producer index and flag (MSB) @@ -180,6 +199,24 @@ struct bbdev_ipc_enqueue_op { uint32_t rsvd; }; +/** Structure specifying dequeue operation (dequeue at LA1224) */ +struct bbdev_ipc_dequeue_op { + /** Input buffer memory address */ + uint32_t in_addr; + /** Input buffer memory length */ + uint32_t in_len; + /** Output buffer memory address */ + uint32_t out_addr; + /** Output buffer memory length */ + uint32_t out_len; + /* Number of code blocks. Only set when HARQ is used */ + uint32_t num_code_blocks; + /** Dequeue Operation flags */ + uint32_t op_flags; + /** Shared metadata between L1 and L2 */ + uint32_t shared_metadata; +}; + /* This shared memory would be on the host side which have copy of some * of the parameters which are also part of Shared BD ring. Read access * of these parameters from the host side would not be over PCI. From patchwork Sun Sep 12 12:15:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 509490 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp2955365jai; Sun, 12 Sep 2021 05:16:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMqsLPHuDXVBGx9t+wYFAd0U0XPqanPUYGBaWq7v4wJi7LEzr38eSiYr6IBPvEQ1sJg64C X-Received: by 2002:a05:600c:4109:: with SMTP id j9mr6602240wmi.88.1631448989235; Sun, 12 Sep 2021 05:16:29 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id 135si4490030wme.73.2021.09.12.05.16.29; Sun, 12 Sep 2021 05:16:29 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=oBT+d+or; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 50B8041139; Sun, 12 Sep 2021 14:15:54 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70075.outbound.protection.outlook.com [40.107.7.75]) by mails.dpdk.org (Postfix) with ESMTP id 8419C41120 for ; Sun, 12 Sep 2021 14:15:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MWFe6QNiPd7Fg4fpc4P9xzcBaDPr1K56DnO7anVrOQ638dLUuymNncxjlRdROMRf4p43VzVi+Lvc3UCw7I7gE9hi0lzaP8vk0AwDe/G2ZxOHSWdC3O/Q/7xENuUNb0SQ3wW+53X6tvVGxw2TpGksZ3gGdzdQvWR/jXPA90Sdo97YW2aJ4tLUXR8IJYZrx5u8e3QPU8aY2NFjh2KdBeIlgn2dP+kXlZ5lLndm63Us3M9kHGJddgNTRdm2Lln7sURS9PaYidwZ/XYkF/XamSSyUv65hQgKsPbhff04+3vAYUeV7n/8RnidEHFHMg4hx8ps5LgT/J/eyl7qJYGBpNPTuA== 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; bh=/IrUaxIfufBaEiUqnVH6Iq1wPsf3swie/0bL0qOJKVM=; b=J+dz5A4tWQA39ed1ohOMoK8u9+pZrO1keZT6fWVOzVl7gcPdTsVcco7LfN8okWaeVhuOQk2eAWy9af2NzIKmFm1r4ms7HJjnGJOkVsOmheMFcAGQ3k5+X7vIYgfCPr9yQqWkhtQoEs3nrRwWdwffKk/UoKdtOw3OOddD02oRweSVdR3PtsgHI0mSU0J5TPUQOZ4lHQ2ibW53SxiZirSpbFZjv5+tOCCkXv4vS0r1J7o629U4KiRMsqMmIGhnM3MHIUQ7qJALF3MKBfudW7ATFiW3qSg+/jvDkbD+GPz3Iq/TmM8suv1DAfG7p+F2HFmsOjDSl0p9FfbW35QPtJvoTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/IrUaxIfufBaEiUqnVH6Iq1wPsf3swie/0bL0qOJKVM=; b=oBT+d+or0pKDN5cHL6Y16QVy2JdAOfjdx3e1E6X/qWS02PX1zQPLylnzXnAxDqAeXLYQva19GJya+H0oEP+Hhvl7Px/R+h2eoPd/vQ12EVjufSMvLOu5CwkFw22/MGNM7I1jIPXsOkwMY6wbaBsDoytBOAosb7Ki1mXWJMu/3ag= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) by DB9PR04MB8202.eurprd04.prod.outlook.com (2603:10a6:10:24f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.17; Sun, 12 Sep 2021 12:15:51 +0000 Received: from DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4]) by DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4%9]) with mapi id 15.20.4500.018; Sun, 12 Sep 2021 12:15:51 +0000 From: Nipun Gupta To: dev@dpdk.org, gakhil@marvell.com, nicolas.chautru@intel.com Cc: david.marchand@redhat.com, hemant.agrawal@nxp.com Date: Sun, 12 Sep 2021 17:45:08 +0530 Message-Id: <20210912121510.22699-8-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210912121510.22699-1-nipun.gupta@nxp.com> References: <20210318063421.14895-1-hemant.agrawal@nxp.com> <20210912121510.22699-1-nipun.gupta@nxp.com> X-ClientProxiedBy: SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) To DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03274.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Sun, 12 Sep 2021 12:15:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bb141bd1-eef5-4ff3-91bf-08d975e70f7f X-MS-TrafficTypeDiagnostic: DB9PR04MB8202: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1201; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: htmrd7pM0QeQF+TOAX+JICxTNIrf2FUeLvTOFb7sHGCwB5shgCpNmncAfYl+rU4qY6MEfj6SsQ/47zKBIVpwBNIA3/KgB14EVskMlENkXCERuiRDu2JZ5jEmy4+NXd+UDOHeFk1XacqVbG7xAkFhZYseGbwuzQfX9EJRoz5+8zsAduOFSrh+E/4fzxZHaU0tGnh/YCim2+q0ajXeIPra25U+ODcLsQgqdh60YZe7GvQUky7EpvyUSA17nSf5RnaBBnuMCKXx0qssLQOqDvrMPYbUIQhksGA1zRTYsJB1ErpFFnRVHW6CBgaxLS3mchcxk7yKPUDZMvz5FJxO8SKdkbyosRhX8ak9RoczvX3HMd9SvSnvuBC0MeaBRV/NvuvApgRefR1orFLlHdb1zjURTnUwtI6LC889XnllsJH4pqC9tu64y3ntVEXeNeG7F5n6e3aGpvh7UdrdsD9B4pO0KNLfHSgpMwIzXJhSE1S6OZCkMnOd0TjxhNQ+M1em1Q39tQTWsdMK38Cj0T0XRZ6MNpS5ZrOvNsUO04UT2g6IHdQnpxABmlaLeythpeQuLwUNOnzmOfXo2rrNxtCpuZ8/qgb0uyLfFrB4ZtNx6+wteKq7GzRjUCgawo49B5b6bAsQzOoSGflfDGFsuElcZCylsSWFRJ3imVFeryUDcfMBCojU9l9EISezs/VG+bTAuutZ0eH0HKwXXgTsfBk17Ywv88lBvAx9wHc8OBTYMc6el2k= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR04MB8429.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(346002)(366004)(396003)(376002)(39860400002)(4326008)(1006002)(2616005)(956004)(6666004)(66946007)(5660300002)(36756003)(38100700002)(38350700002)(8936002)(186003)(26005)(2906002)(478600001)(44832011)(55236004)(86362001)(6486002)(1076003)(52116002)(4744005)(7696005)(8676002)(316002)(66556008)(66476007)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5UMf/6ZPMlWYlGX6RAMYnyJVpLY3s8WElrIqRFT6N5l7y9msMSuQ7lNaObieodFxgHGDjvOKggkB3lcVWegpvK2n62lpEIReSEaM8rJgZacVRXcpFijfdi3qbIxgxKOXcrQoFWDe54jC1pNCVLoebZhCqorWBT8wwehzNlHSM4vA8CrlM+uRkPqoUbVsQDEalaz66J25lxfJ4X/E+QSOO2s+LnodpMLlvjBA/gnzLabNYsl8/Sp2zmlLk2K2hOui/2/4I0G77fCU2M6DBdnqAvzG4PI1IkOCQ4HaYBgUbm+fnMh2v12/rPkvK2rPgyC9PAJmeYxMvR+s5x+ofHnWLVwDpcThGnhV3ImpzrPsIfUicslmkkPC23zAuSBulICX+PXYqQ8AKkZWOGfU7Em6e9BG7iOwo8cxD/or0+EvG+S47TUb0H/T4+BBhPQNgPd+/7erwly1l75J/z0kin7MtxuAkxlcixefbDxMmM9xoI5dQCUAVAs6nYJnK0Pme89LoKEVd9cL3mUslijeSy7A2pOKnQ4BlhjyzGVKnsaNvHUfltJ+oSVK3gCTx50Yh/XOu7ZCGlMx7ZfVQ3LXPnLXGj4QR+2p9dGatRauO4UU0n15U9gL2IV7BQErj44mZhT8VEneEJqOwW6V53DO1zs/v/eC75Daurd9NkX+iJs5BFt3VnZld4If26iQv/gWbhGfBf7oy/92bpsbbxEDFgY7txTIfctX8fJMuJJ9TBZUL5/StXtiBtJ9zFT9vKGgudODBM/5sTSPcGjH6tiiUn02Vu39r286R6dDSTMbcahLBmKj6OB+r90DrFelCog7bgoyMYsYstENefxHbQ46qjh7ZtJT+8A8W2Wq7MMRFehRo1cjOuJauiPVuRY+5ncbFIw40sYm65Tsh/cURxo6juSQglKOM5/hk+35pfRuWD2YvD+FcLgyCJ/7xUyPPf1XhEHPVKIJoRpheu1GB6iT9M/fpuuvPNdew38GlSWCBaAD1x/Ho2MVbVY3lLICq7U1pu86UQTyHx3j3Gr0lNBF0DcgdK/iOwCRZF6yWX+l8m942648sdgxGqjcYEZ3kFPVeJwH3bxxUkG6ezMR8yiTd4C7SL4gqcP0qYV2cmKy1JgB44oZuePtjumNeSYZXy4ICMD6aeBsnvsi/7z+on/R1uRHOlMMnX/DIAWY58wrxyOjwjXTeCLORyMsQovlyrn5tH66OsS8RkFZxDcpP60Zj6G8RrhfqVVgOwCgDkLkDfvosTIU0hDqbAJxY0UjEnLlKyqHxRRcVHVdOZdC3pQ0ntGCyIgxQAY0bS+GEP5uDYik+k9EYNVlFNged2n/Gihy2JCq X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb141bd1-eef5-4ff3-91bf-08d975e70f7f X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8429.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2021 12:15:51.0436 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lyiXVaTtLKxKnjfP4heQk4pp9LD8W3Wb3d1S+od87UCNpv7s+TJjZs+8gcGXsY53+p6Sli9NKlzg7Eav5VfvpA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8202 Subject: [dpdk-dev] [PATCH v5 7/9] app/bbdev: enable la12xx for bbdev X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Hemant Agrawal this patch adds la12xx driver in test bbdev Signed-off-by: Hemant Agrawal --- app/test-bbdev/meson.build | 3 +++ 1 file changed, 3 insertions(+) -- 2.17.1 diff --git a/app/test-bbdev/meson.build b/app/test-bbdev/meson.build index edb9deef84..a726a5b3fa 100644 --- a/app/test-bbdev/meson.build +++ b/app/test-bbdev/meson.build @@ -23,3 +23,6 @@ endif if dpdk_conf.has('RTE_BASEBAND_ACC100') deps += ['baseband_acc100'] endif +if dpdk_conf.has('RTE_LIBRTE_PMD_BBDEV_LA12XX') + deps += ['baseband_la12xx'] +endif From patchwork Sun Sep 12 12:15:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 509491 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp2955423jai; Sun, 12 Sep 2021 05:16:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySOV73RjHISXCjJ5q23P0VOc5Bu1xZmZtT4opmR6EAR0L7Cse073hCId3aAaKixQgOzFz4 X-Received: by 2002:aa7:c81a:: with SMTP id a26mr7712611edt.323.1631448995076; Sun, 12 Sep 2021 05:16:35 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id de41si4037139ejc.244.2021.09.12.05.16.34; Sun, 12 Sep 2021 05:16:35 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=fA4ngDpS; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 777D14113D; Sun, 12 Sep 2021 14:15:55 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70053.outbound.protection.outlook.com [40.107.7.53]) by mails.dpdk.org (Postfix) with ESMTP id D4C1741125 for ; Sun, 12 Sep 2021 14:15:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EWrMg83WO8qRZibVWo3C74iVooeBn2AnUuEiRLDaGUXEkoYzutQFOVIOAj/67jweLuwDzvqBfFUe+B5ofNaA+g5SwouL/TZd4mmCAdEbdpTFTfAYDc8DcNCSjzlawgo61nKoGwoVqv9oMUZQxGw8+KHqpKrLfdwloVlwS+IuGWmJwY9JY5EJvozP+hOaIGpUpgJbtNoEVlSZyyzx6IRtNmZHFxfvtXBPRH+edoEpLAuLglzZyUKfxR7GJ4BsBtaVY4QbTcQ6mOH7ygAQ6jNvFE1dyTJXDHNveHig/uAr7nQee30WX3pM4FDiNzPMvCzydI2qwLdrWMLeZuBH4FVKUA== 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; bh=hXBhgOSdoSpvoyWlG7QuY3kZIY4yKaLaxfPcm1FYNbE=; b=A535Yqt5+XieJb/zlq5d2wdBuu6DiIzNEBsigS+saS3X4iDK/oGkU6Gas0fXwLPXa2LGxjlYfsci8C+lVff/6BG1q14oJNHyvEPV4rcdqae3y27moVCVfloUcrvPJhLn/nrf7YFSJtN+egyfiMWEgMtv4KIR/Vlg5lFtgWpjWcJwA3p3ucXDac9aOT/goWSnrDQsR60zReYEcBvIsqVeMitjqiVxXaSRWqyKU7CZMY+Q848WhRj+y9V+YHxF4TZjSHmg+X0DDGXsFIuyJvuEUuQcO7FUwvKjiV1cwwRRA1EudZsgByB4huyM0wrjAZ61gQjbmlTCPqbEBu3NWFhfZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hXBhgOSdoSpvoyWlG7QuY3kZIY4yKaLaxfPcm1FYNbE=; b=fA4ngDpSh7Yda3W1I3ecrcdSsC6lbHYT1axJ8ufmpznDQzlcI/hFe9hym9kYG4EStbdLIssFDblSEiGhkLQVKNdhu0LXMY5Uu/Np8+pX6Ejg2H68V1ihLuqqIlqBj0lPHfE9ULcT/0MmcE40v/NvfGTXk7Q/D8lMcsuVXLPQo+k= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) by DB9PR04MB8202.eurprd04.prod.outlook.com (2603:10a6:10:24f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.17; Sun, 12 Sep 2021 12:15:53 +0000 Received: from DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4]) by DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4%9]) with mapi id 15.20.4500.018; Sun, 12 Sep 2021 12:15:53 +0000 From: Nipun Gupta To: dev@dpdk.org, gakhil@marvell.com, nicolas.chautru@intel.com Cc: david.marchand@redhat.com, hemant.agrawal@nxp.com, Nipun Gupta Date: Sun, 12 Sep 2021 17:45:09 +0530 Message-Id: <20210912121510.22699-9-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210912121510.22699-1-nipun.gupta@nxp.com> References: <20210318063421.14895-1-hemant.agrawal@nxp.com> <20210912121510.22699-1-nipun.gupta@nxp.com> X-ClientProxiedBy: SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) To DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03274.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Sun, 12 Sep 2021 12:15:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a1425a98-f164-4cc9-b4ce-08d975e710d4 X-MS-TrafficTypeDiagnostic: DB9PR04MB8202: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aJrfdMy90pTi4EoFg1Cvwa85uWuVXri+fkz8QlkU/DH+BR1vRnnLckrS3Au0qZG3e1HsnIXzQZCX57uPIOyq82GlHb7NF7OlDdU+67HaSKdlEd1sOY6Lmj3dgtWyo6sPdAAMu8IiRGcLPK67HTJcCxWNzqJYfNRhBVP/ji2/TW3Phd6LssLfNAEwBWLKsNOuC+mdNjYaz3Oso6f6uvmH91m3g091HwXcDfAARbTsaEFTRaCjgaTBWEKLQ4OFviQpnqWU1ucfsvj6DTXk4WkQUj2PCmfXJLJ3nokL7SvuAakZH7emwaRBGyYitETBzbcRikaPkPjkyPaoISo/BbTtjvl4LwFFpRIhEtatcwHj+ddTR1kB5mInCIgrVXfC4aYdueRkLLg0QEX9RonaC1VNo5ubdrW/DPUJetBZi95BC62q7x6U0pR4sc543WkkwJjDwWBIwMLXkvYectMNeUKyiYDIvEoK/q3ZEPso4+e1O27awf1/eqiUEBEIO/Q1Gq6sReSl56mwsnakq7o1ln3MV0a5jQ1EM44npK7AazFtk0b7o7VieZ5RrPYDg7uoKJ6poI1a0sStn5BF79zZp/FlYgC7bk7VEafFuofK9HzGag/l9H+jYL69sA3w+IKyttrwHFSzzR7tc7caXW6pqq5panK6p7Vdfn2Hxi8vrUXZCXKtS7UpFYDQtAjIPDa3yKKld6+eOwQdN16u56w2sUOMs3B6DBTJgo0O4bS1EMy9Bh4= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR04MB8429.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(346002)(366004)(396003)(376002)(39860400002)(4326008)(1006002)(2616005)(956004)(6666004)(66946007)(5660300002)(83380400001)(36756003)(38100700002)(38350700002)(8936002)(186003)(26005)(2906002)(478600001)(44832011)(55236004)(86362001)(6486002)(1076003)(52116002)(7696005)(8676002)(316002)(66556008)(66476007)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GMswOrn14jRjTct1Q4v9HZTki4sNrLrVq3hRV588qdJx15e1yBzwaaXTfkhuCgGOlf9S3VOW+A5mV79QThIWJXLDGm8odEbS+w3wZyBu+5ulT347FAwrgK/D2rsx7XdS6052OMe9sun5bfHO3as9g5jABDH8KRxrQ66aFeRSgjLbHOldAv9cZizxwZ/djZyKohz1y+RSaHhx2dtqGEU+2uu4R6WAbB+Q2QhME4noeGe+uAVrESycgZZSY1lpBkEFujfnRRlavfvndBv4Ve1KF6flvZUC4kl9aNCDKKDHcWWWd03W4lQ0vhHsnXoaDoEz0BOTHsTpaNzVM0NvXA4vJp925FxYd7x7YKuPAr8t0/MEw8aZGPhNrErkfVIMqoeC9dZRuaOFTcNZiPHzv5OfgI9yiw6PKhDNlmavt0x/jKFXG69ZuXO9nS7Vyc2FExnEeH3st+tmPqYXPIgR/y60MYi4BTUKXjG10XC+ZX9FttCRaY2IDgy1oZmfWgOzPX55Rjct5/w0smtR4I/ukfPsh9WfnENyKDkOpX4j33UEN/gs6omM0ixrPMs6V/hTQGvSLVrS9Wczl95FeiiiyuzrJNtoxssaBVm4Dc3ck3438dkpmNEfX9X+OP4juC4OrmHhjvdEfLt3NGGjw0Tv8Wh6isptQNDgFu14jJEhJutwaI2sfSMv+ZljLgFOHN5/61iNthD53jS7+J/rq26ij7exRcTR42wRVAcKfJ1lVCu6kL+6Y4XNQdme4gEdi8cxKB5smwWYvvFbFun4hkAJ1VWeE/NYHVQ6VYWpG6ZxL0nPUMKgtJnysqQ6f31YmH8x3957Vlhi/3slyN2tcWk3jmrdf9m6nFFzwiFm0tV5NzPqwHlEPNa7bZX1QYHihBbydeWOM2UllpDzge4pOm8nUw6gIOU6HqPN9BbfJWfL6f1zVrF2fWkHVT6Gnr1hMsBndgOEa7VSan/IVH09kZ/ykhpl6vXQs0qqf6X30BonTyjeowmWbdb59W+iMixUt5qIxLD6sSDL/4rdklyaNEoWbexi1LyosRwVVLbjRbEYqg06bCBuRRbKkn5joatZz2Liq/oVXhSPJ50zKUp6JvNIDD/p3EClFatX38YDwrVvZpavkOUOSg5G4eRdS3G6Xdv4CVrP3mQMRlPAosooQSIJPE5vzuSEwKMwoXRCvSYmuB+n99FFJIo9F8LZJYE/1K13KJFuuWvz+bVc0IRERsdBvGXnoaIeiZuOcyEXWvIJzMsxic0HC/gsNzYhjAiIpK7XGGVrU5x7XK6lVAsZu2XlDFsbQEdmPGLzOni+at2Woyr0wzCHcRJdOszWu/FTMV08r2lx X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1425a98-f164-4cc9-b4ce-08d975e710d4 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8429.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2021 12:15:53.1345 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Zdd4j8LNcpMWReLy35egQVgDMUJR+l2BrxPt754h69ALOk1d4q0dQcut/AVIbB60GESoN2BskgKsBOCsTibOhQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8202 Subject: [dpdk-dev] [PATCH v5 8/9] app/bbdev: handle endianness of test data X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" With data input, output and harq also supported in big endian format, this patch updates the testbbdev application to handle the endianness conversion as directed by the test vector and the driver being used. For instance, if the driver supports big endian data processing, but the test vector does not mention the data as a big endian format, conversion from little endian to big will be handled by the testbbdev application. Signed-off-by: Nipun Gupta --- app/test-bbdev/test_bbdev_perf.c | 84 ++++++++++++++++++++++++++++++ app/test-bbdev/test_bbdev_vector.c | 4 ++ 2 files changed, 88 insertions(+) -- 2.17.1 diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c index 469597b8b3..836e07d747 100644 --- a/app/test-bbdev/test_bbdev_perf.c +++ b/app/test-bbdev/test_bbdev_perf.c @@ -227,6 +227,71 @@ clear_soft_out_cap(uint32_t *op_flags) *op_flags &= ~RTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT; } +static void +clear_ldpc_endianness_flag(uint32_t *op_flags) +{ + *op_flags &= ~RTE_BBDEV_LDPC_ENC_BIG_ENDIAN; + *op_flags &= ~RTE_BBDEV_LDPC_DEC_BIG_ENDIAN; +} + +static inline void +reverse_op(struct op_data_entries *op) +{ + uint8_t nb_segs = op->nb_segments; + uint32_t *data, len; + int complete, rem, i, j; + uint8_t *rem_data, temp; + + /* Validate each mbuf segment length */ + for (i = 0; i < nb_segs; ++i) { + len = op->segments[i].length; + data = op->segments[i].addr; + + /* Swap complete u32 bytes */ + complete = len / 4; + for (j = 0; j < complete; j++) + data[j] = rte_bswap32(data[j]); + + /* Swap any remaining data for last seg */ + if (i == (nb_segs - 1)) { + rem = len % 4; + rem_data = (uint8_t *)&data[j]; + for (j = 0; j < rem/2; j++) { + temp = rem_data[j]; + rem_data[j] = rem_data[rem - j - 1]; + rem_data[rem - j - 1] = temp; + } + } + } +} + +static inline void +reverse_all_ops(void) +{ + unsigned int nb_inputs, nb_soft_outputs, nb_hard_outputs, + nb_harq_inputs, nb_harq_outputs; + + nb_inputs = test_vector.entries[DATA_INPUT].nb_segments; + if (nb_inputs) + reverse_op(&test_vector.entries[DATA_INPUT]); + + nb_soft_outputs = test_vector.entries[DATA_SOFT_OUTPUT].nb_segments; + if (nb_soft_outputs) + reverse_op(&test_vector.entries[DATA_SOFT_OUTPUT]); + + nb_hard_outputs = test_vector.entries[DATA_HARD_OUTPUT].nb_segments; + if (nb_hard_outputs) + reverse_op(&test_vector.entries[DATA_HARD_OUTPUT]); + + nb_harq_inputs = test_vector.entries[DATA_HARQ_INPUT].nb_segments; + if (nb_harq_inputs) + reverse_op(&test_vector.entries[DATA_HARQ_INPUT]); + + nb_harq_outputs = test_vector.entries[DATA_HARQ_OUTPUT].nb_segments; + if (nb_harq_outputs) + reverse_op(&test_vector.entries[DATA_HARQ_OUTPUT]); +} + static int check_dev_cap(const struct rte_bbdev_info *dev_info) { @@ -324,6 +389,16 @@ check_dev_cap(const struct rte_bbdev_info *dev_info) const struct rte_bbdev_op_cap_ldpc_enc *cap = &op_cap->cap.ldpc_enc; + if ((test_vector.ldpc_enc.op_flags & + RTE_BBDEV_LDPC_ENC_BIG_ENDIAN) != + (cap->capability_flags & + RTE_BBDEV_LDPC_ENC_BIG_ENDIAN)) { + reverse_all_ops(); + clear_ldpc_endianness_flag( + &test_vector.ldpc_enc.op_flags); + + } + if (!flags_match(test_vector.ldpc_enc.op_flags, cap->capability_flags)){ printf("Flag Mismatch\n"); @@ -352,6 +427,15 @@ check_dev_cap(const struct rte_bbdev_info *dev_info) const struct rte_bbdev_op_cap_ldpc_dec *cap = &op_cap->cap.ldpc_dec; + if ((test_vector.ldpc_dec.op_flags & + RTE_BBDEV_LDPC_DEC_BIG_ENDIAN) != + (cap->capability_flags & + RTE_BBDEV_LDPC_DEC_BIG_ENDIAN)) { + reverse_all_ops(); + clear_ldpc_endianness_flag( + &test_vector.ldpc_dec.op_flags); + } + if (!flags_match(test_vector.ldpc_dec.op_flags, cap->capability_flags)){ printf("Flag Mismatch\n"); diff --git a/app/test-bbdev/test_bbdev_vector.c b/app/test-bbdev/test_bbdev_vector.c index 614dbd1a6d..b2e7a9008d 100644 --- a/app/test-bbdev/test_bbdev_vector.c +++ b/app/test-bbdev/test_bbdev_vector.c @@ -191,6 +191,8 @@ op_ldpc_decoder_flag_strtoul(char *token, uint32_t *op_flag_value) *op_flag_value = RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION; else if (!strcmp(token, "RTE_BBDEV_LDPC_LLR_COMPRESSION")) *op_flag_value = RTE_BBDEV_LDPC_LLR_COMPRESSION; + else if (!strcmp(token, "RTE_BBDEV_LDPC_DEC_BIG_ENDIAN")) + *op_flag_value = RTE_BBDEV_LDPC_DEC_BIG_ENDIAN; else if (!strcmp(token, "RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE")) *op_flag_value = RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE; @@ -248,6 +250,8 @@ op_ldpc_encoder_flag_strtoul(char *token, uint32_t *op_flag_value) *op_flag_value = RTE_BBDEV_LDPC_ENC_INTERRUPTS; else if (!strcmp(token, "RTE_BBDEV_LDPC_ENC_SCATTER_GATHER")) *op_flag_value = RTE_BBDEV_LDPC_ENC_SCATTER_GATHER; + else if (!strcmp(token, "RTE_BBDEV_LDPC_ENC_BIG_ENDIAN")) + *op_flag_value = RTE_BBDEV_LDPC_ENC_BIG_ENDIAN; else { printf("The given value is not a turbo encoder flag\n"); return -1; From patchwork Sun Sep 12 12:15:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 509492 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp2955481jai; Sun, 12 Sep 2021 05:16:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzShszyGaqXb26xIO4Qdr7kmEncGPa3Zad4yTEjj9Y+Bue3+1eYuEBX8wApY6m8dneo4Wk/ X-Received: by 2002:a05:6402:389:: with SMTP id o9mr7550845edv.213.1631449002502; Sun, 12 Sep 2021 05:16:42 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id q9si4109664ejn.647.2021.09.12.05.16.42; Sun, 12 Sep 2021 05:16:42 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=RYSULFy8; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0E13441148; Sun, 12 Sep 2021 14:15:58 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70041.outbound.protection.outlook.com [40.107.7.41]) by mails.dpdk.org (Postfix) with ESMTP id 0BCEC41130 for ; Sun, 12 Sep 2021 14:15:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YYAaB+wvUz0D6s6WH97V+Hm9WLsNRttMrSfC9bdGX27hmd5xOxNH/oq10pWUXweL6hHqDWD8QIWESs85hVOojPGvIYBewQjCE1xlsSVdUtzrAYc6Ho61qyWogEnHMfwssgRYIuLmPYtKDQadJi68s38bQQAdku0pmQtSl6faxlyTTuz+UcIluz0BDxp+r6ZrmVW7k74c1TwuFxvvGxqzUWJa6oANg1VjRiGg60+a4E7/yij485PnVQa8T81bX1hHpm1Uhjd3dWrcG0a86cTFtEi0Dd4nsJf7H/UWtTbCkVakwd9b7Ox4+9Dd63nbaZ/N5rZ1ce34xLVKfQ6Udnm5OQ== 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; bh=V5gHKlU6zpwj6PO2+De2dZiOslA+hj+basXCX7FqO4s=; b=FExclxiyZZi/wuo5SMzNTf+CjeESuwPP3ubbBRe6E1e/mtGM7WtIr68ZoIQRTMhjLga/DQ6pDnTq987X6rwzhj05zPnPA5aH5xEIDhv34aHuGmXz3WX08yoNm8FPn4ENqEBwwWhYICG08alf3aM0YSXbCLAyKvRb+OrW5NaMPZbuMb9YXSBalAyqFUtAB2h/pVvxZhy0LdGpla92v9CeS7+bvTP57ivWGSonkezZJfUH8TWc37SDxskvAV01S4n08wZlcsvdBFWGYkggtt3/g28VC7ydIfgALID27WTIDAdOkHiseNn5TunKLaLxRL2CZhQENAtcb28wnR3b29FU8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V5gHKlU6zpwj6PO2+De2dZiOslA+hj+basXCX7FqO4s=; b=RYSULFy897g/b+lTA+p2HX56AHRtneouI/AZE2AGhk4DSlGSyF2gWOP4Hmw2cX3ST2cZdbOHA1VESQuNkGBRAW0N7JZnrgB8L+8BSkk/2VM2FTVeSWp+KxNLRXEV2nDmjuv1UVmVkTnzsOAvuVIQiqpL87Jvonwt40Ry96u82XA= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) by DB9PR04MB8202.eurprd04.prod.outlook.com (2603:10a6:10:24f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.17; Sun, 12 Sep 2021 12:15:55 +0000 Received: from DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4]) by DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4%9]) with mapi id 15.20.4500.018; Sun, 12 Sep 2021 12:15:55 +0000 From: Nipun Gupta To: dev@dpdk.org, gakhil@marvell.com, nicolas.chautru@intel.com Cc: david.marchand@redhat.com, hemant.agrawal@nxp.com, Nipun Gupta Date: Sun, 12 Sep 2021 17:45:10 +0530 Message-Id: <20210912121510.22699-10-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210912121510.22699-1-nipun.gupta@nxp.com> References: <20210318063421.14895-1-hemant.agrawal@nxp.com> <20210912121510.22699-1-nipun.gupta@nxp.com> X-ClientProxiedBy: SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) To DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03274.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR0601CA0003.apcprd06.prod.outlook.com (2603:1096:3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Sun, 12 Sep 2021 12:15:53 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 82f299eb-208f-469d-31cb-08d975e71214 X-MS-TrafficTypeDiagnostic: DB9PR04MB8202: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:291; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RuV3CJtiPOWIGmWqRQrgNRa3rQ14zuE5iUF+aOlHgkTRmHk/CLLxS/pf2u5vpyxh2IdwwUwUnSpRJvhVyD1I71nOKOOlDHQwpjKgOSpcdMP8LpG6VHP/uwxxbOUnDIrOsEvOl/QvLKoSrpLB+3pQh8kKc3tgq+I2KaS8HA/bFRXrtKzoIIWuhKga97FNBdXkEJ3f8338UDPpstuP3nyMCGd6qXoFURxi4Vt7YXXllEeUcUvJtfrOE50D9thcm0PKM/QHsztRQmkmOXcEq7mGmYTV3CkdOEu1fUkKLbYa0fOGnJc7nE1vNtZcMuU2BTK87b8sBt+g7IHi4RwLk4WC2usWjV99CJ/gnlT96wUShGgBeLSlO8XXn4pa2YOsO8zcIFFvKhiSsTH+ae+eESTQ5EGf0vue8DhSNtireimtD5IVWXW0VMxgEViyPRUEGAh4xBRbIZUFmSXFBv0hcqwr7Zr0qGrR/+fT+j6wNbHCbuSG/x/1oDoq4BXv5FaCLjHfxkC+TCPfO2U6pnPSnES1eLrKWzGQlpkHal2Kxvd2v7YH2Dm7kpjtdOrSON3bAZg4xtzRSLcl6DYO98kpZy+MgDPbTUXbnuZSSsINNQr5LBK4TnmIZ+j1lCo0E7QAjJkpyCYfvQnf5+yA1WNuQIlMMKAzAWqdAQM3txTz25cUM0E2jgeexvAq16tgN3n6Ut9n6wLzgyGfzsmDmKnUvDy/GX+NXmYaEiqoPgsIz4999FE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR04MB8429.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(346002)(366004)(396003)(376002)(39860400002)(4326008)(1006002)(2616005)(956004)(6666004)(66946007)(5660300002)(83380400001)(36756003)(38100700002)(38350700002)(8936002)(186003)(26005)(2906002)(478600001)(44832011)(55236004)(86362001)(6486002)(1076003)(52116002)(7696005)(8676002)(316002)(66556008)(66476007)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ztv3lI9ldf6QPHICjheU8BWIeeEIiOyoHrQGBNGXzpUtYvL2sS9jKHz9Dzwwv7xfCSoXcHjSagNU6iT/rnGpCHRyWwdQNiB/Ec2dRYs3kY2Z/XknE45JOJen8KI/8P5jkPZW7tZuvsXMh9CsQ7mE3iiOu8c+Z3myvKrAISwnG0S+rOI6o61SE0FhT0KCLErGXxRPoVPTVdRUwW2SxQD5wthLXKkD2NehTk+97zbvXlAZTl+hDZ2mL+pN1ZXz8mDZBXJT8Ow99uuNwiDNGjG+cmEL8DhdMOdKGhr1Mt/M7RVj1UQbq4Jc6Q9NbBvfpo0nEbD2qdjC8sSAPMLXAR55ekoJwXDBw8+ptyIIzz/WQyajDybZP7lpM1nl0tmO9KTdPb16clH5Gwwk9eOwhyZ549OiHbytnmyreskU6KuuIzN52Z4uWaCJrCOxZwy6l+M2RnMV2LRJxY9hxJCTCuk/KQpwBWSk6CyrWxvorqYcSGd4OKSFsPOQEtLVq3MbIHby0dH0KWwdIk6+T1LYCmktXLt7D51C2qA4hVUhCR7vnnsVx2qqyeZ8Mc0Gbs01yzerMIgZWQbgYDPwP3RYhFZcolrC1ALolSTfHwl5Lw/wjSiwItTTsRHa/icBCNf8ZqvENEOSfHt6nh76SveLYLbIUyJyVpZgiY77kEApQgi5bIFhtQVYdVv5yj59H/NmVtVvHz9jaeyGcLwpgg7V+QO98MVic/nZiOGFvOodtGp75Js2fT8mfQsfcEqSxz/heA+ae/rG0K4SaaAVLkMvrPf2C3pjLp/YyJpMh4tPP56lL0OeVXrMrUQVYOqaBAe7ZPoHQtK/CVdrMgF4mlAl8L3ilizQ0e8A8WyaakArNvN3n3k0nnnjJ1NhAOMwhjhaeQ4pDrK/XDEnBwbwv7Cvn3BJloHTKEtaIEo/aa2gHGMjyTO+GgK4fM4G0i+N5+KHbL7lyv8M5fuaVLygxYSJy0MuIZM19DXSIAskI8s2MCdbJtmfP4YaW1UmUxsOnnnXmeBiTPYSYfx0IwbH2uVlLM+XrN+XMXnWxkzyq41NHwjA2ZK4VLsNVMjnq1+9F+bz3rMEned5z3fnV9HSgZz64PpYiuzidRDXIPnX7hq1K1lBH4s1FXWyC4I6r+np5W54VhPATY55rikIBgEzNp+yCHuZKQxFVp87hagZ6UAPNQaX6gpliJgJGyl4euzYNs3w+x28UEo3w0kCizOphhWhuhCcST7rc/xv+HV3AHe6SyoHfIDZBX2DhLYvuxj5ETU9WSjOnPjltPEELw0JlS+2hmFG2tF/l/Kv3SwFBaOyVOeDYZxb4jqCPz2GCR/1+KPe4CA4 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82f299eb-208f-469d-31cb-08d975e71214 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8429.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2021 12:15:55.2173 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dqylbcbxGTYulVYI1mjYMtTDIRlKosobyZDzhrBGVMZ2IBMUazIwQw4HESHianV+8B214timCCsd2gGVAZSajA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8202 Subject: [dpdk-dev] [PATCH v5 9/9] app/bbdev: add test vectors for transport blocks X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch adds two test vectors for transport block in network byte order: - LDPC encode for Transport Block - LDPC decode for Transport block Signed-off-by: Nipun Gupta --- app/test-bbdev/test_vectors/ldpc_dec_tb.data | 122 +++++++++++++++++++ app/test-bbdev/test_vectors/ldpc_enc_tb.data | 60 +++++++++ 2 files changed, 182 insertions(+) create mode 100644 app/test-bbdev/test_vectors/ldpc_dec_tb.data create mode 100644 app/test-bbdev/test_vectors/ldpc_enc_tb.data -- 2.17.1 diff --git a/app/test-bbdev/test_vectors/ldpc_dec_tb.data b/app/test-bbdev/test_vectors/ldpc_dec_tb.data new file mode 100644 index 0000000000..b991e8f305 --- /dev/null +++ b/app/test-bbdev/test_vectors/ldpc_dec_tb.data @@ -0,0 +1,122 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2020 NXP + +op_type = +RTE_BBDEV_OP_LDPC_DEC + +input0 = +0x817f8181, 0x7f7f8181, 0x817f7f81, 0x81817f81, 0x81817f81, 0x817f7f81, 0x7f7f7f7f, 0x7f7f7f81, +0x817f7f81, 0x817f7f81, 0x7f7f817f, 0x7f7f7f81, 0x81817f7f, 0x81818181, 0x817f8181, 0x7f817f81, +0x81817f7f, 0x7f7f817f, 0x81817f81, 0x817f8181, 0x7f7f7f81, 0x817f817f, 0x7f817f7f, 0x7f817f7f, +0x7f817f7f, 0x81817f7f, 0x7f818181, 0x817f7f7f, 0x8181817f, 0x81817f7f, 0x7f817f81, 0x7f7f7f7f, +0x7f817f7f, 0x81817f7f, 0x81818181, 0x817f817f, 0x81817f7f, 0x7f81817f, 0x7f7f7f7f, 0x7f7f7f7f, +0x7f818181, 0x7f7f7f81, 0x81817f81, 0x7f817f7f, 0x7f7f7f7f, 0x817f817f, 0x817f817f, 0x7f7f817f, +0x81817f81, 0x7f7f7f7f, 0x7f81817f, 0x817f817f, 0x7f7f8181, 0x7f7f7f7f, 0x817f7f7f, 0x81818181, +0x817f8181, 0x7f7f817f, 0x7f7f8181, 0x7f7f7f7f, 0x7f818181, 0x817f8181, 0x817f7f81, 0x817f8181, +0x817f7f81, 0x81817f7f, 0x7f7f8181, 0x81818181, 0x817f817f, 0x817f7f7f, 0x81818181, 0x7f817f81, +0x7f7f7f81, 0x81817f81, 0x7f817f7f, 0x7f818181, 0x7f7f7f81, 0x817f817f, 0x81818181, 0x81818181, +0x81817f81, 0x81817f81, 0x7f7f8181, 0x817f7f7f, 0x7f81817f, 0x817f817f, 0x81817f7f, 0x817f7f81, +0x81817f7f, 0x7f7f7f81, 0x7f817f81, 0x7f817f81, 0x817f7f7f, 0x7f818181, 0x81818181, 0x7f7f7f7f, +0x7f7f7f7f, 0x8181817f, 0x7f7f7f81, 0x7f817f81, 0x81817f81, 0x7f7f817f, 0x7f81817f, 0x817f8181, +0x7f81817f, 0x7f81817f, 0x817f7f7f, 0x7f81817f, 0x817f7f81, 0x817f7f81, 0x7f817f7f, 0x8181817f, +0x7f81817f, 0x7f7f8181, 0x817f8181, 0x817f7f7f, 0x817f7f81, 0x7f81817f, 0x7f7f817f, 0x7f817f7f, +0x7f7f8181, 0x81818181, 0x7f818181, 0x7f7f817f, 0x7f818181, 0x81818181, 0x7f817f7f, 0x817f817f, +0x817f817f, 0x817f7f7f, 0x81817f81, 0x81817f7f, 0x81817f81, 0x7f817f81, 0x7f817f7f, 0x7f817f7f, +0x817f7f7f, 0x817f7f7f, 0x7f7f7f7f, 0x7f7f7f81, 0x7f7f8181, 0x7f817f81, 0x7f817f7f, 0x817f7f7f, +0x7f7f8181, 0x8181817f, 0x7f7f8181, 0x7f7f7f81, 0x817f7f7f, 0x7f7f7f81, 0x817f8181, 0x7f7f817f, +0x7f81817f, 0x817f817f, 0x7f817f81, 0x7f7f8181, 0x7f818181, 0x7f817f81, 0x81818181, 0x81817f7f, +0x7f81817f, 0x7f81817f, 0x7f7f8181, 0x81818181, 0x817f8181, 0x7f7f817f, 0x7f817f7f, 0x7f7f8181, +0x7f81817f, 0x7f7f817f, 0x7f7f7f7f, 0x7f818181, 0x81817f7f, 0x8181817f, 0x7f81817f, 0x8181817f, +0x81817f81, 0x7f7f7f7f, 0x81818181, 0x7f7f817f, 0x7f81817f, 0x7f7f7f7f, 0x81817f81, 0x817f7f81, +0x817f7f81, 0x817f7f81, 0x81818181, 0x7f7f7f7f, 0x81817f81, 0x817f7f7f, 0x8181817f, 0x7f7f7f81, +0x81817f81, 0x817f7f81, 0x81818181, 0x7f7f7f7f, 0x81817f7f, 0x81817f81, 0x7f7f7f81, 0x7f7f7f7f, +0x817f817f, 0x7f818181, 0x8181817f, 0x81817f81, 0x7f7f7f81, 0x7f817f7f, 0x7f7f7f7f, 0x7f817f81, +0x8181817f, 0x7f7f7f7f, 0x81817f7f, 0x7f7f7f81, 0x7f81817f, 0x7f7f7f7f, 0x7f7f7f81, 0x817f8181, +0x7f7f8181, 0x7f7f7f81, 0x7f7f8181, 0x7f817f7f, 0x81818181, 0x7f81817f, 0x7f818181, 0x7f818181, +0x7f818181, 0x817f7f81, 0x7f7f8181, 0x81818181, 0x7f7f7f7f, 0x7f7f7f7f, 0x817f8181, 0x81818181, +0x7f7f817f, 0x817f8181, 0x81817f7f, 0x817f817f, 0x7f7f817f, 0x7f7f7f7f, 0x817f8181, 0x817f8181, +0x817f8181, 0x81818181, 0x7f7f817f, 0x7f817f81, 0x817f7f81, 0x7f7f7f81, 0x81817f81, 0x7f818181, +0x81817f7f, 0x7f818181, 0x81818181, 0x817f817f, 0x7f817f7f, 0x81818181, 0x817f8181, 0x7f7f7f7f, +0x7f817f81, 0x817f7f7f, 0x7f818181, 0x8181817f, 0x817f817f, 0x7f817f7f, 0x817f7f81, 0x7f818181, +0x817f7f7f, 0x817f7f81, 0x7f7f7f81, 0x81817f81, 0x7f81817f, 0x7f818181, 0x81817f7f, 0x817f7f81, +0x81817f81, 0x7f7f8181, 0x7f7f8181, 0x7f817f81, 0x7f7f817f, 0x817f7f7f, 0x7f7f7f7f, 0x817f7f7f, +0x7f7f8181, 0x817f8181, 0x817f8181, 0x7f817f81, 0x817f8181, 0x8181817f, 0x81817f7f, 0x7f817f7f, +0x7f817f7f, 0x7f817f81, 0x817f817f, 0x817f7f7f, 0x8181817f, 0x817f817f, 0x817f7f81, 0x81817f7f, +0x7f817f7f, 0x7f7f7f7f, 0x7f817f7f, 0x7f7f817f, 0x7f818181, 0x8181817f, 0x817f7f7f, 0x7f817f81, +0x7f7f8181, 0x81817f7f, 0x7f7f817f, 0x7f7f817f, 0x7f817f7f, 0x7f7f817f, 0x7f818181, 0x7f817f7f, +0x817f7f7f, 0x7f817f81, 0x81818181, 0x7f818181, 0x817f8181, 0x8181817f, 0x8181817f, 0x817f7f7f, +0x81817f81, 0x817f7f7f, 0x7f81817f, 0x817f8181, 0x7f818181, 0x7f817f7f, 0x81817f7f, 0x7f81817f, +0x81817f81, 0x7f7f7f81, 0x7f7f7f7f, 0x81818181, 0x817f7f7f, 0x81817f81, 0x817f7f81, 0x81817f7f, +0x81818181, 0x7f7f7f7f, 0x817f817f, 0x7f817f81, 0x817f7f7f, 0x7f817f81, 0x817f8181, 0x7f81817f, +0x7f818181, 0x7f7f8181, 0x817f817f, 0x7f7f7f7f, 0x81818181, 0x7f817f81, 0x81817f81, 0x7f81817f, +0x81818181, 0x7f7f817f, 0x81818181, 0x7f7f7f81, 0x817f7f81, 0x8181817f, 0x7f818181, 0x7f7f7f7f, +0x7f7f7f7f, 0x8181817f, 0x81817f81, 0x81818181, 0x7f7f817f, 0x81817f7f, 0x7f817f81, 0x817f8181, +0x81817f7f, 0x7f817f7f, 0x817f7f7f, 0x7f81817f, 0x817f7f7f, 0x7f7f7f7f, 0x7f7f8181, 0x7f7f8181, +0x7f81817f, 0x7f7f8181, 0x7f7f8181, 0x817f7f81, 0x8181817f, 0x81817f7f, 0x817f8181, 0x817f817f, +0x8181817f, 0x7f7f8181, 0x7f81817f, 0x817f817f, 0x7f817f81, 0x7f817f7f, 0x7f7f8181, 0x81818181, +0x7f817f81, 0x7f7f8181, 0x81817f7f, 0x7f7f7f81, 0x7f7f7f81, 0x7f7f7f7f, 0x7f81817f, 0x7f7f8181, +0x7f7f817f, 0x817f817f, 0x7f7f7f7f, 0x817f8181, 0x7f818181, 0x7f7f817f, 0x8181817f, 0x8181817f, +0x817f7f81, 0x8181817f, 0x817f8181, 0x7f817f7f, 0x81817f7f, 0x81818181, 0x7f7f8181, 0x7f817f81, +0x817f8181, 0x7f817f7f, 0x81818181, 0x81817f81, 0x7f817f81, 0x81817f7f, 0x7f818181, 0x8181817f, +0x7f7f7f81, 0x7f81817f, 0x7f7f8181, 0x81818181, 0x81817f7f, 0x817f8181, 0x81817f7f, 0x7f7f817f, +0x81818181, 0x7f7f8181, 0x7f7f817f, 0x817f817f, 0x7f817f81, 0x7f7f7f7f, 0x7f817f81, 0x7f817f7f, +0x7f81817f, 0x7f7f8181, 0x7f7f817f, 0x81818181, 0x7f7f8181, 0x817f7f81, 0x81817f81, 0x81817f7f, +0x81817f81, 0x81818181, 0x7f817f81, 0x7f7f7f7f, 0x81817f7f, 0x7f817f7f, 0x7f7f817f, 0x81817f7f, +0x81817f7f, 0x7f7f7f7f, 0x817f7f7f, 0x7f817f81, 0x81818181, 0x81817f7f, 0x7f817f7f, 0x8181817f, +0x7f81817f, 0x817f7f81, 0x7f817f7f, 0x7f7f7f7f, 0x817f7f81, 0x7f817f81, 0x81818181, 0x81817f81, +0x7f817f81, 0x81818181, 0x81818181, 0x8181817f, 0x7f7f817f, 0x817f7f7f, 0x817f7f7f, 0x7f7f7f7f, +0x81818181, 0x7f817f7f, 0x817f7f81, 0x7f7f8181, 0x817f8181, 0x81817f7f, 0x81817f7f, 0x817f7f7f, +0x817f817f, 0x7f818181, 0x7f817f7f, 0x817f8181, 0x7f817f7f, 0x817f8181, 0x7f7f817f, 0x81817f7f, +0x8181817f, 0x7f817f81, 0x7f7f7f81, 0x81818181, 0x7f7f7f81, 0x81818181, 0x7f7f817f, 0x817f7f7f, +0x817f817f, 0x7f7f8181, 0x7f7f7f81, 0x7f817f7f, 0x817f8181, 0x817f817f, 0x81818181, 0x81817f7f + +output0 = +0xea7bdad9, 0xabd8311a, 0x4e7ba2e2, 0x5c5c5c85, 0xc400ed50, 0x9bea8883, 0xb7f0 + +basegraph= +2 + +z_c= +28 + +n_cb= +1400 + +q_m= +2 + +n_filler= +56 + +ea = +2048 + +eb = +2048 + +iter_max= +8 + +expected_iter_count= +2 + +c = +1 + +r = +0 + +cab = +0 + +rv_index = +0 + +code_block_mode = +0 + +op_flags = +RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP, RTE_BBDEV_LDPC_DEC_BIG_ENDIAN + +expected_status = +OK diff --git a/app/test-bbdev/test_vectors/ldpc_enc_tb.data b/app/test-bbdev/test_vectors/ldpc_enc_tb.data new file mode 100644 index 0000000000..277db673c8 --- /dev/null +++ b/app/test-bbdev/test_vectors/ldpc_enc_tb.data @@ -0,0 +1,60 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2020 NXP + +op_type = +RTE_BBDEV_OP_LDPC_ENC + +input0 = +0xea7bdad9, 0xabd8311a, 0x4e7ba2e2, 0x5c5c5c85, 0xc400ed50, 0x9bea8883, 0xb7f0 + +output0 = +0x109dd93b, 0x5bfc1299, 0x44a1bd2c, 0x05ce87c4, 0x006cafc4, 0x2aa04d17, 0xf803a60d, 0xb9b7032b, +0x5f8af3c9, 0xffa174d1, 0x9ca683dd, 0x0f78551c, 0xb62d51e0, 0xe4996866, 0x42698b36, 0xa4f727f3, +0x445dcd8a, 0x84531088, 0x2b1813e3, 0xcf5735a6, 0x342bf366, 0xe6ec7026, 0x9d062f0d, 0x1e8d0f99, +0x01dc0f9d, 0x5041de7a, 0xb1061c0e, 0x776f4313, 0xfb00f397, 0xbb02acb2, 0x7d1952fb, 0x0bf4af7c, +0x794ae785, 0x9c76d198, 0x8082533d, 0x4ceb5bb3, 0xc9ae8a54, 0x58e72404, 0x472422c3, 0x8eeb7f58, +0x6c47b68d, 0xc9d8f01d, 0x6b585a0f, 0x6d5f0a37, 0x07e91f2f, 0xb5c2fde0, 0x3308684c, 0xabce9336, +0xf345a63e, 0x36011c35, 0xee27b0a2, 0x53fc4be9, 0xe7c5df4b, 0x2cbcf361, 0x4505a23f, 0xcd93f236, +0xc24c05fd, 0xe4cf580c, 0xdf590496, 0x0882eff5, 0x8ccb394f, 0xc2b4b47a, 0x82f1f15e, 0xcfab413a + +basegraph= +2 + +z_c= +28 + +n_cb= +1400 + +q_m= +2 + +n_filler= +56 + +ea = +2048 + +eb = +2048 + +c = +1 + +r = +0 + +cab = +0 + +rv_index = +0 + +code_block_mode = +0 + +op_flags = +RTE_BBDEV_LDPC_CRC_24B_ATTACH, RTE_BBDEV_LDPC_ENC_BIG_ENDIAN + +expected_status = +OK