BBDEV: add LDPC op parameters and flags to support CBGT
PATCH v2 1/1 BBDEV: add LDPC op parameters and flags to support CBGT
This commit adds support to BBDEV for LDPC Code Block Group Transmission (CBGT) as defined in 3GPP TS 38.214. The following changes facilitate this:
- add RTE_BBDEV_LDPC_[ENC/DEC]_CBGT feature flag
- add CBGT input parameters to LDPC encode transport block op structure
- add CBGT input and output parameters to LDPC decode transport block op
- add support for reading these parameters from test vector files
- add sanity tests for RTE_BBDEV_LDPC_[ENC/DEC]_CBGT flag in test vector read
- update user guide with the flags and parameters
CBGT parameters are only required when the RTE_BBDEV_LDPC_[ENC/DEC]_CBGT op flag is specified.
Reported-by Rob Maunder <[email protected]>
Signed-off-by Aidan Goddard <[email protected]>
Acked-by Dave Burley <[email protected]>
--- app/test-bbdev/test_bbdev_vector.c | 46 +++++++++++++++++++--- app/test-bbdev/test_bbdev_vector.h | 3 ++ doc/guides/prog_guide/bbdev.rst | 29 ++++++++++++++ lib/librte_bbdev/rte_bbdev_op.h | 80 +++++++++++++++++++++++++++++++++++++- 4 files changed, 151 insertions(+), 7 deletions(-)
app/test-bbdev/test_bbdev_vector.c +41 -5
@@ -200,6 +200,8 @@else if (!strcmp (token,"RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK" )) *op_flag_value =RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK ; +else if (!strcmp (token,"RTE_BBDEV_LDPC_DEC_CBGT" )) + *op_flag_value =RTE_BBDEV_LDPC_DEC_CBGT ;else {printf ("The given value is not a LDPC decoder flag\n" );return -1 ;
@@ -248,8 +250,10 @@ *op_flag_value =RTE_BBDEV_LDPC_ENC_INTERRUPTS ; else if (!strcmp(token, "RTE_BBDEV_LDPC_ENC_SCATTER_GATHER")) *op_flag_value =RTE_BBDEV_LDPC_ENC_SCATTER_GATHER ; + else if (!strcmp(token, "RTE_BBDEV_LDPC_ENC_CBGT")) + *op_flag_value =RTE_BBDEV_LDPC_ENC_CBGT ; else { -printf ("The given value is not a turbo encoder flag\n" ); +printf ("The given value is not a LDPC encoder flag\n" );return -1 ; }
@@ -718,6 +722,14 @@ vector->mask |=TEST_BBDEV_VF_CODE_BLOCK_MODE ; ldpc_enc->code_block_mode = (uint8_t )strtoul (token, &err,0 ); ret = ((err ==NULL ) || (*err !='\0' )) ?-1 :0 ; + }else if (!strcmp (key_token,"max_cbg" )) { + vector->mask |=TEST_BBDEV_VF_MAX_CBG_PER_TB ; + ldpc_enc->tb_params.max_cbg = (uint8_t )strtoul (token, &err,0 ); + ret = ((err ==NULL ) || (*err !='\0' )) ?-1 :0 ; + }else if (!strcmp (key_token,"cbgti" )) { + vector->mask |=TEST_BBDEV_VF_CBGTI ; + ldpc_enc->tb_params.cbgti = (uint8_t )strtoul (token, &err,0 ); + ret = ((err ==NULL ) || (*err !='\0' )) ?-1 :0 ; }else if (!strcmp (key_token,"op_flags" )) { vector->mask |=TEST_BBDEV_VF_OP_FLAGS ; ret =parse_turbo_flags (token, &op_flags, vector->op_type);
@@ -828,6 +840,18 @@ vector->mask |=TEST_BBDEV_VF_CODE_BLOCK_MODE ; ldpc_dec->code_block_mode = (uint8_t )strtoul (token, &err,0 ); ret = ((err ==NULL ) || (*err !='\0' )) ?-1 :0 ; + }else if (!strcmp (key_token,"max_cbg" )) { + vector->mask |=TEST_BBDEV_VF_MAX_CBG_PER_TB ; + ldpc_dec->tb_params.max_cbg = (uint8_t )strtoul (token, &err,0 ); + ret = ((err ==NULL ) || (*err !='\0' )) ?-1 :0 ; + }else if (!strcmp (key_token,"cbgti" )) { + vector->mask |=TEST_BBDEV_VF_CBGTI ; + ldpc_dec->tb_params.cbgti = (uint8_t )strtoul (token, &err,0 ); + ret = ((err ==NULL ) || (*err !='\0' )) ?-1 :0 ; + }else if (!strcmp (key_token,"cbgfi" )) { + vector->mask |=TEST_BBDEV_VF_CBGFI ; + ldpc_dec->tb_params.cbgfi = (uint8_t )strtoul (token, &err,0 ); + ret = ((err ==NULL ) || (*err !='\0' )) ?-1 :0 ; }else if (!strcmp (key_token,"op_flags" )) { vector->mask |=TEST_BBDEV_VF_OP_FLAGS ; ret =parse_turbo_flags (token, &op_flags, vector->op_type);
@@ -1162,6 +1186,12 @@if (!(mask &TEST_BBDEV_VF_R ))printf ("WARNING: r was not specified in vector file and will be set to 0\n" ); +if (!(mask &TEST_BBDEV_VF_MAX_CBG_PER_TB ) && (ldpc_dec->op_flags & +RTE_BBDEV_LDPC_DEC_CBGT )) { +printf ( +"WARNING: max_cbg was not specified in vector file and will be set to 1\n" ); + ldpc_dec->tb_params.max_cbg =1 ; + } }else {if (!(mask &TEST_BBDEV_VF_E )) printf(
@@ -1298,12 +1328,18 @@if (!(mask &TEST_BBDEV_VF_CODE_BLOCK_MODE )) {printf ("WARNING: code_block_mode was not specified in vector file and will be set to 1\n" ); - vector->turbo_enc.code_block_mode =1 ; + vector->ldpc_enc.code_block_mode =1 ; } -if (vector->turbo_enc.code_block_mode ==0 ) { +if (vector->ldpc_enc.code_block_mode ==0 ) { +if (!(mask &TEST_BBDEV_VF_MAX_CBG_PER_TB ) && (vector->ldpc_enc.op_flags & +RTE_BBDEV_LDPC_ENC_CBGT )) { +printf ( +"WARNING: max_cbg was not specified in vector file and will be set to 1\n" ); + vector->ldpc_enc.tb_params.max_cbg =1 ; + } }else { -if (!(mask &TEST_BBDEV_VF_E ) && (vector->turbo_enc.op_flags & -RTE_BBDEV_TURBO_RATE_MATCH )) +if (!(mask &TEST_BBDEV_VF_E ) && (vector->ldpc_enc.op_flags & +RTE_BBDEV_LDPC_RATE_MATCH ))printf ("WARNING: e was not specified in vector file and will be set to 0\n" );if (!(mask &TEST_BBDEV_VF_NCB ))
app/test-bbdev/test_bbdev_vector.h +3 -0
@@ -35,6 +35,9 @@ enum {TEST_BBDEV_VF_CODE_BLOCK_MODE = (1ULL <<23 ),TEST_BBDEV_VF_OP_FLAGS = (1ULL <<24 ),TEST_BBDEV_VF_EXPECTED_STATUS = (1ULL <<25 ), +TEST_BBDEV_VF_MAX_CBG_PER_TB = (1ULL <<26 ), +TEST_BBDEV_VF_CBGTI = (1ULL <<27 ), + TEST_BBDEV_VF_CBGFI = (1ULL << 28), }; enum op_data_type {
doc/guides/prog_guide/bbdev.rst +29 -0
@@ -747,6 +747,9 @@ given below. |RTE_BBDEV_LDPC_ENC_CONCATENATION | | Set if a device supports concatenation of non byte aligned output | +--------------------------------------------------------------------+ +|RTE_BBDEV_LDPC_ENC_CBGT | +| Set if a device supports CB group transmission | ++--------------------------------------------------------------------+ The structure passed for each LDPC encode operation is given below, with the operation flags forming a bitmask in the ``op_flags`` field.
@@ -815,6 +818,10 @@ The LDPC encode parameters are set out in the table below. +----------------+------------+-------------------------------------------------------+ | |eb |Eb, length of the RM output sequence in bits, r >= cab | +----------------+------------+-------------------------------------------------------+ +| |max_cbg |maximum number of CB groups per TB: 1-8 | ++----------------+------------+-------------------------------------------------------+ +| |cbgti |CB group transmission information bitfield | ++----------------+------------+-------------------------------------------------------+ The mbuf input ``input`` is mandatory for all BBDEV PMDs and is the incoming code block or transport block data.
@@ -869,6 +876,11 @@ Figure :numref:`figure_turbo_tb_encode` above showing the Turbo encoding of CBs using BBDEV interface in TB-mode is also valid for LDPC encode. +In TB-mode, If the ``RTE_BBDEV_LDPC_ENC_CBGT`` flag is specified the +``max_cbg`` and ``cbgti`` parameters are used for CB group transmission. If +the ``RTE_BBDEV_LDPC_ENC_CBGT`` flag is not specified, these parameters +are ignored. + BBDEV LDPC Decode Operation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -942,6 +954,9 @@ given below. |RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK | | Set if a device supports loopback access to HARQ internal memory | +--------------------------------------------------------------------+ +|RTE_BBDEV_LDPC_DEC_CBGT | +| Set if a device supports CB group transmission | ++--------------------------------------------------------------------+ The structure passed for each LDPC decode operation is given below, with the operation flags forming a bitmask in the ``op_flags`` field.
@@ -1027,6 +1042,14 @@ The LDPC decode parameters are set out in the table below. +----------------+------------+-------------------------------------------------------+ | |eb |Eb, length of the RM output sequence in bits r >= cab | +----------------+------------+-------------------------------------------------------+ +| |max_cbg |maximum number of CB groups per TB: 1-8 | ++----------------+------------+-------------------------------------------------------+ +| |cbgti |CB group transmission information bitfield | ++----------------+------------+-------------------------------------------------------+ +| |cbgfi |CB group Flushing out Information (CBGFI) | ++----------------+------------+-------------------------------------------------------+ +| |cbg_crc_err |CB group CRC failure bitfield (output) | ++----------------+------------+-------------------------------------------------------+ The mbuf input ``input`` encoded CB data is mandatory for all BBDEV PMDs and is the Virtual Circular Buffer data stream with null padding.
@@ -1084,6 +1107,12 @@ Figure :numref:`figure_turbo_tb_decode` above showing the Turbo decoding of CBs using BBDEV interface in TB-mode is also valid for LDPC decode. +In TB-mode, If the ``RTE_BBDEV_LDPC_DEC_CBGT`` flag is specified the +``max_cbg`` and ``cbgti`` parameters are used for CB group transmission. The +``cbg_crc_err`` output parameter is a bitfield used to indicate crc failures +in the respective CB groups. If the ``RTE_BBDEV_LDPC_DEC_CBGT`` flag is not +specified, these parameters are ignored. + Sample code -----------
lib/librte_bbdev/rte_bbdev_op.h +78 -2
104 lines not on this page · raw message
Signature · 1 line
1.8.3.1