doc: include bbdev code snippet using literal include

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 <nicolas.chautru@intel.com>
This commit is contained in:
Nicolas Chautru 2022-10-12 11:16:22 -07:00 committed by Akhil Goyal
parent 7283c59e37
commit c49c880ffe
2 changed files with 38 additions and 82 deletions

View File

@ -510,20 +510,10 @@ This structure has three elements:
BBDEV Turbo Encode Operation BBDEV Turbo Encode Operation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: c .. literalinclude:: ../../../lib/bbdev/rte_bbdev_op.h
:language: c
struct rte_bbdev_op_turbo_enc { :start-after: Structure rte_bbdev_op_turbo_enc 8<
struct rte_bbdev_op_data input; :end-before: >8 End of structure rte_bbdev_op_turbo_enc.
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;
};
};
The Turbo encode structure includes the ``input`` and ``output`` mbuf The Turbo encode structure includes the ``input`` and ``output`` mbuf
data pointers. The provided mbuf pointer of ``input`` needs to be big 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 BBDEV Turbo Decode Operation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: c .. literalinclude:: ../../../lib/bbdev/rte_bbdev_op.h
:language: c
struct rte_bbdev_op_turbo_dec { :start-after: Structure rte_bbdev_op_turbo_dec 8<
struct rte_bbdev_op_data input; :end-before: >8 End of structure rte_bbdev_op_turbo_dec.
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;
};
};
The Turbo decode structure includes the ``input``, ``hard_output`` and The Turbo decode structure includes the ``input``, ``hard_output`` and
optionally the ``soft_output`` mbuf data pointers. optionally the ``soft_output`` mbuf data pointers.
@ -751,26 +725,10 @@ given below.
The structure passed for each LDPC encode operation is 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. with the operation flags forming a bitmask in the ``op_flags`` field.
.. code-block:: c .. literalinclude:: ../../../lib/bbdev/rte_bbdev_op.h
:language: c
struct rte_bbdev_op_ldpc_enc { :start-after: Structure rte_bbdev_op_ldpc_enc 8<
:end-before: >8 End of structure 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;
};
};
The LDPC encode parameters are set out in the table below. 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, The structure passed for each LDPC decode operation is given below,
with the operation flags forming a bitmask in the ``op_flags`` field. with the operation flags forming a bitmask in the ``op_flags`` field.
.. code-block:: c .. literalinclude:: ../../../lib/bbdev/rte_bbdev_op.h
:language: c
:start-after: Structure rte_bbdev_op_ldpc_dec 8<
struct rte_bbdev_op_ldpc_dec { :end-before: >8 End of structure 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;
};
};
The LDPC decode parameters are set out in the table below. The LDPC decode parameters are set out in the table below.
@ -1137,12 +1072,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 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. 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 **NOTE:** The actual operation flags that may be used with a specific
bbdev PMD are dependent on the driver capabilities as reported via bbdev PMD are dependent on the driver capabilities as reported via
``rte_bbdev_info_get()``, and may be a subset of those below. ``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 | |Description of FFT capability flags |
+====================================================================+ +====================================================================+

View File

