From patchwork Sat Oct 1 01:15:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chautru, Nicolas" X-Patchwork-Id: 117239 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id DA99AA00C4; Sat, 1 Oct 2022 03:16:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8A2A740684; Sat, 1 Oct 2022 03:16:10 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id AB84E4003F for ; Sat, 1 Oct 2022 03:16:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664586968; x=1696122968; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=58FPcoIV3NeOMeuFJcJuIDA1qax11AoQN8wcEKLmHHo=; b=TsDlz1RIdQM4Isu0uPmRfOAKF3SutyLl/TkbohcV4QB2nJlNnCoqUsow ZlY75gamK4qngOm39l/EH9vmZJLDwZcaZFeDNxUGnXQPHofuq64c3j1/K ssUEytBgJfkxUfzzPzjM6c0AwJkRgpModr8ucmf+HodX05l2jCTyDKX3L NSmMS0yAapbc1ATlC+jgYGEMvaDWNIw4vFUCpcrGQvPWPo3hJ0VljvRwB 4pIjQy4N5I9eZ0qs6TW4rmc6m+Woap1qR+8f3X2Fqw4OZYT3HrVSqkKJZ ya8ku2CSVFJtDZff6YlkqBY36xL2lbTcE60kRXDBhDCjqrQX+RjQXC5op Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10486"; a="299923704" X-IronPort-AV: E=Sophos;i="5.93,359,1654585200"; d="scan'208";a="299923704" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2022 18:15:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10486"; a="691445013" X-IronPort-AV: E=Sophos;i="5.93,359,1654585200"; d="scan'208";a="691445013" Received: from unknown (HELO icx-npg-scs1-cp1.localdomain) ([10.233.180.245]) by fmsmga004.fm.intel.com with ESMTP; 30 Sep 2022 18:15:50 -0700 From: Nicolas Chautru To: dev@dpdk.org, gakhil@marvell.com Cc: maxime.coquelin@redhat.com, Nicolas Chautru Subject: [PATCH v1] doc: update to include bbdev snippet using literalinclude Date: Fri, 30 Sep 2022 18:15:47 -0700 Message-Id: <20221001011547.49459-1-nicolas.chautru@intel.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Adding code snippet using literalinclude so that to keep automatically these structures in doc in sync with the bbdev source code. Signed-off-by: Nicolas Chautru --- doc/guides/prog_guide/bbdev.rst | 105 +++++++------------------------- lib/bbdev/rte_bbdev_op.h | 15 +++++ 2 files changed, 38 insertions(+), 82 deletions(-) diff --git a/doc/guides/prog_guide/bbdev.rst b/doc/guides/prog_guide/bbdev.rst index 0149a99198..7b95d72524 100644 --- a/doc/guides/prog_guide/bbdev.rst +++ b/doc/guides/prog_guide/bbdev.rst @@ -510,20 +510,10 @@ This structure has three elements: BBDEV Turbo Encode Operation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: c - - struct rte_bbdev_op_turbo_enc { - struct rte_bbdev_op_data input; - struct rte_bbdev_op_data output; - - uint32_t op_flags; - uint8_t rv_index; - uint8_t code_block_mode; - union { - struct rte_bbdev_op_enc_cb_params cb_params; - struct rte_bbdev_op_enc_tb_params tb_params; - }; - }; +.. literalinclude:: ../../../lib/bbdev/rte_bbdev_op.h + :language: c + :start-after: Structure rte_bbdev_op_turbo_enc 8< + :end-before: >8 End of structure rte_bbdev_op_turbo_enc. The Turbo encode structure includes the ``input`` and ``output`` mbuf data pointers. The provided mbuf pointer of ``input`` needs to be big @@ -606,26 +596,10 @@ TB-mode. CB-mode is a reduced version, where only one CB exists: BBDEV Turbo Decode Operation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: c - - struct rte_bbdev_op_turbo_dec { - struct rte_bbdev_op_data input; - struct rte_bbdev_op_data hard_output; - struct rte_bbdev_op_data soft_output; - - uint32_t op_flags; - uint8_t rv_index; - uint8_t iter_min:4; - uint8_t iter_max:4; - uint8_t iter_count; - uint8_t ext_scale; - uint8_t num_maps; - uint8_t code_block_mode; - union { - struct rte_bbdev_op_dec_cb_params cb_params; - struct rte_bbdev_op_dec_tb_params tb_params; - }; - }; +.. literalinclude:: ../../../lib/bbdev/rte_bbdev_op.h + :language: c + :start-after: Structure rte_bbdev_op_turbo_dec 8< + :end-before: >8 End of structure rte_bbdev_op_turbo_dec. The Turbo decode structure includes the ``input``, ``hard_output`` and optionally the ``soft_output`` mbuf data pointers. @@ -751,26 +725,10 @@ given below. The structure passed for each LDPC encode operation is given below, with the operation flags forming a bitmask in the ``op_flags`` field. -.. code-block:: c - - struct rte_bbdev_op_ldpc_enc { - - struct rte_bbdev_op_data input; - struct rte_bbdev_op_data output; - - uint32_t op_flags; - uint8_t rv_index; - uint8_t basegraph; - uint16_t z_c; - uint16_t n_cb; - uint8_t q_m; - uint16_t n_filler; - uint8_t code_block_mode; - union { - struct rte_bbdev_op_enc_ldpc_cb_params cb_params; - struct rte_bbdev_op_enc_ldpc_tb_params tb_params; - }; - }; +.. literalinclude:: ../../../lib/bbdev/rte_bbdev_op.h + :language: c + :start-after: Structure rte_bbdev_op_ldpc_enc 8< + :end-before: >8 End of structure rte_bbdev_op_ldpc_enc. The LDPC encode parameters are set out in the table below. @@ -949,33 +907,10 @@ given below. The structure passed for each LDPC decode operation is given below, with the operation flags forming a bitmask in the ``op_flags`` field. -.. code-block:: c - - - struct rte_bbdev_op_ldpc_dec { - - struct rte_bbdev_op_data input; - struct rte_bbdev_op_data hard_output; - struct rte_bbdev_op_data soft_output; - struct rte_bbdev_op_data harq_combined_input; - struct rte_bbdev_op_data harq_combined_output; - - uint32_t op_flags; - uint8_t rv_index; - uint8_t basegraph; - uint16_t z_c; - uint16_t n_cb; - uint8_t q_m; - uint16_t n_filler; - uint8_t iter_max; - uint8_t iter_count; - uint8_t code_block_mode; - union { - struct rte_bbdev_op_dec_ldpc_cb_params cb_params; - struct rte_bbdev_op_dec_ldpc_tb_params tb_params; - }; - }; - +.. literalinclude:: ../../../lib/bbdev/rte_bbdev_op.h + :language: c + :start-after: Structure rte_bbdev_op_ldpc_dec 8< + :end-before: >8 End of structure rte_bbdev_op_ldpc_dec. The LDPC decode parameters are set out in the table below. @@ -1135,12 +1070,18 @@ A flexible number of Rx antennas are being processed in parallel with the same c The API allows more generally for flexibility in what the PMD may support (capability flags) and flexibility to adjust some of the parameters of the processing. -The operation/capability flags that can be set for each FFT operation are given below. +The structure passed for each FFT operation is given below, +with the operation flags forming a bitmask in the ``op_flags`` field. **NOTE:** The actual operation flags that may be used with a specific BBDEV PMD are dependent on the driver capabilities as reported via ``rte_bbdev_info_get()``, and may be a subset of those below. +.. literalinclude:: ../../../lib/bbdev/rte_bbdev_op.h + :language: c + :start-after: Structure rte_bbdev_op_fft 8< + :end-before: >8 End of structure rte_bbdev_op_fft. + +--------------------------------------------------------------------+ |Description of FFT capability flags | +====================================================================+ diff --git a/lib/bbdev/rte_bbdev_op.h b/lib/bbdev/rte_bbdev_op.h index c0940ce085..05fe814ffc 100644 --- a/lib/bbdev/rte_bbdev_op.h +++ b/lib/bbdev/rte_bbdev_op.h @@ -402,6 +402,8 @@ struct rte_bbdev_op_dec_ldpc_tb_params { * The output mbuf data structure is expected to be allocated by the * application with enough room for the output data. */ + +/* Structure rte_bbdev_op_turbo_dec 8< */ struct rte_bbdev_op_turbo_dec { /** The Virtual Circular Buffer, wk, size 3*Kpi for each CB */ struct rte_bbdev_op_data input; @@ -445,6 +447,7 @@ struct rte_bbdev_op_turbo_dec { struct rte_bbdev_op_dec_turbo_tb_params tb_params; }; }; +/* >8 End of structure rte_bbdev_op_turbo_dec. */ /** Operation structure for LDPC decode. * @@ -475,6 +478,8 @@ struct rte_bbdev_op_turbo_dec { * The output mbuf data structure is expected to be allocated by the * application with enough room for the output data. */ + +/* Structure rte_bbdev_op_ldpc_dec 8< */ struct rte_bbdev_op_ldpc_dec { /** The Virtual Circular Buffer for this code block, one LLR * per bit of the original CB. @@ -535,6 +540,7 @@ struct rte_bbdev_op_ldpc_dec { struct rte_bbdev_op_dec_ldpc_tb_params tb_params; }; }; +/* >8 End of structure rte_bbdev_op_ldpc_dec. */ /** Turbo encode code block parameters */ struct rte_bbdev_op_enc_turbo_cb_params { @@ -643,6 +649,8 @@ struct rte_bbdev_op_enc_ldpc_tb_params { * The output mbuf data structure is expected to be allocated by the * application with enough room for the output data. */ + +/* Structure rte_bbdev_op_turbo_enc 8< */ struct rte_bbdev_op_turbo_enc { /** The input CB or TB data */ struct rte_bbdev_op_data input; @@ -662,6 +670,7 @@ struct rte_bbdev_op_turbo_enc { struct rte_bbdev_op_enc_turbo_tb_params tb_params; }; }; +/* >8 End of structure rte_bbdev_op_turbo_enc. */ /** Operation structure for LDPC encode. * An operation can be performed on one CB at a time "CB-mode". @@ -676,6 +685,8 @@ struct rte_bbdev_op_turbo_enc { * The output mbuf data structure is expected to be allocated by the * application with enough room for the output data. */ + +/* Structure rte_bbdev_op_ldpc_enc 8< */ struct rte_bbdev_op_ldpc_enc { /** The input TB or CB data */ struct rte_bbdev_op_data input; @@ -716,6 +727,7 @@ struct rte_bbdev_op_ldpc_enc { struct rte_bbdev_op_enc_ldpc_tb_params tb_params; }; }; +/* >8 End of structure rte_bbdev_op_ldpc_enc. */ /** Operation structure for FFT processing. * @@ -725,6 +737,8 @@ struct rte_bbdev_op_ldpc_enc { * The output mbuf data structure is expected to be allocated by the * application with enough room for the output data. */ + +/* Structure rte_bbdev_op_fft 8< */ struct rte_bbdev_op_fft { /** Input data starting from first antenna */ struct rte_bbdev_op_data base_input; @@ -765,6 +779,7 @@ struct rte_bbdev_op_fft { /** Adjust the FP6 exponent for INT<->FP16 conversion */ uint16_t fp16_exp_adjust; }; +/* >8 End of structure rte_bbdev_op_fft. */ /** List of the capabilities for the Turbo Decoder */ struct rte_bbdev_op_cap_turbo_dec {