DPDK 22.11.5
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_compat.h>
21#include <rte_common.h>
22#include <rte_mbuf.h>
23#include <rte_memory.h>
24#include <rte_mempool.h>
25
26/* Number of columns in sub-block interleaver (36.212, section 5.1.4.1.1) */
27#define RTE_BBDEV_TURBO_C_SUBBLOCK (32)
28/* Maximum size of Transport Block (36.213, Table, Table 7.1.7.2.5-1) */
29#define RTE_BBDEV_TURBO_MAX_TB_SIZE (391656)
30/* Maximum size of Code Block (36.212, Table 5.1.3-3) */
31#define RTE_BBDEV_TURBO_MAX_CB_SIZE (6144)
32/* Maximum size of Code Block */
33#define RTE_BBDEV_LDPC_MAX_CB_SIZE (8448)
34/* Minimum size of Code Block */
35#define RTE_BBDEV_LDPC_MIN_CB_SIZE (40)
36/* Maximum E size we can manage with default mbuf */
37#define RTE_BBDEV_LDPC_E_MAX_MBUF (64000)
38/* Minimum size of Code Block (36.212, Table 5.1.3-3) */
39#define RTE_BBDEV_TURBO_MIN_CB_SIZE (40)
40/* Maximum size of circular buffer */
41#define RTE_BBDEV_TURBO_MAX_KW (18528)
42/*
43 * Turbo: Maximum number of Code Blocks in Transport Block. It is calculated
44 * based on maximum size of one Code Block and one Transport Block
45 * (considering CRC24A and CRC24B):
46 * (391656 + 24) / (6144 - 24) = 64
47 */
48#define RTE_BBDEV_TURBO_MAX_CODE_BLOCKS (64)
49/* LDPC: Maximum number of Code Blocks in Transport Block.*/
50#define RTE_BBDEV_LDPC_MAX_CODE_BLOCKS (256)
51/* 12 CS maximum */
52#define RTE_BBDEV_MAX_CS_2 (6)
53
54/*
55 * Maximum size to be used to manage the enum rte_bbdev_op_type
56 * including padding for future enum insertion.
57 * The enum values must be explicitly kept smaller or equal to this padded maximum size.
58 */
59#define RTE_BBDEV_OP_TYPE_SIZE_MAX 8
60
129
130
146
203
223
241 RTE_BBDEV_FFT_FP16_OUTPUT = (1ULL << 7)
243
250};
251
283 struct rte_mbuf *data;
291 uint32_t offset;
304 uint32_t length;
305};
306
314 uint16_t k;
318 uint32_t e;
319};
320
326 uint32_t e;
327};
328
334 uint16_t k_neg;
338 uint16_t k_pos;
340 uint8_t c_neg;
344 uint8_t c;
346 uint8_t cab;
350 uint32_t ea;
354 uint32_t eb;
356 uint8_t r;
357};
358
364 uint32_t ea;
368 uint32_t eb;
372 uint8_t c;
374 uint8_t r;
376 uint8_t cab;
377};
378
408/* Structure rte_bbdev_op_turbo_dec 8< */
418
420 uint32_t op_flags;
421
423 uint8_t rv_index;
427 uint8_t iter_min:4;
431 uint8_t iter_max:4;
435 uint8_t iter_count;
437 uint8_t ext_scale;
441 uint8_t num_maps;
442
445 union {
450 };
451};
452/* >8 End of structure rte_bbdev_op_turbo_dec. */
453
484/* Structure rte_bbdev_op_ldpc_dec 8< */
500
502 uint32_t op_flags;
503
507 uint8_t rv_index;
511 uint8_t iter_max;
515 uint8_t iter_count;
519 uint8_t basegraph;
523 uint16_t z_c;
527 uint16_t n_cb;
531 uint8_t q_m;
535 uint16_t n_filler;
538 union {
543 };
544};
545/* >8 End of structure rte_bbdev_op_ldpc_dec. */
546
554 uint16_t k;
558 uint32_t e;
562 uint16_t ncb;
563};
564
572 uint16_t k_neg;
578 uint16_t k_pos;
580 uint8_t c_neg;
584 uint8_t c;
586 uint8_t cab;
590 uint32_t ea;
594 uint32_t eb;
598 uint16_t ncb_neg;
602 uint16_t ncb_pos;
604 uint8_t r;
605};
606
612 uint32_t e;
613};
614
620 uint32_t ea;
624 uint32_t eb;
628 uint8_t c;
630 uint8_t r;
632 uint8_t cab;
633};
634
655/* Structure rte_bbdev_op_turbo_enc 8< */
662 uint32_t op_flags;
663
665 uint8_t rv_index;
668 union {
673 };
674};
675/* >8 End of structure rte_bbdev_op_turbo_enc. */
676
691/* Structure rte_bbdev_op_ldpc_enc 8< */
697
699 uint32_t op_flags;
700
702 uint8_t rv_index;
706 uint8_t basegraph;
710 uint16_t z_c;
714 uint16_t n_cb;
718 uint8_t q_m;
722 uint16_t n_filler;
725 union {
730 };
731};
732/* >8 End of structure rte_bbdev_op_ldpc_enc. */
733
743/* Structure rte_bbdev_op_fft 8< */
752 uint32_t op_flags;
762 uint8_t window_index[RTE_BBDEV_MAX_CS_2];
764 uint16_t cs_bitmap;
768 uint8_t idft_log2;
770 uint8_t dft_log2;
776 int8_t dft_shift;
780 uint16_t power_shift;
783};
784/* >8 End of structure rte_bbdev_op_fft. */
785
800};
801
810};
811
817 int8_t llr_size;
826};
827
836};
837
846};
847
859 /* Note: RTE_BBDEV_OP_TYPE_SIZE_MAX must be larger or equal to maximum enum value */
860};
861
863enum {
864 RTE_BBDEV_DRV_ERROR,
865 RTE_BBDEV_DATA_ERROR,
866 RTE_BBDEV_CRC_ERROR,
867 RTE_BBDEV_SYNDROME_ERROR
868};
869
878 union {
883 };
884};
885
894 union {
899 };
900};
901
912};
913
917 union {
918 struct rte_bbdev_op_cap_turbo_dec turbo_dec;
919 struct rte_bbdev_op_cap_turbo_enc turbo_enc;
920 struct rte_bbdev_op_cap_ldpc_dec ldpc_dec;
921 struct rte_bbdev_op_cap_ldpc_enc ldpc_enc;
922 struct rte_bbdev_op_cap_fft fft;
923 } cap;
924};
925
927struct rte_bbdev_op_pool_private {
928 enum rte_bbdev_op_type type;
929};
930
941const char*
943
964struct rte_mempool *
966 unsigned int num_elements, unsigned int cache_size,
967 int socket_id);
968
983static inline int
985 struct rte_bbdev_enc_op **ops, uint16_t num_ops)
986{
987 struct rte_bbdev_op_pool_private *priv;
988
989 /* Check type */
990 priv = (struct rte_bbdev_op_pool_private *)
991 rte_mempool_get_priv(mempool);
992 if (unlikely((priv->type != RTE_BBDEV_OP_TURBO_ENC) &&
993 (priv->type != RTE_BBDEV_OP_LDPC_ENC)))
994 return -EINVAL;
995
996 /* Get elements */
997 return rte_mempool_get_bulk(mempool, (void **)ops, num_ops);
998}
999
1014static inline int
1016 struct rte_bbdev_dec_op **ops, uint16_t num_ops)
1017{
1018 struct rte_bbdev_op_pool_private *priv;
1019
1020 /* Check type */
1021 priv = (struct rte_bbdev_op_pool_private *)
1022 rte_mempool_get_priv(mempool);
1023 if (unlikely((priv->type != RTE_BBDEV_OP_TURBO_DEC) &&
1024 (priv->type != RTE_BBDEV_OP_LDPC_DEC)))
1025 return -EINVAL;
1026
1027 /* Get elements */
1028 return rte_mempool_get_bulk(mempool, (void **)ops, num_ops);
1029}
1030
1045__rte_experimental
1046static inline int
1048 struct rte_bbdev_fft_op **ops, uint16_t num_ops)
1049{
1050 struct rte_bbdev_op_pool_private *priv;
1051
1052 /* Check type */
1053 priv = (struct rte_bbdev_op_pool_private *)rte_mempool_get_priv(mempool);
1054 if (unlikely(priv->type != RTE_BBDEV_OP_FFT))
1055 return -EINVAL;
1056
1057 /* Get elements */
1058 return rte_mempool_get_bulk(mempool, (void **)ops, num_ops);
1059}
1060
1071static inline void
1072rte_bbdev_dec_op_free_bulk(struct rte_bbdev_dec_op **ops, unsigned int num_ops)
1073{
1074 if (num_ops > 0)
1075 rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops);
1076}
1077
1088static inline void
1089rte_bbdev_enc_op_free_bulk(struct rte_bbdev_enc_op **ops, unsigned int num_ops)
1090{
1091 if (num_ops > 0)
1092 rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops);
1093}
1094
1105__rte_experimental
1106static inline void
1107rte_bbdev_fft_op_free_bulk(struct rte_bbdev_fft_op **ops, unsigned int num_ops)
1108{
1109 if (num_ops > 0)
1110 rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops);
1111}
1112
1113#ifdef __cplusplus
1114}
1115#endif
1116
1117#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:984
static int rte_bbdev_dec_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_dec_op **ops, uint16_t num_ops)
rte_bbdev_op_ldpcenc_flag_bitmasks
Definition: rte_bbdev_op.h:205
@ RTE_BBDEV_LDPC_CRC_16_ATTACH
Definition: rte_bbdev_op.h:215
@ RTE_BBDEV_LDPC_ENC_CONCATENATION
Definition: rte_bbdev_op.h:221
@ RTE_BBDEV_LDPC_INTERLEAVER_BYPASS
Definition: rte_bbdev_op.h:207
@ RTE_BBDEV_LDPC_CRC_24B_ATTACH
Definition: rte_bbdev_op.h:213
@ RTE_BBDEV_LDPC_ENC_SCATTER_GATHER
Definition: rte_bbdev_op.h:219
@ RTE_BBDEV_LDPC_CRC_24A_ATTACH
Definition: rte_bbdev_op.h:211
@ RTE_BBDEV_LDPC_RATE_MATCH
Definition: rte_bbdev_op.h:209
@ RTE_BBDEV_LDPC_ENC_INTERRUPTS
Definition: rte_bbdev_op.h:217
static __rte_experimental void rte_bbdev_fft_op_free_bulk(struct rte_bbdev_fft_op **ops, unsigned int num_ops)
rte_bbdev_op_fft_flag_bitmasks
Definition: rte_bbdev_op.h:225
@ RTE_BBDEV_FFT_DFT_BYPASS
Definition: rte_bbdev_op.h:231
@ RTE_BBDEV_FFT_FP16_OUTPUT
Definition: rte_bbdev_op.h:241
@ RTE_BBDEV_FFT_IDFT_BYPASS
Definition: rte_bbdev_op.h:233
@ RTE_BBDEV_FFT_CS_ADJUSTMENT
Definition: rte_bbdev_op.h:229
@ RTE_BBDEV_FFT_FP16_INPUT
Definition: rte_bbdev_op.h:239
@ RTE_BBDEV_FFT_POWER_MEAS
Definition: rte_bbdev_op.h:237
@ RTE_BBDEV_FFT_WINDOWING_BYPASS
Definition: rte_bbdev_op.h:235
@ RTE_BBDEV_FFT_WINDOWING
Definition: rte_bbdev_op.h:227
rte_bbdev_op_type
Definition: rte_bbdev_op.h:852
@ RTE_BBDEV_OP_FFT
Definition: rte_bbdev_op.h:858
@ RTE_BBDEV_OP_TURBO_DEC
Definition: rte_bbdev_op.h:854
@ RTE_BBDEV_OP_LDPC_DEC
Definition: rte_bbdev_op.h:856
@ RTE_BBDEV_OP_TURBO_ENC
Definition: rte_bbdev_op.h:855
@ RTE_BBDEV_OP_NONE
Definition: rte_bbdev_op.h:853
@ RTE_BBDEV_OP_LDPC_ENC
Definition: rte_bbdev_op.h:857
static __rte_experimental int rte_bbdev_fft_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_fft_op **ops, uint16_t num_ops)
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:62
@ RTE_BBDEV_TURBO_DEC_SCATTER_GATHER
Definition: rte_bbdev_op.h:120
@ RTE_BBDEV_TURBO_HALF_ITERATION_EVEN
Definition: rte_bbdev_op.h:74
@ RTE_BBDEV_TURBO_CONTINUE_CRC_MATCH
Definition: rte_bbdev_op.h:78
@ RTE_BBDEV_TURBO_DEC_INTERRUPTS
Definition: rte_bbdev_op.h:84
@ RTE_BBDEV_TURBO_DEC_CRC_24B_DROP
Definition: rte_bbdev_op.h:127
@ RTE_BBDEV_TURBO_MAP_DEC
Definition: rte_bbdev_op.h:118
@ RTE_BBDEV_TURBO_POS_LLR_1_BIT_SOFT_OUT
Definition: rte_bbdev_op.h:106
@ RTE_BBDEV_TURBO_SUBBLOCK_DEINTERLEAVE
Definition: rte_bbdev_op.h:64
@ RTE_BBDEV_TURBO_CRC_TYPE_24B
Definition: rte_bbdev_op.h:66
@ RTE_BBDEV_TURBO_SOFT_OUTPUT
Definition: rte_bbdev_op.h:80
@ RTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT
Definition: rte_bbdev_op.h:114
@ RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP
Definition: rte_bbdev_op.h:124
@ RTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN
Definition: rte_bbdev_op.h:98
@ RTE_BBDEV_TURBO_EQUALIZER
Definition: rte_bbdev_op.h:68
@ RTE_BBDEV_TURBO_POS_LLR_1_BIT_IN
Definition: rte_bbdev_op.h:91
@ RTE_BBDEV_TURBO_SOFT_OUT_SATURATE
Definition: rte_bbdev_op.h:70
@ RTE_BBDEV_TURBO_EARLY_TERMINATION
Definition: rte_bbdev_op.h:82
rte_bbdev_op_ldpcdec_flag_bitmasks
Definition: rte_bbdev_op.h:148
@ RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK
Definition: rte_bbdev_op.h:150
@ RTE_BBDEV_LDPC_LLR_COMPRESSION
Definition: rte_bbdev_op.h:184
@ RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS
Definition: rte_bbdev_op.h:158
@ RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE
Definition: rte_bbdev_op.h:162
@ RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS
Definition: rte_bbdev_op.h:172
@ RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE
Definition: rte_bbdev_op.h:176
@ RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS
Definition: rte_bbdev_op.h:170
@ RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE
Definition: rte_bbdev_op.h:188
@ RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK
Definition: rte_bbdev_op.h:196
@ RTE_BBDEV_LDPC_DEC_INTERRUPTS
Definition: rte_bbdev_op.h:178
@ RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK
Definition: rte_bbdev_op.h:156
@ RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE
Definition: rte_bbdev_op.h:192
@ RTE_BBDEV_LDPC_DEC_SCATTER_GATHER
Definition: rte_bbdev_op.h:180
@ RTE_BBDEV_LDPC_SOFT_OUT_ENABLE
Definition: rte_bbdev_op.h:168
@ RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION
Definition: rte_bbdev_op.h:182
@ RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE
Definition: rte_bbdev_op.h:160
@ RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS
Definition: rte_bbdev_op.h:201
@ RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK
Definition: rte_bbdev_op.h:152
@ RTE_BBDEV_LDPC_DECODE_BYPASS
Definition: rte_bbdev_op.h:166
@ RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP
Definition: rte_bbdev_op.h:154
rte_bbdev_op_te_flag_bitmasks
Definition: rte_bbdev_op.h:132
@ RTE_BBDEV_TURBO_CRC_24B_ATTACH
Definition: rte_bbdev_op.h:138
@ RTE_BBDEV_TURBO_RATE_MATCH
Definition: rte_bbdev_op.h:136
@ RTE_BBDEV_TURBO_ENC_SCATTER_GATHER
Definition: rte_bbdev_op.h:144
@ RTE_BBDEV_TURBO_ENC_INTERRUPTS
Definition: rte_bbdev_op.h:142
@ RTE_BBDEV_TURBO_CRC_24A_ATTACH
Definition: rte_bbdev_op.h:140
@ RTE_BBDEV_TURBO_RV_INDEX_BYPASS
Definition: rte_bbdev_op.h:134
static void rte_bbdev_enc_op_free_bulk(struct rte_bbdev_enc_op **ops, unsigned int num_ops)
rte_bbdev_op_cb_mode
Definition: rte_bbdev_op.h:245
@ RTE_BBDEV_CODE_BLOCK
Definition: rte_bbdev_op.h:249
@ RTE_BBDEV_TRANSPORT_BLOCK
Definition: rte_bbdev_op.h:247
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)
#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:1640
static __rte_always_inline void rte_mempool_put_bulk(struct rte_mempool *mp, void *const *obj_table, unsigned int n)
Definition: rte_mempool.h:1455
static void * rte_mempool_get_priv(struct rte_mempool *mp)
Definition: rte_mempool.h:1822
struct rte_bbdev_op_ldpc_dec ldpc_dec
Definition: rte_bbdev_op.h:898
struct rte_mempool * mempool
Definition: rte_bbdev_op.h:891
struct rte_bbdev_op_turbo_dec turbo_dec
Definition: rte_bbdev_op.h:896
struct rte_bbdev_op_ldpc_enc ldpc_enc
Definition: rte_bbdev_op.h:882
struct rte_mempool * mempool
Definition: rte_bbdev_op.h:875
struct rte_bbdev_op_turbo_enc turbo_enc
Definition: rte_bbdev_op.h:880
struct rte_mempool * mempool
Definition: rte_bbdev_op.h:907
struct rte_bbdev_op_fft fft
Definition: rte_bbdev_op.h:911
union rte_bbdev_op_cap::@40 cap
enum rte_bbdev_op_type type
Definition: rte_bbdev_op.h:916
struct rte_mbuf * data
Definition: rte_bbdev_op.h:283
struct rte_bbdev_op_data base_input
Definition: rte_bbdev_op.h:746
uint16_t input_leading_padding
Definition: rte_bbdev_op.h:756
struct rte_bbdev_op_data base_output
Definition: rte_bbdev_op.h:748
uint16_t output_leading_depadding
Definition: rte_bbdev_op.h:760
struct rte_bbdev_op_data power_meas_output
Definition: rte_bbdev_op.h:750
uint16_t ncs_reciprocal
Definition: rte_bbdev_op.h:778
uint16_t cs_bitmap
Definition: rte_bbdev_op.h:764
uint16_t fp16_exp_adjust
Definition: rte_bbdev_op.h:782
int8_t cs_time_adjustment
Definition: rte_bbdev_op.h:772
uint16_t input_sequence_size
Definition: rte_bbdev_op.h:754
uint16_t power_shift
Definition: rte_bbdev_op.h:780
uint8_t num_antennas_log2
Definition: rte_bbdev_op.h:766
uint8_t window_index[RTE_BBDEV_MAX_CS_2]
Definition: rte_bbdev_op.h:762
uint16_t output_sequence_size
Definition: rte_bbdev_op.h:758
struct rte_bbdev_op_data soft_output
Definition: rte_bbdev_op.h:495
struct rte_bbdev_op_data harq_combined_output
Definition: rte_bbdev_op.h:499
struct rte_bbdev_op_dec_ldpc_tb_params tb_params
Definition: rte_bbdev_op.h:542
struct rte_bbdev_op_data harq_combined_input
Definition: rte_bbdev_op.h:497
struct rte_bbdev_op_data hard_output
Definition: rte_bbdev_op.h:493
struct rte_bbdev_op_data input
Definition: rte_bbdev_op.h:489
struct rte_bbdev_op_dec_ldpc_cb_params cb_params
Definition: rte_bbdev_op.h:540
struct rte_bbdev_op_enc_ldpc_tb_params tb_params
Definition: rte_bbdev_op.h:729
struct rte_bbdev_op_data output
Definition: rte_bbdev_op.h:696
struct rte_bbdev_op_data input
Definition: rte_bbdev_op.h:694
struct rte_bbdev_op_enc_ldpc_cb_params cb_params
Definition: rte_bbdev_op.h:727
struct rte_bbdev_op_data soft_output
Definition: rte_bbdev_op.h:417
struct rte_bbdev_op_dec_turbo_tb_params tb_params
Definition: rte_bbdev_op.h:449
struct rte_bbdev_op_dec_turbo_cb_params cb_params
Definition: rte_bbdev_op.h:447
struct rte_bbdev_op_data hard_output
Definition: rte_bbdev_op.h:415
struct rte_bbdev_op_data input
Definition: rte_bbdev_op.h:411
struct rte_bbdev_op_data output
Definition: rte_bbdev_op.h:660
struct rte_bbdev_op_enc_turbo_tb_params tb_params
Definition: rte_bbdev_op.h:672
struct rte_bbdev_op_data input
Definition: rte_bbdev_op.h:658
struct rte_bbdev_op_enc_turbo_cb_params cb_params
Definition: rte_bbdev_op.h:670
char name[RTE_MEMPOOL_NAMESIZE]
Definition: rte_mempool.h:220
uint32_t cache_size
Definition: rte_mempool.h:231