get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 66075,
    "url": "http://patches.dpdk.org/api/patches/66075/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1582778348-113547-7-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": "<1582778348-113547-7-git-send-email-nicolas.chautru@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1582778348-113547-7-git-send-email-nicolas.chautru@intel.com",
    "date": "2020-02-27T04:39:00",
    "name": "[v1,06/14] test-bbdev: support HARQ validation",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d50139159d1c7e4acef6306ff9bad095058d5af1",
    "submitter": {
        "id": 1314,
        "url": "http://patches.dpdk.org/api/people/1314/?format=api",
        "name": "Chautru, Nicolas",
        "email": "nicolas.chautru@intel.com"
    },
    "delegate": {
        "id": 6690,
        "url": "http://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1582778348-113547-7-git-send-email-nicolas.chautru@intel.com/mbox/",
    "series": [
        {
            "id": 8704,
            "url": "http://patches.dpdk.org/api/series/8704/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8704",
            "date": "2020-02-27T04:38:54",
            "name": "bbdev new features",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/8704/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/66075/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/66075/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 597C0A055A;\n\tThu, 27 Feb 2020 05:41:14 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 02DE91BFFB;\n\tThu, 27 Feb 2020 05:40:20 +0100 (CET)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by dpdk.org (Postfix) with ESMTP id 186731BFC8\n for <dev@dpdk.org>; Thu, 27 Feb 2020 05:40:08 +0100 (CET)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 26 Feb 2020 20:40:06 -0800",
            "from skx-5gnr-sc12-4.sc.intel.com ([172.25.69.210])\n by fmsmga004.fm.intel.com with ESMTP; 26 Feb 2020 20:40:06 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.70,490,1574150400\"; d=\"scan'208\";a=\"261310497\"",
        "From": "Nicolas Chautru <nicolas.chautru@intel.com>",
        "To": "thomas@monjalon.net,\n\takhil.goyal@nxp.com,\n\tdev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com,\n\tNic Chautru <nicolas.chautru@intel.com>",
        "Date": "Wed, 26 Feb 2020 20:39:00 -0800",
        "Message-Id": "<1582778348-113547-7-git-send-email-nicolas.chautru@intel.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1582778348-113547-1-git-send-email-nicolas.chautru@intel.com>",
        "References": "<1582778348-113547-1-git-send-email-nicolas.chautru@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v1 06/14] test-bbdev: support HARQ validation",
        "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Nic Chautru <nicolas.chautru@intel.com>\n\nAdding functionality to validate HARQ for different\ndevices implementation.\nAdding capacity to fetch HARQ data when required as\npart of this validation.\n\nSigned-off-by: Nic Chautru <nicolas.chautru@intel.com>\n---\n app/test-bbdev/test_bbdev_perf.c   | 552 ++++++++++++++++++++++++++++++++-----\n app/test-bbdev/test_bbdev_vector.c |   9 +-\n 2 files changed, 492 insertions(+), 69 deletions(-)",
    "diff": "diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c\nindex aa8bb71..978ccd6 100644\n--- a/app/test-bbdev/test_bbdev_perf.c\n+++ b/app/test-bbdev/test_bbdev_perf.c\n@@ -44,14 +44,25 @@\n \n #define SYNC_WAIT 0\n #define SYNC_START 1\n+#define INVALID_OPAQUE -1\n \n #define INVALID_QUEUE_ID -1\n+/* Increment for next code block in external HARQ memory */\n+#define HARQ_INCR 32768\n+/* Headroom for filler LLRs insertion in HARQ buffer */\n+#define FILLER_HEADROOM 1024\n \n static struct test_bbdev_vector test_vector;\n \n /* Switch between PMD and Interrupt for throughput TC */\n static bool intr_enabled;\n \n+/* LLR arithmetic representation for numerical conversion */\n+static int ldpc_llr_decimals;\n+static int ldpc_llr_size;\n+/* Keep track of the LDPC decoder device capability flag */\n+static uint32_t ldpc_cap_flags;\n+\n /* Represents tested active devices */\n static struct active_device {\n \tconst char *driver_name;\n@@ -293,7 +304,7 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\t\treturn TEST_FAILED;\n \t\t\t}\n \t\t\tif (intr_enabled && !(cap->capability_flags &\n-\t\t\t\t\tRTE_BBDEV_TURBO_ENC_INTERRUPTS)) {\n+\t\t\t\t\tRTE_BBDEV_LDPC_ENC_INTERRUPTS)) {\n \t\t\t\tprintf(\n \t\t\t\t\t\"Dequeue interrupts are not supported!\\n\");\n \t\t\t\treturn TEST_FAILED;\n@@ -336,12 +347,19 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\t\treturn TEST_FAILED;\n \t\t\t}\n \t\t\tif (intr_enabled && !(cap->capability_flags &\n-\t\t\t\t\tRTE_BBDEV_TURBO_DEC_INTERRUPTS)) {\n+\t\t\t\t\tRTE_BBDEV_LDPC_DEC_INTERRUPTS)) {\n \t\t\t\tprintf(\n \t\t\t\t\t\"Dequeue interrupts are not supported!\\n\");\n \t\t\t\treturn TEST_FAILED;\n \t\t\t}\n-\n+\t\t\tif (intr_enabled && (test_vector.ldpc_dec.op_flags &\n+\t\t\t\t(RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE |\n+\t\t\t\tRTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE |\n+\t\t\t\tRTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK\n+\t\t\t\t\t))) {\n+\t\t\t\tprintf(\"Skip loop-back with interrupt\\n\");\n+\t\t\t\treturn TEST_FAILED;\n+\t\t\t}\n \t\t\treturn TEST_SUCCESS;\n \t\t}\n \t}\n@@ -377,7 +395,8 @@ typedef int (test_case_function)(struct active_device *ad,\n \tsnprintf(pool_name, sizeof(pool_name), \"%s_pool_%u\", op_type_str,\n \t\t\tdev_id);\n \treturn rte_pktmbuf_pool_create(pool_name, mbuf_pool_size, 0, 0,\n-\t\t\tRTE_MAX(max_seg_sz + RTE_PKTMBUF_HEADROOM,\n+\t\t\tRTE_MAX(max_seg_sz + RTE_PKTMBUF_HEADROOM\n+\t\t\t\t\t+ FILLER_HEADROOM,\n \t\t\t(unsigned int)RTE_MBUF_DEFAULT_BUF_SIZE), socket_id);\n }\n \n@@ -432,27 +451,33 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\treturn TEST_SUCCESS;\n \n \t/* Inputs */\n-\tmbuf_pool_size = optimal_mempool_size(ops_pool_size * in->nb_segments);\n-\tmp = create_mbuf_pool(in, ad->dev_id, socket_id, mbuf_pool_size, \"in\");\n-\tTEST_ASSERT_NOT_NULL(mp,\n-\t\t\t\"ERROR Failed to create %u items input pktmbuf pool for dev %u on socket %u.\",\n-\t\t\tmbuf_pool_size,\n-\t\t\tad->dev_id,\n-\t\t\tsocket_id);\n-\tad->in_mbuf_pool = mp;\n+\tif (in->nb_segments > 0) {\n+\t\tmbuf_pool_size = optimal_mempool_size(ops_pool_size *\n+\t\t\t\tin->nb_segments);\n+\t\tmp = create_mbuf_pool(in, ad->dev_id, socket_id,\n+\t\t\t\tmbuf_pool_size, \"in\");\n+\t\tTEST_ASSERT_NOT_NULL(mp,\n+\t\t\t\t\"ERROR Failed to create %u items input pktmbuf pool for dev %u on socket %u.\",\n+\t\t\t\tmbuf_pool_size,\n+\t\t\t\tad->dev_id,\n+\t\t\t\tsocket_id);\n+\t\tad->in_mbuf_pool = mp;\n+\t}\n \n \t/* Hard outputs */\n-\tmbuf_pool_size = optimal_mempool_size(ops_pool_size *\n-\t\t\thard_out->nb_segments);\n-\tmp = create_mbuf_pool(hard_out, ad->dev_id, socket_id, mbuf_pool_size,\n-\t\t\t\"hard_out\");\n-\tTEST_ASSERT_NOT_NULL(mp,\n-\t\t\t\"ERROR Failed to create %u items hard output pktmbuf pool for dev %u on socket %u.\",\n-\t\t\tmbuf_pool_size,\n-\t\t\tad->dev_id,\n-\t\t\tsocket_id);\n-\tad->hard_out_mbuf_pool = mp;\n-\n+\tif (hard_out->nb_segments > 0) {\n+\t\tmbuf_pool_size = optimal_mempool_size(ops_pool_size *\n+\t\t\t\thard_out->nb_segments);\n+\t\tmp = create_mbuf_pool(hard_out, ad->dev_id, socket_id,\n+\t\t\t\tmbuf_pool_size,\n+\t\t\t\t\"hard_out\");\n+\t\tTEST_ASSERT_NOT_NULL(mp,\n+\t\t\t\t\"ERROR Failed to create %u items hard output pktmbuf pool for dev %u on socket %u.\",\n+\t\t\t\tmbuf_pool_size,\n+\t\t\t\tad->dev_id,\n+\t\t\t\tsocket_id);\n+\t\tad->hard_out_mbuf_pool = mp;\n+\t}\n \n \t/* Soft outputs */\n \tif (soft_out->nb_segments > 0) {\n@@ -907,6 +932,45 @@ typedef int (test_case_function)(struct active_device *ad,\n \t}\n }\n \n+/*\n+ * We may have to insert filler bits\n+ * when they are required by the HARQ assumption\n+ */\n+static void\n+ldpc_add_filler(struct rte_bbdev_op_data *input_ops,\n+\t\tconst uint16_t n, struct test_op_params *op_params)\n+{\n+\tstruct rte_bbdev_op_ldpc_dec dec = op_params->ref_dec_op->ldpc_dec;\n+\n+\tif (input_ops == NULL)\n+\t\treturn;\n+\t/* No need to add filler if not required by device */\n+\tif (!(ldpc_cap_flags &\n+\t\t\tRTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS))\n+\t\treturn;\n+\t/* No need to add filler for loopback operation */\n+\tif (dec.op_flags & RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK)\n+\t\treturn;\n+\n+\tuint16_t i, j, parity_offset;\n+\tfor (i = 0; i < n; ++i) {\n+\t\tstruct rte_mbuf *m = input_ops[i].data;\n+\t\tint8_t *llr = rte_pktmbuf_mtod_offset(m, int8_t *,\n+\t\t\t\tinput_ops[i].offset);\n+\t\tparity_offset = (dec.basegraph == 1 ? 20 : 8)\n+\t\t\t\t* dec.z_c - dec.n_filler;\n+\t\tuint16_t new_hin_size = input_ops[i].length + dec.n_filler;\n+\t\tm->data_len = new_hin_size;\n+\t\tinput_ops[i].length = new_hin_size;\n+\t\tfor (j = new_hin_size - 1; j >= parity_offset + dec.n_filler;\n+\t\t\t\tj--)\n+\t\t\tllr[j] = llr[j - dec.n_filler];\n+\t\tuint16_t llr_max_pre_scaling = (1 << (ldpc_llr_size - 1)) - 1;\n+\t\tfor (j = 0; j < dec.n_filler; j++)\n+\t\t\tllr[parity_offset + j] = llr_max_pre_scaling;\n+\t}\n+}\n+\n static void\n ldpc_input_llr_scaling(struct rte_bbdev_op_data *input_ops,\n \t\tconst uint16_t n, const int8_t llr_size,\n@@ -929,7 +993,9 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\t\t\t++byte_idx) {\n \n \t\t\t\tllr_tmp = llr[byte_idx];\n-\t\t\t\tif (llr_decimals == 2)\n+\t\t\t\tif (llr_decimals == 4)\n+\t\t\t\t\tllr_tmp *= 8;\n+\t\t\t\telse if (llr_decimals == 2)\n \t\t\t\t\tllr_tmp *= 2;\n \t\t\t\telse if (llr_decimals == 0)\n \t\t\t\t\tllr_tmp /= 2;\n@@ -997,12 +1063,24 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\tcapabilities->cap.turbo_dec.max_llr_modulus);\n \n \tif (test_vector.op_type == RTE_BBDEV_OP_LDPC_DEC) {\n-\t\tldpc_input_llr_scaling(*queue_ops[DATA_INPUT], n,\n-\t\t\tcapabilities->cap.ldpc_dec.llr_size,\n-\t\t\tcapabilities->cap.ldpc_dec.llr_decimals);\n-\t\tldpc_input_llr_scaling(*queue_ops[DATA_HARQ_INPUT], n,\n-\t\t\t\tcapabilities->cap.ldpc_dec.llr_size,\n-\t\t\t\tcapabilities->cap.ldpc_dec.llr_decimals);\n+\t\tbool loopback = op_params->ref_dec_op->ldpc_dec.op_flags &\n+\t\t\t\tRTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK;\n+\t\tbool llr_comp = op_params->ref_dec_op->ldpc_dec.op_flags &\n+\t\t\t\tRTE_BBDEV_LDPC_LLR_COMPRESSION;\n+\t\tbool harq_comp = op_params->ref_dec_op->ldpc_dec.op_flags &\n+\t\t\t\tRTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION;\n+\t\tldpc_llr_decimals = capabilities->cap.ldpc_dec.llr_decimals;\n+\t\tldpc_llr_size = capabilities->cap.ldpc_dec.llr_size;\n+\t\tldpc_cap_flags = capabilities->cap.ldpc_dec.capability_flags;\n+\t\tif (!loopback && !llr_comp)\n+\t\t\tldpc_input_llr_scaling(*queue_ops[DATA_INPUT], n,\n+\t\t\t\t\tldpc_llr_size, ldpc_llr_decimals);\n+\t\tif (!loopback && !harq_comp)\n+\t\t\tldpc_input_llr_scaling(*queue_ops[DATA_HARQ_INPUT], n,\n+\t\t\t\t\tldpc_llr_size, ldpc_llr_decimals);\n+\t\tif (!loopback)\n+\t\t\tldpc_add_filler(*queue_ops[DATA_HARQ_INPUT], n,\n+\t\t\t\t\top_params);\n \t}\n \n \treturn 0;\n@@ -1165,17 +1243,21 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\tops[i]->ldpc_dec.op_flags = ldpc_dec->op_flags;\n \t\tops[i]->ldpc_dec.code_block_mode = ldpc_dec->code_block_mode;\n \n-\t\tops[i]->ldpc_dec.hard_output = hard_outputs[start_idx + i];\n-\t\tops[i]->ldpc_dec.input = inputs[start_idx + i];\n+\t\tif (hard_outputs != NULL)\n+\t\t\tops[i]->ldpc_dec.hard_output =\n+\t\t\t\t\thard_outputs[start_idx + i];\n+\t\tif (inputs != NULL)\n+\t\t\tops[i]->ldpc_dec.input =\n+\t\t\t\t\tinputs[start_idx + i];\n \t\tif (soft_outputs != NULL)\n \t\t\tops[i]->ldpc_dec.soft_output =\n-\t\t\t\tsoft_outputs[start_idx + i];\n+\t\t\t\t\tsoft_outputs[start_idx + i];\n \t\tif (harq_inputs != NULL)\n \t\t\tops[i]->ldpc_dec.harq_combined_input =\n \t\t\t\t\tharq_inputs[start_idx + i];\n \t\tif (harq_outputs != NULL)\n \t\t\tops[i]->ldpc_dec.harq_combined_output =\n-\t\t\t\tharq_outputs[start_idx + i];\n+\t\t\t\t\tharq_outputs[start_idx + i];\n \t}\n }\n \n@@ -1217,7 +1299,22 @@ typedef int (test_case_function)(struct active_device *ad,\n check_dec_status_and_ordering(struct rte_bbdev_dec_op *op,\n \t\tunsigned int order_idx, const int expected_status)\n {\n-\tTEST_ASSERT(op->status == expected_status,\n+\tint status = op->status;\n+\t/* ignore parity mismatch false alarms for long iterations */\n+\t{\n+\t\tif (!(expected_status & (1 << RTE_BBDEV_SYNDROME_ERROR)) &&\n+\t\t\t\t(status & (1 << RTE_BBDEV_SYNDROME_ERROR))) {\n+\t\t\tprintf(\"WARNING: Ignore Syndrome Check mismatch\\n\");\n+\t\t\tstatus -= (1 << RTE_BBDEV_SYNDROME_ERROR);\n+\t\t}\n+\t\tif ((expected_status & (1 << RTE_BBDEV_SYNDROME_ERROR)) &&\n+\t\t\t\t!(status & (1 << RTE_BBDEV_SYNDROME_ERROR))) {\n+\t\t\tprintf(\"WARNING: Ignore Syndrome Check mismatch\\n\");\n+\t\t\tstatus += (1 << RTE_BBDEV_SYNDROME_ERROR);\n+\t\t}\n+\t}\n+\n+\tTEST_ASSERT(status == expected_status,\n \t\t\t\"op_status (%d) != expected_status (%d)\",\n \t\t\top->status, expected_status);\n \n@@ -1236,9 +1333,10 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\t\"op_status (%d) != expected_status (%d)\",\n \t\t\top->status, expected_status);\n \n-\tTEST_ASSERT((void *)(uintptr_t)order_idx == op->opaque_data,\n-\t\t\t\"Ordering error, expected %p, got %p\",\n-\t\t\t(void *)(uintptr_t)order_idx, op->opaque_data);\n+\tif (op->opaque_data != (void *)(uintptr_t)INVALID_OPAQUE)\n+\t\tTEST_ASSERT((void *)(uintptr_t)order_idx == op->opaque_data,\n+\t\t\t\t\"Ordering error, expected %p, got %p\",\n+\t\t\t\t(void *)(uintptr_t)order_idx, op->opaque_data);\n \n \treturn TEST_SUCCESS;\n }\n@@ -1282,6 +1380,170 @@ typedef int (test_case_function)(struct active_device *ad,\n \treturn TEST_SUCCESS;\n }\n \n+\n+/* Compute K0 for a given configuration for HARQ output length computation */\n+static inline uint16_t\n+get_k0(uint16_t n_cb, uint16_t z_c, uint8_t basegraph, uint8_t rv_index)\n+{\n+\tif (rv_index == 0)\n+\t\treturn 0;\n+\tuint16_t n = (basegraph == 1 ? 66 : 50) * z_c;\n+\tif (n_cb == n) {\n+\t\tif (rv_index == 1)\n+\t\t\treturn (basegraph == 1 ? 17 : 13) * z_c;\n+\t\telse if (rv_index == 2)\n+\t\t\treturn (basegraph == 1 ? 33 : 25) * z_c;\n+\t\telse\n+\t\t\treturn (basegraph == 1 ? 56 : 43) * z_c;\n+\t}\n+\t/* LBRM case - includes a division by N */\n+\tif (rv_index == 1)\n+\t\treturn (((basegraph == 1 ? 17 : 13) * n_cb)\n+\t\t\t\t/ n) * z_c;\n+\telse if (rv_index == 2)\n+\t\treturn (((basegraph == 1 ? 33 : 25) * n_cb)\n+\t\t\t\t/ n) * z_c;\n+\telse\n+\t\treturn (((basegraph == 1 ? 56 : 43) * n_cb)\n+\t\t\t\t/ n) * z_c;\n+}\n+\n+/* HARQ output length including the Filler bits */\n+static inline uint16_t\n+compute_Harq_Len(struct rte_bbdev_op_ldpc_dec *ops_ld) {\n+\tuint16_t k0 = 0;\n+\tuint8_t max_rv = (ops_ld->rv_index == 1) ? 3 : ops_ld->rv_index;\n+\tk0 = get_k0(ops_ld->n_cb, ops_ld->z_c, ops_ld->basegraph, max_rv);\n+\t/* Compute RM out size and number of rows */\n+\tuint16_t parity_offset = (ops_ld->basegraph == 1 ? 20 : 8)\n+\t\t\t* ops_ld->z_c - ops_ld->n_filler;\n+\tuint16_t deRmOutSize = RTE_MIN(\n+\t\t\tk0 + ops_ld->cb_params.e +\n+\t\t\t((k0 > parity_offset) ?\n+\t\t\t\t\t0 : ops_ld->n_filler),\n+\t\t\t\t\tops_ld->n_cb);\n+\tuint16_t numRows = ((deRmOutSize + ops_ld->z_c - 1)\n+\t\t\t/ ops_ld->z_c);\n+\tuint16_t harq_output_len = numRows * ops_ld->z_c;\n+\treturn harq_output_len;\n+}\n+\n+static inline int\n+validate_op_harq_chain(struct rte_bbdev_op_data *op,\n+\t\tstruct op_data_entries *orig_op,\n+\t\tstruct rte_bbdev_op_ldpc_dec *ops_ld)\n+{\n+\tuint8_t i;\n+\tuint32_t j, jj, k;\n+\tstruct rte_mbuf *m = op->data;\n+\tuint8_t nb_dst_segments = orig_op->nb_segments;\n+\tuint32_t total_data_size = 0;\n+\tint8_t *harq_orig, *harq_out, abs_harq_origin;\n+\tuint32_t byte_error = 0, cum_error = 0, error;\n+\tint16_t llr_max = (1 << (ldpc_llr_size - ldpc_llr_decimals)) - 1;\n+\tint16_t llr_max_pre_scaling = (1 << (ldpc_llr_size - 1)) - 1;\n+\tuint16_t parity_offset;\n+\n+\tTEST_ASSERT(nb_dst_segments == m->nb_segs,\n+\t\t\t\"Number of segments differ in original (%u) and filled (%u) op\",\n+\t\t\tnb_dst_segments, m->nb_segs);\n+\n+\t/* Validate each mbuf segment length */\n+\tfor (i = 0; i < nb_dst_segments; ++i) {\n+\t\t/* Apply offset to the first mbuf segment */\n+\t\tuint16_t offset = (i == 0) ? op->offset : 0;\n+\t\tuint16_t data_len = rte_pktmbuf_data_len(m) - offset;\n+\t\ttotal_data_size += orig_op->segments[i].length;\n+\n+\t\tTEST_ASSERT(orig_op->segments[i].length <\n+\t\t\t\t(uint32_t)(data_len + 64),\n+\t\t\t\t\"Length of segment differ in original (%u) and filled (%u) op\",\n+\t\t\t\torig_op->segments[i].length, data_len);\n+\t\tharq_orig = (int8_t *) orig_op->segments[i].addr;\n+\t\tharq_out = rte_pktmbuf_mtod_offset(m, int8_t *, offset);\n+\n+\t\tif (!(ldpc_cap_flags &\n+\t\t\t\tRTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS\n+\t\t\t\t) || (ops_ld->op_flags &\n+\t\t\t\tRTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK)) {\n+\t\t\tdata_len -= ops_ld->z_c;\n+\t\t\tparity_offset = data_len;\n+\t\t} else {\n+\t\t\t/* Compute RM out size and number of rows */\n+\t\t\tparity_offset = (ops_ld->basegraph == 1 ? 20 : 8)\n+\t\t\t\t\t* ops_ld->z_c - ops_ld->n_filler;\n+\t\t\tuint16_t deRmOutSize = compute_Harq_Len(ops_ld) -\n+\t\t\t\t\tops_ld->n_filler;\n+\t\t\tif (data_len > deRmOutSize)\n+\t\t\t\tdata_len = deRmOutSize;\n+\t\t\tif (data_len > orig_op->segments[i].length)\n+\t\t\t\tdata_len = orig_op->segments[i].length;\n+\t\t}\n+\t\t/*\n+\t\t * HARQ output can have minor differences\n+\t\t * due to integer representation and related scaling\n+\t\t */\n+\t\tfor (j = 0, jj = 0; j < data_len; j++, jj++) {\n+\t\t\tif (j == parity_offset) {\n+\t\t\t\t/* Special Handling of the filler bits */\n+\t\t\t\tfor (k = 0; k < ops_ld->n_filler; k++) {\n+\t\t\t\t\tif (harq_out[jj] !=\n+\t\t\t\t\t\t\tllr_max_pre_scaling) {\n+\t\t\t\t\t\tprintf(\"HARQ Filler issue %d: %d %d\\n\",\n+\t\t\t\t\t\t\tjj, harq_out[jj],\n+\t\t\t\t\t\t\tllr_max);\n+\t\t\t\t\t\tbyte_error++;\n+\t\t\t\t\t}\n+\t\t\t\t\tjj++;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tif (!(ops_ld->op_flags &\n+\t\t\t\tRTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK)) {\n+\t\t\t\tif (ldpc_llr_decimals > 1)\n+\t\t\t\t\tharq_out[jj] = (harq_out[jj] + 1)\n+\t\t\t\t\t\t>> (ldpc_llr_decimals - 1);\n+\t\t\t\t/* Saturated to S7 */\n+\t\t\t\tif (harq_orig[j] > llr_max)\n+\t\t\t\t\tharq_orig[j] = llr_max;\n+\t\t\t\tif (harq_orig[j] < -llr_max)\n+\t\t\t\t\tharq_orig[j] = -llr_max;\n+\t\t\t}\n+\t\t\tif (harq_orig[j] != harq_out[jj]) {\n+\t\t\t\terror = (harq_orig[j] > harq_out[jj]) ?\n+\t\t\t\t\t\tharq_orig[j] - harq_out[jj] :\n+\t\t\t\t\t\tharq_out[jj] - harq_orig[j];\n+\t\t\t\tabs_harq_origin = harq_orig[j] > 0 ?\n+\t\t\t\t\t\t\tharq_orig[j] :\n+\t\t\t\t\t\t\t-harq_orig[j];\n+\t\t\t\t/* Residual quantization error */\n+\t\t\t\tif ((error > 8 && (abs_harq_origin <\n+\t\t\t\t\t\t(llr_max - 16))) ||\n+\t\t\t\t\t\t(error > 16)) {\n+\t\t\t\t\tprintf(\"HARQ mismatch %d: exp %d act %d => %d\\n\",\n+\t\t\t\t\t\t\tj, harq_orig[j],\n+\t\t\t\t\t\t\tharq_out[jj], error);\n+\t\t\t\t\tbyte_error++;\n+\t\t\t\t\tcum_error += error;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\t\tm = m->next;\n+\t}\n+\n+\tif (byte_error)\n+\t\tTEST_ASSERT(byte_error <= 1,\n+\t\t\t\t\"HARQ output mismatch (%d) %d\",\n+\t\t\t\tbyte_error, cum_error);\n+\n+\t/* Validate total mbuf pkt length */\n+\tuint32_t pkt_len = rte_pktmbuf_pkt_len(op->data) - op->offset;\n+\tTEST_ASSERT(total_data_size < pkt_len + 64,\n+\t\t\t\"Length of data differ in original (%u) and filled (%u) op\",\n+\t\t\ttotal_data_size, pkt_len);\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n static int\n validate_dec_op(struct rte_bbdev_dec_op **ops, const uint16_t n,\n \t\tstruct rte_bbdev_dec_op *ref_op, const int vector_mask)\n@@ -1325,7 +1587,6 @@ typedef int (test_case_function)(struct active_device *ad,\n \treturn TEST_SUCCESS;\n }\n \n-\n static int\n validate_ldpc_dec_op(struct rte_bbdev_dec_op **ops, const uint16_t n,\n \t\tstruct rte_bbdev_dec_op *ref_op, const int vector_mask)\n@@ -1357,8 +1618,15 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\tTEST_ASSERT(ops_td->iter_count <= ref_td->iter_count,\n \t\t\t\t\t\"Returned iter_count (%d) > expected iter_count (%d)\",\n \t\t\t\t\tops_td->iter_count, ref_td->iter_count);\n-\t\t/* We can ignore data when the decoding failed to converge */\n-\t\tif ((ops[i]->status &  (1 << RTE_BBDEV_SYNDROME_ERROR)) == 0)\n+\t\t/*\n+\t\t * We can ignore output data when the decoding failed to\n+\t\t * converge or for loop-back cases\n+\t\t */\n+\t\tif (!check_bit(ops[i]->ldpc_dec.op_flags,\n+\t\t\t\tRTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK\n+\t\t\t\t) && (\n+\t\t\t\tops[i]->status & (1 << RTE_BBDEV_SYNDROME_ERROR\n+\t\t\t\t\t\t)) == 0)\n \t\t\tTEST_ASSERT_SUCCESS(validate_op_chain(hard_output,\n \t\t\t\t\thard_data_orig),\n \t\t\t\t\t\"Hard output buffers (CB=%u) are not equal\",\n@@ -1371,12 +1639,18 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\t\t\ti);\n \t\tif (ref_op->ldpc_dec.op_flags &\n \t\t\t\tRTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE) {\n-\t\t\tldpc_input_llr_scaling(harq_output, 1, 8, 0);\n-\t\t\tTEST_ASSERT_SUCCESS(validate_op_chain(harq_output,\n-\t\t\t\t\tharq_data_orig),\n+\t\t\tTEST_ASSERT_SUCCESS(validate_op_harq_chain(harq_output,\n+\t\t\t\t\tharq_data_orig, ops_td),\n \t\t\t\t\t\"HARQ output buffers (CB=%u) are not equal\",\n \t\t\t\t\ti);\n \t\t}\n+\t\tif (ref_op->ldpc_dec.op_flags &\n+\t\t\t\tRTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK)\n+\t\t\tTEST_ASSERT_SUCCESS(validate_op_harq_chain(harq_output,\n+\t\t\t\t\tharq_data_orig, ops_td),\n+\t\t\t\t\t\"HARQ output buffers (CB=%u) are not equal\",\n+\t\t\t\t\ti);\n+\n \t}\n \n \treturn TEST_SUCCESS;\n@@ -1715,6 +1989,105 @@ typedef int (test_case_function)(struct active_device *ad,\n \treturn ret;\n }\n \n+\n+/* Push back the HARQ output from DDR to host */\n+static void\n+retrieve_harq_ddr(uint16_t dev_id, uint16_t queue_id,\n+\t\tstruct rte_bbdev_dec_op **ops,\n+\t\tconst uint16_t n)\n+{\n+\tuint16_t j;\n+\tint save_status, ret;\n+\tuint32_t harq_offset = (uint32_t) queue_id * HARQ_INCR * 1024;\n+\tstruct rte_bbdev_dec_op *ops_deq[MAX_BURST];\n+\tuint32_t flags = ops[0]->ldpc_dec.op_flags;\n+\tbool loopback = flags & RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK;\n+\tbool mem_out = flags & RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE;\n+\tbool hc_out = flags & RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE;\n+\tbool h_comp = flags & RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION;\n+\tfor (j = 0; j < n; ++j) {\n+\t\tif ((loopback && mem_out) || hc_out) {\n+\t\t\tsave_status = ops[j]->status;\n+\t\t\tops[j]->ldpc_dec.op_flags =\n+\t\t\t\tRTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK +\n+\t\t\t\tRTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE;\n+\t\t\tif (h_comp)\n+\t\t\t\tops[j]->ldpc_dec.op_flags +=\n+\t\t\t\t\tRTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION;\n+\t\t\tops[j]->ldpc_dec.harq_combined_input.offset =\n+\t\t\t\t\tharq_offset;\n+\t\t\tops[j]->ldpc_dec.harq_combined_output.offset = 0;\n+\t\t\tharq_offset += HARQ_INCR;\n+\t\t\tif (!loopback)\n+\t\t\t\tops[j]->ldpc_dec.harq_combined_input.length =\n+\t\t\t\tops[j]->ldpc_dec.harq_combined_output.length;\n+\t\t\trte_bbdev_enqueue_ldpc_dec_ops(dev_id, queue_id,\n+\t\t\t\t\t&ops[j], 1);\n+\t\t\tret = 0;\n+\t\t\twhile (ret == 0)\n+\t\t\t\tret = rte_bbdev_dequeue_ldpc_dec_ops(\n+\t\t\t\t\t\tdev_id, queue_id,\n+\t\t\t\t\t\t&ops_deq[j], 1);\n+\t\t\tops[j]->ldpc_dec.op_flags = flags;\n+\t\t\tops[j]->status = save_status;\n+\t\t}\n+\t}\n+}\n+\n+/*\n+ * Push back the HARQ output from HW DDR to Host\n+ * Preload HARQ memory input and adjust HARQ offset\n+ */\n+static void\n+preload_harq_ddr(uint16_t dev_id, uint16_t queue_id,\n+\t\tstruct rte_bbdev_dec_op **ops, const uint16_t n,\n+\t\tbool preload)\n+{\n+\tuint16_t j;\n+\tint ret;\n+\tuint32_t harq_offset = (uint32_t) queue_id * HARQ_INCR * 1024;\n+\tstruct rte_bbdev_op_data save_hc_in, save_hc_out;\n+\tstruct rte_bbdev_dec_op *ops_deq[MAX_BURST];\n+\tuint32_t flags = ops[0]->ldpc_dec.op_flags;\n+\tbool mem_in = flags & RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE;\n+\tbool hc_in = flags & RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE;\n+\tbool mem_out = flags & RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE;\n+\tbool hc_out = flags & RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE;\n+\tbool h_comp = flags & RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION;\n+\tfor (j = 0; j < n; ++j) {\n+\t\tif ((mem_in || hc_in) && preload) {\n+\t\t\tsave_hc_in = ops[j]->ldpc_dec.harq_combined_input;\n+\t\t\tsave_hc_out = ops[j]->ldpc_dec.harq_combined_output;\n+\t\t\tops[j]->ldpc_dec.op_flags =\n+\t\t\t\tRTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK +\n+\t\t\t\tRTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE;\n+\t\t\tif (h_comp)\n+\t\t\t\tops[j]->ldpc_dec.op_flags +=\n+\t\t\t\t\tRTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION;\n+\t\t\tops[j]->ldpc_dec.harq_combined_output.offset =\n+\t\t\t\t\tharq_offset;\n+\t\t\tops[j]->ldpc_dec.harq_combined_input.offset = 0;\n+\t\t\trte_bbdev_enqueue_ldpc_dec_ops(dev_id, queue_id,\n+\t\t\t\t\t&ops[j], 1);\n+\t\t\tret = 0;\n+\t\t\twhile (ret == 0)\n+\t\t\t\tret = rte_bbdev_dequeue_ldpc_dec_ops(\n+\t\t\t\t\tdev_id, queue_id, &ops_deq[j], 1);\n+\t\t\tops[j]->ldpc_dec.op_flags = flags;\n+\t\t\tops[j]->ldpc_dec.harq_combined_input = save_hc_in;\n+\t\t\tops[j]->ldpc_dec.harq_combined_output = save_hc_out;\n+\t\t}\n+\t\t/* Adjust HARQ offset when we reach external DDR */\n+\t\tif (mem_in || hc_in)\n+\t\t\tops[j]->ldpc_dec.harq_combined_input.offset\n+\t\t\t\t= harq_offset;\n+\t\tif (mem_out || hc_out)\n+\t\t\tops[j]->ldpc_dec.harq_combined_output.offset\n+\t\t\t\t= harq_offset;\n+\t\tharq_offset += HARQ_INCR;\n+\t}\n+}\n+\n static void\n dequeue_event_callback(uint16_t dev_id,\n \t\tenum rte_bbdev_event_type event, void *cb_arg,\n@@ -1750,13 +2123,22 @@ typedef int (test_case_function)(struct active_device *ad,\n \tburst_sz = rte_atomic16_read(&tp->burst_sz);\n \tnum_ops = tp->op_params->num_to_process;\n \n-\tif (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC ||\n-\t\t\ttest_vector.op_type == RTE_BBDEV_OP_LDPC_DEC)\n+\tif (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC)\n \t\tdeq = rte_bbdev_dequeue_dec_ops(dev_id, queue_id,\n \t\t\t\t&tp->dec_ops[\n \t\t\t\t\trte_atomic16_read(&tp->nb_dequeued)],\n \t\t\t\tburst_sz);\n-\telse\n+\telse if (test_vector.op_type == RTE_BBDEV_OP_LDPC_DEC)\n+\t\tdeq = rte_bbdev_dequeue_ldpc_dec_ops(dev_id, queue_id,\n+\t\t\t\t&tp->dec_ops[\n+\t\t\t\t\trte_atomic16_read(&tp->nb_dequeued)],\n+\t\t\t\tburst_sz);\n+\telse if (test_vector.op_type == RTE_BBDEV_OP_LDPC_ENC)\n+\t\tdeq = rte_bbdev_dequeue_ldpc_enc_ops(dev_id, queue_id,\n+\t\t\t\t&tp->enc_ops[\n+\t\t\t\t\trte_atomic16_read(&tp->nb_dequeued)],\n+\t\t\t\tburst_sz);\n+\telse /*RTE_BBDEV_OP_TURBO_ENC*/\n \t\tdeq = rte_bbdev_dequeue_enc_ops(dev_id, queue_id,\n \t\t\t\t&tp->enc_ops[\n \t\t\t\t\trte_atomic16_read(&tp->nb_dequeued)],\n@@ -2133,6 +2515,12 @@ typedef int (test_case_function)(struct active_device *ad,\n \tint i, j, ret;\n \tstruct rte_bbdev_info info;\n \tuint16_t num_to_enq;\n+\tbool extDdr = check_bit(ldpc_cap_flags,\n+\t\t\tRTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE);\n+\tbool loopback = check_bit(ref_op->ldpc_dec.op_flags,\n+\t\t\tRTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK);\n+\tbool hc_out = check_bit(ref_op->ldpc_dec.op_flags,\n+\t\t\tRTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE);\n \n \tTEST_ASSERT_SUCCESS((burst_sz > MAX_BURST),\n \t\t\t\"BURST_SIZE should be <= %u\", MAX_BURST);\n@@ -2170,13 +2558,18 @@ typedef int (test_case_function)(struct active_device *ad,\n \n \tfor (i = 0; i < TEST_REPETITIONS; ++i) {\n \t\tfor (j = 0; j < num_ops; ++j) {\n-\t\t\tmbuf_reset(ops_enq[j]->ldpc_dec.hard_output.data);\n-\t\t\tif (check_bit(ref_op->ldpc_dec.op_flags,\n-\t\t\t\t\tRTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE))\n+\t\t\tif (!loopback)\n+\t\t\t\tmbuf_reset(\n+\t\t\t\tops_enq[j]->ldpc_dec.hard_output.data);\n+\t\t\tif (hc_out || loopback)\n \t\t\t\tmbuf_reset(\n \t\t\t\tops_enq[j]->ldpc_dec.harq_combined_output.data);\n \t\t}\n-\n+\t\tif (extDdr) {\n+\t\t\tbool preload = i == (TEST_REPETITIONS - 1);\n+\t\t\tpreload_harq_ddr(tp->dev_id, queue_id, ops_enq,\n+\t\t\t\t\tnum_ops, preload);\n+\t\t}\n \t\tstart_time = rte_rdtsc_precise();\n \n \t\tfor (enq = 0, deq = 0; enq < num_ops;) {\n@@ -2207,6 +2600,10 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\ttp->iter_count = RTE_MAX(ops_enq[i]->ldpc_dec.iter_count,\n \t\t\t\ttp->iter_count);\n \t}\n+\tif (extDdr) {\n+\t\t/* Read loopback is not thread safe */\n+\t\tretrieve_harq_ddr(tp->dev_id, queue_id, ops_enq, num_ops);\n+\t}\n \n \tif (test_vector.op_type != RTE_BBDEV_OP_NONE) {\n \t\tret = validate_ldpc_dec_op(ops_deq, num_ops, ref_op,\n@@ -2696,6 +3093,8 @@ typedef int (test_case_function)(struct active_device *ad,\n \tuint16_t i, j, dequeued;\n \tstruct rte_bbdev_dec_op *ops_enq[MAX_BURST], *ops_deq[MAX_BURST];\n \tuint64_t start_time = 0, last_time = 0;\n+\tbool extDdr = ldpc_cap_flags &\n+\t\t\tRTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE;\n \n \tfor (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {\n \t\tuint16_t enq = 0, deq = 0;\n@@ -2708,6 +3107,15 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\tret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);\n \t\tTEST_ASSERT_SUCCESS(ret,\n \t\t\t\t\"rte_bbdev_dec_op_alloc_bulk() failed\");\n+\n+\t\t/* For latency tests we need to disable early termination */\n+\t\tif (check_bit(ref_op->ldpc_dec.op_flags,\n+\t\t\t\tRTE_BBDEV_LDPC_ITERATION_STOP_ENABLE))\n+\t\t\tref_op->ldpc_dec.op_flags -=\n+\t\t\t\t\tRTE_BBDEV_LDPC_ITERATION_STOP_ENABLE;\n+\t\tref_op->ldpc_dec.iter_max = 6;\n+\t\tref_op->ldpc_dec.iter_count = ref_op->ldpc_dec.iter_max;\n+\n \t\tif (test_vector.op_type != RTE_BBDEV_OP_NONE)\n \t\t\tcopy_reference_ldpc_dec_op(ops_enq, burst_sz, dequeued,\n \t\t\t\t\tbufs->inputs,\n@@ -2717,6 +3125,10 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\t\t\tbufs->harq_outputs,\n \t\t\t\t\tref_op);\n \n+\t\tif (extDdr)\n+\t\t\tpreload_harq_ddr(dev_id, queue_id, ops_enq,\n+\t\t\t\t\tburst_sz, true);\n+\n \t\t/* Set counter to validate the ordering */\n \t\tfor (j = 0; j < burst_sz; ++j)\n \t\t\tops_enq[j]->opaque_data = (void *)(uintptr_t)j;\n@@ -2743,6 +3155,9 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t*min_time = RTE_MIN(*min_time, last_time);\n \t\t*total_time += last_time;\n \n+\t\tif (extDdr)\n+\t\t\tretrieve_harq_ddr(dev_id, queue_id, ops_enq, burst_sz);\n+\n \t\tif (test_vector.op_type != RTE_BBDEV_OP_NONE) {\n \t\t\tret = validate_ldpc_dec_op(ops_deq, burst_sz, ref_op,\n \t\t\t\t\tvector_mask);\n@@ -2752,7 +3167,6 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\trte_bbdev_dec_op_free_bulk(ops_enq, deq);\n \t\tdequeued += deq;\n \t}\n-\n \treturn i;\n }\n \n@@ -2844,7 +3258,6 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\tburst_sz = num_to_process - dequeued;\n \n \t\tret = rte_bbdev_enc_op_alloc_bulk(mempool, ops_enq, burst_sz);\n-\n \t\tTEST_ASSERT_SUCCESS(ret,\n \t\t\t\t\"rte_bbdev_enc_op_alloc_bulk() failed\");\n \t\tif (test_vector.op_type != RTE_BBDEV_OP_NONE)\n@@ -3081,6 +3494,8 @@ typedef int (test_case_function)(struct active_device *ad,\n \tuint64_t enq_start_time, deq_start_time;\n \tuint64_t enq_sw_last_time, deq_last_time;\n \tstruct rte_bbdev_stats stats;\n+\tbool extDdr = ldpc_cap_flags &\n+\t\t\tRTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE;\n \n \tfor (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {\n \t\tuint16_t enq = 0, deq = 0;\n@@ -3098,6 +3513,10 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\t\t\tbufs->harq_outputs,\n \t\t\t\t\tref_op);\n \n+\t\tif (extDdr)\n+\t\t\tpreload_harq_ddr(dev_id, queue_id, ops_enq,\n+\t\t\t\t\tburst_sz, true);\n+\n \t\t/* Start time meas for enqueue function offload latency */\n \t\tenq_start_time = rte_rdtsc_precise();\n \t\tdo {\n@@ -3105,13 +3524,13 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\t\t\t&ops_enq[enq], burst_sz - enq);\n \t\t} while (unlikely(burst_sz != enq));\n \n+\t\tenq_sw_last_time = rte_rdtsc_precise() - enq_start_time;\n \t\tret = get_bbdev_queue_stats(dev_id, queue_id, &stats);\n \t\tTEST_ASSERT_SUCCESS(ret,\n \t\t\t\t\"Failed to get stats for queue (%u) of device (%u)\",\n \t\t\t\tqueue_id, dev_id);\n \n-\t\tenq_sw_last_time = rte_rdtsc_precise() - enq_start_time -\n-\t\t\t\tstats.acc_offload_cycles;\n+\t\tenq_sw_last_time -= stats.acc_offload_cycles;\n \t\ttime_st->enq_sw_max_time = RTE_MAX(time_st->enq_sw_max_time,\n \t\t\t\tenq_sw_last_time);\n \t\ttime_st->enq_sw_min_time = RTE_MIN(time_st->enq_sw_min_time,\n@@ -3144,9 +3563,14 @@ typedef int (test_case_function)(struct active_device *ad,\n \n \t\t/* Dequeue remaining operations if needed*/\n \t\twhile (burst_sz != deq)\n-\t\t\tdeq += rte_bbdev_dequeue_dec_ops(dev_id, queue_id,\n+\t\t\tdeq += rte_bbdev_dequeue_ldpc_dec_ops(dev_id, queue_id,\n \t\t\t\t\t&ops_deq[deq], burst_sz - deq);\n \n+\t\tif (extDdr) {\n+\t\t\t/* Read loopback is not thread safe */\n+\t\t\tretrieve_harq_ddr(dev_id, queue_id, ops_enq, burst_sz);\n+\t\t}\n+\n \t\trte_bbdev_dec_op_free_bulk(ops_enq, deq);\n \t\tdequeued += deq;\n \t}\n@@ -3173,7 +3597,8 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\tburst_sz = num_to_process - dequeued;\n \n \t\tret = rte_bbdev_enc_op_alloc_bulk(mempool, ops_enq, burst_sz);\n-\t\tTEST_ASSERT_SUCCESS(ret, \"rte_bbdev_op_alloc_bulk() failed\");\n+\t\tTEST_ASSERT_SUCCESS(ret,\n+\t\t\t\t\"rte_bbdev_enc_op_alloc_bulk() failed\");\n \t\tif (test_vector.op_type != RTE_BBDEV_OP_NONE)\n \t\t\tcopy_reference_enc_op(ops_enq, burst_sz, dequeued,\n \t\t\t\t\tbufs->inputs,\n@@ -3187,13 +3612,13 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\t\t\t&ops_enq[enq], burst_sz - enq);\n \t\t} while (unlikely(burst_sz != enq));\n \n+\t\tenq_sw_last_time = rte_rdtsc_precise() - enq_start_time;\n+\n \t\tret = get_bbdev_queue_stats(dev_id, queue_id, &stats);\n \t\tTEST_ASSERT_SUCCESS(ret,\n \t\t\t\t\"Failed to get stats for queue (%u) of device (%u)\",\n \t\t\t\tqueue_id, dev_id);\n-\n-\t\tenq_sw_last_time = rte_rdtsc_precise() - enq_start_time -\n-\t\t\t\tstats.acc_offload_cycles;\n+\t\tenq_sw_last_time -= stats.acc_offload_cycles;\n \t\ttime_st->enq_sw_max_time = RTE_MAX(time_st->enq_sw_max_time,\n \t\t\t\tenq_sw_last_time);\n \t\ttime_st->enq_sw_min_time = RTE_MIN(time_st->enq_sw_min_time,\n@@ -3255,7 +3680,8 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\tburst_sz = num_to_process - dequeued;\n \n \t\tret = rte_bbdev_enc_op_alloc_bulk(mempool, ops_enq, burst_sz);\n-\t\tTEST_ASSERT_SUCCESS(ret, \"rte_bbdev_op_alloc_bulk() failed\");\n+\t\tTEST_ASSERT_SUCCESS(ret,\n+\t\t\t\t\"rte_bbdev_enc_op_alloc_bulk() failed\");\n \t\tif (test_vector.op_type != RTE_BBDEV_OP_NONE)\n \t\t\tcopy_reference_ldpc_enc_op(ops_enq, burst_sz, dequeued,\n \t\t\t\t\tbufs->inputs,\n@@ -3269,13 +3695,13 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\t\t\t&ops_enq[enq], burst_sz - enq);\n \t\t} while (unlikely(burst_sz != enq));\n \n+\t\tenq_sw_last_time = rte_rdtsc_precise() - enq_start_time;\n \t\tret = get_bbdev_queue_stats(dev_id, queue_id, &stats);\n \t\tTEST_ASSERT_SUCCESS(ret,\n \t\t\t\t\"Failed to get stats for queue (%u) of device (%u)\",\n \t\t\t\tqueue_id, dev_id);\n \n-\t\tenq_sw_last_time = rte_rdtsc_precise() - enq_start_time -\n-\t\t\t\tstats.acc_offload_cycles;\n+\t\tenq_sw_last_time -= stats.acc_offload_cycles;\n \t\ttime_st->enq_sw_max_time = RTE_MAX(time_st->enq_sw_max_time,\n \t\t\t\tenq_sw_last_time);\n \t\ttime_st->enq_sw_min_time = RTE_MIN(time_st->enq_sw_min_time,\ndiff --git a/app/test-bbdev/test_bbdev_vector.c b/app/test-bbdev/test_bbdev_vector.c\nindex 77356cb..50d1da0 100644\n--- a/app/test-bbdev/test_bbdev_vector.c\n+++ b/app/test-bbdev/test_bbdev_vector.c\n@@ -197,6 +197,9 @@\n \telse if (!strcmp(token,\n \t\t\t\"RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE\"))\n \t\t*op_flag_value = RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE;\n+\telse if (!strcmp(token,\n+\t\t\t\"RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK;\n \telse {\n \t\tprintf(\"The given value is not a LDPC decoder flag\\n\");\n \t\treturn -1;\n@@ -943,16 +946,10 @@\n \tunsigned char i;\n \tstruct rte_bbdev_op_ldpc_dec *ldpc_dec = &vector->ldpc_dec;\n \n-\tif (vector->entries[DATA_INPUT].nb_segments == 0)\n-\t\treturn -1;\n-\n \tfor (i = 0; i < vector->entries[DATA_INPUT].nb_segments; i++)\n \t\tif (vector->entries[DATA_INPUT].segments[i].addr == NULL)\n \t\t\treturn -1;\n \n-\tif (vector->entries[DATA_HARD_OUTPUT].nb_segments == 0)\n-\t\treturn -1;\n-\n \tfor (i = 0; i < vector->entries[DATA_HARD_OUTPUT].nb_segments; i++)\n \t\tif (vector->entries[DATA_HARD_OUTPUT].segments[i].addr == NULL)\n \t\t\treturn -1;\n",
    "prefixes": [
        "v1",
        "06/14"
    ]
}