@ -403,6 +403,8 @@ struct rte_bbdev_op_dec_ldpc_tb_params {
* The output mbuf data structure is expected to be allocated by the * The output mbuf data structure is expected to be allocated by the
* application with enough room for the output data. * application with enough room for the output data.
*/ */
/* Structure rte_bbdev_op_turbo_dec 8< */
struct rte_bbdev_op_turbo_dec { struct rte_bbdev_op_turbo_dec {
/** The Virtual Circular Buffer, wk, size 3*Kpi for each CB */ /** The Virtual Circular Buffer, wk, size 3*Kpi for each CB */
struct rte_bbdev_op_data input; struct rte_bbdev_op_data input;
@ -446,6 +448,7 @@ struct rte_bbdev_op_turbo_dec {
struct rte_bbdev_op_dec_turbo_tb_params tb_params; struct rte_bbdev_op_dec_turbo_tb_params tb_params;
}; };
}; };
/* >8 End of structure rte_bbdev_op_turbo_dec. */
/** Operation structure for LDPC decode. /** Operation structure for LDPC decode.
* *
@ -476,6 +479,8 @@ struct rte_bbdev_op_turbo_dec {
* The output mbuf data structure is expected to be allocated by the * The output mbuf data structure is expected to be allocated by the
* application with enough room for the output data. * application with enough room for the output data.
*/ */
/* Structure rte_bbdev_op_ldpc_dec 8< */
struct rte_bbdev_op_ldpc_dec { struct rte_bbdev_op_ldpc_dec {
/** The Virtual Circular Buffer for this code block, one LLR /** The Virtual Circular Buffer for this code block, one LLR
* per bit of the original CB. * per bit of the original CB.
@ -536,6 +541,7 @@ struct rte_bbdev_op_ldpc_dec {
struct rte_bbdev_op_dec_ldpc_tb_params tb_params; struct rte_bbdev_op_dec_ldpc_tb_params tb_params;
}; };
}; };
/* >8 End of structure rte_bbdev_op_ldpc_dec. */
/** Turbo encode code block parameters */ /** Turbo encode code block parameters */
struct rte_bbdev_op_enc_turbo_cb_params { struct rte_bbdev_op_enc_turbo_cb_params {
@ -644,6 +650,8 @@ struct rte_bbdev_op_enc_ldpc_tb_params {
* The output mbuf data structure is expected to be allocated by the * The output mbuf data structure is expected to be allocated by the
* application with enough room for the output data. * application with enough room for the output data.
*/ */
/* Structure rte_bbdev_op_turbo_enc 8< */
struct rte_bbdev_op_turbo_enc { struct rte_bbdev_op_turbo_enc {
/** The input CB or TB data */ /** The input CB or TB data */
struct rte_bbdev_op_data input; struct rte_bbdev_op_data input;
@ -663,6 +671,7 @@ struct rte_bbdev_op_turbo_enc {
struct rte_bbdev_op_enc_turbo_tb_params tb_params; struct rte_bbdev_op_enc_turbo_tb_params tb_params;
}; };
}; };
/* >8 End of structure rte_bbdev_op_turbo_enc. */
/** Operation structure for LDPC encode. /** Operation structure for LDPC encode.
* An operation can be performed on one CB at a time "CB-mode". * An operation can be performed on one CB at a time "CB-mode".
@ -677,6 +686,8 @@ struct rte_bbdev_op_turbo_enc {
* The output mbuf data structure is expected to be allocated by the * The output mbuf data structure is expected to be allocated by the
* application with enough room for the output data. * application with enough room for the output data.
*/ */
/* Structure rte_bbdev_op_ldpc_enc 8< */
struct rte_bbdev_op_ldpc_enc { struct rte_bbdev_op_ldpc_enc {
/** The input TB or CB data */ /** The input TB or CB data */
struct rte_bbdev_op_data input; struct rte_bbdev_op_data input;
@ -717,6 +728,7 @@ struct rte_bbdev_op_ldpc_enc {
struct rte_bbdev_op_enc_ldpc_tb_params tb_params; struct rte_bbdev_op_enc_ldpc_tb_params tb_params;
}; };
}; };
/* >8 End of structure rte_bbdev_op_ldpc_enc. */
/** Operation structure for FFT processing. /** Operation structure for FFT processing.
* *
@ -726,6 +738,8 @@ struct rte_bbdev_op_ldpc_enc {
* The output mbuf data structure is expected to be allocated by the * The output mbuf data structure is expected to be allocated by the
* application with enough room for the output data. * application with enough room for the output data.
*/ */
/* Structure rte_bbdev_op_fft 8< */
struct rte_bbdev_op_fft { struct rte_bbdev_op_fft {
/** Input data starting from first antenna. */ /** Input data starting from first antenna. */
struct rte_bbdev_op_data base_input; struct rte_bbdev_op_data base_input;
@ -766,6 +780,7 @@ struct rte_bbdev_op_fft {
/** Adjust the FP6 exponent for INT<->FP16 conversion. */ /** Adjust the FP6 exponent for INT<->FP16 conversion. */
uint16_t fp16_exp_adjust; uint16_t fp16_exp_adjust;
}; };
/* >8 End of structure rte_bbdev_op_fft. */
/** List of the capabilities for the Turbo Decoder */ /** List of the capabilities for the Turbo Decoder */
struct rte_bbdev_op_cap_turbo_dec { struct rte_bbdev_op_cap_turbo_dec {