DPDK 21.11.9
rte_bbdev_op.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2017 Intel Corporation
3 */
4
5#ifndef _RTE_BBDEV_OP_H_
6#define _RTE_BBDEV_OP_H_
7
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#include <stdint.h>
19
20#include <rte_common.h>
21#include <rte_mbuf.h>
22#include <rte_memory.h>
23#include <rte_mempool.h>
24
25/* Number of columns in sub-block interleaver (36.212, section 5.1.4.1.1) */
26#define RTE_BBDEV_TURBO_C_SUBBLOCK (32)
27/* Maximum size of Transport Block (36.213, Table, Table 7.1.7.2.5-1) */
28#define RTE_BBDEV_TURBO_MAX_TB_SIZE (391656)
29/* Maximum size of Code Block (36.212, Table 5.1.3-3) */
30#define RTE_BBDEV_TURBO_MAX_CB_SIZE (6144)
31/* Maximum size of Code Block */
32#define RTE_BBDEV_LDPC_MAX_CB_SIZE (8448)
33/* Minimum size of Code Block */
34#define RTE_BBDEV_LDPC_MIN_CB_SIZE (40)
35/* Maximum E size we can manage with default mbuf */
36#define RTE_BBDEV_LDPC_E_MAX_MBUF (64000)
37/* Minimum size of Code Block (36.212, Table 5.1.3-3) */
38#define RTE_BBDEV_TURBO_MIN_CB_SIZE (40)
39/* Maximum size of circular buffer */
40#define RTE_BBDEV_TURBO_MAX_KW (18528)
41/*
42 * Turbo: Maximum number of Code Blocks in Transport Block. It is calculated
43 * based on maximum size of one Code Block and one Transport Block
44 * (considering CRC24A and CRC24B):
45 * (391656 + 24) / (6144 - 24) = 64
46 */
47#define RTE_BBDEV_TURBO_MAX_CODE_BLOCKS (64)
48/* LDPC: Maximum number of Code Blocks in Transport Block.*/
49#define RTE_BBDEV_LDPC_MAX_CODE_BLOCKS (256)
50
119
120
136
193
213
220};
221
253 struct rte_mbuf *data;
261 uint32_t offset;
274 uint32_t length;
275};
276
284 uint16_t k;
288 uint32_t e;
289};
290
296 uint32_t e;
297};
298
304 uint16_t k_neg;
308 uint16_t k_pos;
310 uint8_t c_neg;
314 uint8_t c;
316 uint8_t cab;
320 uint32_t ea;
324 uint32_t eb;
326 uint8_t r;
327};
328
334 uint32_t ea;
338 uint32_t eb;
342 uint8_t c;
344 uint8_t r;
346 uint8_t cab;
347};
348
386
388 uint32_t op_flags;
389
391 uint8_t rv_index;
395 uint8_t iter_min:4;
399 uint8_t iter_max:4;
403 uint8_t iter_count;
405 uint8_t ext_scale;
409 uint8_t num_maps;
410
413 union {
418 };
419};
420
465
467 uint32_t op_flags;
468
472 uint8_t rv_index;
476 uint8_t iter_max;
480 uint8_t iter_count;
484 uint8_t basegraph;
488 uint16_t z_c;
492 uint16_t n_cb;
496 uint8_t q_m;
500 uint16_t n_filler;
503 union {
508 };
509};
510
518 uint16_t k;
522 uint32_t e;
526 uint16_t ncb;
527};
528
536 uint16_t k_neg;
542 uint16_t k_pos;
544 uint8_t c_neg;
548 uint8_t c;
550 uint8_t cab;
554 uint32_t ea;
558 uint32_t eb;
562 uint16_t ncb_neg;
566 uint16_t ncb_pos;
568 uint8_t r;
569};
570
576 uint32_t e;
577};
578
584 uint32_t ea;
588 uint32_t eb;
592 uint8_t c;
594 uint8_t r;
596 uint8_t cab;
597};
598
624 uint32_t op_flags;
625
627 uint8_t rv_index;
630 union {
635 };
636};
637
656
658 uint32_t op_flags;
659
661 uint8_t rv_index;
665 uint8_t basegraph;
669 uint16_t z_c;
673 uint16_t n_cb;
677 uint8_t q_m;
681 uint16_t n_filler;
684 union {
689 };
690};
691
706};
707
716};
717
723 int8_t llr_size;
732};
733
742};
743
752};
753
755enum {
756 RTE_BBDEV_DRV_ERROR,
757 RTE_BBDEV_DATA_ERROR,
758 RTE_BBDEV_CRC_ERROR,
759 RTE_BBDEV_SYNDROME_ERROR
760};
761
770 union {
775 };
776};
777
786 union {
791 };
792};
793
797 union {
798 struct rte_bbdev_op_cap_turbo_dec turbo_dec;
799 struct rte_bbdev_op_cap_turbo_enc turbo_enc;
800 struct rte_bbdev_op_cap_ldpc_dec ldpc_dec;
801 struct rte_bbdev_op_cap_ldpc_enc ldpc_enc;
802 } cap;
803};
804
806struct rte_bbdev_op_pool_private {
807 enum rte_bbdev_op_type type;
808};
809
820const char*
822
843struct rte_mempool *
845 unsigned int num_elements, unsigned int cache_size,
846 int socket_id);
847
862static inline int
864 struct rte_bbdev_enc_op **ops, uint16_t num_ops)
865{
866 struct rte_bbdev_op_pool_private *priv;
867 int ret;
868
869 /* Check type */
870 priv = (struct rte_bbdev_op_pool_private *)
871 rte_mempool_get_priv(mempool);
872 if (unlikely((priv->type != RTE_BBDEV_OP_TURBO_ENC) &&
873 (priv->type != RTE_BBDEV_OP_LDPC_ENC)))
874 return -EINVAL;
875
876 /* Get elements */
877 ret = rte_mempool_get_bulk(mempool, (void **)ops, num_ops);
878 if (unlikely(ret < 0))
879 return ret;
880
881 return 0;
882}
883
898static inline int
900 struct rte_bbdev_dec_op **ops, uint16_t num_ops)
901{
902 struct rte_bbdev_op_pool_private *priv;
903 int ret;
904
905 /* Check type */
906 priv = (struct rte_bbdev_op_pool_private *)
907 rte_mempool_get_priv(mempool);
908 if (unlikely((priv->type != RTE_BBDEV_OP_TURBO_DEC) &&
909 (priv->type != RTE_BBDEV_OP_LDPC_DEC)))
910 return -EINVAL;
911
912 /* Get elements */
913 ret = rte_mempool_get_bulk(mempool, (void **)ops, num_ops);
914 if (unlikely(ret < 0))
915 return ret;
916
917 return 0;
918}
919
930static inline void
931rte_bbdev_dec_op_free_bulk(struct rte_bbdev_dec_op **ops, unsigned int num_ops)
932{
933 if (num_ops > 0)
934 rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops);
935}
936
947static inline void
948rte_bbdev_enc_op_free_bulk(struct rte_bbdev_enc_op **ops, unsigned int num_ops)
949{
950 if (num_ops > 0)
951 rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops);
952}
953
954#ifdef __cplusplus
955}
956#endif
957
958#endif /* _RTE_BBDEV_OP_H_ */
static int rte_bbdev_enc_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_enc_op **ops, uint16_t num_ops)
Definition: rte_bbdev_op.h:863
static int rte_bbdev_dec_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_dec_op **ops, uint16_t num_ops)
Definition: rte_bbdev_op.h:899
rte_bbdev_op_ldpcenc_flag_bitmasks
Definition: rte_bbdev_op.h:195
@ RTE_BBDEV_LDPC_CRC_16_ATTACH
Definition: rte_bbdev_op.h:205
@ RTE_BBDEV_LDPC_ENC_CONCATENATION
Definition: rte_bbdev_op.h:211
@ RTE_BBDEV_LDPC_INTERLEAVER_BYPASS
Definition: rte_bbdev_op.h:197
@ RTE_BBDEV_LDPC_CRC_24B_ATTACH
Definition: rte_bbdev_op.h:203
@ RTE_BBDEV_LDPC_ENC_SCATTER_GATHER
Definition: rte_bbdev_op.h:209
@ RTE_BBDEV_LDPC_CRC_24A_ATTACH
Definition: rte_bbdev_op.h:201
@ RTE_BBDEV_LDPC_RATE_MATCH
Definition: rte_bbdev_op.h:199
@ RTE_BBDEV_LDPC_ENC_INTERRUPTS
Definition: rte_bbdev_op.h:207
rte_bbdev_op_type
Definition: rte_bbdev_op.h:745
@ RTE_BBDEV_OP_TYPE_COUNT
Definition: rte_bbdev_op.h:751
@ RTE_BBDEV_OP_TURBO_DEC
Definition: rte_bbdev_op.h:747
@ RTE_BBDEV_OP_LDPC_DEC
Definition: rte_bbdev_op.h:749
@ RTE_BBDEV_OP_TURBO_ENC
Definition: rte_bbdev_op.h:748
@ RTE_BBDEV_OP_NONE
Definition: rte_bbdev_op.h:746
@ RTE_BBDEV_OP_LDPC_ENC
Definition: rte_bbdev_op.h:750
struct rte_mempool * rte_bbdev_op_pool_create(const char *name, enum rte_bbdev_op_type type, unsigned int num_elements, unsigned int cache_size, int socket_id)
rte_bbdev_op_td_flag_bitmasks
Definition: rte_bbdev_op.h:52
@ RTE_BBDEV_TURBO_DEC_SCATTER_GATHER
Definition: rte_bbdev_op.h:110
@ RTE_BBDEV_TURBO_HALF_ITERATION_EVEN
Definition: rte_bbdev_op.h:64
@ RTE_BBDEV_TURBO_CONTINUE_CRC_MATCH
Definition: rte_bbdev_op.h:68
@ RTE_BBDEV_TURBO_DEC_INTERRUPTS
Definition: rte_bbdev_op.h:74
@ RTE_BBDEV_TURBO_DEC_CRC_24B_DROP
Definition: rte_bbdev_op.h:117
@ RTE_BBDEV_TURBO_MAP_DEC
Definition: rte_bbdev_op.h:108
@ RTE_BBDEV_TURBO_POS_LLR_1_BIT_SOFT_OUT
Definition: rte_bbdev_op.h:96
@ RTE_BBDEV_TURBO_SUBBLOCK_DEINTERLEAVE
Definition: rte_bbdev_op.h:54
@ RTE_BBDEV_TURBO_CRC_TYPE_24B
Definition: rte_bbdev_op.h:56
@ RTE_BBDEV_TURBO_SOFT_OUTPUT
Definition: rte_bbdev_op.h:70
@ RTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT
Definition: rte_bbdev_op.h:104
@ RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP
Definition: rte_bbdev_op.h:114
@ RTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN
Definition: rte_bbdev_op.h:88
@ RTE_BBDEV_TURBO_EQUALIZER
Definition: rte_bbdev_op.h:58
@ RTE_BBDEV_TURBO_POS_LLR_1_BIT_IN
Definition: rte_bbdev_op.h:81
@ RTE_BBDEV_TURBO_SOFT_OUT_SATURATE
Definition: rte_bbdev_op.h:60
@ RTE_BBDEV_TURBO_EARLY_TERMINATION
Definition: rte_bbdev_op.h:72
rte_bbdev_op_ldpcdec_flag_bitmasks
Definition: rte_bbdev_op.h:138
@ RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK
Definition: rte_bbdev_op.h:140
@ RTE_BBDEV_LDPC_LLR_COMPRESSION
Definition: rte_bbdev_op.h:174
@ RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS
Definition: rte_bbdev_op.h:148
@ RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE
Definition: rte_bbdev_op.h:152
@ RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS
Definition: rte_bbdev_op.h:162
@ RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE
Definition: rte_bbdev_op.h:166
@ RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS
Definition: rte_bbdev_op.h:160
@ RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE
Definition: rte_bbdev_op.h:178
@ RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK
Definition: rte_bbdev_op.h:186
@ RTE_BBDEV_LDPC_DEC_INTERRUPTS
Definition: rte_bbdev_op.h:168
@ RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK
Definition: rte_bbdev_op.h:146
@ RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE
Definition: rte_bbdev_op.h:182
@ RTE_BBDEV_LDPC_DEC_SCATTER_GATHER
Definition: rte_bbdev_op.h:170
@ RTE_BBDEV_LDPC_SOFT_OUT_ENABLE
Definition: rte_bbdev_op.h:158
@ RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION
Definition: rte_bbdev_op.h:172
@ RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE
Definition: rte_bbdev_op.h:150
@ RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS
Definition: rte_bbdev_op.h:191
@ RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK
Definition: rte_bbdev_op.h:142
@ RTE_BBDEV_LDPC_DECODE_BYPASS
Definition: rte_bbdev_op.h:156
@ RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP
Definition: rte_bbdev_op.h:144
rte_bbdev_op_te_flag_bitmasks
Definition: rte_bbdev_op.h:122
@ RTE_BBDEV_TURBO_CRC_24B_ATTACH
Definition: rte_bbdev_op.h:128
@ RTE_BBDEV_TURBO_RATE_MATCH
Definition: rte_bbdev_op.h:126
@ RTE_BBDEV_TURBO_ENC_SCATTER_GATHER
Definition: rte_bbdev_op.h:134
@ RTE_BBDEV_TURBO_ENC_INTERRUPTS
Definition: rte_bbdev_op.h:132
@ RTE_BBDEV_TURBO_CRC_24A_ATTACH
Definition: rte_bbdev_op.h:130
@ RTE_BBDEV_TURBO_RV_INDEX_BYPASS
Definition: rte_bbdev_op.h:124
static void rte_bbdev_enc_op_free_bulk(struct rte_bbdev_enc_op **ops, unsigned int num_ops)
Definition: rte_bbdev_op.h:948
rte_bbdev_op_cb_mode
Definition: rte_bbdev_op.h:215
@ RTE_BBDEV_CODE_BLOCK
Definition: rte_bbdev_op.h:219
@ RTE_BBDEV_TRANSPORT_BLOCK
Definition: rte_bbdev_op.h:217
const char * rte_bbdev_op_type_str(enum rte_bbdev_op_type op_type)
static void rte_bbdev_dec_op_free_bulk(struct rte_bbdev_dec_op **ops, unsigned int num_ops)
Definition: rte_bbdev_op.h:931
#define unlikely(x)
static __rte_always_inline int rte_mempool_get_bulk(struct rte_mempool *mp, void **obj_table, unsigned int n)
Definition: rte_mempool.h:1580
static __rte_always_inline void rte_mempool_put_bulk(struct rte_mempool *mp, void *const *obj_table, unsigned int n)
Definition: rte_mempool.h:1422
static void * rte_mempool_get_priv(struct rte_mempool *mp)
Definition: rte_mempool.h:1762
struct rte_bbdev_op_ldpc_dec ldpc_dec
Definition: rte_bbdev_op.h:790
struct rte_mempool * mempool
Definition: rte_bbdev_op.h:783
struct rte_bbdev_op_turbo_dec turbo_dec
Definition: rte_bbdev_op.h:788
struct rte_bbdev_op_ldpc_enc ldpc_enc
Definition: rte_bbdev_op.h:774
struct rte_mempool * mempool
Definition: rte_bbdev_op.h:767
struct rte_bbdev_op_turbo_enc turbo_enc
Definition: rte_bbdev_op.h:772
union rte_bbdev_op_cap::@73 cap
enum rte_bbdev_op_type type
Definition: rte_bbdev_op.h:796
struct rte_mbuf * data
Definition: rte_bbdev_op.h:253
struct rte_bbdev_op_data soft_output
Definition: rte_bbdev_op.h:460
struct rte_bbdev_op_data harq_combined_output
Definition: rte_bbdev_op.h:464
struct rte_bbdev_op_dec_ldpc_tb_params tb_params
Definition: rte_bbdev_op.h:507
struct rte_bbdev_op_data harq_combined_input
Definition: rte_bbdev_op.h:462
struct rte_bbdev_op_data hard_output
Definition: rte_bbdev_op.h:458
struct rte_bbdev_op_data input
Definition: rte_bbdev_op.h:454
struct rte_bbdev_op_dec_ldpc_cb_params cb_params
Definition: rte_bbdev_op.h:505
struct rte_bbdev_op_enc_ldpc_tb_params tb_params
Definition: rte_bbdev_op.h:688
struct rte_bbdev_op_data output
Definition: rte_bbdev_op.h:655
struct rte_bbdev_op_data input
Definition: rte_bbdev_op.h:653
struct rte_bbdev_op_enc_ldpc_cb_params cb_params
Definition: rte_bbdev_op.h:686
struct rte_bbdev_op_data soft_output
Definition: rte_bbdev_op.h:385
struct rte_bbdev_op_dec_turbo_tb_params tb_params
Definition: rte_bbdev_op.h:417
struct rte_bbdev_op_dec_turbo_cb_params cb_params
Definition: rte_bbdev_op.h:415
struct rte_bbdev_op_data hard_output
Definition: rte_bbdev_op.h:383
struct rte_bbdev_op_data input
Definition: rte_bbdev_op.h:379
struct rte_bbdev_op_data output
Definition: rte_bbdev_op.h:622
struct rte_bbdev_op_enc_turbo_tb_params tb_params
Definition: rte_bbdev_op.h:634
struct rte_bbdev_op_data input
Definition: rte_bbdev_op.h:620
struct rte_bbdev_op_enc_turbo_cb_params cb_params
Definition: rte_bbdev_op.h:632
char name[RTE_MEMPOOL_NAMESIZE]
Definition: rte_mempool.h:213
uint32_t cache_size
Definition: rte_mempool.h:224