get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 132231,
    "url": "http://patchwork.dpdk.org/api/patches/132231/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230929163516.3636499-9-nicolas.chautru@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20230929163516.3636499-9-nicolas.chautru@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230929163516.3636499-9-nicolas.chautru@intel.com",
    "date": "2023-09-29T16:35:12",
    "name": "[v3,08/12] baseband/acc: add FEC capabilities for the VRB2 variant",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "52de2b35441ad75ce7b4b1336cb8368459f0175e",
    "submitter": {
        "id": 1314,
        "url": "http://patchwork.dpdk.org/api/people/1314/?format=api",
        "name": "Chautru, Nicolas",
        "email": "nicolas.chautru@intel.com"
    },
    "delegate": {
        "id": 2642,
        "url": "http://patchwork.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230929163516.3636499-9-nicolas.chautru@intel.com/mbox/",
    "series": [
        {
            "id": 29702,
            "url": "http://patchwork.dpdk.org/api/series/29702/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29702",
            "date": "2023-09-29T16:35:04",
            "name": "VRB2 bbdev PMD introduction",
            "version": 3,
            "mbox": "http://patchwork.dpdk.org/series/29702/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/132231/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/132231/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 386A142674;\n\tFri, 29 Sep 2023 18:39:10 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id EAB5340E40;\n\tFri, 29 Sep 2023 18:38:16 +0200 (CEST)",
            "from mgamail.intel.com (mgamail.intel.com [192.55.52.151])\n by mails.dpdk.org (Postfix) with ESMTP id 680E2402AD\n for <dev@dpdk.org>; Fri, 29 Sep 2023 18:38:05 +0200 (CEST)",
            "from fmsmga007.fm.intel.com ([10.253.24.52])\n by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 29 Sep 2023 09:38:03 -0700",
            "from spr-npg-bds1-eec2.sn.intel.com (HELO spr-npg-bds1-eec2..)\n ([10.233.181.123])\n by fmsmga007.fm.intel.com with ESMTP; 29 Sep 2023 09:38:03 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1696005485; x=1727541485;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=B84fFOzBdGkgjbyzMGEO7KXQVFV6jaC6tPMCipOQkmo=;\n b=Z0WzcvEz3FRwJ4JinbWFSTvmBIVMLOW3SUsWJ/UR8Spyy7I2qCHo+H2h\n cjB64hJ+wcwlXxiTL/gE9Tegne8+Ix5r65zSxpL7Iu9yLzwttpGe2b2dh\n WeNmq1KKbLa8yFWyTKgis51qtVRcy52jGcfRgyGEdedZQeDLbKtZ3Nzp1\n uEWYC5RWsPzlAq9d7DSqBp8UXhz0xCVpb+Nmvqqix7zSF9DJMQAoHJsk6\n G/8ASK06BlmXkprhBrC6Se2ct9/sorH5ige/T/UBKNyxAbeQusHodaAA3\n 65/pBIet5G7CfvIqE9CdZil1cUTiEDQ4rAhm/xYYE3brnto1X3X7ZRJtN w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10848\"; a=\"362584231\"",
            "E=Sophos;i=\"6.03,187,1694761200\"; d=\"scan'208\";a=\"362584231\"",
            "E=McAfee;i=\"6600,9927,10848\"; a=\"753433493\"",
            "E=Sophos;i=\"6.03,187,1694761200\"; d=\"scan'208\";a=\"753433493\""
        ],
        "X-ExtLoop1": "1",
        "From": "Nicolas Chautru <nicolas.chautru@intel.com>",
        "To": "dev@dpdk.org,\n\tmaxime.coquelin@redhat.com",
        "Cc": "hemant.agrawal@nxp.com, david.marchand@redhat.com,\n hernan.vargas@intel.com,\n Nicolas Chautru <nicolas.chautru@intel.com>",
        "Subject": "[PATCH v3 08/12] baseband/acc: add FEC capabilities for the VRB2\n variant",
        "Date": "Fri, 29 Sep 2023 16:35:12 +0000",
        "Message-Id": "<20230929163516.3636499-9-nicolas.chautru@intel.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20230929163516.3636499-1-nicolas.chautru@intel.com>",
        "References": "<20230929163516.3636499-1-nicolas.chautru@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "New implementation for some of the FEC features\nspecific to the VRB2 variant.\n\nSigned-off-by: Nicolas Chautru <nicolas.chautru@intel.com>\n---\n drivers/baseband/acc/rte_vrb_pmd.c | 567 ++++++++++++++++++++++++++++-\n 1 file changed, 548 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c\nindex 48e779ce77..93add82947 100644\n--- a/drivers/baseband/acc/rte_vrb_pmd.c\n+++ b/drivers/baseband/acc/rte_vrb_pmd.c\n@@ -1235,6 +1235,94 @@ vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info)\n \t};\n \n \tstatic const struct rte_bbdev_op_cap vrb2_bbdev_capabilities[] = {\n+\t\t{\n+\t\t\t.type = RTE_BBDEV_OP_TURBO_DEC,\n+\t\t\t.cap.turbo_dec = {\n+\t\t\t\t.capability_flags =\n+\t\t\t\t\tRTE_BBDEV_TURBO_SUBBLOCK_DEINTERLEAVE |\n+\t\t\t\t\tRTE_BBDEV_TURBO_CRC_TYPE_24B |\n+\t\t\t\t\tRTE_BBDEV_TURBO_DEC_CRC_24B_DROP |\n+\t\t\t\t\tRTE_BBDEV_TURBO_EQUALIZER |\n+\t\t\t\t\tRTE_BBDEV_TURBO_SOFT_OUT_SATURATE |\n+\t\t\t\t\tRTE_BBDEV_TURBO_HALF_ITERATION_EVEN |\n+\t\t\t\t\tRTE_BBDEV_TURBO_CONTINUE_CRC_MATCH |\n+\t\t\t\t\tRTE_BBDEV_TURBO_SOFT_OUTPUT |\n+\t\t\t\t\tRTE_BBDEV_TURBO_EARLY_TERMINATION |\n+\t\t\t\t\tRTE_BBDEV_TURBO_DEC_INTERRUPTS |\n+\t\t\t\t\tRTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN |\n+\t\t\t\t\tRTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT |\n+\t\t\t\t\tRTE_BBDEV_TURBO_MAP_DEC |\n+\t\t\t\t\tRTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP |\n+\t\t\t\t\tRTE_BBDEV_TURBO_DEC_SCATTER_GATHER,\n+\t\t\t\t.max_llr_modulus = INT8_MAX,\n+\t\t\t\t.num_buffers_src =\n+\t\t\t\t\t\tRTE_BBDEV_TURBO_MAX_CODE_BLOCKS,\n+\t\t\t\t.num_buffers_hard_out =\n+\t\t\t\t\t\tRTE_BBDEV_TURBO_MAX_CODE_BLOCKS,\n+\t\t\t\t.num_buffers_soft_out =\n+\t\t\t\t\t\tRTE_BBDEV_TURBO_MAX_CODE_BLOCKS,\n+\t\t\t}\n+\t\t},\n+\t\t{\n+\t\t\t.type = RTE_BBDEV_OP_TURBO_ENC,\n+\t\t\t.cap.turbo_enc = {\n+\t\t\t\t.capability_flags =\n+\t\t\t\t\tRTE_BBDEV_TURBO_CRC_24B_ATTACH |\n+\t\t\t\t\tRTE_BBDEV_TURBO_RV_INDEX_BYPASS |\n+\t\t\t\t\tRTE_BBDEV_TURBO_RATE_MATCH |\n+\t\t\t\t\tRTE_BBDEV_TURBO_ENC_INTERRUPTS |\n+\t\t\t\t\tRTE_BBDEV_TURBO_ENC_SCATTER_GATHER,\n+\t\t\t\t.num_buffers_src =\n+\t\t\t\t\t\tRTE_BBDEV_TURBO_MAX_CODE_BLOCKS,\n+\t\t\t\t.num_buffers_dst =\n+\t\t\t\t\t\tRTE_BBDEV_TURBO_MAX_CODE_BLOCKS,\n+\t\t\t}\n+\t\t},\n+\t\t{\n+\t\t\t.type   = RTE_BBDEV_OP_LDPC_ENC,\n+\t\t\t.cap.ldpc_enc = {\n+\t\t\t\t.capability_flags =\n+\t\t\t\t\tRTE_BBDEV_LDPC_RATE_MATCH |\n+\t\t\t\t\tRTE_BBDEV_LDPC_CRC_24B_ATTACH |\n+\t\t\t\t\tRTE_BBDEV_LDPC_INTERLEAVER_BYPASS |\n+\t\t\t\t\tRTE_BBDEV_LDPC_ENC_INTERRUPTS |\n+\t\t\t\t\tRTE_BBDEV_LDPC_ENC_SCATTER_GATHER |\n+\t\t\t\t\tRTE_BBDEV_LDPC_ENC_CONCATENATION,\n+\t\t\t\t.num_buffers_src =\n+\t\t\t\t\t\tRTE_BBDEV_LDPC_MAX_CODE_BLOCKS,\n+\t\t\t\t.num_buffers_dst =\n+\t\t\t\t\t\tRTE_BBDEV_LDPC_MAX_CODE_BLOCKS,\n+\t\t\t}\n+\t\t},\n+\t\t{\n+\t\t\t.type   = RTE_BBDEV_OP_LDPC_DEC,\n+\t\t\t.cap.ldpc_dec = {\n+\t\t\t.capability_flags =\n+\t\t\t\tRTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK |\n+\t\t\t\tRTE_BBDEV_LDPC_CRC_TYPE_24B_DROP |\n+\t\t\t\tRTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK |\n+\t\t\t\tRTE_BBDEV_LDPC_CRC_TYPE_16_CHECK |\n+\t\t\t\tRTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE |\n+\t\t\t\tRTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE |\n+\t\t\t\tRTE_BBDEV_LDPC_ITERATION_STOP_ENABLE |\n+\t\t\t\tRTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS |\n+\t\t\t\tRTE_BBDEV_LDPC_DEC_SCATTER_GATHER |\n+\t\t\t\tRTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION |\n+\t\t\t\tRTE_BBDEV_LDPC_HARQ_4BIT_COMPRESSION |\n+\t\t\t\tRTE_BBDEV_LDPC_LLR_COMPRESSION |\n+\t\t\t\tRTE_BBDEV_LDPC_SOFT_OUT_ENABLE |\n+\t\t\t\tRTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS |\n+\t\t\t\tRTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS |\n+\t\t\t\tRTE_BBDEV_LDPC_DEC_INTERRUPTS,\n+\t\t\t.llr_size = 8,\n+\t\t\t.llr_decimals = 2,\n+\t\t\t.num_buffers_src =\n+\t\t\t\t\tRTE_BBDEV_LDPC_MAX_CODE_BLOCKS,\n+\t\t\t.num_buffers_hard_out =\n+\t\t\t\t\tRTE_BBDEV_LDPC_MAX_CODE_BLOCKS,\n+\t\t\t.num_buffers_soft_out = 0,\n+\t\t\t}\n+\t\t},\n \t\tRTE_BBDEV_END_OF_CAPABILITIES_LIST()\n \t};\n \n@@ -1774,6 +1862,141 @@ vrb1_dma_desc_ld_fill(struct rte_bbdev_dec_op *op,\n \treturn 0;\n }\n \n+/* Fill in a frame control word for LDPC decoding. */\n+static inline void\n+vrb2_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw,\n+\t\tunion acc_harq_layout_data *harq_layout)\n+{\n+\tuint16_t harq_out_length, harq_in_length, ncb_p, k0_p, parity_offset;\n+\tuint32_t harq_index;\n+\tuint32_t l;\n+\n+\tfcw->qm = op->ldpc_dec.q_m;\n+\tfcw->nfiller = op->ldpc_dec.n_filler;\n+\tfcw->BG = (op->ldpc_dec.basegraph - 1);\n+\tfcw->Zc = op->ldpc_dec.z_c;\n+\tfcw->ncb = op->ldpc_dec.n_cb;\n+\tfcw->k0 = get_k0(fcw->ncb, fcw->Zc, op->ldpc_dec.basegraph,\n+\t\t\top->ldpc_dec.rv_index);\n+\tif (op->ldpc_dec.code_block_mode == RTE_BBDEV_CODE_BLOCK)\n+\t\tfcw->rm_e = op->ldpc_dec.cb_params.e;\n+\telse\n+\t\tfcw->rm_e = (op->ldpc_dec.tb_params.r <\n+\t\t\t\top->ldpc_dec.tb_params.cab) ?\n+\t\t\t\t\t\top->ldpc_dec.tb_params.ea :\n+\t\t\t\t\t\top->ldpc_dec.tb_params.eb;\n+\n+\tif (unlikely(check_bit(op->ldpc_dec.op_flags,\n+\t\t\tRTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE) &&\n+\t\t\t(op->ldpc_dec.harq_combined_input.length == 0))) {\n+\t\trte_bbdev_log(WARNING, \"Null HARQ input size provided\");\n+\t\t/* Disable HARQ input in that case to carry forward. */\n+\t\top->ldpc_dec.op_flags ^= RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE;\n+\t}\n+\tif (unlikely(fcw->rm_e == 0)) {\n+\t\trte_bbdev_log(WARNING, \"Null E input provided\");\n+\t\tfcw->rm_e = 2;\n+\t}\n+\n+\tfcw->hcin_en = check_bit(op->ldpc_dec.op_flags,\n+\t\t\tRTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE);\n+\tfcw->hcout_en = check_bit(op->ldpc_dec.op_flags,\n+\t\t\tRTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE);\n+\tfcw->crc_select = check_bit(op->ldpc_dec.op_flags,\n+\t\t\tRTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK);\n+\tfcw->so_en = check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_SOFT_OUT_ENABLE);\n+\tfcw->so_bypass_intlv = check_bit(op->ldpc_dec.op_flags,\n+\t\t\tRTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS);\n+\tfcw->so_bypass_rm = check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS);\n+\tfcw->bypass_dec = 0;\n+\tfcw->bypass_intlv = check_bit(op->ldpc_dec.op_flags,\n+\t\t\tRTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS);\n+\tif (op->ldpc_dec.q_m == 1) {\n+\t\tfcw->bypass_intlv = 1;\n+\t\tfcw->qm = 2;\n+\t}\n+\tif (check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION)) {\n+\t\tfcw->hcin_decomp_mode = 1;\n+\t\tfcw->hcout_comp_mode = 1;\n+\t} else if (check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_HARQ_4BIT_COMPRESSION)) {\n+\t\tfcw->hcin_decomp_mode = 4;\n+\t\tfcw->hcout_comp_mode = 4;\n+\t} else {\n+\t\tfcw->hcin_decomp_mode = 0;\n+\t\tfcw->hcout_comp_mode = 0;\n+\t}\n+\n+\tfcw->llr_pack_mode = check_bit(op->ldpc_dec.op_flags,\n+\t\t\tRTE_BBDEV_LDPC_LLR_COMPRESSION);\n+\tharq_index = hq_index(op->ldpc_dec.harq_combined_output.offset);\n+\tif (fcw->hcin_en > 0) {\n+\t\tharq_in_length = op->ldpc_dec.harq_combined_input.length;\n+\t\tif (fcw->hcin_decomp_mode == 1)\n+\t\t\tharq_in_length = harq_in_length * 8 / 6;\n+\t\telse if (fcw->hcin_decomp_mode == 4)\n+\t\t\tharq_in_length = harq_in_length * 2;\n+\t\tharq_in_length = RTE_MIN(harq_in_length, op->ldpc_dec.n_cb\n+\t\t\t\t- op->ldpc_dec.n_filler);\n+\t\tharq_in_length = RTE_ALIGN_CEIL(harq_in_length, 64);\n+\t\tfcw->hcin_size0 = harq_in_length;\n+\t\tfcw->hcin_offset = 0;\n+\t\tfcw->hcin_size1 = 0;\n+\t} else {\n+\t\tfcw->hcin_size0 = 0;\n+\t\tfcw->hcin_offset = 0;\n+\t\tfcw->hcin_size1 = 0;\n+\t}\n+\n+\tfcw->itmax = op->ldpc_dec.iter_max;\n+\tfcw->so_it = op->ldpc_dec.iter_max;\n+\tfcw->itstop = check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE);\n+\tfcw->cnu_algo = ACC_ALGO_MSA;\n+\tfcw->synd_precoder = fcw->itstop;\n+\n+\tfcw->minsum_offset = 1;\n+\tfcw->dec_llrclip   = 2;\n+\n+\t/*\n+\t * These are all implicitly set\n+\t * fcw->synd_post = 0;\n+\t * fcw->dec_convllr = 0;\n+\t * fcw->hcout_convllr = 0;\n+\t * fcw->hcout_size1 = 0;\n+\t * fcw->hcout_offset = 0;\n+\t * fcw->negstop_th = 0;\n+\t * fcw->negstop_it = 0;\n+\t * fcw->negstop_en = 0;\n+\t * fcw->gain_i = 1;\n+\t * fcw->gain_h = 1;\n+\t */\n+\tif (fcw->hcout_en > 0) {\n+\t\tparity_offset = (op->ldpc_dec.basegraph == 1 ? 20 : 8)\n+\t\t\t* op->ldpc_dec.z_c - op->ldpc_dec.n_filler;\n+\t\tk0_p = (fcw->k0 > parity_offset) ?\n+\t\t\t\tfcw->k0 - op->ldpc_dec.n_filler : fcw->k0;\n+\t\tncb_p = fcw->ncb - op->ldpc_dec.n_filler;\n+\t\tl = k0_p + fcw->rm_e;\n+\t\tharq_out_length = (uint16_t) fcw->hcin_size0;\n+\t\tharq_out_length = RTE_MIN(RTE_MAX(harq_out_length, l), ncb_p);\n+\t\tharq_out_length = RTE_ALIGN_CEIL(harq_out_length, 64);\n+\t\tfcw->hcout_size0 = harq_out_length;\n+\t\tfcw->hcout_size1 = 0;\n+\t\tfcw->hcout_offset = 0;\n+\t\tharq_layout[harq_index].offset = fcw->hcout_offset;\n+\t\tharq_layout[harq_index].size0 = fcw->hcout_size0;\n+\t} else {\n+\t\tfcw->hcout_size0 = 0;\n+\t\tfcw->hcout_size1 = 0;\n+\t\tfcw->hcout_offset = 0;\n+\t}\n+\n+\tfcw->tb_crc_select = 0;\n+\tif (check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK))\n+\t\tfcw->tb_crc_select = 2;\n+\tif (check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK))\n+\t\tfcw->tb_crc_select = 1;\n+}\n+\n static inline void\n vrb_dma_desc_ld_update(struct rte_bbdev_dec_op *op,\n \t\tstruct acc_dma_req_desc *desc,\n@@ -1817,6 +2040,139 @@ vrb_dma_desc_ld_update(struct rte_bbdev_dec_op *op,\n \tdesc->op_addr = op;\n }\n \n+static inline int\n+vrb2_dma_desc_ld_fill(struct rte_bbdev_dec_op *op,\n+\t\tstruct acc_dma_req_desc *desc,\n+\t\tstruct rte_mbuf **input, struct rte_mbuf *h_output,\n+\t\tuint32_t *in_offset, uint32_t *h_out_offset,\n+\t\tuint32_t *h_out_length, uint32_t *mbuf_total_left,\n+\t\tuint32_t *seg_total_left, struct acc_fcw_ld *fcw)\n+{\n+\tstruct rte_bbdev_op_ldpc_dec *dec = &op->ldpc_dec;\n+\tint next_triplet = 1; /* FCW already done. */\n+\tuint32_t input_length;\n+\tuint16_t output_length, crc24_overlap = 0;\n+\tuint16_t sys_cols, K, h_p_size, h_np_size;\n+\n+\tacc_header_init(desc);\n+\n+\tif (check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP))\n+\t\tcrc24_overlap = 24;\n+\n+\t/* Compute some LDPC BG lengths. */\n+\tinput_length = fcw->rm_e;\n+\tif (check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_LLR_COMPRESSION))\n+\t\tinput_length = (input_length * 3 + 3) / 4;\n+\tsys_cols = (dec->basegraph == 1) ? 22 : 10;\n+\tK = sys_cols * dec->z_c;\n+\toutput_length = K - dec->n_filler - crc24_overlap;\n+\n+\tif (unlikely((*mbuf_total_left == 0) || (*mbuf_total_left < input_length))) {\n+\t\trte_bbdev_log(ERR,\n+\t\t\t\t\"Mismatch between mbuf length and included CB sizes: mbuf len %u, cb len %u\",\n+\t\t\t\t*mbuf_total_left, input_length);\n+\t\treturn -1;\n+\t}\n+\n+\tnext_triplet = acc_dma_fill_blk_type_in(desc, input,\n+\t\t\tin_offset, input_length,\n+\t\t\tseg_total_left, next_triplet,\n+\t\t\tcheck_bit(op->ldpc_dec.op_flags,\n+\t\t\tRTE_BBDEV_LDPC_DEC_SCATTER_GATHER));\n+\n+\tif (unlikely(next_triplet < 0)) {\n+\t\trte_bbdev_log(ERR,\n+\t\t\t\t\"Mismatch between data to process and mbuf data length in bbdev_op: %p\",\n+\t\t\t\top);\n+\t\treturn -1;\n+\t}\n+\n+\tif (check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE)) {\n+\t\tif (op->ldpc_dec.harq_combined_input.data == 0) {\n+\t\t\trte_bbdev_log(ERR, \"HARQ input is not defined\");\n+\t\t\treturn -1;\n+\t\t}\n+\t\th_p_size = fcw->hcin_size0 + fcw->hcin_size1;\n+\t\tif (fcw->hcin_decomp_mode == 1)\n+\t\t\th_p_size = (h_p_size * 3 + 3) / 4;\n+\t\telse if (fcw->hcin_decomp_mode == 4)\n+\t\t\th_p_size = h_p_size / 2;\n+\t\tif (op->ldpc_dec.harq_combined_input.data == 0) {\n+\t\t\trte_bbdev_log(ERR, \"HARQ input is not defined\");\n+\t\t\treturn -1;\n+\t\t}\n+\t\tacc_dma_fill_blk_type(\n+\t\t\t\tdesc,\n+\t\t\t\top->ldpc_dec.harq_combined_input.data,\n+\t\t\t\top->ldpc_dec.harq_combined_input.offset,\n+\t\t\t\th_p_size,\n+\t\t\t\tnext_triplet,\n+\t\t\t\tACC_DMA_BLKID_IN_HARQ);\n+\t\tnext_triplet++;\n+\t}\n+\n+\tdesc->data_ptrs[next_triplet - 1].last = 1;\n+\tdesc->m2dlen = next_triplet;\n+\t*mbuf_total_left -= input_length;\n+\n+\tnext_triplet = acc_dma_fill_blk_type(desc, h_output,\n+\t\t\t*h_out_offset, output_length >> 3, next_triplet,\n+\t\t\tACC_DMA_BLKID_OUT_HARD);\n+\n+\tif (check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_SOFT_OUT_ENABLE)) {\n+\t\tif (op->ldpc_dec.soft_output.data == 0) {\n+\t\t\trte_bbdev_log(ERR, \"Soft output is not defined\");\n+\t\t\treturn -1;\n+\t\t}\n+\t\tdec->soft_output.length = fcw->rm_e;\n+\t\tacc_dma_fill_blk_type(desc, dec->soft_output.data, dec->soft_output.offset,\n+\t\t\t\tfcw->rm_e, next_triplet, ACC_DMA_BLKID_OUT_SOFT);\n+\t\tnext_triplet++;\n+\t}\n+\n+\tif (check_bit(op->ldpc_dec.op_flags,\n+\t\t\t\tRTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE)) {\n+\t\tif (op->ldpc_dec.harq_combined_output.data == 0) {\n+\t\t\trte_bbdev_log(ERR, \"HARQ output is not defined\");\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\t/* Pruned size of the HARQ */\n+\t\th_p_size = fcw->hcout_size0 + fcw->hcout_size1;\n+\t\t/* Non-Pruned size of the HARQ */\n+\t\th_np_size = fcw->hcout_offset > 0 ?\n+\t\t\t\tfcw->hcout_offset + fcw->hcout_size1 :\n+\t\t\t\th_p_size;\n+\t\tif (fcw->hcin_decomp_mode == 1) {\n+\t\t\th_np_size = (h_np_size * 3 + 3) / 4;\n+\t\t\th_p_size = (h_p_size * 3 + 3) / 4;\n+\t\t} else if (fcw->hcin_decomp_mode == 4) {\n+\t\t\th_np_size = h_np_size / 2;\n+\t\t\th_p_size = h_p_size / 2;\n+\t\t}\n+\t\tdec->harq_combined_output.length = h_np_size;\n+\t\tacc_dma_fill_blk_type(\n+\t\t\t\tdesc,\n+\t\t\t\tdec->harq_combined_output.data,\n+\t\t\t\tdec->harq_combined_output.offset,\n+\t\t\t\th_p_size,\n+\t\t\t\tnext_triplet,\n+\t\t\t\tACC_DMA_BLKID_OUT_HARQ);\n+\n+\t\tnext_triplet++;\n+\t}\n+\n+\t*h_out_length = output_length >> 3;\n+\tdec->hard_output.length += *h_out_length;\n+\t*h_out_offset += *h_out_length;\n+\tdesc->data_ptrs[next_triplet - 1].last = 1;\n+\tdesc->d2mlen = next_triplet - desc->m2dlen;\n+\n+\tdesc->op_addr = op;\n+\n+\treturn 0;\n+}\n+\n /* Enqueue one encode operations for device in CB mode. */\n static inline int\n enqueue_enc_one_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op *op,\n@@ -1877,6 +2233,7 @@ enqueue_ldpc_enc_n_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op **ops,\n \t/** This could be done at polling. */\n \tacc_header_init(&desc->req);\n \tdesc->req.numCBs = num;\n+\tdesc->req.dltb = 0;\n \n \tin_length_in_bytes = ops[0]->ldpc_enc.input.data->data_len;\n \tout_length = (enc->cb_params.e + 7) >> 3;\n@@ -2102,6 +2459,105 @@ vrb1_enqueue_ldpc_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op\n \treturn return_descs;\n }\n \n+/* Fill in a frame control word for LDPC encoding. */\n+static inline void\n+vrb2_fcw_letb_fill(const struct rte_bbdev_enc_op *op, struct acc_fcw_le *fcw)\n+{\n+\tfcw->qm = op->ldpc_enc.q_m;\n+\tfcw->nfiller = op->ldpc_enc.n_filler;\n+\tfcw->BG = (op->ldpc_enc.basegraph - 1);\n+\tfcw->Zc = op->ldpc_enc.z_c;\n+\tfcw->ncb = op->ldpc_enc.n_cb;\n+\tfcw->k0 = get_k0(fcw->ncb, fcw->Zc, op->ldpc_enc.basegraph,\n+\t\t\top->ldpc_enc.rv_index);\n+\tfcw->rm_e = op->ldpc_enc.tb_params.ea;\n+\tfcw->rm_e_b = op->ldpc_enc.tb_params.eb;\n+\tfcw->crc_select = check_bit(op->ldpc_enc.op_flags,\n+\t\t\tRTE_BBDEV_LDPC_CRC_24B_ATTACH);\n+\tfcw->bypass_intlv = 0;\n+\tif (op->ldpc_enc.tb_params.c > 1) {\n+\t\tfcw->mcb_count = 0;\n+\t\tfcw->C = op->ldpc_enc.tb_params.c;\n+\t\tfcw->Cab = op->ldpc_enc.tb_params.cab;\n+\t} else {\n+\t\tfcw->mcb_count = 1;\n+\t\tfcw->C = 0;\n+\t}\n+}\n+\n+/* Enqueue one encode operations for device in TB mode.\n+ * returns the number of descs used.\n+ */\n+static inline int\n+vrb2_enqueue_ldpc_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op,\n+\t\tuint16_t enq_descs)\n+{\n+\tunion acc_dma_desc *desc = NULL;\n+\tuint32_t in_offset, out_offset, out_length, seg_total_left;\n+\tstruct rte_mbuf *input, *output_head, *output;\n+\n+\tuint16_t desc_idx = ((q->sw_ring_head + enq_descs) & q->sw_ring_wrap_mask);\n+\tdesc = q->ring_addr + desc_idx;\n+\tvrb2_fcw_letb_fill(op, &desc->req.fcw_le);\n+\tstruct rte_bbdev_op_ldpc_enc *enc = &op->ldpc_enc;\n+\tint next_triplet = 1; /* FCW already done */\n+\tuint32_t in_length_in_bytes;\n+\tuint16_t K, in_length_in_bits;\n+\n+\tinput = enc->input.data;\n+\toutput_head = output = enc->output.data;\n+\tin_offset = enc->input.offset;\n+\tout_offset = enc->output.offset;\n+\tseg_total_left = rte_pktmbuf_data_len(enc->input.data) - in_offset;\n+\n+\tacc_header_init(&desc->req);\n+\tK = (enc->basegraph == 1 ? 22 : 10) * enc->z_c;\n+\tin_length_in_bits = K - enc->n_filler;\n+\tif ((enc->op_flags & RTE_BBDEV_LDPC_CRC_24A_ATTACH) ||\n+\t\t\t(enc->op_flags & RTE_BBDEV_LDPC_CRC_24B_ATTACH))\n+\t\tin_length_in_bits -= 24;\n+\tin_length_in_bytes = (in_length_in_bits >> 3) * enc->tb_params.c;\n+\n+\tnext_triplet = acc_dma_fill_blk_type_in(&desc->req, &input, &in_offset,\n+\t\t\tin_length_in_bytes, &seg_total_left, next_triplet,\n+\t\t\tcheck_bit(enc->op_flags, RTE_BBDEV_LDPC_ENC_SCATTER_GATHER));\n+\tif (unlikely(next_triplet < 0)) {\n+\t\trte_bbdev_log(ERR,\n+\t\t\t\t\"Mismatch between data to process and mbuf data length in bbdev_op: %p\",\n+\t\t\t\top);\n+\t\treturn -1;\n+\t}\n+\tdesc->req.data_ptrs[next_triplet - 1].last = 1;\n+\tdesc->req.m2dlen = next_triplet;\n+\n+\t/* Set output length */\n+\t/* Integer round up division by 8 */\n+\tout_length = (enc->tb_params.ea * enc->tb_params.cab +\n+\t\t\tenc->tb_params.eb * (enc->tb_params.c - enc->tb_params.cab)  + 7) >> 3;\n+\n+\tnext_triplet = acc_dma_fill_blk_type(&desc->req, output, out_offset,\n+\t\t\tout_length, next_triplet, ACC_DMA_BLKID_OUT_ENC);\n+\tenc->output.length = out_length;\n+\tout_offset += out_length;\n+\tdesc->req.data_ptrs[next_triplet - 1].last = 1;\n+\tdesc->req.data_ptrs[next_triplet - 1].dma_ext = 0;\n+\tdesc->req.d2mlen = next_triplet - desc->req.m2dlen;\n+\tdesc->req.numCBs = enc->tb_params.c;\n+\tif (desc->req.numCBs > 1)\n+\t\tdesc->req.dltb = 1;\n+\tdesc->req.op_addr = op;\n+\n+\tif (out_length < ACC_MAX_E_MBUF)\n+\t\tmbuf_append(output_head, output, out_length);\n+\n+#ifdef RTE_LIBRTE_BBDEV_DEBUG\n+\trte_memdump(stderr, \"FCW\", &desc->req.fcw_le, sizeof(desc->req.fcw_le));\n+\trte_memdump(stderr, \"Req Desc.\", desc, sizeof(*desc));\n+#endif\n+\t/* One CB (one op) was successfully prepared to enqueue */\n+\treturn 1;\n+}\n+\n /** Enqueue one decode operations for device in CB mode. */\n static inline int\n enqueue_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,\n@@ -2215,10 +2671,16 @@ vrb_enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,\n \t\telse\n \t\t\tseg_total_left = fcw->rm_e;\n \n-\t\tret = vrb1_dma_desc_ld_fill(op, &desc->req, &input, h_output,\n-\t\t\t\t&in_offset, &h_out_offset,\n-\t\t\t\t&h_out_length, &mbuf_total_left,\n-\t\t\t\t&seg_total_left, fcw);\n+\t\tif (q->d->device_variant == VRB1_VARIANT)\n+\t\t\tret = vrb1_dma_desc_ld_fill(op, &desc->req, &input, h_output,\n+\t\t\t\t\t&in_offset, &h_out_offset,\n+\t\t\t\t\t&h_out_length, &mbuf_total_left,\n+\t\t\t\t\t&seg_total_left, fcw);\n+\t\telse\n+\t\t\tret = vrb2_dma_desc_ld_fill(op, &desc->req, &input, h_output,\n+\t\t\t\t\t&in_offset, &h_out_offset,\n+\t\t\t\t\t&h_out_length, &mbuf_total_left,\n+\t\t\t\t\t&seg_total_left, fcw);\n \t\tif (unlikely(ret < 0))\n \t\t\treturn ret;\n \t}\n@@ -2308,11 +2770,18 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,\n \t\trte_memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld, ACC_FCW_LD_BLEN);\n \t\tdesc->req.fcw_ld.tb_trailer_size = (c - r - 1) * trail_len;\n \n-\t\tret = vrb1_dma_desc_ld_fill(op, &desc->req, &input,\n-\t\t\t\th_output, &in_offset, &h_out_offset,\n-\t\t\t\t&h_out_length,\n-\t\t\t\t&mbuf_total_left, &seg_total_left,\n-\t\t\t\t&desc->req.fcw_ld);\n+\t\tif (q->d->device_variant == VRB1_VARIANT)\n+\t\t\tret = vrb1_dma_desc_ld_fill(op, &desc->req, &input,\n+\t\t\t\t\th_output, &in_offset, &h_out_offset,\n+\t\t\t\t\t&h_out_length,\n+\t\t\t\t\t&mbuf_total_left, &seg_total_left,\n+\t\t\t\t\t&desc->req.fcw_ld);\n+\t\telse\n+\t\t\tret = vrb2_dma_desc_ld_fill(op, &desc->req, &input,\n+\t\t\t\t\th_output, &in_offset, &h_out_offset,\n+\t\t\t\t\t&h_out_length,\n+\t\t\t\t\t&mbuf_total_left, &seg_total_left,\n+\t\t\t\t\t&desc->req.fcw_ld);\n \n \t\tif (unlikely(ret < 0))\n \t\t\treturn ret;\n@@ -2576,14 +3045,22 @@ vrb_enqueue_ldpc_enc_tb(struct rte_bbdev_queue_data *q_data,\n \tint descs_used;\n \n \tfor (i = 0; i < num; ++i) {\n-\t\tcbs_in_tb = get_num_cbs_in_tb_ldpc_enc(&ops[i]->ldpc_enc);\n-\t\t/* Check if there are available space for further processing. */\n-\t\tif (unlikely((avail - cbs_in_tb < 0) || (cbs_in_tb == 0))) {\n-\t\t\tacc_enqueue_ring_full(q_data);\n-\t\t\tbreak;\n+\t\tif (q->d->device_variant == VRB1_VARIANT) {\n+\t\t\tcbs_in_tb = get_num_cbs_in_tb_ldpc_enc(&ops[i]->ldpc_enc);\n+\t\t\t/* Check if there are available space for further processing. */\n+\t\t\tif (unlikely((avail - cbs_in_tb < 0) || (cbs_in_tb == 0))) {\n+\t\t\t\tacc_enqueue_ring_full(q_data);\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t\tdescs_used = vrb1_enqueue_ldpc_enc_one_op_tb(q, ops[i],\n+\t\t\t\t\tenqueued_descs, cbs_in_tb);\n+\t\t} else {\n+\t\t\tif (unlikely(avail < 1)) {\n+\t\t\t\tacc_enqueue_ring_full(q_data);\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t\tdescs_used = vrb2_enqueue_ldpc_enc_one_op_tb(q, ops[i], enqueued_descs);\n \t\t}\n-\n-\t\tdescs_used = vrb1_enqueue_ldpc_enc_one_op_tb(q, ops[i], enqueued_descs, cbs_in_tb);\n \t\tif (descs_used < 0) {\n \t\t\tacc_enqueue_invalid(q_data);\n \t\t\tbreak;\n@@ -2865,6 +3342,52 @@ vrb_dequeue_enc_one_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,\n \treturn desc->req.numCBs;\n }\n \n+/* Dequeue one LDPC encode operations from VRB2 device in TB mode. */\n+static inline int\n+vrb2_dequeue_ldpc_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,\n+\t\tuint16_t *dequeued_ops, uint32_t *aq_dequeued,\n+\t\tuint16_t *dequeued_descs)\n+{\n+\tunion acc_dma_desc *desc, atom_desc;\n+\tunion acc_dma_rsp_desc rsp;\n+\tstruct rte_bbdev_enc_op *op;\n+\tint desc_idx = ((q->sw_ring_tail + *dequeued_descs) & q->sw_ring_wrap_mask);\n+\n+\tdesc = q->ring_addr + desc_idx;\n+\tatom_desc.atom_hdr = __atomic_load_n((uint64_t *)desc, __ATOMIC_RELAXED);\n+\n+\t/* Check fdone bit. */\n+\tif (!(atom_desc.rsp.val & ACC_FDONE))\n+\t\treturn -1;\n+\n+\trsp.val = atom_desc.rsp.val;\n+\trte_bbdev_log_debug(\"Resp. desc %p: %x\", desc, rsp.val);\n+\n+\t/* Dequeue. */\n+\top = desc->req.op_addr;\n+\n+\t/* Clearing status, it will be set based on response. */\n+\top->status = 0;\n+\top->status |= rsp.input_err << RTE_BBDEV_DATA_ERROR;\n+\top->status |= rsp.dma_err << RTE_BBDEV_DRV_ERROR;\n+\top->status |= rsp.fcw_err << RTE_BBDEV_DRV_ERROR;\n+\top->status |= rsp.engine_hung << RTE_BBDEV_ENGINE_ERROR;\n+\n+\tif (desc->req.last_desc_in_batch) {\n+\t\t(*aq_dequeued)++;\n+\t\tdesc->req.last_desc_in_batch = 0;\n+\t}\n+\tdesc->rsp.val = ACC_DMA_DESC_TYPE;\n+\tdesc->rsp.add_info_0 = 0; /* Reserved bits. */\n+\tdesc->rsp.add_info_1 = 0; /* Reserved bits. */\n+\n+\t/* One op was successfully dequeued */\n+\tref_op[0] = op;\n+\t(*dequeued_descs)++;\n+\t(*dequeued_ops)++;\n+\treturn 1;\n+}\n+\n /* Dequeue one LDPC encode operations from device in TB mode.\n  * That operation may cover multiple descriptors.\n  */\n@@ -3189,9 +3712,14 @@ vrb_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,\n \n \tfor (i = 0; i < avail; i++) {\n \t\tif (cbm == RTE_BBDEV_TRANSPORT_BLOCK)\n-\t\t\tret = vrb_dequeue_enc_one_op_tb(q, &ops[dequeued_ops],\n-\t\t\t\t\t&dequeued_ops, &aq_dequeued,\n-\t\t\t\t\t&dequeued_descs, num);\n+\t\t\tif (q->d->device_variant == VRB1_VARIANT)\n+\t\t\t\tret = vrb_dequeue_enc_one_op_tb(q, &ops[dequeued_ops],\n+\t\t\t\t\t\t&dequeued_ops, &aq_dequeued,\n+\t\t\t\t\t\t&dequeued_descs, num);\n+\t\t\telse\n+\t\t\t\tret = vrb2_dequeue_ldpc_enc_one_op_tb(q, &ops[dequeued_ops],\n+\t\t\t\t\t\t&dequeued_ops, &aq_dequeued,\n+\t\t\t\t\t\t&dequeued_descs);\n \t\telse\n \t\t\tret = vrb_dequeue_enc_one_op_cb(q, &ops[dequeued_ops],\n \t\t\t\t\t&dequeued_ops, &aq_dequeued,\n@@ -3536,6 +4064,7 @@ vrb_bbdev_init(struct rte_bbdev *dev, struct rte_pci_driver *drv)\n \t} else {\n \t\td->device_variant = VRB2_VARIANT;\n \t\td->queue_offset = vrb2_queue_offset;\n+\t\td->fcw_ld_fill = vrb2_fcw_ld_fill;\n \t\td->num_qgroups = VRB2_NUM_QGRPS;\n \t\td->num_aqs = VRB2_NUM_AQS;\n \t\tif (d->pf_device)\n",
    "prefixes": [
        "v3",
        "08/12"
    ]
}