get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 55232,
    "url": "http://patches.dpdk.org/api/patches/55232/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1561344776-43990-9-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": "<1561344776-43990-9-git-send-email-nicolas.chautru@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1561344776-43990-9-git-send-email-nicolas.chautru@intel.com",
    "date": "2019-06-24T02:52:54",
    "name": "[v4,08/10] test-bbdev: update of bbdev test-app for 5GNR",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d6a1a5179d98e0d50fc73a9b79839e0863c060d1",
    "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/1561344776-43990-9-git-send-email-nicolas.chautru@intel.com/mbox/",
    "series": [
        {
            "id": 5127,
            "url": "http://patches.dpdk.org/api/series/5127/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5127",
            "date": "2019-06-24T02:52:46",
            "name": "bbdev: adding support in BBDEV for 5GNR FEC",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/5127/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/55232/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/55232/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 3B9861BF9C;\n\tMon, 24 Jun 2019 04:53:29 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 228701BF6D\n\tfor <dev@dpdk.org>; Mon, 24 Jun 2019 04:53:03 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t23 Jun 2019 19:52:59 -0700",
            "from skx-5gnr-sc12-4.sc.intel.com ([172.25.69.210])\n\tby fmsmga004.fm.intel.com with ESMTP; 23 Jun 2019 19:52:59 -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,410,1557212400\"; d=\"scan'208\";a=\"183991206\"",
        "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": "Sun, 23 Jun 2019 19:52:54 -0700",
        "Message-Id": "<1561344776-43990-9-git-send-email-nicolas.chautru@intel.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1561344776-43990-1-git-send-email-nicolas.chautru@intel.com>",
        "References": "<1561136352-32198-2-git-send-email-nicolas.chautru@intel.com>\n\t<1561344776-43990-1-git-send-email-nicolas.chautru@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 08/10] test-bbdev: update of bbdev test-app\n\tfor 5GNR",
        "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": "Extending test framework for FEC 5GNR operations\nfor UT verification and profiling.\n\nSigned-off-by: Nicolas Chautru <nicolas.chautru@intel.com>\n---\n app/test-bbdev/main.c                 |   48 +-\n app/test-bbdev/main.h                 |    6 +-\n app/test-bbdev/meson.build            |    3 +\n app/test-bbdev/test-bbdev.py          |    7 +\n app/test-bbdev/test_bbdev.c           |   12 +-\n app/test-bbdev/test_bbdev_perf.c      | 1233 ++++++++++++++++++++++++++++++---\n app/test-bbdev/test_bbdev_vector.c    |  517 +++++++++++++-\n app/test-bbdev/test_bbdev_vector.h    |   14 +-\n app/test-bbdev/turbo_enc_default.data |    2 +-\n 9 files changed, 1715 insertions(+), 127 deletions(-)",
    "diff": "diff --git a/app/test-bbdev/main.c b/app/test-bbdev/main.c\nindex a2f8722..8a42115 100644\n--- a/app/test-bbdev/main.c\n+++ b/app/test-bbdev/main.c\n@@ -16,11 +16,13 @@\n \n #include \"main.h\"\n \n+\n /* Defines how many testcases can be specified as cmdline args */\n #define MAX_CMDLINE_TESTCASES 8\n \n static const char tc_sep = ',';\n \n+/* Declare structure for command line test parameters and options */\n static struct test_params {\n \tstruct test_command *test_to_run[MAX_CMDLINE_TESTCASES];\n \tunsigned int num_tests;\n@@ -28,6 +30,7 @@\n \tunsigned int burst_sz;\n \tunsigned int num_lcores;\n \tchar test_vector_filename[PATH_MAX];\n+\tbool init_device;\n } test_params;\n \n static struct test_commands_list commands_list =\n@@ -46,9 +49,8 @@\n \tunsigned int total = 0, skipped = 0, succeeded = 0, failed = 0;\n \tuint64_t start, end;\n \n-\tprintf(\n-\t\t\t\"\\n + ------------------------------------------------------- +\\n\");\n-\tprintf(\" + Starting Test Suite : %s\\n\", suite->suite_name);\n+\tprintf(\"\\n===========================================================\\n\");\n+\tprintf(\"Starting Test Suite : %s\\n\", suite->suite_name);\n \n \tstart = rte_rdtsc_precise();\n \n@@ -57,15 +59,13 @@\n \t\tif (test_result == TEST_FAILED) {\n \t\t\tprintf(\" + Test suite setup %s failed!\\n\",\n \t\t\t\t\tsuite->suite_name);\n-\t\t\tprintf(\n-\t\t\t\t\t\" + ------------------------------------------------------- +\\n\");\n+\t\t\tprintf(\" + ------------------------------------------------------- +\\n\");\n \t\t\treturn 1;\n \t\t}\n \t\tif (test_result == TEST_SKIPPED) {\n \t\t\tprintf(\" + Test suite setup %s skipped!\\n\",\n \t\t\t\t\tsuite->suite_name);\n-\t\t\tprintf(\n-\t\t\t\t\t\" + ------------------------------------------------------- +\\n\");\n+\t\t\tprintf(\" + ------------------------------------------------------- +\\n\");\n \t\t\treturn 0;\n \t\t}\n \t}\n@@ -82,15 +82,15 @@\n \n \t\tif (test_result == TEST_SUCCESS) {\n \t\t\tsucceeded++;\n-\t\t\tprintf(\" + TestCase [%2d] : %s passed\\n\", total,\n+\t\t\tprintf(\"TestCase [%2d] : %s passed\\n\", total,\n \t\t\t\t\tsuite->unit_test_cases[total].name);\n \t\t} else if (test_result == TEST_SKIPPED) {\n \t\t\tskipped++;\n-\t\t\tprintf(\" + TestCase [%2d] : %s skipped\\n\", total,\n+\t\t\tprintf(\"TestCase [%2d] : %s skipped\\n\", total,\n \t\t\t\t\tsuite->unit_test_cases[total].name);\n \t\t} else {\n \t\t\tfailed++;\n-\t\t\tprintf(\" + TestCase [%2d] : %s failed\\n\", total,\n+\t\t\tprintf(\"TestCase [%2d] : %s failed\\n\", total,\n \t\t\t\t\tsuite->unit_test_cases[total].name);\n \t\t}\n \n@@ -103,7 +103,7 @@\n \n \tend = rte_rdtsc_precise();\n \n-\tprintf(\" + ------------------------------------------------------- +\\n\");\n+\tprintf(\" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\\n\");\n \tprintf(\" + Test Suite Summary : %s\\n\", suite->suite_name);\n \tprintf(\" + Tests Total :       %2d\\n\", total);\n \tprintf(\" + Tests Skipped :     %2d\\n\", skipped);\n@@ -111,7 +111,7 @@\n \tprintf(\" + Tests Failed :      %2d\\n\", failed);\n \tprintf(\" + Tests Lasted :       %lg ms\\n\",\n \t\t\t((end - start) * 1000) / (double)rte_get_tsc_hz());\n-\tprintf(\" + ------------------------------------------------------- +\\n\");\n+\tprintf(\" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\\n\");\n \n \treturn (failed > 0) ? 1 : 0;\n }\n@@ -140,12 +140,18 @@\n \treturn test_params.num_lcores;\n }\n \n+bool\n+get_init_device(void)\n+{\n+\treturn test_params.init_device;\n+}\n+\n static void\n print_usage(const char *prog_name)\n {\n \tstruct test_command *t;\n \n-\tprintf(\"Usage: %s [EAL params] [-- [-n/--num-ops NUM_OPS]\\n\"\n+\tprintf(\"***Usage: %s [EAL params] [-- [-n/--num-ops NUM_OPS]\\n\"\n \t\t\t\"\\t[-b/--burst-size BURST_SIZE]\\n\"\n \t\t\t\"\\t[-v/--test-vector VECTOR_FILE]\\n\"\n \t\t\t\"\\t[-c/--test-cases TEST_CASE[,TEST_CASE,...]]]\\n\",\n@@ -174,11 +180,12 @@\n \t\t{ \"test-cases\", 1, 0, 'c' },\n \t\t{ \"test-vector\", 1, 0, 'v' },\n \t\t{ \"lcores\", 1, 0, 'l' },\n+\t\t{ \"init-device\", 0, 0, 'i'},\n \t\t{ \"help\", 0, 0, 'h' },\n \t\t{ NULL,  0, 0, 0 }\n \t};\n \n-\twhile ((opt = getopt_long(argc, argv, \"hn:b:c:v:l:\", lgopts,\n+\twhile ((opt = getopt_long(argc, argv, \"hin:b:c:v:l:\", lgopts,\n \t\t\t&option_index)) != EOF)\n \t\tswitch (opt) {\n \t\tcase 'n':\n@@ -226,8 +233,9 @@\n \t\t\tTEST_ASSERT(strlen(optarg) > 0,\n \t\t\t\t\t\"Config file name is null\");\n \n-\t\t\tstrlcpy(tp->test_vector_filename, optarg,\n-\t\t\t\tsizeof(tp->test_vector_filename));\n+\t\t\tsnprintf(tp->test_vector_filename,\n+\t\t\t\t\tsizeof(tp->test_vector_filename),\n+\t\t\t\t\t\"%s\", optarg);\n \t\t\tbreak;\n \t\tcase 'l':\n \t\t\tTEST_ASSERT(strlen(optarg) > 0,\n@@ -237,6 +245,10 @@\n \t\t\t\t\t\"Num of lcores mustn't be greater than %u\",\n \t\t\t\t\tRTE_MAX_LCORE);\n \t\t\tbreak;\n+\t\tcase 'i':\n+\t\t\t/* indicate fpga fec config required */\n+\t\t\ttp->init_device = true;\n+\t\t\tbreak;\n \t\tcase 'h':\n \t\t\tprint_usage(argv[0]);\n \t\t\treturn 0;\n@@ -279,7 +291,7 @@\n \tstruct test_command *t;\n \n \tTAILQ_FOREACH(t, &commands_list, next)\n-\t\tret |= t->callback();\n+\t\tret |= (int) t->callback();\n \n \treturn ret;\n }\n@@ -291,7 +303,7 @@\n \tunsigned int i;\n \n \tfor (i = 0; i < tp->num_tests; ++i)\n-\t\tret |= tp->test_to_run[i]->callback();\n+\t\tret |= (int) tp->test_to_run[i]->callback();\n \n \treturn ret;\n }\ndiff --git a/app/test-bbdev/main.h b/app/test-bbdev/main.h\nindex 2bbe1b8..23b4d58 100644\n--- a/app/test-bbdev/main.h\n+++ b/app/test-bbdev/main.h\n@@ -20,6 +20,7 @@\n #define DEFAULT_BURST 32U\n #define DEFAULT_OPS 64U\n \n+\n #define TEST_ASSERT(cond, msg, ...) do {  \\\n \t\tif (!(cond)) {  \\\n \t\t\tprintf(\"TestCase %s() line %d failed: \" \\\n@@ -103,7 +104,8 @@ struct test_command {\n \t\t.command = RTE_STR(name), \\\n \t\t.callback = test_func_##name, \\\n \t}; \\\n-\tRTE_INIT(test_register_##name) \\\n+\tstatic void __attribute__((constructor, used)) \\\n+\ttest_register_##name(void) \\\n \t{ \\\n \t\tadd_test_command(&test_struct_##name); \\\n \t}\n@@ -116,4 +118,6 @@ struct test_command {\n \n unsigned int get_num_lcores(void);\n \n+bool get_init_device(void);\n+\n #endif\ndiff --git a/app/test-bbdev/meson.build b/app/test-bbdev/meson.build\nindex eb8cc04..d3f2b77 100644\n--- a/app/test-bbdev/meson.build\n+++ b/app/test-bbdev/meson.build\n@@ -7,3 +7,6 @@ sources = files('main.c',\n \t\t'test_bbdev_vector.c')\n allow_experimental_apis = true\n deps += ['bbdev', 'bus_vdev']\n+if dpdk_conf.has('RTE_LIBRTE_PMD_FPGA_LTE_FEC')\n+\tdeps += ['bbdev_fpga_lte_fec']\n+endif\n\\ No newline at end of file\ndiff --git a/app/test-bbdev/test-bbdev.py b/app/test-bbdev/test-bbdev.py\nindex 25340ec..0194be0 100755\n--- a/app/test-bbdev/test-bbdev.py\n+++ b/app/test-bbdev/test-bbdev.py\n@@ -59,6 +59,9 @@ def kill(process):\n                     type=int,\n                     help=\"Number of lcores to run.\",\n                     default=16)\n+parser.add_argument(\"-i\", \"--init-device\",\n+                    action='store_true',\n+                    help=\"Initialise PF device with default values.\")\n \n args = parser.parse_args()\n \n@@ -82,6 +85,10 @@ def kill(process):\n     params.extend([\"-c\"])\n     params.extend([\",\".join(args.test_cases)])\n \n+if args.init_device:\n+    params.extend([\"-i\"])\n+\n+\n exit_status = 0\n for vector in args.test_vector:\n     for burst_size in args.burst_size:\ndiff --git a/app/test-bbdev/test_bbdev.c b/app/test-bbdev/test_bbdev.c\nindex 137c74c..ac06d73 100644\n--- a/app/test-bbdev/test_bbdev.c\n+++ b/app/test-bbdev/test_bbdev.c\n@@ -14,8 +14,6 @@\n #include <rte_bbdev.h>\n #include <rte_bbdev_op.h>\n #include <rte_bbdev_pmd.h>\n-#include<string.h>\n-#include <rte_string_fns.h>\n \n #include \"main.h\"\n \n@@ -770,7 +768,7 @@ struct bbdev_testsuite_params {\n {\n \tstruct rte_bbdev *dev1, *dev2;\n \tconst char *name = \"dev_name\";\n-\tchar name_tmp[16];\n+\tchar name_tmp[32];\n \tint num_devs, num_devs_tmp;\n \n \tdev1 = rte_bbdev_allocate(NULL);\n@@ -790,14 +788,14 @@ struct bbdev_testsuite_params {\n \n \t/* Initialize the maximum amount of devices */\n \tdo {\n-\t\tsnprintf(name_tmp, sizeof(name_tmp), \"%s%i\", \"name_\", num_devs);\n+\t\tsprintf(name_tmp, \"%s%i\", \"name_\", num_devs);\n \t\tdev2 = rte_bbdev_allocate(name_tmp);\n \t\tTEST_ASSERT(dev2 != NULL,\n \t\t\t\t\"Failed to initialize bbdev driver\");\n \t\t++num_devs;\n \t} while (num_devs < (RTE_BBDEV_MAX_DEVS - 1));\n \n-\tsnprintf(name_tmp, sizeof(name_tmp), \"%s%i\", \"name_\", num_devs);\n+\tsprintf(name_tmp, \"%s%i\", \"name_\", num_devs);\n \tdev2 = rte_bbdev_allocate(name_tmp);\n \tTEST_ASSERT(dev2 == NULL, \"Failed to initialize bbdev driver number %d \"\n \t\t\t\"more drivers than RTE_BBDEV_MAX_DEVS: %d \", num_devs,\n@@ -806,7 +804,7 @@ struct bbdev_testsuite_params {\n \tnum_devs--;\n \n \twhile (num_devs >= num_devs_tmp) {\n-\t\tsnprintf(name_tmp, sizeof(name_tmp), \"%s%i\", \"name_\", num_devs);\n+\t\tsprintf(name_tmp, \"%s%i\", \"name_\", num_devs);\n \t\tdev2 = rte_bbdev_get_named_dev(name_tmp);\n \t\tTEST_ASSERT_SUCCESS(rte_bbdev_release(dev2),\n \t\t\t\t\"Failed to uninitialize bbdev driver %s \",\n@@ -827,7 +825,7 @@ struct bbdev_testsuite_params {\n \tTEST_ASSERT_FAIL(rte_bbdev_release(NULL),\n \t\t\t\"Failed to uninitialize bbdev driver with NULL bbdev\");\n \n-\tstrlcpy(name_tmp, \"invalid_name\", sizeof(name_tmp));\n+\tsprintf(name_tmp, \"%s\", \"invalid_name\");\n \tdev2 = rte_bbdev_get_named_dev(name_tmp);\n \tTEST_ASSERT_FAIL(rte_bbdev_release(dev2),\n \t\t\t\"Failed to uninitialize bbdev driver with invalid name\");\ndiff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c\nindex d18ddae..a166eaf 100644\n--- a/app/test-bbdev/test_bbdev_perf.c\n+++ b/app/test-bbdev/test_bbdev_perf.c\n@@ -16,6 +16,11 @@\n #include <rte_malloc.h>\n #include <rte_random.h>\n #include <rte_hexdump.h>\n+#include <rte_interrupts.h>\n+\n+#ifdef RTE_LIBRTE_PMD_FPGA_LTE_FEC\n+#include <fpga_lte_fec.h>\n+#endif\n \n #include \"main.h\"\n #include \"test_bbdev_vector.h\"\n@@ -25,6 +30,18 @@\n #define MAX_QUEUES RTE_MAX_LCORE\n #define TEST_REPETITIONS 1000\n \n+#ifdef RTE_LIBRTE_PMD_FPGA_LTE_FEC\n+#define FPGA_PF_DRIVER_NAME (\"intel_fpga_lte_fec_pf\")\n+#define FPGA_VF_DRIVER_NAME (\"intel_fpga_lte_fec_vf\")\n+#define VF_UL_QUEUE_VALUE 4\n+#define VF_DL_QUEUE_VALUE 4\n+#define UL_BANDWIDTH 3\n+#define DL_BANDWIDTH 3\n+#define UL_LOAD_BALANCE 128\n+#define DL_LOAD_BALANCE 128\n+#define FLR_TIMEOUT 610\n+#endif\n+\n #define OPS_CACHE_SIZE 256U\n #define OPS_POOL_SIZE_MIN 511U /* 0.5K per queue */\n \n@@ -49,6 +66,8 @@\n \tstruct rte_mempool *in_mbuf_pool;\n \tstruct rte_mempool *hard_out_mbuf_pool;\n \tstruct rte_mempool *soft_out_mbuf_pool;\n+\tstruct rte_mempool *harq_in_mbuf_pool;\n+\tstruct rte_mempool *harq_out_mbuf_pool;\n } active_devs[RTE_BBDEV_MAX_DEVS];\n \n static uint8_t nb_active_devs;\n@@ -58,6 +77,8 @@ struct test_buffers {\n \tstruct rte_bbdev_op_data *inputs;\n \tstruct rte_bbdev_op_data *hard_outputs;\n \tstruct rte_bbdev_op_data *soft_outputs;\n+\tstruct rte_bbdev_op_data *harq_inputs;\n+\tstruct rte_bbdev_op_data *harq_outputs;\n };\n \n /* Operation parameters specific for given test case */\n@@ -128,6 +149,13 @@ typedef int (test_case_function)(struct active_device *ad,\n \t} while (m != NULL);\n }\n \n+/* Read flag value 0/1 from bitmap */\n+static inline bool\n+check_bit(uint32_t bitmap, uint32_t bitmask)\n+{\n+\treturn bitmap & bitmask;\n+}\n+\n static inline void\n set_avail_op(struct active_device *ad, enum rte_bbdev_op_type op_type)\n {\n@@ -158,12 +186,15 @@ typedef int (test_case_function)(struct active_device *ad,\n check_dev_cap(const struct rte_bbdev_info *dev_info)\n {\n \tunsigned int i;\n-\tunsigned int nb_inputs, nb_soft_outputs, nb_hard_outputs;\n+\tunsigned int nb_inputs, nb_soft_outputs, nb_hard_outputs,\n+\t\tnb_harq_inputs, nb_harq_outputs;\n \tconst struct rte_bbdev_op_cap *op_cap = dev_info->drv.capabilities;\n \n \tnb_inputs = test_vector.entries[DATA_INPUT].nb_segments;\n \tnb_soft_outputs = test_vector.entries[DATA_SOFT_OUTPUT].nb_segments;\n \tnb_hard_outputs = test_vector.entries[DATA_HARD_OUTPUT].nb_segments;\n+\tnb_harq_inputs  = test_vector.entries[DATA_HARQ_INPUT].nb_segments;\n+\tnb_harq_outputs = test_vector.entries[DATA_HARQ_OUTPUT].nb_segments;\n \n \tfor (i = 0; op_cap->type != RTE_BBDEV_OP_NONE; ++i, ++op_cap) {\n \t\tif (op_cap->type != test_vector.op_type)\n@@ -180,7 +211,7 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\t\t\t!(cap->capability_flags &\n \t\t\t\t\tRTE_BBDEV_TURBO_SOFT_OUTPUT)) {\n \t\t\t\tprintf(\n-\t\t\t\t\t\"WARNING: Device \\\"%s\\\" does not support soft output - soft output flags will be ignored.\\n\",\n+\t\t\t\t\t\"INFO: Device \\\"%s\\\" does not support soft output - soft output flags will be ignored.\\n\",\n \t\t\t\t\tdev_info->dev_name);\n \t\t\t\tclear_soft_out_cap(\n \t\t\t\t\t&test_vector.turbo_dec.op_flags);\n@@ -233,7 +264,35 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\tif (nb_hard_outputs > cap->num_buffers_dst) {\n \t\t\t\tprintf(\n \t\t\t\t\t\"Too many hard outputs defined: %u, max: %u\\n\",\n-\t\t\t\t\tnb_hard_outputs, cap->num_buffers_src);\n+\t\t\t\t\tnb_hard_outputs, cap->num_buffers_dst);\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\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\treturn TEST_SUCCESS;\n+\t\t} else if (op_cap->type == RTE_BBDEV_OP_LDPC_ENC) {\n+\t\t\tconst struct rte_bbdev_op_cap_ldpc_enc *cap =\n+\t\t\t\t\t&op_cap->cap.ldpc_enc;\n+\n+\t\t\tif (!flags_match(test_vector.ldpc_enc.op_flags,\n+\t\t\t\t\tcap->capability_flags)){\n+\t\t\t\tprintf(\"Flag Mismatch\\n\");\n+\t\t\t\treturn TEST_FAILED;\n+\t\t\t}\n+\t\t\tif (nb_inputs > cap->num_buffers_src) {\n+\t\t\t\tprintf(\"Too many inputs defined: %u, max: %u\\n\",\n+\t\t\t\t\tnb_inputs, cap->num_buffers_src);\n+\t\t\t\treturn TEST_FAILED;\n+\t\t\t}\n+\t\t\tif (nb_hard_outputs > cap->num_buffers_dst) {\n+\t\t\t\tprintf(\n+\t\t\t\t\t\"Too many hard outputs defined: %u, max: %u\\n\",\n+\t\t\t\t\tnb_hard_outputs, cap->num_buffers_dst);\n \t\t\t\treturn TEST_FAILED;\n \t\t\t}\n \t\t\tif (intr_enabled && !(cap->capability_flags &\n@@ -244,6 +303,49 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\t}\n \n \t\t\treturn TEST_SUCCESS;\n+\t\t} else if (op_cap->type == RTE_BBDEV_OP_LDPC_DEC) {\n+\t\t\tconst struct rte_bbdev_op_cap_ldpc_dec *cap =\n+\t\t\t\t\t&op_cap->cap.ldpc_dec;\n+\n+\t\t\tif (!flags_match(test_vector.ldpc_dec.op_flags,\n+\t\t\t\t\tcap->capability_flags)){\n+\t\t\t\tprintf(\"Flag Mismatch\\n\");\n+\t\t\t\treturn TEST_FAILED;\n+\t\t\t}\n+\t\t\tif (nb_inputs > cap->num_buffers_src) {\n+\t\t\t\tprintf(\"Too many inputs defined: %u, max: %u\\n\",\n+\t\t\t\t\tnb_inputs, cap->num_buffers_src);\n+\t\t\t\treturn TEST_FAILED;\n+\t\t\t}\n+\t\t\tif (nb_hard_outputs > cap->num_buffers_hard_out) {\n+\t\t\t\tprintf(\n+\t\t\t\t\t\"Too many hard outputs defined: %u, max: %u\\n\",\n+\t\t\t\t\tnb_hard_outputs,\n+\t\t\t\t\tcap->num_buffers_hard_out);\n+\t\t\t\treturn TEST_FAILED;\n+\t\t\t}\n+\t\t\tif (nb_harq_inputs > cap->num_buffers_hard_out) {\n+\t\t\t\tprintf(\n+\t\t\t\t\t\"Too many HARQ inputs defined: %u, max: %u\\n\",\n+\t\t\t\t\tnb_hard_outputs,\n+\t\t\t\t\tcap->num_buffers_hard_out);\n+\t\t\t\treturn TEST_FAILED;\n+\t\t\t}\n+\t\t\tif (nb_harq_outputs > cap->num_buffers_hard_out) {\n+\t\t\t\tprintf(\n+\t\t\t\t\t\"Too many HARQ outputs defined: %u, max: %u\\n\",\n+\t\t\t\t\tnb_hard_outputs,\n+\t\t\t\t\tcap->num_buffers_hard_out);\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\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\treturn TEST_SUCCESS;\n \t\t}\n \t}\n \n@@ -297,6 +399,10 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\t&test_vector.entries[DATA_HARD_OUTPUT];\n \tstruct op_data_entries *soft_out =\n \t\t\t&test_vector.entries[DATA_SOFT_OUTPUT];\n+\tstruct op_data_entries *harq_in =\n+\t\t\t&test_vector.entries[DATA_HARQ_INPUT];\n+\tstruct op_data_entries *harq_out =\n+\t\t\t&test_vector.entries[DATA_HARQ_OUTPUT];\n \n \t/* allocate ops mempool */\n \tops_pool_size = optimal_mempool_size(RTE_MAX(\n@@ -350,22 +456,53 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\tsocket_id);\n \tad->hard_out_mbuf_pool = mp;\n \n-\tif (soft_out->nb_segments == 0)\n-\t\treturn TEST_SUCCESS;\n \n \t/* Soft outputs */\n-\tmbuf_pool_size = optimal_mempool_size(ops_pool_size *\n-\t\t\tsoft_out->nb_segments);\n-\tmp = create_mbuf_pool(soft_out, ad->dev_id, socket_id, mbuf_pool_size,\n-\t\t\t\"soft_out\");\n-\tTEST_ASSERT_NOT_NULL(mp,\n-\t\t\t\"ERROR Failed to create %uB soft 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->soft_out_mbuf_pool = mp;\n+\tif (soft_out->nb_segments > 0) {\n+\t\tmbuf_pool_size = optimal_mempool_size(ops_pool_size *\n+\t\t\t\tsoft_out->nb_segments);\n+\t\tmp = create_mbuf_pool(soft_out, ad->dev_id, socket_id,\n+\t\t\t\tmbuf_pool_size,\n+\t\t\t\t\"soft_out\");\n+\t\tTEST_ASSERT_NOT_NULL(mp,\n+\t\t\t\t\"ERROR Failed to create %uB soft 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->soft_out_mbuf_pool = mp;\n+\t}\n \n-\treturn 0;\n+\t/* HARQ inputs */\n+\tif (harq_in->nb_segments > 0) {\n+\t\tmbuf_pool_size = optimal_mempool_size(ops_pool_size *\n+\t\t\t\tharq_in->nb_segments);\n+\t\tmp = create_mbuf_pool(harq_in, ad->dev_id, socket_id,\n+\t\t\t\tmbuf_pool_size,\n+\t\t\t\t\"harq_in\");\n+\t\tTEST_ASSERT_NOT_NULL(mp,\n+\t\t\t\t\"ERROR Failed to create %uB harq 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->harq_in_mbuf_pool = mp;\n+\t}\n+\n+\t/* HARQ outputs */\n+\tif (harq_out->nb_segments > 0) {\n+\t\tmbuf_pool_size = optimal_mempool_size(ops_pool_size *\n+\t\t\t\tharq_out->nb_segments);\n+\t\tmp = create_mbuf_pool(harq_out, ad->dev_id, socket_id,\n+\t\t\t\tmbuf_pool_size,\n+\t\t\t\t\"harq_out\");\n+\t\tTEST_ASSERT_NOT_NULL(mp,\n+\t\t\t\t\"ERROR Failed to create %uB harq 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->harq_out_mbuf_pool = mp;\n+\t}\n+\n+\treturn TEST_SUCCESS;\n }\n \n static int\n@@ -379,7 +516,58 @@ typedef int (test_case_function)(struct active_device *ad,\n \tunsigned int nb_queues;\n \tenum rte_bbdev_op_type op_type = vector->op_type;\n \n+/* Configure fpga lte fec with PF & VF values\n+ * if '-i' flag is set and using fpga device\n+ */\n+#ifndef RTE_BUILD_SHARED_LIB\n+#ifdef RTE_LIBRTE_PMD_FPGA_LTE_FEC\n+\tif ((get_init_device() == true) &&\n+\t\t(!strcmp(info->drv.driver_name, FPGA_PF_DRIVER_NAME))) {\n+\t\tstruct fpga_lte_fec_conf conf;\n+\t\tunsigned int i;\n+\n+\t\tprintf(\"Configure FPGA FEC Driver %s with default values\\n\",\n+\t\t\t\tinfo->drv.driver_name);\n+\n+\t\t/* clear default configuration before initialization */\n+\t\tmemset(&conf, 0, sizeof(struct fpga_lte_fec_conf));\n+\n+\t\t/* Set PF mode :\n+\t\t * true if PF is used for data plane\n+\t\t * false for VFs\n+\t\t */\n+\t\tconf.pf_mode_en = true;\n+\n+\t\tfor (i = 0; i < FPGA_LTE_FEC_NUM_VFS; ++i) {\n+\t\t\t/* Number of UL queues per VF (fpga supports 8 VFs) */\n+\t\t\tconf.vf_ul_queues_number[i] = VF_UL_QUEUE_VALUE;\n+\t\t\t/* Number of DL queues per VF (fpga supports 8 VFs) */\n+\t\t\tconf.vf_dl_queues_number[i] = VF_DL_QUEUE_VALUE;\n+\t\t}\n+\n+\t\t/* UL bandwidth. Needed for schedule algorithm */\n+\t\tconf.ul_bandwidth = UL_BANDWIDTH;\n+\t\t/* DL bandwidth */\n+\t\tconf.dl_bandwidth = DL_BANDWIDTH;\n+\n+\t\t/* UL & DL load Balance Factor to 64 */\n+\t\tconf.ul_load_balance = UL_LOAD_BALANCE;\n+\t\tconf.dl_load_balance = DL_LOAD_BALANCE;\n+\n+\t\t/**< FLR timeout value */\n+\t\tconf.flr_time_out = FLR_TIMEOUT;\n+\n+\t\t/* setup FPGA PF with configuration information */\n+\t\tret = fpga_lte_fec_configure(info->dev_name, &conf);\n+\t\tTEST_ASSERT_SUCCESS(ret,\n+\t\t\t\t\"Failed to configure 4G FPGA PF for bbdev %s\",\n+\t\t\t\tinfo->dev_name);\n+\t}\n+#endif\n+#endif\n \tnb_queues = RTE_MIN(rte_lcore_count(), info->drv.max_num_queues);\n+\tnb_queues = RTE_MIN(nb_queues, (unsigned int) MAX_QUEUES);\n+\n \t/* setup device */\n \tret = rte_bbdev_setup_queues(dev_id, nb_queues, info->socket_id);\n \tif (ret < 0) {\n@@ -596,7 +784,7 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\tbufs[i].offset = 0;\n \t\tbufs[i].length = 0;\n \n-\t\tif (op_type == DATA_INPUT) {\n+\t\tif ((op_type == DATA_INPUT) || (op_type == DATA_HARQ_INPUT)) {\n \t\t\tdata = rte_pktmbuf_append(m_head, seg->length);\n \t\t\tTEST_ASSERT_NOT_NULL(data,\n \t\t\t\t\t\"Couldn't append %u bytes to mbuf from %d data type mbuf pool\",\n@@ -635,7 +823,6 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\t\t\t\t\"Couldn't chain mbufs from %d data type mbuf pool\",\n \t\t\t\t\t\top_type);\n \t\t\t}\n-\n \t\t} else {\n \n \t\t\t/* allocate chained-mbuf for output buffer */\n@@ -682,7 +869,7 @@ typedef int (test_case_function)(struct active_device *ad,\n \n static void\n limit_input_llr_val_range(struct rte_bbdev_op_data *input_ops,\n-\t\tuint16_t n, int8_t max_llr_modulus)\n+\t\tconst uint16_t n, const int8_t max_llr_modulus)\n {\n \tuint16_t i, byte_idx;\n \n@@ -701,10 +888,50 @@ typedef int (test_case_function)(struct active_device *ad,\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+\t\tconst int8_t llr_decimals)\n+{\n+\tif (input_ops == NULL)\n+\t\treturn;\n+\n+\tuint16_t i, byte_idx;\n+\n+\tint16_t llr_max, llr_min, llr_tmp;\n+\tllr_max = (1 << (llr_size - 1)) - 1;\n+\tllr_min = -llr_max;\n+\tfor (i = 0; i < n; ++i) {\n+\t\tstruct rte_mbuf *m = input_ops[i].data;\n+\t\twhile (m != NULL) {\n+\t\t\tint8_t *llr = rte_pktmbuf_mtod_offset(m, int8_t *,\n+\t\t\t\t\tinput_ops[i].offset);\n+\t\t\tfor (byte_idx = 0; byte_idx < rte_pktmbuf_data_len(m);\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\t\tllr_tmp *= 2;\n+\t\t\t\telse if (llr_decimals == 0)\n+\t\t\t\t\tllr_tmp /= 2;\n+\t\t\t\tllr_tmp = RTE_MIN(llr_max,\n+\t\t\t\t\t\tRTE_MAX(llr_min, llr_tmp));\n+\t\t\t\tllr[byte_idx] = (int8_t) llr_tmp;\n+\t\t\t}\n+\n+\t\t\tm = m->next;\n+\t\t}\n+\t}\n+}\n+\n+\n+\n static int\n fill_queue_buffers(struct test_op_params *op_params,\n \t\tstruct rte_mempool *in_mp, struct rte_mempool *hard_out_mp,\n-\t\tstruct rte_mempool *soft_out_mp, uint16_t queue_id,\n+\t\tstruct rte_mempool *soft_out_mp,\n+\t\tstruct rte_mempool *harq_in_mp, struct rte_mempool *harq_out_mp,\n+\t\tuint16_t queue_id,\n \t\tconst struct rte_bbdev_op_cap *capabilities,\n \t\tuint16_t min_alignment, const int socket_id)\n {\n@@ -716,12 +943,16 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\tin_mp,\n \t\tsoft_out_mp,\n \t\thard_out_mp,\n+\t\tharq_in_mp,\n+\t\tharq_out_mp,\n \t};\n \n \tstruct rte_bbdev_op_data **queue_ops[DATA_NUM_TYPES] = {\n \t\t&op_params->q_bufs[socket_id][queue_id].inputs,\n \t\t&op_params->q_bufs[socket_id][queue_id].soft_outputs,\n \t\t&op_params->q_bufs[socket_id][queue_id].hard_outputs,\n+\t\t&op_params->q_bufs[socket_id][queue_id].harq_inputs,\n+\t\t&op_params->q_bufs[socket_id][queue_id].harq_outputs,\n \t};\n \n \tfor (type = DATA_INPUT; type < DATA_NUM_TYPES; ++type) {\n@@ -746,6 +977,15 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\tlimit_input_llr_val_range(*queue_ops[DATA_INPUT], n,\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}\n+\n \treturn 0;\n }\n \n@@ -758,12 +998,16 @@ typedef int (test_case_function)(struct active_device *ad,\n \trte_mempool_free(ad->in_mbuf_pool);\n \trte_mempool_free(ad->hard_out_mbuf_pool);\n \trte_mempool_free(ad->soft_out_mbuf_pool);\n+\trte_mempool_free(ad->harq_in_mbuf_pool);\n+\trte_mempool_free(ad->harq_out_mbuf_pool);\n \n \tfor (i = 0; i < rte_lcore_count(); ++i) {\n \t\tfor (j = 0; j < RTE_MAX_NUMA_NODES; ++j) {\n \t\t\trte_free(op_params->q_bufs[j][i].inputs);\n \t\t\trte_free(op_params->q_bufs[j][i].hard_outputs);\n \t\t\trte_free(op_params->q_bufs[j][i].soft_outputs);\n+\t\t\trte_free(op_params->q_bufs[j][i].harq_inputs);\n+\t\t\trte_free(op_params->q_bufs[j][i].harq_outputs);\n \t\t}\n \t}\n }\n@@ -863,6 +1107,93 @@ typedef int (test_case_function)(struct active_device *ad,\n \t}\n }\n \n+static void\n+copy_reference_ldpc_dec_op(struct rte_bbdev_dec_op **ops, unsigned int n,\n+\t\tunsigned int start_idx,\n+\t\tstruct rte_bbdev_op_data *inputs,\n+\t\tstruct rte_bbdev_op_data *hard_outputs,\n+\t\tstruct rte_bbdev_op_data *soft_outputs,\n+\t\tstruct rte_bbdev_op_data *harq_inputs,\n+\t\tstruct rte_bbdev_op_data *harq_outputs,\n+\t\tstruct rte_bbdev_dec_op *ref_op)\n+{\n+\tunsigned int i;\n+\tstruct rte_bbdev_op_ldpc_dec *ldpc_dec = &ref_op->ldpc_dec;\n+\n+\tfor (i = 0; i < n; ++i) {\n+\t\tif (ldpc_dec->code_block_mode == 0) {\n+\t\t\tops[i]->ldpc_dec.tb_params.ea =\n+\t\t\t\t\tldpc_dec->tb_params.ea;\n+\t\t\tops[i]->ldpc_dec.tb_params.eb =\n+\t\t\t\t\tldpc_dec->tb_params.eb;\n+\t\t\tops[i]->ldpc_dec.tb_params.c =\n+\t\t\t\t\tldpc_dec->tb_params.c;\n+\t\t\tops[i]->ldpc_dec.tb_params.cab =\n+\t\t\t\t\tldpc_dec->tb_params.cab;\n+\t\t\tops[i]->ldpc_dec.tb_params.r =\n+\t\t\t\t\tldpc_dec->tb_params.r;\n+\t\t} else {\n+\t\t\tops[i]->ldpc_dec.cb_params.e = ldpc_dec->cb_params.e;\n+\t\t}\n+\n+\t\tops[i]->ldpc_dec.basegraph = ldpc_dec->basegraph;\n+\t\tops[i]->ldpc_dec.z_c = ldpc_dec->z_c;\n+\t\tops[i]->ldpc_dec.q_m = ldpc_dec->q_m;\n+\t\tops[i]->ldpc_dec.n_filler = ldpc_dec->n_filler;\n+\t\tops[i]->ldpc_dec.n_cb = ldpc_dec->n_cb;\n+\t\tops[i]->ldpc_dec.iter_max = ldpc_dec->iter_max;\n+\t\tops[i]->ldpc_dec.rv_index = ldpc_dec->rv_index;\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 (soft_outputs != NULL)\n+\t\t\tops[i]->ldpc_dec.soft_output =\n+\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}\n+}\n+\n+\n+static void\n+copy_reference_ldpc_enc_op(struct rte_bbdev_enc_op **ops, unsigned int n,\n+\t\tunsigned int start_idx,\n+\t\tstruct rte_bbdev_op_data *inputs,\n+\t\tstruct rte_bbdev_op_data *outputs,\n+\t\tstruct rte_bbdev_enc_op *ref_op)\n+{\n+\tunsigned int i;\n+\tstruct rte_bbdev_op_ldpc_enc *ldpc_enc = &ref_op->ldpc_enc;\n+\tfor (i = 0; i < n; ++i) {\n+\t\tif (ldpc_enc->code_block_mode == 0) {\n+\t\t\tops[i]->ldpc_enc.tb_params.ea = ldpc_enc->tb_params.ea;\n+\t\t\tops[i]->ldpc_enc.tb_params.eb = ldpc_enc->tb_params.eb;\n+\t\t\tops[i]->ldpc_enc.tb_params.cab =\n+\t\t\t\t\tldpc_enc->tb_params.cab;\n+\t\t\tops[i]->ldpc_enc.tb_params.c = ldpc_enc->tb_params.c;\n+\t\t\tops[i]->ldpc_enc.tb_params.r = ldpc_enc->tb_params.r;\n+\t\t} else {\n+\t\t\tops[i]->ldpc_enc.cb_params.e = ldpc_enc->cb_params.e;\n+\t\t}\n+\t\tops[i]->ldpc_enc.basegraph = ldpc_enc->basegraph;\n+\t\tops[i]->ldpc_enc.z_c = ldpc_enc->z_c;\n+\t\tops[i]->ldpc_enc.q_m = ldpc_enc->q_m;\n+\t\tops[i]->ldpc_enc.n_filler = ldpc_enc->n_filler;\n+\t\tops[i]->ldpc_enc.n_cb = ldpc_enc->n_cb;\n+\t\tops[i]->ldpc_enc.rv_index = ldpc_enc->rv_index;\n+\t\tops[i]->ldpc_enc.op_flags = ldpc_enc->op_flags;\n+\t\tops[i]->ldpc_enc.code_block_mode = ldpc_enc->code_block_mode;\n+\t\tops[i]->ldpc_enc.output = outputs[start_idx + i];\n+\t\tops[i]->ldpc_enc.input = inputs[start_idx + i];\n+\t}\n+}\n+\n static int\n check_dec_status_and_ordering(struct rte_bbdev_dec_op *op,\n \t\tunsigned int order_idx, const int expected_status)\n@@ -975,6 +1306,64 @@ 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+{\n+\tunsigned int i;\n+\tint ret;\n+\tstruct op_data_entries *hard_data_orig =\n+\t\t\t&test_vector.entries[DATA_HARD_OUTPUT];\n+\tstruct op_data_entries *soft_data_orig =\n+\t\t\t&test_vector.entries[DATA_SOFT_OUTPUT];\n+\tstruct op_data_entries *harq_data_orig =\n+\t\t\t\t&test_vector.entries[DATA_HARQ_OUTPUT];\n+\tstruct rte_bbdev_op_ldpc_dec *ops_td;\n+\tstruct rte_bbdev_op_data *hard_output;\n+\tstruct rte_bbdev_op_data *harq_output;\n+\tstruct rte_bbdev_op_data *soft_output;\n+\tstruct rte_bbdev_op_ldpc_dec *ref_td = &ref_op->ldpc_dec;\n+\n+\tfor (i = 0; i < n; ++i) {\n+\t\tops_td = &ops[i]->ldpc_dec;\n+\t\thard_output = &ops_td->hard_output;\n+\t\tharq_output = &ops_td->harq_combined_output;\n+\t\tsoft_output = &ops_td->soft_output;\n+\n+\t\tret = check_dec_status_and_ordering(ops[i], i, ref_op->status);\n+\t\tTEST_ASSERT_SUCCESS(ret,\n+\t\t\t\t\"Checking status and ordering for decoder failed\");\n+\t\tif (vector_mask & TEST_BBDEV_VF_EXPECTED_ITER_COUNT)\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\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+\t\t\t\t\ti);\n+\n+\t\tif (ref_op->ldpc_dec.op_flags & RTE_BBDEV_LDPC_SOFT_OUT_ENABLE)\n+\t\t\tTEST_ASSERT_SUCCESS(validate_op_chain(soft_output,\n+\t\t\t\t\tsoft_data_orig),\n+\t\t\t\t\t\"Soft output buffers (CB=%u) are not equal\",\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\t\t\t\"HARQ output buffers (CB=%u) are not equal\",\n+\t\t\t\t\ti);\n+\t\t}\n+\t}\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+\n static int\n validate_enc_op(struct rte_bbdev_enc_op **ops, const uint16_t n,\n \t\tstruct rte_bbdev_enc_op *ref_op)\n@@ -998,6 +1387,29 @@ typedef int (test_case_function)(struct active_device *ad,\n \treturn TEST_SUCCESS;\n }\n \n+static int\n+validate_ldpc_enc_op(struct rte_bbdev_enc_op **ops, const uint16_t n,\n+\t\tstruct rte_bbdev_enc_op *ref_op)\n+{\n+\tunsigned int i;\n+\tint ret;\n+\tstruct op_data_entries *hard_data_orig =\n+\t\t\t&test_vector.entries[DATA_HARD_OUTPUT];\n+\n+\tfor (i = 0; i < n; ++i) {\n+\t\tret = check_enc_status_and_ordering(ops[i], i, ref_op->status);\n+\t\tTEST_ASSERT_SUCCESS(ret,\n+\t\t\t\t\"Checking status and ordering for encoder failed\");\n+\t\tTEST_ASSERT_SUCCESS(validate_op_chain(\n+\t\t\t\t&ops[i]->ldpc_enc.output,\n+\t\t\t\thard_data_orig),\n+\t\t\t\t\"Output buffers (CB=%u) are not equal\",\n+\t\t\t\ti);\n+\t}\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n static void\n create_reference_dec_op(struct rte_bbdev_dec_op *op)\n {\n@@ -1012,6 +1424,27 @@ typedef int (test_case_function)(struct active_device *ad,\n }\n \n static void\n+create_reference_ldpc_dec_op(struct rte_bbdev_dec_op *op)\n+{\n+\tunsigned int i;\n+\tstruct op_data_entries *entry;\n+\n+\top->ldpc_dec = test_vector.ldpc_dec;\n+\tentry = &test_vector.entries[DATA_INPUT];\n+\tfor (i = 0; i < entry->nb_segments; ++i)\n+\t\top->ldpc_dec.input.length +=\n+\t\t\t\tentry->segments[i].length;\n+\tif (test_vector.ldpc_dec.op_flags &\n+\t\t\tRTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE) {\n+\t\tentry = &test_vector.entries[DATA_HARQ_INPUT];\n+\t\tfor (i = 0; i < entry->nb_segments; ++i)\n+\t\t\top->ldpc_dec.harq_combined_input.length +=\n+\t\t\t\tentry->segments[i].length;\n+\t}\n+}\n+\n+\n+static void\n create_reference_enc_op(struct rte_bbdev_enc_op *op)\n {\n \tunsigned int i;\n@@ -1024,6 +1457,19 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\t\tentry->segments[i].length;\n }\n \n+static void\n+create_reference_ldpc_enc_op(struct rte_bbdev_enc_op *op)\n+{\n+\tunsigned int i;\n+\tstruct op_data_entries *entry;\n+\n+\top->ldpc_enc = test_vector.ldpc_enc;\n+\tentry = &test_vector.entries[DATA_INPUT];\n+\tfor (i = 0; i < entry->nb_segments; ++i)\n+\t\top->ldpc_enc.input.length +=\n+\t\t\t\tentry->segments[i].length;\n+}\n+\n static uint32_t\n calc_dec_TB_size(struct rte_bbdev_dec_op *op)\n {\n@@ -1044,6 +1490,25 @@ typedef int (test_case_function)(struct active_device *ad,\n }\n \n static uint32_t\n+calc_ldpc_dec_TB_size(struct rte_bbdev_dec_op *op)\n+{\n+\tuint8_t i;\n+\tuint32_t c, r, tb_size = 0;\n+\tuint16_t sys_cols = (op->ldpc_dec.basegraph == 1) ? 22 : 10;\n+\n+\tif (op->ldpc_dec.code_block_mode) {\n+\t\ttb_size = sys_cols * op->ldpc_dec.z_c - op->ldpc_dec.n_filler;\n+\t} else {\n+\t\tc = op->ldpc_dec.tb_params.c;\n+\t\tr = op->ldpc_dec.tb_params.r;\n+\t\tfor (i = 0; i < c-r; i++)\n+\t\t\ttb_size += sys_cols * op->ldpc_dec.z_c\n+\t\t\t\t\t- op->ldpc_dec.n_filler;\n+\t}\n+\treturn tb_size;\n+}\n+\n+static uint32_t\n calc_enc_TB_size(struct rte_bbdev_enc_op *op)\n {\n \tuint8_t i;\n@@ -1062,6 +1527,26 @@ typedef int (test_case_function)(struct active_device *ad,\n \treturn tb_size;\n }\n \n+static uint32_t\n+calc_ldpc_enc_TB_size(struct rte_bbdev_enc_op *op)\n+{\n+\tuint8_t i;\n+\tuint32_t c, r, tb_size = 0;\n+\tuint16_t sys_cols = (op->ldpc_enc.basegraph == 1) ? 22 : 10;\n+\n+\tif (op->turbo_enc.code_block_mode) {\n+\t\ttb_size = sys_cols * op->ldpc_enc.z_c - op->ldpc_enc.n_filler;\n+\t} else {\n+\t\tc = op->turbo_enc.tb_params.c;\n+\t\tr = op->turbo_enc.tb_params.r;\n+\t\tfor (i = 0; i < c-r; i++)\n+\t\t\ttb_size += sys_cols * op->ldpc_enc.z_c\n+\t\t\t\t\t- op->ldpc_enc.n_filler;\n+\t}\n+\treturn tb_size;\n+}\n+\n+\n static int\n init_test_op_params(struct test_op_params *op_params,\n \t\tenum rte_bbdev_op_type op_type, const int expected_status,\n@@ -1069,7 +1554,8 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\tuint16_t burst_sz, uint16_t num_to_process, uint16_t num_lcores)\n {\n \tint ret = 0;\n-\tif (op_type == RTE_BBDEV_OP_TURBO_DEC)\n+\tif (op_type == RTE_BBDEV_OP_TURBO_DEC ||\n+\t\t\top_type == RTE_BBDEV_OP_LDPC_DEC)\n \t\tret = rte_bbdev_dec_op_alloc_bulk(ops_mp,\n \t\t\t\t&op_params->ref_dec_op, 1);\n \telse\n@@ -1083,11 +1569,12 @@ typedef int (test_case_function)(struct active_device *ad,\n \top_params->num_to_process = num_to_process;\n \top_params->num_lcores = num_lcores;\n \top_params->vector_mask = vector_mask;\n-\tif (op_type == RTE_BBDEV_OP_TURBO_DEC)\n+\tif (op_type == RTE_BBDEV_OP_TURBO_DEC ||\n+\t\t\top_type == RTE_BBDEV_OP_LDPC_DEC)\n \t\top_params->ref_dec_op->status = expected_status;\n-\telse if (op_type == RTE_BBDEV_OP_TURBO_ENC)\n+\telse if (op_type == RTE_BBDEV_OP_TURBO_ENC\n+\t\t\t|| op_type == RTE_BBDEV_OP_LDPC_ENC)\n \t\top_params->ref_enc_op->status = expected_status;\n-\n \treturn 0;\n }\n \n@@ -1133,27 +1620,35 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\tgoto fail;\n \t}\n \n-\tif (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC) {\n-\t\t/* Find Decoder capabilities */\n-\t\tconst struct rte_bbdev_op_cap *cap = info.drv.capabilities;\n-\t\twhile (cap->type != RTE_BBDEV_OP_NONE) {\n-\t\t\tif (cap->type == RTE_BBDEV_OP_TURBO_DEC) {\n-\t\t\t\tcapabilities = cap;\n-\t\t\t\tbreak;\n-\t\t\t}\n-\t\t}\n-\t\tTEST_ASSERT_NOT_NULL(capabilities,\n-\t\t\t\t\"Couldn't find Decoder capabilities\");\n \n-\t\tcreate_reference_dec_op(op_params->ref_dec_op);\n+\t/* Find capabilities */\n+\tconst struct rte_bbdev_op_cap *cap = info.drv.capabilities;\n+\tfor (i = 0; i < RTE_BBDEV_OP_TYPE_COUNT; i++) {\n+\t\tif (cap->type == test_vector.op_type) {\n+\t\t\tcapabilities = cap;\n+\t\t\tbreak;\n+\t\t}\n+\t\tcap++;\n+\t}\n+\tTEST_ASSERT_NOT_NULL(capabilities,\n+\t\t\t\"Couldn't find capabilities\");\n+\n+\tif (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC) {\n+\t\tcreate_reference_dec_op(op_params->ref_dec_op);\n \t} else if (test_vector.op_type == RTE_BBDEV_OP_TURBO_ENC)\n \t\tcreate_reference_enc_op(op_params->ref_enc_op);\n+\telse if (test_vector.op_type == RTE_BBDEV_OP_LDPC_ENC)\n+\t\tcreate_reference_ldpc_enc_op(op_params->ref_enc_op);\n+\telse if (test_vector.op_type == RTE_BBDEV_OP_LDPC_DEC)\n+\t\tcreate_reference_ldpc_dec_op(op_params->ref_dec_op);\n \n \tfor (i = 0; i < ad->nb_queues; ++i) {\n \t\tf_ret = fill_queue_buffers(op_params,\n \t\t\t\tad->in_mbuf_pool,\n \t\t\t\tad->hard_out_mbuf_pool,\n \t\t\t\tad->soft_out_mbuf_pool,\n+\t\t\t\tad->harq_in_mbuf_pool,\n+\t\t\t\tad->harq_out_mbuf_pool,\n \t\t\t\tad->queue_ids[i],\n \t\t\t\tcapabilities,\n \t\t\t\tinfo.drv.min_alignment,\n@@ -1212,9 +1707,7 @@ typedef int (test_case_function)(struct active_device *ad,\n \tuint16_t deq, burst_sz, num_ops;\n \tuint16_t queue_id = *(uint16_t *) ret_param;\n \tstruct rte_bbdev_info info;\n-\n \tdouble tb_len_bits;\n-\n \tstruct thread_params *tp = cb_arg;\n \n \t/* Find matching thread params using queue_id */\n@@ -1238,7 +1731,8 @@ 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+\tif (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC ||\n+\t\t\ttest_vector.op_type == RTE_BBDEV_OP_LDPC_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@@ -1282,6 +1776,15 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\tstruct rte_bbdev_enc_op *ref_op = tp->op_params->ref_enc_op;\n \t\tret = validate_enc_op(tp->enc_ops, num_ops, ref_op);\n \t\trte_bbdev_enc_op_free_bulk(tp->enc_ops, deq);\n+\t} else if (test_vector.op_type == RTE_BBDEV_OP_LDPC_ENC) {\n+\t\tstruct rte_bbdev_enc_op *ref_op = tp->op_params->ref_enc_op;\n+\t\tret = validate_ldpc_enc_op(tp->enc_ops, num_ops, ref_op);\n+\t\trte_bbdev_enc_op_free_bulk(tp->enc_ops, deq);\n+\t} else if (test_vector.op_type == RTE_BBDEV_OP_LDPC_DEC) {\n+\t\tstruct rte_bbdev_dec_op *ref_op = tp->op_params->ref_dec_op;\n+\t\tret = validate_ldpc_dec_op(tp->dec_ops, num_ops, ref_op,\n+\t\t\t\ttp->op_params->vector_mask);\n+\t\trte_bbdev_dec_op_free_bulk(tp->dec_ops, deq);\n \t}\n \n \tif (ret) {\n@@ -1296,6 +1799,12 @@ typedef int (test_case_function)(struct active_device *ad,\n \tcase RTE_BBDEV_OP_TURBO_ENC:\n \t\ttb_len_bits = calc_enc_TB_size(tp->op_params->ref_enc_op);\n \t\tbreak;\n+\tcase RTE_BBDEV_OP_LDPC_DEC:\n+\t\ttb_len_bits = calc_ldpc_dec_TB_size(tp->op_params->ref_dec_op);\n+\t\tbreak;\n+\tcase RTE_BBDEV_OP_LDPC_ENC:\n+\t\ttb_len_bits = calc_ldpc_enc_TB_size(tp->op_params->ref_enc_op);\n+\t\tbreak;\n \tcase RTE_BBDEV_OP_NONE:\n \t\ttb_len_bits = 0.0;\n \t\tbreak;\n@@ -1375,8 +1884,8 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\tenq = 0;\n \t\t\tdo {\n \t\t\t\tenq += rte_bbdev_enqueue_dec_ops(tp->dev_id,\n-\t\t\t\t\tqueue_id, &ops[enqueued],\n-\t\t\t\t\tnum_to_enq);\n+\t\t\t\t\t\tqueue_id, &ops[enqueued],\n+\t\t\t\t\t\tnum_to_enq);\n \t\t\t} while (unlikely(num_to_enq != enq));\n \t\t\tenqueued += enq;\n \n@@ -1390,7 +1899,7 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\trte_atomic16_set(&tp->burst_sz, num_to_enq);\n \n \t\t\t/* Wait until processing of previous batch is\n-\t\t\t * completed.\n+\t\t\t * completed\n \t\t\t */\n \t\t\twhile (rte_atomic16_read(&tp->nb_dequeued) !=\n \t\t\t\t\t(int16_t) enqueued)\n@@ -1479,7 +1988,7 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\trte_atomic16_set(&tp->burst_sz, num_to_enq);\n \n \t\t\t/* Wait until processing of previous batch is\n-\t\t\t * completed.\n+\t\t\t * completed\n \t\t\t */\n \t\t\twhile (rte_atomic16_read(&tp->nb_dequeued) !=\n \t\t\t\t\t(int16_t) enqueued)\n@@ -1590,6 +2099,116 @@ typedef int (test_case_function)(struct active_device *ad,\n }\n \n static int\n+throughput_pmd_lcore_ldpc_dec(void *arg)\n+{\n+\tstruct thread_params *tp = arg;\n+\tuint16_t enq, deq;\n+\tuint64_t total_time = 0, start_time;\n+\tconst uint16_t queue_id = tp->queue_id;\n+\tconst uint16_t burst_sz = tp->op_params->burst_sz;\n+\tconst uint16_t num_ops = tp->op_params->num_to_process;\n+\tstruct rte_bbdev_dec_op *ops_enq[num_ops];\n+\tstruct rte_bbdev_dec_op *ops_deq[num_ops];\n+\tstruct rte_bbdev_dec_op *ref_op = tp->op_params->ref_dec_op;\n+\tstruct test_buffers *bufs = NULL;\n+\tint i, j, ret;\n+\tstruct rte_bbdev_info info;\n+\tuint16_t num_to_enq;\n+\n+\tTEST_ASSERT_SUCCESS((burst_sz > MAX_BURST),\n+\t\t\t\"BURST_SIZE should be <= %u\", MAX_BURST);\n+\n+\trte_bbdev_info_get(tp->dev_id, &info);\n+\n+\tTEST_ASSERT_SUCCESS((num_ops > info.drv.queue_size_lim),\n+\t\t\t\"NUM_OPS cannot exceed %u for this device\",\n+\t\t\tinfo.drv.queue_size_lim);\n+\n+\tbufs = &tp->op_params->q_bufs[GET_SOCKET(info.socket_id)][queue_id];\n+\n+\twhile (rte_atomic16_read(&tp->op_params->sync) == SYNC_WAIT)\n+\t\trte_pause();\n+\n+\tret = rte_bbdev_dec_op_alloc_bulk(tp->op_params->mp, ops_enq, num_ops);\n+\tTEST_ASSERT_SUCCESS(ret, \"Allocation failed for %d ops\", num_ops);\n+\n+\t/* For throughput tests we need to disable early termination */\n+\tif (check_bit(ref_op->ldpc_dec.op_flags,\n+\t\t\tRTE_BBDEV_LDPC_ITERATION_STOP_ENABLE))\n+\t\tref_op->ldpc_dec.op_flags -=\n+\t\t\t\tRTE_BBDEV_LDPC_ITERATION_STOP_ENABLE;\n+\tref_op->ldpc_dec.iter_max = 6;\n+\tref_op->ldpc_dec.iter_count = ref_op->ldpc_dec.iter_max;\n+\n+\tif (test_vector.op_type != RTE_BBDEV_OP_NONE)\n+\t\tcopy_reference_ldpc_dec_op(ops_enq, num_ops, 0, bufs->inputs,\n+\t\t\t\tbufs->hard_outputs, bufs->soft_outputs,\n+\t\t\t\tbufs->harq_inputs, bufs->harq_outputs, ref_op);\n+\n+\t/* Set counter to validate the ordering */\n+\tfor (j = 0; j < num_ops; ++j)\n+\t\tops_enq[j]->opaque_data = (void *)(uintptr_t)j;\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\t\tmbuf_reset(\n+\t\t\t\tops_enq[j]->ldpc_dec.harq_combined_output.data);\n+\t\t}\n+\n+\t\tstart_time = rte_rdtsc_precise();\n+\n+\t\tfor (enq = 0, deq = 0; enq < num_ops;) {\n+\t\t\tnum_to_enq = burst_sz;\n+\n+\t\t\tif (unlikely(num_ops - enq < num_to_enq))\n+\t\t\t\tnum_to_enq = num_ops - enq;\n+\n+\t\t\tenq += rte_bbdev_enqueue_ldpc_dec_ops(tp->dev_id,\n+\t\t\t\t\tqueue_id, &ops_enq[enq], num_to_enq);\n+\n+\t\t\tdeq += rte_bbdev_dequeue_ldpc_dec_ops(tp->dev_id,\n+\t\t\t\t\tqueue_id, &ops_deq[deq], enq - deq);\n+\t\t}\n+\n+\t\t/* dequeue the remaining */\n+\t\twhile (deq < enq) {\n+\t\t\tdeq += rte_bbdev_dequeue_ldpc_dec_ops(tp->dev_id,\n+\t\t\t\t\tqueue_id, &ops_deq[deq], enq - deq);\n+\t\t}\n+\n+\t\ttotal_time += rte_rdtsc_precise() - start_time;\n+\t}\n+\n+\ttp->iter_count = 0;\n+\t/* get the max of iter_count for all dequeued ops */\n+\tfor (i = 0; i < num_ops; ++i) {\n+\t\ttp->iter_count = RTE_MAX(ops_enq[i]->ldpc_dec.iter_count,\n+\t\t\t\ttp->iter_count);\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+\t\t\t\ttp->op_params->vector_mask);\n+\t\tTEST_ASSERT_SUCCESS(ret, \"Validation failed!\");\n+\t}\n+\n+\trte_bbdev_dec_op_free_bulk(ops_enq, num_ops);\n+\n+\tdouble tb_len_bits = calc_ldpc_dec_TB_size(ref_op);\n+\n+\ttp->ops_per_sec = ((double)num_ops * TEST_REPETITIONS) /\n+\t\t\t((double)total_time / (double)rte_get_tsc_hz());\n+\ttp->mbps = (((double)(num_ops * TEST_REPETITIONS * tb_len_bits)) /\n+\t\t\t1000000.0) / ((double)total_time /\n+\t\t\t(double)rte_get_tsc_hz());\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n throughput_pmd_lcore_enc(void *arg)\n {\n \tstruct thread_params *tp = arg;\n@@ -1667,6 +2286,8 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\tTEST_ASSERT_SUCCESS(ret, \"Validation failed!\");\n \t}\n \n+\trte_bbdev_enc_op_free_bulk(ops_enq, num_ops);\n+\n \tdouble tb_len_bits = calc_enc_TB_size(ref_op);\n \n \ttp->ops_per_sec = ((double)num_ops * TEST_REPETITIONS) /\n@@ -1678,6 +2299,97 @@ typedef int (test_case_function)(struct active_device *ad,\n \treturn TEST_SUCCESS;\n }\n \n+static int\n+throughput_pmd_lcore_ldpc_enc(void *arg)\n+{\n+\tstruct thread_params *tp = arg;\n+\tuint16_t enq, deq;\n+\tuint64_t total_time = 0, start_time;\n+\tconst uint16_t queue_id = tp->queue_id;\n+\tconst uint16_t burst_sz = tp->op_params->burst_sz;\n+\tconst uint16_t num_ops = tp->op_params->num_to_process;\n+\tstruct rte_bbdev_enc_op *ops_enq[num_ops];\n+\tstruct rte_bbdev_enc_op *ops_deq[num_ops];\n+\tstruct rte_bbdev_enc_op *ref_op = tp->op_params->ref_enc_op;\n+\tstruct test_buffers *bufs = NULL;\n+\tint i, j, ret;\n+\tstruct rte_bbdev_info info;\n+\tuint16_t num_to_enq;\n+\n+\tTEST_ASSERT_SUCCESS((burst_sz > MAX_BURST),\n+\t\t\t\"BURST_SIZE should be <= %u\", MAX_BURST);\n+\n+\trte_bbdev_info_get(tp->dev_id, &info);\n+\n+\tTEST_ASSERT_SUCCESS((num_ops > info.drv.queue_size_lim),\n+\t\t\t\"NUM_OPS cannot exceed %u for this device\",\n+\t\t\tinfo.drv.queue_size_lim);\n+\n+\tbufs = &tp->op_params->q_bufs[GET_SOCKET(info.socket_id)][queue_id];\n+\n+\twhile (rte_atomic16_read(&tp->op_params->sync) == SYNC_WAIT)\n+\t\trte_pause();\n+\n+\tret = rte_bbdev_enc_op_alloc_bulk(tp->op_params->mp, ops_enq,\n+\t\t\tnum_ops);\n+\tTEST_ASSERT_SUCCESS(ret, \"Allocation failed for %d ops\",\n+\t\t\tnum_ops);\n+\tif (test_vector.op_type != RTE_BBDEV_OP_NONE)\n+\t\tcopy_reference_ldpc_enc_op(ops_enq, num_ops, 0, bufs->inputs,\n+\t\t\t\tbufs->hard_outputs, ref_op);\n+\n+\t/* Set counter to validate the ordering */\n+\tfor (j = 0; j < num_ops; ++j)\n+\t\tops_enq[j]->opaque_data = (void *)(uintptr_t)j;\n+\n+\tfor (i = 0; i < TEST_REPETITIONS; ++i) {\n+\n+\t\tif (test_vector.op_type != RTE_BBDEV_OP_NONE)\n+\t\t\tfor (j = 0; j < num_ops; ++j)\n+\t\t\t\tmbuf_reset(ops_enq[j]->turbo_enc.output.data);\n+\n+\t\tstart_time = rte_rdtsc_precise();\n+\n+\t\tfor (enq = 0, deq = 0; enq < num_ops;) {\n+\t\t\tnum_to_enq = burst_sz;\n+\n+\t\t\tif (unlikely(num_ops - enq < num_to_enq))\n+\t\t\t\tnum_to_enq = num_ops - enq;\n+\n+\t\t\tenq += rte_bbdev_enqueue_ldpc_enc_ops(tp->dev_id,\n+\t\t\t\t\tqueue_id, &ops_enq[enq], num_to_enq);\n+\n+\t\t\tdeq += rte_bbdev_dequeue_ldpc_enc_ops(tp->dev_id,\n+\t\t\t\t\tqueue_id, &ops_deq[deq], enq - deq);\n+\t\t}\n+\n+\t\t/* dequeue the remaining */\n+\t\twhile (deq < enq) {\n+\t\t\tdeq += rte_bbdev_dequeue_ldpc_enc_ops(tp->dev_id,\n+\t\t\t\t\tqueue_id, &ops_deq[deq], enq - deq);\n+\t\t}\n+\n+\t\ttotal_time += rte_rdtsc_precise() - start_time;\n+\t}\n+\n+\tif (test_vector.op_type != RTE_BBDEV_OP_NONE) {\n+\t\tret = validate_ldpc_enc_op(ops_deq, num_ops, ref_op);\n+\t\tTEST_ASSERT_SUCCESS(ret, \"Validation failed!\");\n+\t}\n+\n+\trte_bbdev_enc_op_free_bulk(ops_enq, num_ops);\n+\n+\tdouble tb_len_bits = calc_ldpc_enc_TB_size(ref_op);\n+\n+\ttp->ops_per_sec = ((double)num_ops * TEST_REPETITIONS) /\n+\t\t\t((double)total_time / (double)rte_get_tsc_hz());\n+\ttp->mbps = (((double)(num_ops * TEST_REPETITIONS * tb_len_bits))\n+\t\t\t/ 1000000.0) / ((double)total_time /\n+\t\t\t(double)rte_get_tsc_hz());\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n static void\n print_enc_throughput(struct thread_params *t_params, unsigned int used_cores)\n {\n@@ -1740,8 +2452,8 @@ typedef int (test_case_function)(struct active_device *ad,\n \tTEST_ASSERT_NOT_NULL(op_type_str, \"Invalid op type: %u\",\n \t\t\ttest_vector.op_type);\n \n-\tprintf(\n-\t\t\"Throughput test: dev: %s, nb_queues: %u, burst size: %u, num ops: %u, num_lcores: %u, op type: %s, int mode: %s, GHz: %lg\\n\",\n+\tprintf(\"+ ------------------------------------------------------- +\\n\");\n+\tprintf(\"== test: throughput\\ndev: %s, nb_queues: %u, burst size: %u, num ops: %u, num_lcores: %u, op type: %s, itr mode: %s, GHz: %lg\\n\",\n \t\t\tinfo.dev_name, ad->nb_queues, op_params->burst_sz,\n \t\t\top_params->num_to_process, op_params->num_lcores,\n \t\t\top_type_str,\n@@ -1763,6 +2475,12 @@ typedef int (test_case_function)(struct active_device *ad,\n \tif (intr_enabled) {\n \t\tif (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC)\n \t\t\tthroughput_function = throughput_intr_lcore_dec;\n+\t\telse if (test_vector.op_type == RTE_BBDEV_OP_LDPC_DEC)\n+\t\t\tthroughput_function = throughput_intr_lcore_dec;\n+\t\telse if (test_vector.op_type == RTE_BBDEV_OP_TURBO_ENC)\n+\t\t\tthroughput_function = throughput_intr_lcore_enc;\n+\t\telse if (test_vector.op_type == RTE_BBDEV_OP_LDPC_ENC)\n+\t\t\tthroughput_function = throughput_intr_lcore_enc;\n \t\telse\n \t\t\tthroughput_function = throughput_intr_lcore_enc;\n \n@@ -1777,6 +2495,12 @@ typedef int (test_case_function)(struct active_device *ad,\n \t} else {\n \t\tif (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC)\n \t\t\tthroughput_function = throughput_pmd_lcore_dec;\n+\t\telse if (test_vector.op_type == RTE_BBDEV_OP_LDPC_DEC)\n+\t\t\tthroughput_function = throughput_pmd_lcore_ldpc_dec;\n+\t\telse if (test_vector.op_type == RTE_BBDEV_OP_TURBO_ENC)\n+\t\t\tthroughput_function = throughput_pmd_lcore_enc;\n+\t\telse if (test_vector.op_type == RTE_BBDEV_OP_LDPC_ENC)\n+\t\t\tthroughput_function = throughput_pmd_lcore_ldpc_enc;\n \t\telse\n \t\t\tthroughput_function = throughput_pmd_lcore_enc;\n \t}\n@@ -1819,7 +2543,8 @@ typedef int (test_case_function)(struct active_device *ad,\n \n \t/* Print throughput if interrupts are disabled and test passed */\n \tif (!intr_enabled) {\n-\t\tif (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC)\n+\t\tif (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC ||\n+\t\t\t\ttest_vector.op_type == RTE_BBDEV_OP_LDPC_DEC)\n \t\t\tprint_dec_throughput(t_params, num_lcores);\n \t\telse\n \t\t\tprint_enc_throughput(t_params, num_lcores);\n@@ -1841,7 +2566,7 @@ typedef int (test_case_function)(struct active_device *ad,\n \n \ttp->ops_per_sec /= TEST_REPETITIONS;\n \ttp->mbps /= TEST_REPETITIONS;\n-\tret |= rte_atomic16_read(&tp->processing_status);\n+\tret |= (int)rte_atomic16_read(&tp->processing_status);\n \n \t/* Wait for slave lcores operations */\n \tfor (used_cores = 1; used_cores < num_lcores; used_cores++) {\n@@ -1855,14 +2580,16 @@ typedef int (test_case_function)(struct active_device *ad,\n \n \t\ttp->ops_per_sec /= TEST_REPETITIONS;\n \t\ttp->mbps /= TEST_REPETITIONS;\n-\t\tret |= rte_atomic16_read(&tp->processing_status);\n+\t\tret |= (int)rte_atomic16_read(&tp->processing_status);\n \t}\n \n \t/* Print throughput if test passed */\n \tif (!ret) {\n-\t\tif (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC)\n+\t\tif (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC ||\n+\t\t\t\ttest_vector.op_type == RTE_BBDEV_OP_LDPC_DEC)\n \t\t\tprint_dec_throughput(t_params, num_lcores);\n-\t\telse if (test_vector.op_type == RTE_BBDEV_OP_TURBO_ENC)\n+\t\telse if (test_vector.op_type == RTE_BBDEV_OP_TURBO_ENC ||\n+\t\t\t\ttest_vector.op_type == RTE_BBDEV_OP_LDPC_ENC)\n \t\t\tprint_enc_throughput(t_params, num_lcores);\n \t}\n \n@@ -1940,6 +2667,77 @@ typedef int (test_case_function)(struct active_device *ad,\n }\n \n static int\n+latency_test_ldpc_dec(struct rte_mempool *mempool,\n+\t\tstruct test_buffers *bufs, struct rte_bbdev_dec_op *ref_op,\n+\t\tint vector_mask, uint16_t dev_id, uint16_t queue_id,\n+\t\tconst uint16_t num_to_process, uint16_t burst_sz,\n+\t\tuint64_t *total_time, uint64_t *min_time, uint64_t *max_time)\n+{\n+\tint ret = TEST_SUCCESS;\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+\n+\tfor (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {\n+\t\tuint16_t enq = 0, deq = 0;\n+\t\tbool first_time = true;\n+\t\tlast_time = 0;\n+\n+\t\tif (unlikely(num_to_process - dequeued < burst_sz))\n+\t\t\tburst_sz = num_to_process - dequeued;\n+\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+\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+\t\t\t\t\tbufs->hard_outputs,\n+\t\t\t\t\tbufs->soft_outputs,\n+\t\t\t\t\tbufs->harq_inputs,\n+\t\t\t\t\tbufs->harq_outputs,\n+\t\t\t\t\tref_op);\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+\n+\t\tstart_time = rte_rdtsc_precise();\n+\n+\t\tenq = rte_bbdev_enqueue_ldpc_dec_ops(dev_id, queue_id,\n+\t\t\t\t&ops_enq[enq], burst_sz);\n+\t\tTEST_ASSERT(enq == burst_sz,\n+\t\t\t\t\"Error enqueueing burst, expected %u, got %u\",\n+\t\t\t\tburst_sz, enq);\n+\n+\t\t/* Dequeue */\n+\t\tdo {\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+\t\t\tif (likely(first_time && (deq > 0))) {\n+\t\t\t\tlast_time = rte_rdtsc_precise() - start_time;\n+\t\t\t\tfirst_time = false;\n+\t\t\t}\n+\t\t} while (unlikely(burst_sz != deq));\n+\n+\t\t*max_time = RTE_MAX(*max_time, last_time);\n+\t\t*min_time = RTE_MIN(*min_time, last_time);\n+\t\t*total_time += last_time;\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+\t\t\tTEST_ASSERT_SUCCESS(ret, \"Validation failed!\");\n+\t\t}\n+\n+\t\trte_bbdev_dec_op_free_bulk(ops_enq, deq);\n+\t\tdequeued += deq;\n+\t}\n+\n+\treturn i;\n+}\n+\n+static int\n latency_test_enc(struct rte_mempool *mempool,\n \t\tstruct test_buffers *bufs, struct rte_bbdev_enc_op *ref_op,\n \t\tuint16_t dev_id, uint16_t queue_id,\n@@ -2007,6 +2805,84 @@ typedef int (test_case_function)(struct active_device *ad,\n }\n \n static int\n+latency_test_ldpc_enc(struct rte_mempool *mempool,\n+\t\tstruct test_buffers *bufs, struct rte_bbdev_enc_op *ref_op,\n+\t\tuint16_t dev_id, uint16_t queue_id,\n+\t\tconst uint16_t num_to_process, uint16_t burst_sz,\n+\t\tuint64_t *total_time, uint64_t *min_time, uint64_t *max_time)\n+{\n+\tint ret = TEST_SUCCESS;\n+\tuint16_t i, j, dequeued;\n+\tstruct rte_bbdev_enc_op *ops_enq[MAX_BURST], *ops_deq[MAX_BURST];\n+\tuint64_t start_time = 0, last_time = 0;\n+\n+\tfor (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {\n+\t\tuint16_t enq = 0, deq = 0;\n+\t\tbool first_time = true;\n+\t\tlast_time = 0;\n+\n+\t\tif (unlikely(num_to_process - dequeued < burst_sz))\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+\t\t\tcopy_reference_ldpc_enc_op(ops_enq, burst_sz, dequeued,\n+\t\t\t\t\tbufs->inputs,\n+\t\t\t\t\tbufs->hard_outputs,\n+\t\t\t\t\tref_op);\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+\n+\t\tstart_time = rte_rdtsc_precise();\n+\n+\t\t/*\n+\t\t * printf(\"Latency Debug %d\\n\",\n+\t\t * ops_enq[0]->ldpc_enc.cb_params.z_c); REMOVEME\n+\t\t */\n+\n+\t\tenq = rte_bbdev_enqueue_ldpc_enc_ops(dev_id, queue_id,\n+\t\t\t\t&ops_enq[enq], burst_sz);\n+\t\tTEST_ASSERT(enq == burst_sz,\n+\t\t\t\t\"Error enqueueing burst, expected %u, got %u\",\n+\t\t\t\tburst_sz, enq);\n+\n+\t\t/* Dequeue */\n+\t\tdo {\n+\t\t\tdeq += rte_bbdev_dequeue_ldpc_enc_ops(dev_id, queue_id,\n+\t\t\t\t\t&ops_deq[deq], burst_sz - deq);\n+\t\t\tif (likely(first_time && (deq > 0))) {\n+\t\t\t\tlast_time += rte_rdtsc_precise() - start_time;\n+\t\t\t\tfirst_time = false;\n+\t\t\t}\n+\t\t} while (unlikely(burst_sz != deq));\n+\n+\t\t*max_time = RTE_MAX(*max_time, last_time);\n+\t\t*min_time = RTE_MIN(*min_time, last_time);\n+\t\t*total_time += last_time;\n+\n+\t\tif (test_vector.op_type != RTE_BBDEV_OP_NONE) {\n+\t\t\tret = validate_enc_op(ops_deq, burst_sz, ref_op);\n+\t\t\tTEST_ASSERT_SUCCESS(ret, \"Validation failed!\");\n+\t\t}\n+\n+\t\t/*\n+\t\t * printf(\"Ready to free - deq %d num_to_process %d\\n\", FIXME\n+\t\t *\t\tdeq, num_to_process);\n+\t\t * printf(\"cache %d\\n\", ops_enq[0]->mempool->cache_size);\n+\t\t */\n+\t\trte_bbdev_enc_op_free_bulk(ops_enq, deq);\n+\t\tdequeued += deq;\n+\t}\n+\n+\treturn i;\n+}\n+\n+static int\n latency_test(struct active_device *ad,\n \t\tstruct test_op_params *op_params)\n {\n@@ -2032,8 +2908,8 @@ typedef int (test_case_function)(struct active_device *ad,\n \top_type_str = rte_bbdev_op_type_str(op_type);\n \tTEST_ASSERT_NOT_NULL(op_type_str, \"Invalid op type: %u\", op_type);\n \n-\tprintf(\n-\t\t\"\\nValidation/Latency test: dev: %s, burst size: %u, num ops: %u, op type: %s\\n\",\n+\tprintf(\"+ ------------------------------------------------------- +\\n\");\n+\tprintf(\"== test: validation/latency\\ndev: %s, burst size: %u, num ops: %u, op type: %s\\n\",\n \t\t\tinfo.dev_name, burst_sz, num_to_process, op_type_str);\n \n \tif (op_type == RTE_BBDEV_OP_TURBO_DEC)\n@@ -2041,19 +2917,35 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\t\top_params->ref_dec_op, op_params->vector_mask,\n \t\t\t\tad->dev_id, queue_id, num_to_process,\n \t\t\t\tburst_sz, &total_time, &min_time, &max_time);\n-\telse\n+\telse if (op_type == RTE_BBDEV_OP_TURBO_ENC)\n \t\titer = latency_test_enc(op_params->mp, bufs,\n \t\t\t\top_params->ref_enc_op, ad->dev_id, queue_id,\n \t\t\t\tnum_to_process, burst_sz, &total_time,\n \t\t\t\t&min_time, &max_time);\n+\telse if (op_type == RTE_BBDEV_OP_LDPC_ENC)\n+\t\titer = latency_test_ldpc_enc(op_params->mp, bufs,\n+\t\t\t\top_params->ref_enc_op, ad->dev_id, queue_id,\n+\t\t\t\tnum_to_process, burst_sz, &total_time,\n+\t\t\t\t&min_time, &max_time);\n+\telse if (op_type == RTE_BBDEV_OP_LDPC_DEC)\n+\t\titer = latency_test_ldpc_dec(op_params->mp, bufs,\n+\t\t\t\top_params->ref_dec_op, op_params->vector_mask,\n+\t\t\t\tad->dev_id, queue_id, num_to_process,\n+\t\t\t\tburst_sz, &total_time, &min_time, &max_time);\n+\telse\n+\t\titer = latency_test_enc(op_params->mp, bufs,\n+\t\t\t\t\top_params->ref_enc_op,\n+\t\t\t\t\tad->dev_id, queue_id,\n+\t\t\t\t\tnum_to_process, burst_sz, &total_time,\n+\t\t\t\t\t&min_time, &max_time);\n \n \tif (iter <= 0)\n \t\treturn TEST_FAILED;\n \n \tprintf(\"Operation latency:\\n\"\n-\t\t\t\"\\tavg latency: %lg cycles, %lg us\\n\"\n-\t\t\t\"\\tmin latency: %lg cycles, %lg us\\n\"\n-\t\t\t\"\\tmax latency: %lg cycles, %lg us\\n\",\n+\t\t\t\"\\tavg: %lg cycles, %lg us\\n\"\n+\t\t\t\"\\tmin: %lg cycles, %lg us\\n\"\n+\t\t\t\"\\tmax: %lg cycles, %lg us\\n\",\n \t\t\t(double)total_time / (double)iter,\n \t\t\t(double)(total_time * 1000000) / (double)iter /\n \t\t\t(double)rte_get_tsc_hz(), (double)min_time,\n@@ -2104,10 +2996,7 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\tif (unlikely(num_to_process - dequeued < burst_sz))\n \t\t\tburst_sz = num_to_process - dequeued;\n \n-\t\tret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);\n-\t\tTEST_ASSERT_SUCCESS(ret, \"Allocation failed for %d ops\",\n-\t\t\t\tburst_sz);\n-\n+\t\trte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);\n \t\tif (test_vector.op_type != RTE_BBDEV_OP_NONE)\n \t\t\tcopy_reference_dec_op(ops_enq, burst_sz, dequeued,\n \t\t\t\t\tbufs->inputs,\n@@ -2141,7 +3030,7 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\t\tstats.acc_offload_cycles);\n \t\ttime_st->enq_acc_total_time += stats.acc_offload_cycles;\n \n-\t\t/* ensure enqueue has been completed */\n+\t\t/* give time for device to process ops */\n \t\trte_delay_us(200);\n \n \t\t/* Start time meas for dequeue function offload latency */\n@@ -2172,6 +3061,91 @@ typedef int (test_case_function)(struct active_device *ad,\n }\n \n static int\n+offload_latency_test_ldpc_dec(struct rte_mempool *mempool,\n+\t\tstruct test_buffers *bufs,\n+\t\tstruct rte_bbdev_dec_op *ref_op, uint16_t dev_id,\n+\t\tuint16_t queue_id, const uint16_t num_to_process,\n+\t\tuint16_t burst_sz, struct test_time_stats *time_st)\n+{\n+\tint i, dequeued, ret;\n+\tstruct rte_bbdev_dec_op *ops_enq[MAX_BURST], *ops_deq[MAX_BURST];\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+\n+\tfor (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {\n+\t\tuint16_t enq = 0, deq = 0;\n+\n+\t\tif (unlikely(num_to_process - dequeued < burst_sz))\n+\t\t\tburst_sz = num_to_process - dequeued;\n+\n+\t\trte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);\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+\t\t\t\t\tbufs->hard_outputs,\n+\t\t\t\t\tbufs->soft_outputs,\n+\t\t\t\t\tbufs->harq_inputs,\n+\t\t\t\t\tbufs->harq_outputs,\n+\t\t\t\t\tref_op);\n+\n+\t\t/* Start time meas for enqueue function offload latency */\n+\t\tenq_start_time = rte_rdtsc_precise();\n+\t\tdo {\n+\t\t\tenq += rte_bbdev_enqueue_ldpc_dec_ops(dev_id, queue_id,\n+\t\t\t\t\t&ops_enq[enq], burst_sz - enq);\n+\t\t} while (unlikely(burst_sz != enq));\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\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+\t\t\t\tenq_sw_last_time);\n+\t\ttime_st->enq_sw_total_time += enq_sw_last_time;\n+\n+\t\ttime_st->enq_acc_max_time = RTE_MAX(time_st->enq_acc_max_time,\n+\t\t\t\tstats.acc_offload_cycles);\n+\t\ttime_st->enq_acc_min_time = RTE_MIN(time_st->enq_acc_min_time,\n+\t\t\t\tstats.acc_offload_cycles);\n+\t\ttime_st->enq_acc_total_time += stats.acc_offload_cycles;\n+\n+\t\t/* give time for device to process ops */\n+\t\trte_delay_us(200);\n+\n+\t\t/* Start time meas for dequeue function offload latency */\n+\t\tdeq_start_time = rte_rdtsc_precise();\n+\t\t/* Dequeue one operation */\n+\t\tdo {\n+\t\t\tdeq += rte_bbdev_dequeue_ldpc_dec_ops(dev_id, queue_id,\n+\t\t\t\t\t&ops_deq[deq], 1);\n+\t\t} while (unlikely(deq != 1));\n+\n+\t\tdeq_last_time = rte_rdtsc_precise() - deq_start_time;\n+\t\ttime_st->deq_max_time = RTE_MAX(time_st->deq_max_time,\n+\t\t\t\tdeq_last_time);\n+\t\ttime_st->deq_min_time = RTE_MIN(time_st->deq_min_time,\n+\t\t\t\tdeq_last_time);\n+\t\ttime_st->deq_total_time += deq_last_time;\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\t\t\t&ops_deq[deq], burst_sz - deq);\n+\n+\t\trte_bbdev_dec_op_free_bulk(ops_enq, deq);\n+\t\tdequeued += deq;\n+\t}\n+\n+\treturn i;\n+}\n+\n+static int\n offload_latency_test_enc(struct rte_mempool *mempool, struct test_buffers *bufs,\n \t\tstruct rte_bbdev_enc_op *ref_op, uint16_t dev_id,\n \t\tuint16_t queue_id, const uint16_t num_to_process,\n@@ -2189,10 +3163,7 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\tif (unlikely(num_to_process - dequeued < burst_sz))\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, \"Allocation failed for %d ops\",\n-\t\t\t\tburst_sz);\n-\n+\t\trte_bbdev_enc_op_alloc_bulk(mempool, ops_enq, burst_sz);\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@@ -2225,7 +3196,7 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\t\tstats.acc_offload_cycles);\n \t\ttime_st->enq_acc_total_time += stats.acc_offload_cycles;\n \n-\t\t/* ensure enqueue has been completed */\n+\t\t/* give time for device to process ops */\n \t\trte_delay_us(200);\n \n \t\t/* Start time meas for dequeue function offload latency */\n@@ -2253,6 +3224,87 @@ typedef int (test_case_function)(struct active_device *ad,\n \n \treturn i;\n }\n+\n+static int\n+offload_latency_test_ldpc_enc(struct rte_mempool *mempool,\n+\t\tstruct test_buffers *bufs,\n+\t\tstruct rte_bbdev_enc_op *ref_op, uint16_t dev_id,\n+\t\tuint16_t queue_id, const uint16_t num_to_process,\n+\t\tuint16_t burst_sz, struct test_time_stats *time_st)\n+{\n+\tint i, dequeued, ret;\n+\tstruct rte_bbdev_enc_op *ops_enq[MAX_BURST], *ops_deq[MAX_BURST];\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+\n+\tfor (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {\n+\t\tuint16_t enq = 0, deq = 0;\n+\n+\t\tif (unlikely(num_to_process - dequeued < burst_sz))\n+\t\t\tburst_sz = num_to_process - dequeued;\n+\n+\t\trte_bbdev_enc_op_alloc_bulk(mempool, ops_enq, burst_sz);\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+\t\t\t\t\tbufs->hard_outputs,\n+\t\t\t\t\tref_op);\n+\n+\t\t/* Start time meas for enqueue function offload latency */\n+\t\tenq_start_time = rte_rdtsc_precise();\n+\t\tdo {\n+\t\t\tenq += rte_bbdev_enqueue_ldpc_enc_ops(dev_id, queue_id,\n+\t\t\t\t\t&ops_enq[enq], burst_sz - enq);\n+\t\t} while (unlikely(burst_sz != enq));\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\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+\t\t\t\tenq_sw_last_time);\n+\t\ttime_st->enq_sw_total_time += enq_sw_last_time;\n+\n+\t\ttime_st->enq_acc_max_time = RTE_MAX(time_st->enq_acc_max_time,\n+\t\t\t\tstats.acc_offload_cycles);\n+\t\ttime_st->enq_acc_min_time = RTE_MIN(time_st->enq_acc_min_time,\n+\t\t\t\tstats.acc_offload_cycles);\n+\t\ttime_st->enq_acc_total_time += stats.acc_offload_cycles;\n+\n+\t\t/* give time for device to process ops */\n+\t\trte_delay_us(200);\n+\n+\t\t/* Start time meas for dequeue function offload latency */\n+\t\tdeq_start_time = rte_rdtsc_precise();\n+\t\t/* Dequeue one operation */\n+\t\tdo {\n+\t\t\tdeq += rte_bbdev_dequeue_ldpc_enc_ops(dev_id, queue_id,\n+\t\t\t\t\t&ops_deq[deq], 1);\n+\t\t} while (unlikely(deq != 1));\n+\n+\t\tdeq_last_time = rte_rdtsc_precise() - deq_start_time;\n+\t\ttime_st->deq_max_time = RTE_MAX(time_st->deq_max_time,\n+\t\t\t\tdeq_last_time);\n+\t\ttime_st->deq_min_time = RTE_MIN(time_st->deq_min_time,\n+\t\t\t\tdeq_last_time);\n+\t\ttime_st->deq_total_time += deq_last_time;\n+\n+\t\twhile (burst_sz != deq)\n+\t\t\tdeq += rte_bbdev_dequeue_ldpc_enc_ops(dev_id, queue_id,\n+\t\t\t\t\t&ops_deq[deq], burst_sz - deq);\n+\n+\t\trte_bbdev_enc_op_free_bulk(ops_enq, deq);\n+\t\tdequeued += deq;\n+\t}\n+\n+\treturn i;\n+}\n #endif\n \n static int\n@@ -2290,14 +3342,26 @@ typedef int (test_case_function)(struct active_device *ad,\n \top_type_str = rte_bbdev_op_type_str(op_type);\n \tTEST_ASSERT_NOT_NULL(op_type_str, \"Invalid op type: %u\", op_type);\n \n-\tprintf(\n-\t\t\"\\nOffload latency test: dev: %s, burst size: %u, num ops: %u, op type: %s\\n\",\n+\tprintf(\"+ ------------------------------------------------------- +\\n\");\n+\tprintf(\"== test: offload latency test\\ndev: %s, burst size: %u, num ops: %u, op type: %s\\n\",\n \t\t\tinfo.dev_name, burst_sz, num_to_process, op_type_str);\n \n \tif (op_type == RTE_BBDEV_OP_TURBO_DEC)\n \t\titer = offload_latency_test_dec(op_params->mp, bufs,\n \t\t\t\top_params->ref_dec_op, ad->dev_id, queue_id,\n \t\t\t\tnum_to_process, burst_sz, &time_st);\n+\telse if (op_type == RTE_BBDEV_OP_TURBO_ENC)\n+\t\titer = offload_latency_test_enc(op_params->mp, bufs,\n+\t\t\t\top_params->ref_enc_op, ad->dev_id, queue_id,\n+\t\t\t\tnum_to_process, burst_sz, &time_st);\n+\telse if (op_type == RTE_BBDEV_OP_LDPC_ENC)\n+\t\titer = offload_latency_test_ldpc_enc(op_params->mp, bufs,\n+\t\t\t\top_params->ref_enc_op, ad->dev_id, queue_id,\n+\t\t\t\tnum_to_process, burst_sz, &time_st);\n+\telse if (op_type == RTE_BBDEV_OP_LDPC_DEC)\n+\t\titer = offload_latency_test_ldpc_dec(op_params->mp, bufs,\n+\t\t\top_params->ref_dec_op, ad->dev_id, queue_id,\n+\t\t\tnum_to_process, burst_sz, &time_st);\n \telse\n \t\titer = offload_latency_test_enc(op_params->mp, bufs,\n \t\t\t\top_params->ref_enc_op, ad->dev_id, queue_id,\n@@ -2306,13 +3370,14 @@ typedef int (test_case_function)(struct active_device *ad,\n \tif (iter <= 0)\n \t\treturn TEST_FAILED;\n \n-\tprintf(\"Enqueue offload cost latency:\\n\"\n-\t\t\t\"\\tDriver offload avg %lg cycles, %lg us\\n\"\n-\t\t\t\"\\tDriver offload min %lg cycles, %lg us\\n\"\n-\t\t\t\"\\tDriver offload max %lg cycles, %lg us\\n\"\n-\t\t\t\"\\tAccelerator offload avg %lg cycles, %lg us\\n\"\n-\t\t\t\"\\tAccelerator offload min %lg cycles, %lg us\\n\"\n-\t\t\t\"\\tAccelerator offload max %lg cycles, %lg us\\n\",\n+\tprintf(\"Enqueue driver offload cost latency:\\n\"\n+\t\t\t\"\\tavg: %lg cycles, %lg us\\n\"\n+\t\t\t\"\\tmin: %lg cycles, %lg us\\n\"\n+\t\t\t\"\\tmax: %lg cycles, %lg us\\n\"\n+\t\t\t\"Enqueue accelerator offload cost latency:\\n\"\n+\t\t\t\"\\tavg: %lg cycles, %lg us\\n\"\n+\t\t\t\"\\tmin: %lg cycles, %lg us\\n\"\n+\t\t\t\"\\tmax: %lg cycles, %lg us\\n\",\n \t\t\t(double)time_st.enq_sw_total_time / (double)iter,\n \t\t\t(double)(time_st.enq_sw_total_time * 1000000) /\n \t\t\t(double)iter / (double)rte_get_tsc_hz(),\n@@ -2331,9 +3396,9 @@ typedef int (test_case_function)(struct active_device *ad,\n \t\t\trte_get_tsc_hz());\n \n \tprintf(\"Dequeue offload cost latency - one op:\\n\"\n-\t\t\t\"\\tavg %lg cycles, %lg us\\n\"\n-\t\t\t\"\\tmin %lg cycles, %lg us\\n\"\n-\t\t\t\"\\tmax %lg cycles, %lg us\\n\",\n+\t\t\t\"\\tavg: %lg cycles, %lg us\\n\"\n+\t\t\t\"\\tmin: %lg cycles, %lg us\\n\"\n+\t\t\t\"\\tmax: %lg cycles, %lg us\\n\",\n \t\t\t(double)time_st.deq_total_time / (double)iter,\n \t\t\t(double)(time_st.deq_total_time * 1000000) /\n \t\t\t(double)iter / (double)rte_get_tsc_hz(),\n@@ -2437,8 +3502,8 @@ typedef int (test_case_function)(struct active_device *ad,\n \top_type_str = rte_bbdev_op_type_str(op_type);\n \tTEST_ASSERT_NOT_NULL(op_type_str, \"Invalid op type: %u\", op_type);\n \n-\tprintf(\n-\t\t\"\\nOffload latency empty dequeue test: dev: %s, burst size: %u, num ops: %u, op type: %s\\n\",\n+\tprintf(\"+ ------------------------------------------------------- +\\n\");\n+\tprintf(\"== test: offload latency empty dequeue\\ndev: %s, burst size: %u, num ops: %u, op type: %s\\n\",\n \t\t\tinfo.dev_name, burst_sz, num_to_process, op_type_str);\n \n \tif (op_type == RTE_BBDEV_OP_TURBO_DEC)\n@@ -2453,10 +3518,10 @@ typedef int (test_case_function)(struct active_device *ad,\n \tif (iter <= 0)\n \t\treturn TEST_FAILED;\n \n-\tprintf(\"Empty dequeue offload\\n\"\n-\t\t\t\"\\tavg. latency: %lg cycles, %lg us\\n\"\n-\t\t\t\"\\tmin. latency: %lg cycles, %lg us\\n\"\n-\t\t\t\"\\tmax. latency: %lg cycles, %lg us\\n\",\n+\tprintf(\"Empty dequeue offload:\\n\"\n+\t\t\t\"\\tavg: %lg cycles, %lg us\\n\"\n+\t\t\t\"\\tmin: %lg cycles, %lg us\\n\"\n+\t\t\t\"\\tmax: %lg cycles, %lg us\\n\",\n \t\t\t(double)deq_total_time / (double)iter,\n \t\t\t(double)(deq_total_time * 1000000) / (double)iter /\n \t\t\t(double)rte_get_tsc_hz(), (double)deq_min_time,\ndiff --git a/app/test-bbdev/test_bbdev_vector.c b/app/test-bbdev/test_bbdev_vector.c\nindex e149ced..d478d76 100644\n--- a/app/test-bbdev/test_bbdev_vector.c\n+++ b/app/test-bbdev/test_bbdev_vector.c\n@@ -2,7 +2,7 @@\n  * Copyright(c) 2017 Intel Corporation\n  */\n \n-#ifdef RTE_EXEC_ENV_FREEBSD\n+#ifdef RTE_EXEC_ENV_BSDAPP\n \t#define _WITH_GETLINE\n #endif\n #include <stdio.h>\n@@ -18,6 +18,8 @@\n \t\"input\",\n \t\"soft_output\",\n \t\"hard_output\",\n+\t\"harq_input\",\n+\t\"harq_output\",\n };\n \n /* trim leading and trailing spaces */\n@@ -84,6 +86,7 @@\n \t\t}\n \n \t\tvalues[n_tokens] = (uint32_t) strtoul(tok, &error, 0);\n+\n \t\tif ((error == NULL) || (*error != '\\0')) {\n \t\t\tprintf(\"Failed with convert '%s'\\n\", tok);\n \t\t\trte_free(values);\n@@ -154,6 +157,54 @@\n \treturn 0;\n }\n \n+/* convert LDPC flag from string to unsigned long int*/\n+static int\n+op_ldpc_decoder_flag_strtoul(char *token, uint32_t *op_flag_value)\n+{\n+\tif (!strcmp(token, \"RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_DECODE_BYPASS\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_DECODE_BYPASS;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_SOFT_OUT_ENABLE\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_SOFT_OUT_ENABLE;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_DEC_INTERRUPTS\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_DEC_INTERRUPTS;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_DEC_SCATTER_GATHER\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_DEC_SCATTER_GATHER;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_LLR_COMPRESSION\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_LLR_COMPRESSION;\n+\telse if (!strcmp(token,\n+\t\t\t\"RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE;\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 {\n+\t\tprintf(\"The given value is not a LDPC decoder flag\\n\");\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n /* convert turbo encoder flag from string to unsigned long int*/\n static int\n op_encoder_flag_strtoul(char *token, uint32_t *op_flag_value)\n@@ -176,6 +227,32 @@\n \treturn 0;\n }\n \n+/* convert LDPC encoder flag from string to unsigned long int*/\n+static int\n+op_ldpc_encoder_flag_strtoul(char *token, uint32_t *op_flag_value)\n+{\n+\tif (!strcmp(token, \"RTE_BBDEV_LDPC_INTERLEAVER_BYPASS\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_INTERLEAVER_BYPASS;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_RATE_MATCH\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_RATE_MATCH;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_CRC_24A_ATTACH\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_CRC_24A_ATTACH;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_CRC_24B_ATTACH\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_CRC_24B_ATTACH;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_CRC_16_ATTACH\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_CRC_16_ATTACH;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_ENC_INTERRUPTS\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_ENC_INTERRUPTS;\n+\telse if (!strcmp(token, \"RTE_BBDEV_LDPC_ENC_SCATTER_GATHER\"))\n+\t\t*op_flag_value = RTE_BBDEV_LDPC_ENC_SCATTER_GATHER;\n+\telse {\n+\t\tprintf(\"The given value is not a turbo encoder flag\\n\");\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n /* tokenization turbo decoder/encoder flags values separated by a comma */\n static int\n parse_turbo_flags(char *tokens, uint32_t *op_flags,\n@@ -196,6 +273,14 @@\n \t\t} else if (op_type == RTE_BBDEV_OP_TURBO_ENC) {\n \t\t\tif (op_encoder_flag_strtoul(tok, &op_flag_value) == -1)\n \t\t\t\treturn -1;\n+\t\t} else if (op_type == RTE_BBDEV_OP_LDPC_ENC) {\n+\t\t\tif (op_ldpc_encoder_flag_strtoul(tok, &op_flag_value)\n+\t\t\t\t\t== -1)\n+\t\t\t\treturn -1;\n+\t\t} else if (op_type == RTE_BBDEV_OP_LDPC_DEC) {\n+\t\t\tif (op_ldpc_decoder_flag_strtoul(tok, &op_flag_value)\n+\t\t\t\t\t== -1)\n+\t\t\t\treturn -1;\n \t\t} else {\n \t\t\treturn -1;\n \t\t}\n@@ -219,6 +304,10 @@\n \t\t*op_type = RTE_BBDEV_OP_TURBO_DEC;\n \telse if (!strcmp(token, \"RTE_BBDEV_OP_TURBO_ENC\"))\n \t\t*op_type = RTE_BBDEV_OP_TURBO_ENC;\n+\telse if (!strcmp(token, \"RTE_BBDEV_OP_LDPC_ENC\"))\n+\t\t*op_type = RTE_BBDEV_OP_LDPC_ENC;\n+\telse if (!strcmp(token, \"RTE_BBDEV_OP_LDPC_DEC\"))\n+\t\t*op_type = RTE_BBDEV_OP_LDPC_DEC;\n \telse if (!strcmp(token, \"RTE_BBDEV_OP_NONE\"))\n \t\t*op_type = RTE_BBDEV_OP_NONE;\n \telse {\n@@ -248,12 +337,18 @@\n \t\t\t*status = *status | (1 << RTE_BBDEV_DRV_ERROR);\n \t\telse if (!strcmp(tok, \"FCW\"))\n \t\t\t*status = *status | (1 << RTE_BBDEV_DATA_ERROR);\n+\t\telse if (!strcmp(tok, \"SYNCRC\")) {\n+\t\t\t*status = *status | (1 << RTE_BBDEV_SYNDROME_ERROR);\n+\t\t\t*status = *status | (1 << RTE_BBDEV_CRC_ERROR);\n+\t\t} else if (!strcmp(tok, \"SYN\"))\n+\t\t\t*status = *status | (1 << RTE_BBDEV_SYNDROME_ERROR);\n \t\telse if (!strcmp(tok, \"CRC\")) {\n-\t\t\tif (op_type == RTE_BBDEV_OP_TURBO_DEC)\n+\t\t\tif ((op_type == RTE_BBDEV_OP_TURBO_DEC) ||\n+\t\t\t\t\t(op_type == RTE_BBDEV_OP_LDPC_DEC))\n \t\t\t\t*status = *status | (1 << RTE_BBDEV_CRC_ERROR);\n \t\t\telse {\n \t\t\t\tprintf(\n-\t\t\t\t\t\t\"CRC is only a valid value for turbo decoder\\n\");\n+\t\t\t\t\t\t\"CRC is only a valid value for decoder\\n\");\n \t\t\t\treturn -1;\n \t\t\t}\n \t\t} else {\n@@ -414,7 +509,7 @@\n \t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n \t} else if (!strcmp(key_token, \"r\")) {\n \t\tvector->mask |= TEST_BBDEV_VF_R;\n-\t\tturbo_dec->tb_params.r = (uint8_t) strtoul(token, &err, 0);\n+\t\tturbo_dec->tb_params.r = (uint8_t)strtoul(token, &err, 0);\n \t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n \t} else if (!strcmp(key_token, \"code_block_mode\")) {\n \t\tvector->mask |= TEST_BBDEV_VF_CODE_BLOCK_MODE;\n@@ -548,6 +643,211 @@\n \treturn 0;\n }\n \n+\n+/* parses LDPC encoder parameters and assigns to global variable */\n+static int\n+parse_ldpc_encoder_params(const char *key_token, char *token,\n+\t\tstruct test_bbdev_vector *vector)\n+{\n+\tint ret = 0, status = 0;\n+\tuint32_t op_flags = 0;\n+\tchar *err = NULL;\n+\n+\tstruct rte_bbdev_op_ldpc_enc *ldpc_enc = &vector->ldpc_enc;\n+\n+\tif (starts_with(key_token, op_data_prefixes[DATA_INPUT]))\n+\t\tret = parse_data_entry(key_token, token, vector,\n+\t\t\t\tDATA_INPUT,\n+\t\t\t\top_data_prefixes[DATA_INPUT]);\n+\telse if (starts_with(key_token, \"output\"))\n+\t\tret = parse_data_entry(key_token, token, vector,\n+\t\t\t\tDATA_HARD_OUTPUT,\n+\t\t\t\t\"output\");\n+\telse if (!strcmp(key_token, \"e\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_E;\n+\t\tldpc_enc->cb_params.e = (uint32_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"ea\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_EA;\n+\t\tldpc_enc->tb_params.ea = (uint32_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"eb\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_EB;\n+\t\tldpc_enc->tb_params.eb = (uint32_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"c\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_C;\n+\t\tldpc_enc->tb_params.c = (uint8_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"cab\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_CAB;\n+\t\tldpc_enc->tb_params.cab = (uint8_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"rv_index\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_RV_INDEX;\n+\t\tldpc_enc->rv_index = (uint8_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"n_cb\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_NCB;\n+\t\tldpc_enc->n_cb = (uint16_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"r\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_R;\n+\t\tldpc_enc->tb_params.r = (uint8_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"q_m\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_QM;\n+\t\tldpc_enc->q_m = (uint8_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"basegraph\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_BG;\n+\t\tldpc_enc->basegraph = (uint8_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"z_c\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_ZC;\n+\t\tldpc_enc->z_c = (uint16_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"n_filler\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_F;\n+\t\tldpc_enc->n_filler = (uint16_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"code_block_mode\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_CODE_BLOCK_MODE;\n+\t\tldpc_enc->code_block_mode = (uint8_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"op_flags\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_OP_FLAGS;\n+\t\tret = parse_turbo_flags(token, &op_flags, vector->op_type);\n+\t\tif (!ret)\n+\t\t\tldpc_enc->op_flags = op_flags;\n+\t} else if (!strcmp(key_token, \"expected_status\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_EXPECTED_STATUS;\n+\t\tret = parse_expected_status(token, &status, vector->op_type);\n+\t\tif (!ret)\n+\t\t\tvector->expected_status = status;\n+\t} else {\n+\t\tprintf(\"Not valid ldpc enc key: '%s'\\n\", key_token);\n+\t\treturn -1;\n+\t}\n+\n+\tif (ret != 0) {\n+\t\tprintf(\"Failed with convert '%s\\t%s'\\n\", key_token, token);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+/* parses LDPC decoder parameters and assigns to global variable */\n+static int\n+parse_ldpc_decoder_params(const char *key_token, char *token,\n+\t\tstruct test_bbdev_vector *vector)\n+{\n+\tint ret = 0, status = 0;\n+\tuint32_t op_flags = 0;\n+\tchar *err = NULL;\n+\n+\tstruct rte_bbdev_op_ldpc_dec *ldpc_dec = &vector->ldpc_dec;\n+\n+\tif (starts_with(key_token, op_data_prefixes[DATA_INPUT]))\n+\t\tret = parse_data_entry(key_token, token, vector,\n+\t\t\t\tDATA_INPUT,\n+\t\t\t\top_data_prefixes[DATA_INPUT]);\n+\telse if (starts_with(key_token, \"output\"))\n+\t\tret = parse_data_entry(key_token, token, vector,\n+\t\t\t\tDATA_HARD_OUTPUT,\n+\t\t\t\t\"output\");\n+\telse if (starts_with(key_token, op_data_prefixes[DATA_HARQ_INPUT]))\n+\t\tret = parse_data_entry(key_token, token, vector,\n+\t\t\t\tDATA_HARQ_INPUT,\n+\t\t\t\top_data_prefixes[DATA_HARQ_INPUT]);\n+\telse if (starts_with(key_token, op_data_prefixes[DATA_HARQ_OUTPUT]))\n+\t\tret = parse_data_entry(key_token, token, vector,\n+\t\t\t\tDATA_HARQ_OUTPUT,\n+\t\t\t\top_data_prefixes[DATA_HARQ_OUTPUT]);\n+\telse if (!strcmp(key_token, \"e\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_E;\n+\t\tldpc_dec->cb_params.e = (uint32_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"ea\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_EA;\n+\t\tldpc_dec->tb_params.ea = (uint32_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"eb\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_EB;\n+\t\tldpc_dec->tb_params.eb = (uint32_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"c\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_C;\n+\t\tldpc_dec->tb_params.c = (uint8_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"cab\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_CAB;\n+\t\tldpc_dec->tb_params.cab = (uint8_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"rv_index\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_RV_INDEX;\n+\t\tldpc_dec->rv_index = (uint8_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"n_cb\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_NCB;\n+\t\tldpc_dec->n_cb = (uint16_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"r\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_R;\n+\t\tldpc_dec->tb_params.r = (uint8_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"q_m\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_QM;\n+\t\tldpc_dec->q_m = (uint8_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"basegraph\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_BG;\n+\t\tldpc_dec->basegraph = (uint8_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"z_c\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_ZC;\n+\t\tldpc_dec->z_c = (uint16_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"n_filler\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_F;\n+\t\tldpc_dec->n_filler = (uint16_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"expected_iter_count\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_EXPECTED_ITER_COUNT;\n+\t\tldpc_dec->iter_count = (uint8_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"iter_max\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_ITER_MAX;\n+\t\tldpc_dec->iter_max = (uint8_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"code_block_mode\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_CODE_BLOCK_MODE;\n+\t\tldpc_dec->code_block_mode = (uint8_t) strtoul(token, &err, 0);\n+\t\tret = ((err == NULL) || (*err != '\\0')) ? -1 : 0;\n+\t} else if (!strcmp(key_token, \"op_flags\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_OP_FLAGS;\n+\t\tret = parse_turbo_flags(token, &op_flags, vector->op_type);\n+\t\tif (!ret)\n+\t\t\tldpc_dec->op_flags = op_flags;\n+\t} else if (!strcmp(key_token, \"expected_status\")) {\n+\t\tvector->mask |= TEST_BBDEV_VF_EXPECTED_STATUS;\n+\t\tret = parse_expected_status(token, &status, vector->op_type);\n+\t\tif (!ret)\n+\t\t\tvector->expected_status = status;\n+\t} else {\n+\t\tprintf(\"Not valid ldpc dec key: '%s'\\n\", key_token);\n+\t\treturn -1;\n+\t}\n+\n+\tif (ret != 0) {\n+\t\tprintf(\"Failed with convert '%s\\t%s'\\n\", key_token, token);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n /* checks the type of key and assigns data */\n static int\n parse_entry(char *entry, struct test_bbdev_vector *vector)\n@@ -593,6 +893,12 @@\n \t} else if (vector->op_type == RTE_BBDEV_OP_TURBO_ENC) {\n \t\tif (parse_encoder_params(key_token, token, vector) == -1)\n \t\t\treturn -1;\n+\t} else if (vector->op_type == RTE_BBDEV_OP_LDPC_ENC) {\n+\t\tif (parse_ldpc_encoder_params(key_token, token, vector) == -1)\n+\t\t\treturn -1;\n+\t} else if (vector->op_type == RTE_BBDEV_OP_LDPC_DEC) {\n+\t\tif (parse_ldpc_decoder_params(key_token, token, vector) == -1)\n+\t\t\treturn -1;\n \t}\n \n \treturn 0;\n@@ -632,6 +938,45 @@\n }\n \n static int\n+check_ldpc_decoder_segments(struct test_bbdev_vector *vector)\n+{\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+\n+\tif ((ldpc_dec->op_flags & RTE_BBDEV_LDPC_SOFT_OUT_ENABLE) &&\n+\t\t\t(vector->entries[DATA_SOFT_OUTPUT].nb_segments == 0))\n+\t\treturn -1;\n+\n+\tfor (i = 0; i < vector->entries[DATA_SOFT_OUTPUT].nb_segments; i++)\n+\t\tif (vector->entries[DATA_SOFT_OUTPUT].segments[i].addr == NULL)\n+\t\t\treturn -1;\n+\n+\tif ((ldpc_dec->op_flags & RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE) &&\n+\t\t\t(vector->entries[DATA_HARQ_OUTPUT].nb_segments == 0))\n+\t\treturn -1;\n+\n+\tfor (i = 0; i < vector->entries[DATA_HARQ_OUTPUT].nb_segments; i++)\n+\t\tif (vector->entries[DATA_HARQ_OUTPUT].segments[i].addr == NULL)\n+\t\t\treturn -1;\n+\n+\treturn 0;\n+}\n+\n+static int\n check_decoder_llr_spec(struct test_bbdev_vector *vector)\n {\n \tstruct rte_bbdev_op_turbo_dec *turbo_dec = &vector->turbo_dec;\n@@ -648,7 +993,7 @@\n \t\t\t!(turbo_dec->op_flags &\n \t\t\tRTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN)) {\n \t\tprintf(\n-\t\t\t\"WARNING: input LLR sign formalism was not specified and will be set to negative LLR for '1' bit\\n\");\n+\t\t\t\"INFO: input LLR sign formalism was not specified and will be set to negative LLR for '1' bit\\n\");\n \t\tturbo_dec->op_flags |= RTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN;\n \t}\n \n@@ -667,7 +1012,7 @@\n \t\t\t!(turbo_dec->op_flags &\n \t\t\tRTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT)) {\n \t\tprintf(\n-\t\t\t\"WARNING: soft output LLR sign formalism was not specified and will be set to negative LLR for '1' bit\\n\");\n+\t\t\t\"INFO: soft output LLR sign formalism was not specified and will be set to negative LLR for '1' bit\\n\");\n \t\tturbo_dec->op_flags |=\n \t\t\t\tRTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT;\n \t}\n@@ -675,6 +1020,21 @@\n \treturn 0;\n }\n \n+static int\n+check_decoder_op_flags(struct test_bbdev_vector *vector)\n+{\n+\tstruct rte_bbdev_op_turbo_dec *turbo_dec = &vector->turbo_dec;\n+\n+\tif ((turbo_dec->op_flags & RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP) &&\n+\t\t!(turbo_dec->op_flags & RTE_BBDEV_TURBO_CRC_TYPE_24B)) {\n+\t\tprintf(\n+\t\t\t\"WARNING: RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP flag is missing RTE_BBDEV_TURBO_CRC_TYPE_24B\\n\");\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n /* checks decoder parameters */\n static int\n check_decoder(struct test_bbdev_vector *vector)\n@@ -688,6 +1048,9 @@\n \tif (check_decoder_llr_spec(vector) < 0)\n \t\treturn -1;\n \n+\tif (check_decoder_op_flags(vector) < 0)\n+\t\treturn -1;\n+\n \t/* Check which params were set */\n \tif (!(mask & TEST_BBDEV_VF_CODE_BLOCK_MODE)) {\n \t\tprintf(\n@@ -731,7 +1094,7 @@\n \t}\n \tif (!(mask & TEST_BBDEV_VF_RV_INDEX))\n \t\tprintf(\n-\t\t\t\"WARNING: rv_index was not specified in vector file and will be set to 0\\n\");\n+\t\t\t\"INFO: rv_index was not specified in vector file and will be set to 0\\n\");\n \tif (!(mask & TEST_BBDEV_VF_ITER_MIN))\n \t\tprintf(\n \t\t\t\"WARNING: iter_min was not specified in vector file and will be set to 0\\n\");\n@@ -751,7 +1114,7 @@\n \t} else if (!(turbo_dec->op_flags & RTE_BBDEV_TURBO_MAP_DEC) &&\n \t\t\tmask & TEST_BBDEV_VF_NUM_MAPS) {\n \t\tprintf(\n-\t\t\t\"WARNING: RTE_BBDEV_TURBO_MAP_DEC was not set in vector file and num_maps will be set to 0\\n\");\n+\t\t\t\"INFO: RTE_BBDEV_TURBO_MAP_DEC was not set in vector file and num_maps will be set to 0\\n\");\n \t\tturbo_dec->num_maps = 0;\n \t}\n \tif (!(mask & TEST_BBDEV_VF_EXPECTED_STATUS))\n@@ -760,6 +1123,72 @@\n \treturn 0;\n }\n \n+/* checks LDPC decoder parameters */\n+static int\n+check_ldpc_decoder(struct test_bbdev_vector *vector)\n+{\n+\tstruct rte_bbdev_op_ldpc_dec *ldpc_dec = &vector->ldpc_dec;\n+\tconst int mask = vector->mask;\n+\n+\tif (check_ldpc_decoder_segments(vector) < 0)\n+\t\treturn -1;\n+\n+\t/*\n+\t * if (check_ldpc_decoder_llr_spec(vector) < 0)\n+\t *\treturn -1;\n+\t *\n+\t * if (check_ldpc_decoder_op_flags(vector) < 0)\n+\t *\treturn -1;\n+\t */\n+\n+\t/* Check which params were set */\n+\tif (!(mask & TEST_BBDEV_VF_CODE_BLOCK_MODE)) {\n+\t\tprintf(\n+\t\t\t\"WARNING: code_block_mode was not specified in vector file and will be set to 1 (0 - TB Mode, 1 - CB mode)\\n\");\n+\t\tldpc_dec->code_block_mode = 1;\n+\t}\n+\tif (ldpc_dec->code_block_mode == 0) {\n+\t\tif (!(mask & TEST_BBDEV_VF_EA))\n+\t\t\tprintf(\n+\t\t\t\t\"WARNING: ea was not specified in vector file and will be set to 0\\n\");\n+\t\tif (!(mask & TEST_BBDEV_VF_EB))\n+\t\t\tprintf(\n+\t\t\t\t\"WARNING: eb was not specified in vector file and will be set to 0\\n\");\n+\t\tif (!(mask & TEST_BBDEV_VF_C)) {\n+\t\t\tprintf(\n+\t\t\t\t\"WARNING: c was not specified in vector file and will be set to 1\\n\");\n+\t\t\tldpc_dec->tb_params.c = 1;\n+\t\t}\n+\t\tif (!(mask & TEST_BBDEV_VF_CAB))\n+\t\t\tprintf(\n+\t\t\t\t\"WARNING: cab was not specified in vector file and will be set to 0\\n\");\n+\t\tif (!(mask & TEST_BBDEV_VF_R))\n+\t\t\tprintf(\n+\t\t\t\t\"WARNING: r was not specified in vector file and will be set to 0\\n\");\n+\t} else {\n+\t\tif (!(mask & TEST_BBDEV_VF_E))\n+\t\t\tprintf(\n+\t\t\t\t\"WARNING: e was not specified in vector file and will be set to 0\\n\");\n+\t}\n+\tif (!(mask & TEST_BBDEV_VF_RV_INDEX))\n+\t\tprintf(\n+\t\t\t\"INFO: rv_index was not specified in vector file and will be set to 0\\n\");\n+\tif (!(mask & TEST_BBDEV_VF_ITER_MAX))\n+\t\tprintf(\n+\t\t\t\"WARNING: iter_max was not specified in vector file and will be set to 0\\n\");\n+\tif (!(mask & TEST_BBDEV_VF_EXPECTED_ITER_COUNT))\n+\t\tprintf(\n+\t\t\t\"WARNING: expected_iter_count was not specified in vector file and iter_count will not be validated\\n\");\n+\tif (!(mask & TEST_BBDEV_VF_OP_FLAGS)) {\n+\t\tprintf(\n+\t\t\t\"WARNING: op_flags was not specified in vector file and capabilities will not be validated\\n\");\n+\t}\n+\tif (!(mask & TEST_BBDEV_VF_EXPECTED_STATUS))\n+\t\tprintf(\n+\t\t\t\"WARNING: expected_status was not specified in vector file and will be set to 0\\n\");\n+\treturn 0;\n+}\n+\n /* checks encoder parameters */\n static int\n check_encoder(struct test_bbdev_vector *vector)\n@@ -836,10 +1265,66 @@\n \t}\n \tif (!(mask & TEST_BBDEV_VF_RV_INDEX))\n \t\tprintf(\n-\t\t\t\"WARNING: rv_index was not specified in vector file and will be set to 0\\n\");\n+\t\t\t\"INFO: rv_index was not specified in vector file and will be set to 0\\n\");\n \tif (!(mask & TEST_BBDEV_VF_OP_FLAGS))\n \t\tprintf(\n-\t\t\t\"WARNING: op_flags was not specified in vector file and capabilities will not be validated\\n\");\n+\t\t\t\"INFO: op_flags was not specified in vector file and capabilities will not be validated\\n\");\n+\tif (!(mask & TEST_BBDEV_VF_EXPECTED_STATUS))\n+\t\tprintf(\n+\t\t\t\"WARNING: expected_status was not specified in vector file and will be set to 0\\n\");\n+\n+\treturn 0;\n+}\n+\n+\n+/* checks encoder parameters */\n+static int\n+check_ldpc_encoder(struct test_bbdev_vector *vector)\n+{\n+\tunsigned char i;\n+\tconst int mask = vector->mask;\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+\n+\tif (!(mask & TEST_BBDEV_VF_CODE_BLOCK_MODE)) {\n+\t\tprintf(\n+\t\t\t\"WARNING: code_block_mode was not specified in vector file and will be set to 1\\n\");\n+\t\tvector->turbo_enc.code_block_mode = 1;\n+\t}\n+\tif (vector->turbo_enc.code_block_mode == 0) {\n+\t} else {\n+\t\tif (!(mask & TEST_BBDEV_VF_E) && (vector->turbo_enc.op_flags &\n+\t\t\t\tRTE_BBDEV_TURBO_RATE_MATCH))\n+\t\t\tprintf(\n+\t\t\t\t\"WARNING: e was not specified in vector file and will be set to 0\\n\");\n+\t\tif (!(mask & TEST_BBDEV_VF_NCB))\n+\t\t\tprintf(\n+\t\t\t\t\"WARNING: ncb was not specified in vector file and will be set to 0\\n\");\n+\t}\n+\tif (!(mask & TEST_BBDEV_VF_BG))\n+\t\tprintf(\n+\t\t\t\"WARNING: BG was not specified in vector file and will be set to 0\\n\");\n+\tif (!(mask & TEST_BBDEV_VF_ZC))\n+\t\tprintf(\n+\t\t\t\"WARNING: Zc was not specified in vector file and will be set to 0\\n\");\n+\tif (!(mask & TEST_BBDEV_VF_RV_INDEX))\n+\t\tprintf(\n+\t\t\t\"INFO: rv_index was not specified in vector file and will be set to 0\\n\");\n+\tif (!(mask & TEST_BBDEV_VF_OP_FLAGS))\n+\t\tprintf(\n+\t\t\t\"INFO: op_flags was not specified in vector file and capabilities will not be validated\\n\");\n \tif (!(mask & TEST_BBDEV_VF_EXPECTED_STATUS))\n \t\tprintf(\n \t\t\t\"WARNING: expected_status was not specified in vector file and will be set to 0\\n\");\n@@ -856,6 +1341,12 @@\n \t} else if (vector->op_type == RTE_BBDEV_OP_TURBO_ENC) {\n \t\tif (check_encoder(vector) == -1)\n \t\t\treturn -1;\n+\t} else if (vector->op_type == RTE_BBDEV_OP_LDPC_ENC) {\n+\t\tif (check_ldpc_encoder(vector) == -1)\n+\t\t\treturn -1;\n+\t} else if (vector->op_type == RTE_BBDEV_OP_LDPC_DEC) {\n+\t\tif (check_ldpc_decoder(vector) == -1)\n+\t\t\treturn -1;\n \t} else if (vector->op_type != RTE_BBDEV_OP_NONE) {\n \t\tprintf(\"Vector was not filled\\n\");\n \t\treturn -1;\n@@ -898,7 +1389,8 @@\n \t\t\tgoto exit;\n \t\t}\n \n-\t\tstrcpy(entry, line);\n+\t\tmemset(entry, 0, strlen(line) + 1);\n+\t\tstrncpy(entry, line, strlen(line));\n \n \t\t/* check if entry ends with , or = */\n \t\tif (entry[strlen(entry) - 1] == ','\n@@ -920,8 +1412,7 @@\n \t\t\t\t}\n \n \t\t\t\tentry = entry_extended;\n-\t\t\t\t/* entry has been allocated accordingly */\n-\t\t\t\tstrcpy(&entry[strlen(entry)], line);\n+\t\t\t\tstrncat(entry, line, strlen(line));\n \n \t\t\t\tif (entry[strlen(entry) - 1] != ',')\n \t\t\t\t\tbreak;\ndiff --git a/app/test-bbdev/test_bbdev_vector.h b/app/test-bbdev/test_bbdev_vector.h\nindex c85e94d..4e5dbf5 100644\n--- a/app/test-bbdev/test_bbdev_vector.h\n+++ b/app/test-bbdev/test_bbdev_vector.h\n@@ -28,15 +28,21 @@ enum {\n \tTEST_BBDEV_VF_NCB_NEG = (1ULL << 16),\n \tTEST_BBDEV_VF_NCB_POS = (1ULL << 17),\n \tTEST_BBDEV_VF_R = (1ULL << 18),\n-\tTEST_BBDEV_VF_CODE_BLOCK_MODE = (1ULL << 19),\n-\tTEST_BBDEV_VF_OP_FLAGS = (1ULL << 20),\n-\tTEST_BBDEV_VF_EXPECTED_STATUS = (1ULL << 21),\n+\tTEST_BBDEV_VF_BG = (1ULL << 19),\n+\tTEST_BBDEV_VF_ZC = (1ULL << 20),\n+\tTEST_BBDEV_VF_F = (1ULL << 21),\n+\tTEST_BBDEV_VF_QM = (1ULL << 22),\n+\tTEST_BBDEV_VF_CODE_BLOCK_MODE = (1ULL << 23),\n+\tTEST_BBDEV_VF_OP_FLAGS = (1ULL << 24),\n+\tTEST_BBDEV_VF_EXPECTED_STATUS = (1ULL << 25),\n };\n \n enum op_data_type {\n \tDATA_INPUT = 0,\n \tDATA_SOFT_OUTPUT,\n \tDATA_HARD_OUTPUT,\n+\tDATA_HARQ_INPUT,\n+\tDATA_HARQ_OUTPUT,\n \tDATA_NUM_TYPES,\n };\n \n@@ -57,6 +63,8 @@ struct test_bbdev_vector {\n \tunion {\n \t\tstruct rte_bbdev_op_turbo_dec turbo_dec;\n \t\tstruct rte_bbdev_op_turbo_enc turbo_enc;\n+\t\tstruct rte_bbdev_op_ldpc_dec ldpc_dec;\n+\t\tstruct rte_bbdev_op_ldpc_enc ldpc_enc;\n \t};\n \t/* Additional storage for op data entries */\n \tstruct op_data_entries entries[DATA_NUM_TYPES];\ndiff --git a/app/test-bbdev/turbo_enc_default.data b/app/test-bbdev/turbo_enc_default.data\nindex 5587f9c..a2bc833 120000\n--- a/app/test-bbdev/turbo_enc_default.data\n+++ b/app/test-bbdev/turbo_enc_default.data\n@@ -1 +1 @@\n-test_vectors/turbo_enc_c1_k6144_r0_e32256_crc24b_rm.data\n\\ No newline at end of file\n+test_vectors/turbo_enc_c1_k6144_r0_e18444.data\n\\ No newline at end of file\n",
    "prefixes": [
        "v4",
        "08/10"
    ]
}