get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/55182/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 55182,
    "url": "http://patches.dpdk.org/api/patches/55182/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1561136352-32198-5-git-send-email-nicolas.chautru@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1561136352-32198-5-git-send-email-nicolas.chautru@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1561136352-32198-5-git-send-email-nicolas.chautru@intel.com",
    "date": "2019-06-21T16:59:06",
    "name": "[v3,04/10] bbdev: extension of BBDEV API for 5G FEC",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "27efceef1ef647c7e6e93ac7d094ae5a3749a6d9",
    "submitter": {
        "id": 1314,
        "url": "http://patches.dpdk.org/api/people/1314/?format=api",
        "name": "Chautru, Nicolas",
        "email": "nicolas.chautru@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1561136352-32198-5-git-send-email-nicolas.chautru@intel.com/mbox/",
    "series": [
        {
            "id": 5122,
            "url": "http://patches.dpdk.org/api/series/5122/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5122",
            "date": "2019-06-21T16:59:02",
            "name": "bbdev: adding support in BBDEV for 5GNR FEC",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/5122/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/55182/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/55182/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 2EE821D570;\n\tSat, 22 Jun 2019 02:02:27 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 709351D54A\n\tfor <dev@dpdk.org>; Sat, 22 Jun 2019 02:02:13 +0200 (CEST)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t21 Jun 2019 17:02:11 -0700",
            "from skx-5gnr-sc12-4.sc.intel.com ([172.25.69.210])\n\tby orsmga003.jf.intel.com with ESMTP; 21 Jun 2019 17:02:11 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.63,402,1557212400\"; d=\"scan'208\";a=\"163039849\"",
        "From": "Nicolas Chautru <nicolas.chautru@intel.com>",
        "To": "akhil.goyal@nxp.com,\n\tdev@dpdk.org",
        "Cc": "thomas@monjalon.net, ferruh.yigit@intel.com, amr.mokhtar@intel.com,\n\tNicolas Chautru <nicolas.chautru@intel.com>",
        "Date": "Fri, 21 Jun 2019 09:59:06 -0700",
        "Message-Id": "<1561136352-32198-5-git-send-email-nicolas.chautru@intel.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1561136352-32198-1-git-send-email-nicolas.chautru@intel.com>",
        "References": "<1557863143-174842-2-git-send-email-nicolas.chautru@intel.com>\n\t<1561136352-32198-1-git-send-email-nicolas.chautru@intel.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=:\b",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 04/10] bbdev: extension of BBDEV API for 5G FEC",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Extension to BBDEV operations to support 5G\non top of existing 4G operations.\n\nSigned-off-by: Nicolas Chautru <nicolas.chautru@intel.com>\n---\n lib/librte_bbdev/rte_bbdev.c    |  22 +-\n lib/librte_bbdev/rte_bbdev.h    | 135 +++++++++-\n lib/librte_bbdev/rte_bbdev_op.h | 567 ++++++++++++++++++++++++++++++++--------\n 3 files changed, 602 insertions(+), 122 deletions(-)",
    "diff": "diff --git a/lib/librte_bbdev/rte_bbdev.c b/lib/librte_bbdev/rte_bbdev.c\nindex a3ab5d9..7e4acfc 100644\n--- a/lib/librte_bbdev/rte_bbdev.c\n+++ b/lib/librte_bbdev/rte_bbdev.c\n@@ -6,7 +6,6 @@\n #include <string.h>\n #include <stdbool.h>\n \n-#include <rte_string_fns.h>\n #include <rte_compat.h>\n #include <rte_common.h>\n #include <rte_errno.h>\n@@ -215,7 +214,7 @@ struct rte_bbdev * __rte_experimental\n \tbbdev->data->dev_id = dev_id;\n \tbbdev->state = RTE_BBDEV_INITIALIZED;\n \n-\tret = strlcpy(bbdev->data->name, name, RTE_BBDEV_NAME_MAX_LEN);\n+\tret = snprintf(bbdev->data->name, RTE_BBDEV_NAME_MAX_LEN, \"%s\", name);\n \tif ((ret < 0) || (ret >= RTE_BBDEV_NAME_MAX_LEN)) {\n \t\trte_bbdev_log(ERR, \"Copying device name \\\"%s\\\" failed\", name);\n \t\treturn NULL;\n@@ -499,7 +498,7 @@ struct rte_bbdev * __rte_experimental\n \t\tif (conf->op_type == RTE_BBDEV_OP_TURBO_DEC &&\n \t\t\tconf->priority > dev_info.max_ul_queue_priority) {\n \t\t\trte_bbdev_log(ERR,\n-\t\t\t\t\t\"Priority (%u) of queue %u of bdev %u must be <= %u\",\n+\t\t\t\t\t\"Priority (%u) of queue %u of bbdev %u must be <= %u\",\n \t\t\t\t\tconf->priority, queue_id, dev_id,\n \t\t\t\t\tdev_info.max_ul_queue_priority);\n \t\t\treturn -EINVAL;\n@@ -507,7 +506,7 @@ struct rte_bbdev * __rte_experimental\n \t\tif (conf->op_type == RTE_BBDEV_OP_TURBO_ENC &&\n \t\t\tconf->priority > dev_info.max_dl_queue_priority) {\n \t\t\trte_bbdev_log(ERR,\n-\t\t\t\t\t\"Priority (%u) of queue %u of bdev %u must be <= %u\",\n+\t\t\t\t\t\"Priority (%u) of queue %u of bbdev %u must be <= %u\",\n \t\t\t\t\tconf->priority, queue_id, dev_id,\n \t\t\t\t\tdev_info.max_dl_queue_priority);\n \t\t\treturn -EINVAL;\n@@ -796,7 +795,7 @@ struct rte_bbdev * __rte_experimental\n \tmemset(dev_info, 0, sizeof(*dev_info));\n \tdev_info->dev_name = dev->data->name;\n \tdev_info->num_queues = dev->data->num_queues;\n-\tdev_info->bus = rte_bus_find_by_device(dev->device);\n+\tdev_info->device = dev->device;\n \tdev_info->socket_id = dev->data->socket_id;\n \tdev_info->started = dev->data->started;\n \n@@ -847,6 +846,12 @@ struct rte_bbdev * __rte_experimental\n \tcase RTE_BBDEV_OP_TURBO_ENC:\n \t\tresult = sizeof(struct rte_bbdev_enc_op);\n \t\tbreak;\n+\tcase RTE_BBDEV_OP_LDPC_DEC:\n+\t\tresult = sizeof(struct rte_bbdev_dec_op);\n+\t\tbreak;\n+\tcase RTE_BBDEV_OP_LDPC_ENC:\n+\t\tresult = sizeof(struct rte_bbdev_enc_op);\n+\t\tbreak;\n \tdefault:\n \t\tbreak;\n \t}\n@@ -861,11 +866,12 @@ struct rte_bbdev * __rte_experimental\n {\n \tenum rte_bbdev_op_type type = *(enum rte_bbdev_op_type *)arg;\n \n-\tif (type == RTE_BBDEV_OP_TURBO_DEC) {\n+\tif (type == RTE_BBDEV_OP_TURBO_DEC || type == RTE_BBDEV_OP_LDPC_DEC) {\n \t\tstruct rte_bbdev_dec_op *op = element;\n \t\tmemset(op, 0, mempool->elt_size);\n \t\top->mempool = mempool;\n-\t} else if (type == RTE_BBDEV_OP_TURBO_ENC) {\n+\t} else if (type == RTE_BBDEV_OP_TURBO_ENC ||\n+\t\t\ttype == RTE_BBDEV_OP_LDPC_ENC) {\n \t\tstruct rte_bbdev_enc_op *op = element;\n \t\tmemset(op, 0, mempool->elt_size);\n \t\top->mempool = mempool;\n@@ -1117,6 +1123,8 @@ struct rte_mempool * __rte_experimental\n \t\t\"RTE_BBDEV_OP_NONE\",\n \t\t\"RTE_BBDEV_OP_TURBO_DEC\",\n \t\t\"RTE_BBDEV_OP_TURBO_ENC\",\n+\t\t\"RTE_BBDEV_OP_LDPC_DEC\",\n+\t\t\"RTE_BBDEV_OP_LDPC_ENC\",\n \t};\n \n \tif (op_type < RTE_BBDEV_OP_TYPE_COUNT)\ndiff --git a/lib/librte_bbdev/rte_bbdev.h b/lib/librte_bbdev/rte_bbdev.h\nindex d131692..a0e9b1a 100644\n--- a/lib/librte_bbdev/rte_bbdev.h\n+++ b/lib/librte_bbdev/rte_bbdev.h\n@@ -161,7 +161,7 @@ struct rte_bbdev_queue_conf {\n \n /**\n  * Start a device.\n- * This is the last step needed before enqueuing operations is possible.\n+ * This is the last step needed before enqueueing operations is possible.\n  *\n  * @param dev_id\n  *   The identifier of the device.\n@@ -313,7 +313,7 @@ struct rte_bbdev_driver_info {\n struct rte_bbdev_info {\n \tint socket_id;  /**< NUMA socket that device is on */\n \tconst char *dev_name;  /**< Unique device name */\n-\tconst struct rte_bus *bus;  /**< Bus information */\n+\tconst struct rte_device *device; /**< Device Information */\n \tuint16_t num_queues;  /**< Number of queues currently configured */\n \tbool started;  /**< Set if device is currently started */\n \tstruct rte_bbdev_driver_info drv;  /**< Info from device driver */\n@@ -433,6 +433,14 @@ struct __rte_cache_aligned rte_bbdev {\n \trte_bbdev_dequeue_enc_ops_t dequeue_enc_ops;\n \t/**< Dequeue decode function */\n \trte_bbdev_dequeue_dec_ops_t dequeue_dec_ops;\n+\t/**< Enqueue encode function */\n+\trte_bbdev_enqueue_enc_ops_t enqueue_ldpc_enc_ops;\n+\t/**< Enqueue decode function */\n+\trte_bbdev_enqueue_dec_ops_t enqueue_ldpc_dec_ops;\n+\t/**< Dequeue encode function */\n+\trte_bbdev_dequeue_enc_ops_t dequeue_ldpc_enc_ops;\n+\t/**< Dequeue decode function */\n+\trte_bbdev_dequeue_dec_ops_t dequeue_ldpc_dec_ops;\n \tconst struct rte_bbdev_ops *dev_ops;  /**< Functions exported by PMD */\n \tstruct rte_bbdev_data *data;  /**< Pointer to device data */\n \tenum rte_bbdev_state state;  /**< If device is currently used or not */\n@@ -506,6 +514,67 @@ struct __rte_cache_aligned rte_bbdev {\n }\n \n /**\n+ * Enqueue a burst of processed encode operations to a queue of the device.\n+ * This functions only enqueues as many operations as currently possible and\n+ * does not block until @p num_ops entries in the queue are available.\n+ * This function does not provide any error notification to avoid the\n+ * corresponding overhead.\n+ *\n+ * @param dev_id\n+ *   The identifier of the device.\n+ * @param queue_id\n+ *   The index of the queue.\n+ * @param ops\n+ *   Pointer array containing operations to be enqueued Must have at least\n+ *   @p num_ops entries\n+ * @param num_ops\n+ *   The maximum number of operations to enqueue.\n+ *\n+ * @return\n+ *   The number of operations actually enqueued (this is the number of processed\n+ *   entries in the @p ops array).\n+ */\n+static inline uint16_t __rte_experimental\n+rte_bbdev_enqueue_ldpc_enc_ops(uint16_t dev_id, uint16_t queue_id,\n+\t\tstruct rte_bbdev_enc_op **ops, uint16_t num_ops)\n+{\n+\tstruct rte_bbdev *dev = &rte_bbdev_devices[dev_id];\n+\tstruct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];\n+\treturn dev->enqueue_ldpc_enc_ops(q_data, ops, num_ops);\n+}\n+\n+/**\n+ * Enqueue a burst of processed decode operations to a queue of the device.\n+ * This functions only enqueues as many operations as currently possible and\n+ * does not block until @p num_ops entries in the queue are available.\n+ * This function does not provide any error notification to avoid the\n+ * corresponding overhead.\n+ *\n+ * @param dev_id\n+ *   The identifier of the device.\n+ * @param queue_id\n+ *   The index of the queue.\n+ * @param ops\n+ *   Pointer array containing operations to be enqueued Must have at least\n+ *   @p num_ops entries\n+ * @param num_ops\n+ *   The maximum number of operations to enqueue.\n+ *\n+ * @return\n+ *   The number of operations actually enqueued (this is the number of processed\n+ *   entries in the @p ops array).\n+ */\n+static inline uint16_t __rte_experimental\n+rte_bbdev_enqueue_ldpc_dec_ops(uint16_t dev_id, uint16_t queue_id,\n+\t\tstruct rte_bbdev_dec_op **ops, uint16_t num_ops)\n+{\n+\tstruct rte_bbdev *dev = &rte_bbdev_devices[dev_id];\n+\tstruct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];\n+\treturn dev->enqueue_ldpc_dec_ops(q_data, ops, num_ops);\n+}\n+\n+\n+/**\n  * Dequeue a burst of processed encode operations from a queue of the device.\n  * This functions returns only the current contents of the queue, and does not\n  * block until @ num_ops is available.\n@@ -566,6 +635,68 @@ struct __rte_cache_aligned rte_bbdev {\n \treturn dev->dequeue_dec_ops(q_data, ops, num_ops);\n }\n \n+\n+/**\n+ * Dequeue a burst of processed encode operations from a queue of the device.\n+ * This functions returns only the current contents of the queue, and does not\n+ * block until @ num_ops is available.\n+ * This function does not provide any error notification to avoid the\n+ * corresponding overhead.\n+ *\n+ * @param dev_id\n+ *   The identifier of the device.\n+ * @param queue_id\n+ *   The index of the queue.\n+ * @param ops\n+ *   Pointer array where operations will be dequeued to. Must have at least\n+ *   @p num_ops entries\n+ * @param num_ops\n+ *   The maximum number of operations to dequeue.\n+ *\n+ * @return\n+ *   The number of operations actually dequeued (this is the number of entries\n+ *   copied into the @p ops array).\n+ */\n+static inline uint16_t __rte_experimental\n+rte_bbdev_dequeue_ldpc_enc_ops(uint16_t dev_id, uint16_t queue_id,\n+\t\tstruct rte_bbdev_enc_op **ops, uint16_t num_ops)\n+{\n+\tstruct rte_bbdev *dev = &rte_bbdev_devices[dev_id];\n+\tstruct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];\n+\treturn dev->dequeue_ldpc_enc_ops(q_data, ops, num_ops);\n+}\n+\n+/**\n+ * Dequeue a burst of processed decode operations from a queue of the device.\n+ * This functions returns only the current contents of the queue, and does not\n+ * block until @ num_ops is available.\n+ * This function does not provide any error notification to avoid the\n+ * corresponding overhead.\n+ *\n+ * @param dev_id\n+ *   The identifier of the device.\n+ * @param queue_id\n+ *   The index of the queue.\n+ * @param ops\n+ *   Pointer array where operations will be dequeued to. Must have at least\n+ *   @p num_ops entries\n+ * @param num_ops\n+ *   The maximum number of operations to dequeue.\n+ *\n+ * @return\n+ *   The number of operations actually dequeued (this is the number of entries\n+ *   copied into the @p ops array).\n+ */\n+\n+static inline uint16_t __rte_experimental\n+rte_bbdev_dequeue_ldpc_dec_ops(uint16_t dev_id, uint16_t queue_id,\n+\t\tstruct rte_bbdev_dec_op **ops, uint16_t num_ops)\n+{\n+\tstruct rte_bbdev *dev = &rte_bbdev_devices[dev_id];\n+\tstruct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];\n+\treturn dev->dequeue_ldpc_dec_ops(q_data, ops, num_ops);\n+}\n+\n /** Definitions of device event types */\n enum rte_bbdev_event_type {\n \tRTE_BBDEV_EVENT_UNKNOWN,  /**< unknown event type */\ndiff --git a/lib/librte_bbdev/rte_bbdev_op.h b/lib/librte_bbdev/rte_bbdev_op.h\nindex f61c115..992391a 100644\n--- a/lib/librte_bbdev/rte_bbdev_op.h\n+++ b/lib/librte_bbdev/rte_bbdev_op.h\n@@ -31,57 +31,61 @@\n #define RTE_BBDEV_TURBO_MAX_TB_SIZE (391656)\n /* Maximum size of Code Block (36.212, Table 5.1.3-3) */\n #define RTE_BBDEV_TURBO_MAX_CB_SIZE (6144)\n+/* Maximum size of Code Block  */\n+#define RTE_BBDEV_LDPC_MAX_CB_SIZE (8448)\n /* Minimum size of Code Block (36.212, Table 5.1.3-3) */\n #define RTE_BBDEV_TURBO_MIN_CB_SIZE (40)\n /* Maximum size of circular buffer */\n #define RTE_BBDEV_TURBO_MAX_KW (18528)\n /*\n- * Maximum number of Code Blocks in Transport Block. It is calculated based on\n- * maximum size of one Code Block and one Transport Block (considering CRC24A\n- * and CRC24B):\n+ * Turbo: Maximum number of Code Blocks in Transport Block. It is calculated\n+ * based on maximum size of one Code Block and one Transport Block\n+ * (considering CRC24A and CRC24B):\n  * (391656 + 24) / (6144 - 24) = 64\n  */\n #define RTE_BBDEV_TURBO_MAX_CODE_BLOCKS (64)\n+/* LDPC:  Maximum number of Code Blocks in Transport Block.*/\n+#define RTE_BBDEV_LDPC_MAX_CODE_BLOCKS (256)\n \n /** Flags for turbo decoder operation and capability structure */\n enum rte_bbdev_op_td_flag_bitmasks {\n-\t/**< If sub block de-interleaving is to be performed. */\n+\t/** If sub block de-interleaving is to be performed. */\n \tRTE_BBDEV_TURBO_SUBBLOCK_DEINTERLEAVE = (1ULL << 0),\n-\t/**< To use CRC Type 24B (otherwise use CRC Type 24A). */\n+\t/** To use CRC Type 24B (otherwise use CRC Type 24A). */\n \tRTE_BBDEV_TURBO_CRC_TYPE_24B = (1ULL << 1),\n-\t/**< If turbo equalization is to be performed. */\n+\t/** If turbo equalization is to be performed. */\n \tRTE_BBDEV_TURBO_EQUALIZER = (1ULL << 2),\n-\t/**< If set, saturate soft output to +/-127 */\n+\t/** If set, saturate soft output to +/-127 */\n \tRTE_BBDEV_TURBO_SOFT_OUT_SATURATE = (1ULL << 3),\n-\t/**< Set to 1 to start iteration from even, else odd; one iteration =\n+\t/** Set to 1 to start iteration from even, else odd; one iteration =\n \t * max_iteration + 0.5\n \t */\n \tRTE_BBDEV_TURBO_HALF_ITERATION_EVEN = (1ULL << 4),\n-\t/**< If 0, TD stops after CRC matches; else if 1, runs to end of next\n+\t/** If 0, TD stops after CRC matches; else if 1, runs to end of next\n \t * odd iteration after CRC matches\n \t */\n \tRTE_BBDEV_TURBO_CONTINUE_CRC_MATCH = (1ULL << 5),\n-\t/**< Set if soft output is required to be output  */\n+\t/** Set if soft output is required to be output  */\n \tRTE_BBDEV_TURBO_SOFT_OUTPUT = (1ULL << 6),\n-\t/**< Set to enable early termination mode */\n+\t/** Set to enable early termination mode */\n \tRTE_BBDEV_TURBO_EARLY_TERMINATION = (1ULL << 7),\n-\t/**< Set if a device supports decoder dequeue interrupts */\n+\t/** Set if a device supports decoder dequeue interrupts */\n \tRTE_BBDEV_TURBO_DEC_INTERRUPTS = (1ULL << 9),\n-\t/**< Set if positive LLR encoded input is supported. Positive LLR value\n+\t/** Set if positive LLR encoded input is supported. Positive LLR value\n \t * represents the level of confidence for bit '1', and vice versa for\n \t * bit '0'.\n \t * This is mutually exclusive with RTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN\n \t * when used to formalize the input data format.\n \t */\n \tRTE_BBDEV_TURBO_POS_LLR_1_BIT_IN = (1ULL << 10),\n-\t/**< Set if negative LLR encoded input is supported. Negative LLR value\n+\t/** Set if negative LLR encoded input is supported. Negative LLR value\n \t * represents the level of confidence for bit '1', and vice versa for\n \t * bit '0'.\n \t * This is mutually exclusive with RTE_BBDEV_TURBO_POS_LLR_1_BIT_IN\n \t * when used to formalize the input data format.\n \t */\n \tRTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN = (1ULL << 11),\n-\t/**< Set if positive LLR soft output is supported. Positive LLR value\n+\t/** Set if positive LLR soft output is supported. Positive LLR value\n \t * represents the level of confidence for bit '1', and vice versa for\n \t * bit '0'.\n \t * This is mutually exclusive with\n@@ -89,7 +93,7 @@ enum rte_bbdev_op_td_flag_bitmasks {\n \t * the input data format.\n \t */\n \tRTE_BBDEV_TURBO_POS_LLR_1_BIT_SOFT_OUT = (1ULL << 12),\n-\t/**< Set if negative LLR soft output is supported. Negative LLR value\n+\t/** Set if negative LLR soft output is supported. Negative LLR value\n \t * represents the level of confidence for bit '1', and vice versa for\n \t * bit '0'.\n \t * This is mutually exclusive with\n@@ -97,43 +101,114 @@ enum rte_bbdev_op_td_flag_bitmasks {\n \t * input data format.\n \t */\n \tRTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT = (1ULL << 13),\n-\t/**< Set if driver supports flexible parallel MAP engine decoding. If\n+\t/** Set if driver supports flexible parallel MAP engine decoding. If\n \t * not supported, num_maps (number of MAP engines) argument is unusable.\n \t */\n \tRTE_BBDEV_TURBO_MAP_DEC = (1ULL << 14),\n-\t/**< Set if a device supports scatter-gather functionality */\n+\t/** Set if a device supports scatter-gather functionality */\n \tRTE_BBDEV_TURBO_DEC_SCATTER_GATHER = (1ULL << 15),\n-\t/**< Set to keep CRC24B bits appended while decoding. Only usable when\n+\t/** Set to keep CRC24B bits appended while decoding. Only usable when\n \t * decoding Transport Blocks (code_block_mode = 0).\n \t */\n \tRTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP = (1ULL << 16)\n };\n \n+\n /** Flags for turbo encoder operation and capability structure */\n enum rte_bbdev_op_te_flag_bitmasks {\n-\t/**< Ignore rv_index and set K0 = 0 */\n+\t/** Ignore rv_index and set K0 = 0 */\n \tRTE_BBDEV_TURBO_RV_INDEX_BYPASS = (1ULL << 0),\n-\t/**< If rate matching is to be performed */\n+\t/** If rate matching is to be performed */\n \tRTE_BBDEV_TURBO_RATE_MATCH = (1ULL << 1),\n-\t/**< This bit must be set to enable CRC-24B generation */\n+\t/** This bit must be set to enable CRC-24B generation */\n \tRTE_BBDEV_TURBO_CRC_24B_ATTACH = (1ULL << 2),\n-\t/**< This bit must be set to enable CRC-24A generation */\n+\t/** This bit must be set to enable CRC-24A generation */\n \tRTE_BBDEV_TURBO_CRC_24A_ATTACH = (1ULL << 3),\n-\t/**< Set if a device supports encoder dequeue interrupts */\n+\t/** Set if a device supports encoder dequeue interrupts */\n \tRTE_BBDEV_TURBO_ENC_INTERRUPTS = (1ULL << 4),\n-\t/**< Set if a device supports scatter-gather functionality */\n+\t/** Set if a device supports scatter-gather functionality */\n \tRTE_BBDEV_TURBO_ENC_SCATTER_GATHER = (1ULL << 5)\n };\n \n-/**< Data input and output buffer for BBDEV operations */\n+/** Flags for LDPC decoder operation and capability structure */\n+enum rte_bbdev_op_ldpcdec_flag_bitmasks {\n+\t/** Set for transport block CRC-24A checking */\n+\tRTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK = (1ULL << 0),\n+\t/** Set for code block CRC-24B checking */\n+\tRTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK = (1ULL << 1),\n+\t/** Set to drop the last CRC bits decoding output */\n+\tRTE_BBDEV_LDPC_CRC_TYPE_24B_DROP = (1ULL << 2),\n+\t/** Set for bit-level de-interleaver bypass on Rx stream. */\n+\tRTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS = (1ULL << 3),\n+\t/** Set for HARQ combined input stream enable. */\n+\tRTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE = (1ULL << 4),\n+\t/** Set for HARQ combined output stream enable. */\n+\tRTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE = (1ULL << 5),\n+\t/** Set for LDPC decoder bypass.\n+\t *  RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE must be set.\n+\t */\n+\tRTE_BBDEV_LDPC_DECODE_BYPASS = (1ULL << 6),\n+\t/** Set for soft-output stream enable */\n+\tRTE_BBDEV_LDPC_SOFT_OUT_ENABLE = (1ULL << 7),\n+\t/** Set for Rate-Matching bypass on soft-out stream. */\n+\tRTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS = (1ULL << 8),\n+\t/** Set for bit-level de-interleaver bypass on soft-output stream. */\n+\tRTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS = (1ULL << 9),\n+\t/** Set for iteration stopping on successful decode condition\n+\t *  i.e. a successful syndrome check.\n+\t */\n+\tRTE_BBDEV_LDPC_ITERATION_STOP_ENABLE = (1ULL << 10),\n+\t/** Set if a device supports decoder dequeue interrupts. */\n+\tRTE_BBDEV_LDPC_DEC_INTERRUPTS = (1ULL << 11),\n+\t/** Set if a device supports scatter-gather functionality. */\n+\tRTE_BBDEV_LDPC_DEC_SCATTER_GATHER = (1ULL << 12),\n+\t/** Set if a device supports input/output HARQ compression. */\n+\tRTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION = (1ULL << 13),\n+\t/** Set if a device supports input LLR compression. */\n+\tRTE_BBDEV_LDPC_LLR_COMPRESSION = (1ULL << 14),\n+\t/** Set if a device supports HARQ input from\n+\t *  device's internal memory.\n+\t */\n+\tRTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE = (1ULL << 15),\n+\t/** Set if a device supports HARQ output to\n+\t *  device's internal memory.\n+\t */\n+\tRTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE = (1ULL << 16),\n+\t/** Set if a device supports loop-back access to\n+\t *  HARQ internal memory. Intended for troubleshooting.\n+\t */\n+\tRTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK = (1ULL << 17)\n+};\n+\n+/** Flags for LDPC encoder operation and capability structure */\n+enum rte_bbdev_op_ldpcenc_flag_bitmasks {\n+\t/** Set for bit-level interleaver bypass on output stream. */\n+\tRTE_BBDEV_LDPC_INTERLEAVER_BYPASS = (1ULL << 0),\n+\t/** If rate matching is to be performed */\n+\tRTE_BBDEV_LDPC_RATE_MATCH = (1ULL << 1),\n+\t/** Set for transport block CRC-24A attach */\n+\tRTE_BBDEV_LDPC_CRC_24A_ATTACH = (1ULL << 2),\n+\t/** Set for code block CRC-24B attach */\n+\tRTE_BBDEV_LDPC_CRC_24B_ATTACH = (1ULL << 3),\n+\t/** Set for code block CRC-16 attach */\n+\tRTE_BBDEV_LDPC_CRC_16_ATTACH = (1ULL << 4),\n+\t/** Set if a device supports encoder dequeue interrupts. */\n+\tRTE_BBDEV_LDPC_ENC_INTERRUPTS = (1ULL << 5),\n+\t/** Set if a device supports scatter-gather functionality. */\n+\tRTE_BBDEV_LDPC_ENC_SCATTER_GATHER = (1ULL << 6),\n+\t/** Set if a device supports concatenation of non byte aligned output */\n+\tRTE_BBDEV_LDPC_ENC_CONCATENATION = (1ULL << 7)\n+};\n+\n+/** Data input and output buffer for BBDEV operations */\n struct rte_bbdev_op_data {\n-\t/**< The mbuf data structure representing the data for BBDEV operation.\n+\t/** The mbuf data structure representing the data for BBDEV operation.\n \t *\n \t * This mbuf pointer can point to one Code Block (CB) data buffer or\n \t * multiple CBs contiguously located next to each other.\n \t * A Transport Block (TB) represents a whole piece of data that is\n \t * divided into one or more CBs. Maximum number of CBs can be contained\n-\t * in one TB is defined by RTE_BBDEV_TURBO_MAX_CODE_BLOCKS.\n+\t * in one TB is defined by RTE_BBDEV_(TURBO/LDPC)_MAX_CODE_BLOCKS.\n \t *\n \t * An mbuf data structure cannot represent more than one TB. The\n \t * smallest piece of data that can be contained in one mbuf is one CB.\n@@ -145,8 +220,8 @@ struct rte_bbdev_op_data {\n \t * then it is capable of collecting (gathering) non-contiguous\n \t * (scattered) data from multiple locations in the memory.\n \t * This capability is reported by the capability flags:\n-\t * - RTE_BBDEV_TURBO_ENC_SCATTER_GATHER and\n-\t * - RTE_BBDEV_TURBO_DEC_SCATTER_GATHER.\n+\t * - RTE_BBDEV_(TURBO/LDPC)_ENC_SCATTER_GATHER and\n+\t * - RTE_BBDEV_(TURBO/LDPC)_DEC_SCATTER_GATHER.\n \t * Only if a BBDEV PMD supports this feature, chained mbuf data\n \t * structures are accepted. A chained mbuf can represent one\n \t * non-contiguous CB or multiple non-contiguous CBs.\n@@ -157,7 +232,7 @@ struct rte_bbdev_op_data {\n \t * was a chained mbuf.\n \t */\n \tstruct rte_mbuf *data;\n-\t/**< The starting point of the BBDEV (encode/decode) operation,\n+\t/** The starting point of the BBDEV (encode/decode) operation,\n \t * in bytes.\n \t *\n \t * BBDEV starts to read data past this offset.\n@@ -165,13 +240,13 @@ struct rte_bbdev_op_data {\n \t * segment.\n \t */\n \tuint32_t offset;\n-\t/**< The total data length to be processed in one operation, in bytes.\n+\t/** The total data length to be processed in one operation, in bytes.\n \t *\n \t * In case the mbuf data is representing one CB, this is the length of\n \t * the CB undergoing the operation.\n \t * If it's for multiple CBs, this is the total length of those CBs\n \t * undergoing the operation.\n-\t * If it's for one TB, this is the total length of the TB under\n+\t * If it is for one TB, this is the total length of the TB under\n \t * operation.\n \t *\n \t * In case of chained mbuf, this data length includes the lengths of the\n@@ -180,51 +255,83 @@ struct rte_bbdev_op_data {\n \tuint32_t length;\n };\n \n-struct rte_bbdev_op_dec_cb_params {\n-\t/**< The K size of the input CB, in bits [40:6144], as specified in\n+/** Turbo decode code block parameters */\n+struct rte_bbdev_op_dec_turbo_cb_params {\n+\t/** The K size of the input CB, in bits [40:6144], as specified in\n \t * 3GPP TS 36.212.\n \t * This size is inclusive of CRC bits, regardless whether it was\n \t * pre-calculated by the application or not.\n \t */\n \tuint16_t k;\n-\t/**< The E length of the CB rate matched LLR output, in bytes, as in\n+\t/** The E length of the CB rate matched LLR output, in bytes, as in\n \t * 3GPP TS 36.212.\n \t */\n \tuint32_t e;\n };\n \n-struct rte_bbdev_op_dec_tb_params {\n-\t/**< The K- size of the input CB, in bits [40:6144], that is in the\n+/** LDPC decode code block parameters */\n+struct rte_bbdev_op_dec_ldpc_cb_params {\n+\t/** Rate matching output sequence length in bits or LLRs.\n+\t *  [3GPP TS38.212, section 5.4.2.1]\n+\t */\n+\tuint32_t e;\n+};\n+\n+/** Turbo decode transport block parameters */\n+struct rte_bbdev_op_dec_turbo_tb_params {\n+\t/** The K- size of the input CB, in bits [40:6144], that is in the\n \t * Turbo operation when r < C-, as in 3GPP TS 36.212.\n \t */\n \tuint16_t k_neg;\n-\t/**< The K+ size of the input CB, in bits [40:6144], that is in the\n+\t/** The K+ size of the input CB, in bits [40:6144], that is in the\n \t * Turbo operation when r >= C-, as in 3GPP TS 36.212.\n \t */\n \tuint16_t k_pos;\n-\t/**< The number of CBs that have K- size, [0:63] */\n+\t/** The number of CBs that have K- size, [0:63] */\n \tuint8_t c_neg;\n-\t/**< The total number of CBs in the TB, [1:RTE_BBDEV_TURBO_MAX_CODE_BLOCKS] */\n+\t/** The total number of CBs in the TB,\n+\t * [1:RTE_BBDEV_TURBO_MAX_CODE_BLOCKS]\n+\t */\n \tuint8_t c;\n-\t/**< The number of CBs that uses Ea before switching to Eb, [0:63] */\n+\t/** The number of CBs that uses Ea before switching to Eb, [0:63] */\n \tuint8_t cab;\n-\t/**< The E size of the CB rate matched output to use in the Turbo\n+\t/** The E size of the CB rate matched output to use in the Turbo\n \t * operation when r < cab\n \t */\n \tuint32_t ea;\n-\t/**< The E size of the CB rate matched output to use in the Turbo\n+\t/** The E size of the CB rate matched output to use in the Turbo\n \t * operation when r >= cab\n \t */\n \tuint32_t eb;\n-\t/**< The index of the first CB in the inbound mbuf data, default is 0 */\n+\t/** The index of the first CB in the inbound mbuf data, default is 0 */\n \tuint8_t r;\n };\n \n-/**< Operation structure for Turbo decode.\n- * An operation can perform on one CB at a time \"CB-mode\".\n- * An operation can perform on one or multiple CBs that are logically belonging\n- * to one TB \"TB-mode\".\n- * The provided K size parameter of the CB is its size out coming from the\n+/** LDPC decode transport block parameters */\n+struct rte_bbdev_op_dec_ldpc_tb_params {\n+\t/** Ea, length after rate matching in bits, r < cab.\n+\t *  [3GPP TS38.212, section 5.4.2.1]\n+\t */\n+\tuint32_t ea;\n+\t/** Eb, length after rate matching in bits, r >= cab.\n+\t *  [3GPP TS38.212, section 5.4.2.1]\n+\t */\n+\tuint32_t eb;\n+\t/** The total number of CBs in the TB or partial TB\n+\t * [1:RTE_BBDEV_LDPC_MAX_CODE_BLOCKS]\n+\t */\n+\tuint8_t c;\n+\t/** The index of the first CB in the inbound mbuf data, default is 0 */\n+\tuint8_t r;\n+\t/** The number of CBs that use Ea before switching to Eb, [0:63] */\n+\tuint8_t cab;\n+};\n+\n+/** Operation structure for Turbo decode.\n+ * An operation can be performed on one CB at a time \"CB-mode\".\n+ * An operation can be performed on one or multiple CBs that logically\n+ * belong to one TB \"TB-mode\".\n+ * The provided K size parameter of the CB is its size coming from the\n  * decode operation.\n  * CRC24A/B check is requested by the application by setting the flag\n  * RTE_BBDEV_TURBO_CRC_TYPE_24B for CRC24B check or CRC24A otherwise.\n@@ -249,94 +356,192 @@ struct rte_bbdev_op_dec_tb_params {\n  * application with enough room for the output data.\n  */\n struct rte_bbdev_op_turbo_dec {\n-\t/**< The Virtual Circular Buffer, wk, size 3*Kpi for each CB */\n+\t/** The Virtual Circular Buffer, wk, size 3*Kpi for each CB */\n \tstruct rte_bbdev_op_data input;\n-\t/**< The hard decisions buffer for the decoded output,\n+\t/** The hard decisions buffer for the decoded output,\n \t * size K for each CB\n \t */\n \tstruct rte_bbdev_op_data hard_output;\n-\t/**< The soft LLR output buffer - optional */\n+\t/** The soft LLR output buffer - optional */\n \tstruct rte_bbdev_op_data soft_output;\n \n-\tuint32_t op_flags;  /**< Flags from rte_bbdev_op_td_flag_bitmasks */\n-\tuint8_t rv_index;  /**< Rv index for rate matching [0:3] */\n-\t/**< The minimum number of iterations to perform in decoding all CBs in\n+\t/** Flags from rte_bbdev_op_td_flag_bitmasks */\n+\tuint32_t op_flags;\n+\n+\t/** Rv index for rate matching [0:3] */\n+\tuint8_t rv_index;\n+\t/** The minimum number of iterations to perform in decoding all CBs in\n \t * this operation - input\n \t */\n \tuint8_t iter_min:4;\n-\t/**< The maximum number of iterations to perform in decoding all CBs in\n+\t/** The maximum number of iterations to perform in decoding all CBs in\n \t * this operation - input\n \t */\n \tuint8_t iter_max:4;\n-\t/**< The maximum number of iterations that were perform in decoding all\n-\t * CBs in this decode operation - output\n+\t/** The maximum number of iterations that were performed in decoding\n+\t * all CBs in this decode operation - output\n \t */\n \tuint8_t iter_count;\n-\t/**< 5 bit extrinsic scale (scale factor on extrinsic info) */\n+\t/** 5 bit extrinsic scale (scale factor on extrinsic info) */\n \tuint8_t ext_scale;\n-\t/**< Number of MAP engines to use in decode,\n-\t * must be power of 2 (or 0 to auto-select)\n+\t/** Number of MAP engines to use in decode,\n+\t *  must be power of 2 (or 0 to auto-select)\n \t */\n \tuint8_t num_maps;\n \n-\tuint8_t code_block_mode; /**< [0 - TB : 1 - CB] */\n+\t/**< [0 - TB : 1 - CB] */\n+\tuint8_t code_block_mode;\n \tunion {\n \t\t/**< Struct which stores Code Block specific parameters */\n-\t\tstruct rte_bbdev_op_dec_cb_params cb_params;\n+\t\tstruct rte_bbdev_op_dec_turbo_cb_params cb_params;\n \t\t/**< Struct which stores Transport Block specific parameters */\n-\t\tstruct rte_bbdev_op_dec_tb_params tb_params;\n+\t\tstruct rte_bbdev_op_dec_turbo_tb_params tb_params;\n+\t};\n+};\n+\n+/** Operation structure for LDPC decode.\n+ *\n+ * An operation can be performed on one CB at a time \"CB-mode\".\n+ * An operation can also be performed on one or multiple CBs that logically\n+ * belong to a TB \"TB-mode\" (Currently not supported).\n+ *\n+ * The input encoded CB data is the Virtual Circular Buffer data stream.\n+ *\n+ * Each byte in the input circular buffer is the LLR value of each bit of the\n+ * original CB.\n+ *\n+ * Hard output is a mandatory capability that all BBDEV PMDs support. This is\n+ * the decoded CBs (CRC24A/B is the last 24-bit in each decoded CB).\n+ *\n+ * Soft output is an optional capability for BBDEV PMDs. If supported, an LLR\n+ * rate matched output is computed in the soft_output buffer structure.\n+ * These are A Posteriori Probabilities (APP) LLR samples for coded bits.\n+ *\n+ * HARQ combined output is an optional capability for BBDEV PMDs.\n+ * If supported, a LLR output is streamed to the harq_combined_output\n+ * buffer.\n+ *\n+ * HARQ combined input is an optional capability for BBDEV PMDs.\n+ * If supported, a LLR input is streamed from the harq_combined_input\n+ * buffer.\n+ *\n+ * The output mbuf data structure is expected to be allocated by the\n+ * application with enough room for the output data.\n+ */\n+struct rte_bbdev_op_ldpc_dec {\n+\t/** The Virtual Circular Buffer for this code block, one LLR\n+\t* per bit of the original CB.\n+\t*/\n+\tstruct rte_bbdev_op_data input;\n+\t/** The hard decisions buffer for the decoded output,\n+\t * size K for each CB\n+\t */\n+\tstruct rte_bbdev_op_data hard_output;\n+\t/** The soft LLR output LLR stream buffer - optional */\n+\tstruct rte_bbdev_op_data soft_output;\n+\t/** The HARQ combined LLR stream input buffer - optional */\n+\tstruct rte_bbdev_op_data harq_combined_input;\n+\t/** The HARQ combined LLR stream output buffer - optional */\n+\tstruct rte_bbdev_op_data harq_combined_output;\n+\n+\t/** Flags from rte_bbdev_op_ldpcdec_flag_bitmasks */\n+\tuint32_t op_flags;\n+\n+\t/** Rate matching redundancy version\n+\t *  [3GPP TS38.212, section 5.4.2.1]\n+\t */\n+\tuint8_t rv_index;\n+\t/** The maximum number of iterations to perform in decoding CB in\n+\t *  this operation - input\n+\t */\n+\tuint8_t iter_max;\n+\t/** The number of iterations that were performed in decoding\n+\t * CB in this decode operation - output\n+\t */\n+\tuint8_t iter_count;\n+\t/** 1: LDPC Base graph 1, 2: LDPC Base graph 2.\n+\t * [3GPP TS38.212, section 5.2.2]\n+\t */\n+\tuint8_t basegraph;\n+\t/** Zc, LDPC lifting size.\n+\t *  [3GPP TS38.212, section 5.2.2]\n+\t */\n+\tuint16_t z_c;\n+\t/** Ncb, length of the circular buffer in bits.\n+\t *  [3GPP TS38.212, section 5.4.2.1]\n+\t */\n+\tuint16_t n_cb;\n+\t/** Qm, modulation order {1,2,4,6,8}.\n+\t *  [3GPP TS38.212, section 5.4.2.2]\n+\t */\n+\tuint8_t q_m;\n+\t/** Number of Filler bits, n_filler = K – K’\n+\t *  [3GPP TS38.212 section 5.2.2]\n+\t */\n+\tuint16_t n_filler;\n+\t/** [0 - TB : 1 - CB] */\n+\tuint8_t code_block_mode;\n+\tunion {\n+\t\t/** Struct which stores Code Block specific parameters */\n+\t\tstruct rte_bbdev_op_dec_ldpc_cb_params cb_params;\n+\t\t/** Struct which stores Transport Block specific parameters */\n+\t\tstruct rte_bbdev_op_dec_ldpc_tb_params tb_params;\n \t};\n };\n \n+/** Turbo encode code block parameters */\n struct rte_bbdev_op_enc_turbo_cb_params {\n-\t/**< The K size of the input CB, in bits [40:6144], as specified in\n+\t/** The K size of the input CB, in bits [40:6144], as specified in\n \t * 3GPP TS 36.212.\n \t * This size is inclusive of CRC24A, regardless whether it was\n \t * pre-calculated by the application or not.\n \t */\n \tuint16_t k;\n-\t/**< The E length of the CB rate matched output, in bits, as in\n+\t/** The E length of the CB rate matched output, in bits, as in\n \t * 3GPP TS 36.212.\n \t */\n \tuint32_t e;\n-\t/**< The Ncb soft buffer size of the CB rate matched output [K:3*Kpi],\n+\t/** The Ncb soft buffer size of the CB rate matched output [K:3*Kpi],\n \t * in bits, as specified in 3GPP TS 36.212.\n \t */\n \tuint16_t ncb;\n };\n \n+/** Turbo encode transport block parameters */\n struct rte_bbdev_op_enc_turbo_tb_params {\n-\t/**< The K- size of the input CB, in bits [40:6144], that is in the\n+\t/** The K- size of the input CB, in bits [40:6144], that is in the\n \t * Turbo operation when r < C-, as in 3GPP TS 36.212.\n \t * This size is inclusive of CRC24B, regardless whether it was\n \t * pre-calculated and appended by the application or not.\n \t */\n \tuint16_t k_neg;\n-\t/**< The K+ size of the input CB, in bits [40:6144], that is in the\n+\t/** The K+ size of the input CB, in bits [40:6144], that is in the\n \t * Turbo operation when r >= C-, as in 3GPP TS 36.212.\n \t * This size is inclusive of CRC24B, regardless whether it was\n \t * pre-calculated and appended by the application or not.\n \t */\n \tuint16_t k_pos;\n-\t/**< The number of CBs that have K- size, [0:63] */\n+\t/** The number of CBs that have K- size, [0:63] */\n \tuint8_t c_neg;\n-\t/**< The total number of CBs in the TB, [1:RTE_BBDEV_TURBO_MAX_CODE_BLOCKS] */\n+\t/** The total number of CBs in the TB,\n+\t * [1:RTE_BBDEV_TURBO_MAX_CODE_BLOCKS]\n+\t */\n \tuint8_t c;\n-\t/**< The number of CBs that uses Ea before switching to Eb, [0:63] */\n+\t/** The number of CBs that uses Ea before switching to Eb, [0:63] */\n \tuint8_t cab;\n-\t/**< The E size of the CB rate matched output to use in the Turbo\n+\t/** The E size of the CB rate matched output to use in the Turbo\n \t * operation when r < cab\n \t */\n \tuint32_t ea;\n-\t/**< The E size of the CB rate matched output to use in the Turbo\n+\t/** The E size of the CB rate matched output to use in the Turbo\n \t * operation when r >= cab\n \t */\n \tuint32_t eb;\n-\t/**< The Ncb soft buffer size for the rate matched CB that is used in\n+\t/** The Ncb soft buffer size for the rate matched CB that is used in\n \t * the Turbo operation when r < C-, [K:3*Kpi]\n \t */\n \tuint16_t ncb_neg;\n-\t/**< The Ncb soft buffer size for the rate matched CB that is used in\n+\t/** The Ncb soft buffer size for the rate matched CB that is used in\n \t * the Turbo operation when r >= C-, [K:3*Kpi]\n \t */\n \tuint16_t ncb_pos;\n@@ -344,10 +549,38 @@ struct rte_bbdev_op_enc_turbo_tb_params {\n \tuint8_t r;\n };\n \n-/**< Operation structure for Turbo encode.\n- * An operation can perform on one CB at a time \"CB-mode\".\n- * An operation can perform on one or multiple CBs that are logically\n- * belonging to one TB \"TB-mode\".\n+/** LDPC encode code block parameters */\n+struct rte_bbdev_op_enc_ldpc_cb_params {\n+\t/** E, length after rate matching in bits.\n+\t *  [3GPP TS38.212, section 5.4.2.1]\n+\t */\n+\tuint32_t e;\n+};\n+\n+/** LDPC encode transport block parameters */\n+struct rte_bbdev_op_enc_ldpc_tb_params {\n+\t/** Ea, length after rate matching in bits, r < cab.\n+\t *  [3GPP TS38.212, section 5.4.2.1]\n+\t */\n+\tuint32_t ea;\n+\t/** Eb, length after rate matching in bits, r >= cab.\n+\t *  [3GPP TS38.212, section 5.4.2.1]\n+\t */\n+\tuint32_t eb;\n+\t/** The total number of CBs in the TB or partial TB\n+\t * [1:RTE_BBDEV_LDPC_MAX_CODE_BLOCKS]\n+\t */\n+\tuint8_t c;\n+\t/** The index of the first CB in the inbound mbuf data, default is 0 */\n+\tuint8_t r;\n+\t/** The number of CBs that use Ea before switching to Eb, [0:63] */\n+\tuint8_t cab;\n+};\n+\n+/** Operation structure for Turbo encode.\n+ * An operation can be performed on one CB at a time \"CB-mode\".\n+ * An operation can pbe erformd on one or multiple CBs that logically\n+ * belong to one TB \"TB-mode\".\n  *\n  * In CB-mode, CRC24A/B is an optional operation. K size parameter is not\n  * affected by CRC24A/B inclusion, this only affects the inbound mbuf data\n@@ -364,44 +597,131 @@ struct rte_bbdev_op_enc_turbo_tb_params {\n  * application with enough room for the output data.\n  */\n struct rte_bbdev_op_turbo_enc {\n-\t/**< The input CB or TB data */\n+\t/** The input CB or TB data */\n \tstruct rte_bbdev_op_data input;\n-\t/**< The rate matched CB or TB output buffer */\n+\t/** The rate matched CB or TB output buffer */\n \tstruct rte_bbdev_op_data output;\n+\t/** Flags from rte_bbdev_op_te_flag_bitmasks */\n+\tuint32_t op_flags;\n \n-\tuint32_t op_flags;  /**< Flags from rte_bbdev_op_te_flag_bitmasks */\n-\tuint8_t rv_index;  /**< Rv index for rate matching [0:3] */\n-\n-\tuint8_t code_block_mode; /**< [0 - TB : 1 - CB] */\n+\t/** Rv index for rate matching [0:3] */\n+\tuint8_t rv_index;\n+\t/** [0 - TB : 1 - CB] */\n+\tuint8_t code_block_mode;\n \tunion {\n-\t\t/**< Struct which stores Code Block specific parameters */\n+\t\t/** Struct which stores Code Block specific parameters */\n \t\tstruct rte_bbdev_op_enc_turbo_cb_params cb_params;\n-\t\t/**< Struct which stores Transport Block specific parameters */\n+\t\t/** Struct which stores Transport Block specific parameters */\n \t\tstruct rte_bbdev_op_enc_turbo_tb_params tb_params;\n \t};\n };\n \n-/**< List of the capabilities for the Turbo Decoder */\n+/** Operation structure for LDPC encode.\n+ * An operation can be performed on one CB at a time \"CB-mode\".\n+ * An operation can be performed on one or multiple CBs that logically\n+ * belong to a TB \"TB-mode\".\n+ *\n+ * The input data is the CB or TB input to the decoder.\n+ *\n+ * The output data is the ratematched CB or TB data, or the output after\n+ * bit-selection if RTE_BBDEV_LDPC_INTERLEAVER_BYPASS is set.\n+ *\n+ * The output mbuf data structure is expected to be allocated by the\n+ * application with enough room for the output data.\n+ */\n+struct rte_bbdev_op_ldpc_enc {\n+\t/** The input TB or CB data */\n+\tstruct rte_bbdev_op_data input;\n+\t/** The rate matched TB or CB output buffer */\n+\tstruct rte_bbdev_op_data output;\n+\n+\t/** Flags from rte_bbdev_op_ldpcenc_flag_bitmasks */\n+\tuint32_t op_flags;\n+\n+\t/** Rate matching redundancy version */\n+\tuint8_t rv_index;\n+\t/** 1: LDPC Base graph 1, 2: LDPC Base graph 2.\n+\t *  [3GPP TS38.212, section 5.2.2]\n+\t */\n+\tuint8_t basegraph;\n+\t/** Zc, LDPC lifting size.\n+\t *  [3GPP TS38.212, section 5.2.2]\n+\t */\n+\tuint16_t z_c;\n+\t/** Ncb, length of the circular buffer in bits.\n+\t *  [3GPP TS38.212, section 5.4.2.1]\n+\t */\n+\tuint16_t n_cb;\n+\t/** Qm, modulation order {2,4,6,8,10}.\n+\t *  [3GPP TS38.212, section 5.4.2.2]\n+\t */\n+\tuint8_t q_m;\n+\t/** Number of Filler bits, n_filler = K – K’\n+\t *  [3GPP TS38.212 section 5.2.2]\n+\t */\n+\tuint16_t n_filler;\n+\t/** [0 - TB : 1 - CB] */\n+\tuint8_t code_block_mode;\n+\tunion {\n+\t\t/** Struct which stores Code Block specific parameters */\n+\t\tstruct rte_bbdev_op_enc_ldpc_cb_params cb_params;\n+\t\t/** Struct which stores Transport Block specific parameters */\n+\t\tstruct rte_bbdev_op_enc_ldpc_tb_params tb_params;\n+\t};\n+};\n+\n+/** List of the capabilities for the Turbo Decoder */\n struct rte_bbdev_op_cap_turbo_dec {\n-\t/**< Flags from rte_bbdev_op_td_flag_bitmasks */\n+\t/** Flags from rte_bbdev_op_td_flag_bitmasks */\n \tuint32_t capability_flags;\n \t/** Maximal LLR absolute value. Acceptable LLR values lie in range\n \t * [-max_llr_modulus, max_llr_modulus].\n \t */\n \tint8_t max_llr_modulus;\n+\t/** Num input code block buffers */\n \tuint8_t num_buffers_src;  /**< Num input code block buffers */\n-\t/**< Num hard output code block buffers */\n+\t/** Num hard output code block buffers */\n \tuint8_t num_buffers_hard_out;\n-\t/**< Num soft output code block buffers if supported by the driver */\n+\t/** Num soft output code block buffers if supported by the driver */\n \tuint8_t num_buffers_soft_out;\n };\n \n-/**< List of the capabilities for the Turbo Encoder */\n+/** List of the capabilities for the Turbo Encoder */\n struct rte_bbdev_op_cap_turbo_enc {\n-\t/**< Flags from rte_bbdev_op_te_flag_bitmasks */\n+\t/** Flags from rte_bbdev_op_te_flag_bitmasks */\n \tuint32_t capability_flags;\n-\tuint8_t num_buffers_src;  /**< Num input code block buffers */\n-\tuint8_t num_buffers_dst;  /**< Num output code block buffers */\n+\t/** Num input code block buffers */\n+\tuint8_t num_buffers_src;\n+\t/** Num output code block buffers */\n+\tuint8_t num_buffers_dst;\n+};\n+\n+/** List of the capabilities for the LDPC Decoder */\n+struct rte_bbdev_op_cap_ldpc_dec {\n+\t/** Flags from rte_bbdev_op_ldpcdec_flag_bitmasks */\n+\tuint32_t capability_flags;\n+\t/** LLR size in bits. LLR is a two’s complement number. */\n+\tint8_t llr_size;\n+\t/** LLR numbers of decimals bit for arithmetic representation */\n+\tint8_t llr_decimals;\n+\t/** Amount of memory for HARQ in external DDR in MB */\n+\tuint16_t harq_memory_size;\n+\t/** Num input code block buffers */\n+\tuint16_t num_buffers_src;\n+\t/** Num hard output code block buffers */\n+\tuint16_t num_buffers_hard_out;\n+\t/** Num soft output code block buffers if supported by the driver */\n+\tuint16_t num_buffers_soft_out;\n+};\n+\n+/** List of the capabilities for the LDPC Encoder */\n+struct rte_bbdev_op_cap_ldpc_enc {\n+\t/** Flags from rte_bbdev_op_ldpcenc_flag_bitmasks */\n+\tuint32_t capability_flags;\n+\t/** Num input code block buffers */\n+\tuint16_t num_buffers_src;\n+\t/** Num output code block buffers */\n+\tuint16_t num_buffers_dst;\n };\n \n /** Different operation types supported by the device */\n@@ -409,40 +729,59 @@ enum rte_bbdev_op_type {\n \tRTE_BBDEV_OP_NONE,  /**< Dummy operation that does nothing */\n \tRTE_BBDEV_OP_TURBO_DEC,  /**< Turbo decode */\n \tRTE_BBDEV_OP_TURBO_ENC,  /**< Turbo encode */\n+\tRTE_BBDEV_OP_LDPC_DEC,  /**< LDPC decode */\n+\tRTE_BBDEV_OP_LDPC_ENC,  /**< LDPC encode */\n \tRTE_BBDEV_OP_TYPE_COUNT,  /**< Count of different op types */\n };\n \n-/**< Bit indexes of possible errors reported through status field */\n+/** Bit indexes of possible errors reported through status field */\n enum {\n \tRTE_BBDEV_DRV_ERROR,\n \tRTE_BBDEV_DATA_ERROR,\n \tRTE_BBDEV_CRC_ERROR,\n+\tRTE_BBDEV_SYNDROME_ERROR\n };\n \n-/**< Structure specifying a single encode operation */\n+/** Structure specifying a single encode operation */\n struct rte_bbdev_enc_op {\n-\tint status;  /**< Status of operation that was performed */\n-\tstruct rte_mempool *mempool;  /**< Mempool which op instance is in */\n-\tvoid *opaque_data;  /**< Opaque pointer for user data */\n-\t/**< Contains encoder specific parameters */\n-\tstruct rte_bbdev_op_turbo_enc turbo_enc;\n+\t/**< Status of operation that was performed */\n+\tint status;\n+\t/**< Mempool which op instance is in */\n+\tstruct rte_mempool *mempool;\n+\t/**< Opaque pointer for user data */\n+\tvoid *opaque_data;\n+\tunion {\n+\t\t/** Contains turbo decoder specific parameters */\n+\t\tstruct rte_bbdev_op_turbo_enc turbo_enc;\n+\t\t/** Contains LDPC decoder specific parameters */\n+\t\tstruct rte_bbdev_op_ldpc_enc ldpc_enc;\n+\t};\n };\n \n-/**< Structure specifying a single decode operation */\n+/** Structure specifying a single decode operation */\n struct rte_bbdev_dec_op {\n-\tint status;  /**< Status of operation that was performed */\n-\tstruct rte_mempool *mempool;  /**< Mempool which op instance is in */\n-\tvoid *opaque_data;  /**< Opaque pointer for user data */\n-\t/**< Contains decoder specific parameters */\n-\tstruct rte_bbdev_op_turbo_dec turbo_dec;\n+\t/** Status of operation that was performed */\n+\tint status;\n+\t/** Mempool which op instance is in */\n+\tstruct rte_mempool *mempool;\n+\t/** Opaque pointer for user data */\n+\tvoid *opaque_data;\n+\tunion {\n+\t\t/** Contains turbo decoder specific parameters */\n+\t\tstruct rte_bbdev_op_turbo_dec turbo_dec;\n+\t\t/** Contains LDPC decoder specific parameters */\n+\t\tstruct rte_bbdev_op_ldpc_dec ldpc_dec;\n+\t};\n };\n \n-/**< Operation capabilities supported by a device */\n+/** Operation capabilities supported by a device */\n struct rte_bbdev_op_cap {\n \tenum rte_bbdev_op_type type;  /**< Type of operation */\n \tunion {\n \t\tstruct rte_bbdev_op_cap_turbo_dec turbo_dec;\n \t\tstruct rte_bbdev_op_cap_turbo_enc turbo_enc;\n+\t\tstruct rte_bbdev_op_cap_ldpc_dec ldpc_dec;\n+\t\tstruct rte_bbdev_op_cap_ldpc_enc ldpc_enc;\n \t} cap;  /**< Operation-type specific capabilities */\n };\n \n@@ -513,7 +852,8 @@ struct rte_mempool * __rte_experimental\n \t/* Check type */\n \tpriv = (struct rte_bbdev_op_pool_private *)\n \t\t\trte_mempool_get_priv(mempool);\n-\tif (unlikely(priv->type != RTE_BBDEV_OP_TURBO_ENC))\n+\tif (unlikely((priv->type != RTE_BBDEV_OP_TURBO_ENC) &&\n+\t\t\t\t\t(priv->type != RTE_BBDEV_OP_LDPC_ENC)))\n \t\treturn -EINVAL;\n \n \t/* Get elements */\n@@ -548,7 +888,8 @@ struct rte_mempool * __rte_experimental\n \t/* Check type */\n \tpriv = (struct rte_bbdev_op_pool_private *)\n \t\t\trte_mempool_get_priv(mempool);\n-\tif (unlikely(priv->type != RTE_BBDEV_OP_TURBO_DEC))\n+\tif (unlikely((priv->type != RTE_BBDEV_OP_TURBO_DEC) &&\n+\t\t\t\t\t(priv->type != RTE_BBDEV_OP_LDPC_DEC)))\n \t\treturn -EINVAL;\n \n \t/* Get elements */\n",
    "prefixes": [
        "v3",
        "04/10"
    ]
}