DPDK 23.11.0
Loading...
Searching...
No Matches
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#define RTE_BBDEV_MAX_CS (12)
54/* MLD-TS up to 4 layers */
55#define RTE_BBDEV_MAX_MLD_LAYERS (4)
56/* 12 SB per RB */
57#define RTE_BBDEV_SCPERRB (12)
58
59/*
60 * Maximum size to be used to manage the enum rte_bbdev_op_type
61 * including padding for future enum insertion.
62 * The enum values must be explicitly kept smaller or equal to this padded maximum size.
63 */
64#define RTE_BBDEV_OP_TYPE_SIZE_MAX 8
65
134
135
151
210
230
258
264
272
304 struct rte_mbuf *data;
312 uint32_t offset;
325 uint32_t length;
326};
327
335 uint16_t k;
339 uint32_t e;
340};
341
347 uint32_t e;
348};
349
355 uint16_t k_neg;
359 uint16_t k_pos;
361 uint8_t c_neg;
365 uint8_t c;
367 uint8_t cab;
371 uint32_t ea;
375 uint32_t eb;
377 uint8_t r;
378};
379
385 uint32_t ea;
389 uint32_t eb;
393 uint8_t c;
395 uint8_t r;
397 uint8_t cab;
398};
399
429/* Structure rte_bbdev_op_turbo_dec 8< */
439
441 uint32_t op_flags;
442
444 uint8_t rv_index;
448 uint8_t iter_min:4;
452 uint8_t iter_max:4;
456 uint8_t iter_count;
458 uint8_t ext_scale;
462 uint8_t num_maps;
463
466 union {
471 };
472};
473/* >8 End of structure rte_bbdev_op_turbo_dec. */
474
505/* Structure rte_bbdev_op_ldpc_dec 8< */
566/* >8 End of structure rte_bbdev_op_ldpc_dec. */
567
575 uint16_t k;
579 uint32_t e;
583 uint16_t ncb;
584};
585
593 uint16_t k_neg;
599 uint16_t k_pos;
601 uint8_t c_neg;
605 uint8_t c;
607 uint8_t cab;
611 uint32_t ea;
615 uint32_t eb;
619 uint16_t ncb_neg;
623 uint16_t ncb_pos;
625 uint8_t r;
626};
627
633 uint32_t e;
634};
635
641 uint32_t ea;
645 uint32_t eb;
649 uint8_t c;
651 uint8_t r;
653 uint8_t cab;
654};
655
676/* Structure rte_bbdev_op_turbo_enc 8< */
696/* >8 End of structure rte_bbdev_op_turbo_enc. */
697
712/* Structure rte_bbdev_op_ldpc_enc 8< */
718
720 uint32_t op_flags;
721
723 uint8_t rv_index;
727 uint8_t basegraph;
731 uint16_t z_c;
735 uint16_t n_cb;
739 uint8_t q_m;
743 uint16_t n_filler;
746 union {
751 };
752};
753/* >8 End of structure rte_bbdev_op_ldpc_enc. */
754
764/* Structure rte_bbdev_op_fft 8< */
775 uint32_t op_flags;
785 uint8_t window_index[RTE_BBDEV_MAX_CS_2];
787 uint16_t cs_bitmap;
791 uint8_t idft_log2;
793 uint8_t dft_log2;
799 int8_t dft_shift;
803 uint16_t power_shift;
811 uint16_t cs_theta_0[RTE_BBDEV_MAX_CS];
813 uint32_t cs_theta_d[RTE_BBDEV_MAX_CS];
814 /* Time offset per CS of time domain samples. */
815 int8_t time_offset[RTE_BBDEV_MAX_CS];
816};
817/* >8 End of structure rte_bbdev_op_fft. */
818
825/* Structure rte_bbdev_op_mldts 8< */
834 uint32_t op_flags;
836 uint16_t num_rbs;
838 uint16_t num_layers;
840 uint8_t q_m[RTE_BBDEV_MAX_MLD_LAYERS];
842 uint8_t r_rep;
844 uint8_t c_rep;
845};
846/* >8 End of structure rte_bbdev_op_mldts. */
847
863
873
889
899
911
921
936
938enum {
939 RTE_BBDEV_DRV_ERROR,
940 RTE_BBDEV_DATA_ERROR,
941 RTE_BBDEV_CRC_ERROR,
942 RTE_BBDEV_SYNDROME_ERROR,
943 RTE_BBDEV_ENGINE_ERROR
944};
945
954 union {
956 struct rte_bbdev_op_turbo_enc turbo_enc;
958 struct rte_bbdev_op_ldpc_enc ldpc_enc;
959 };
960};
961
970 union {
972 struct rte_bbdev_op_turbo_dec turbo_dec;
974 struct rte_bbdev_op_ldpc_dec ldpc_dec;
975 };
976};
977
989
1001
1005 union {
1006 struct rte_bbdev_op_cap_turbo_dec turbo_dec;
1007 struct rte_bbdev_op_cap_turbo_enc turbo_enc;
1008 struct rte_bbdev_op_cap_ldpc_dec ldpc_dec;
1009 struct rte_bbdev_op_cap_ldpc_enc ldpc_enc;
1010 struct rte_bbdev_op_cap_fft fft;
1011 struct rte_bbdev_op_cap_mld mld;
1013};
1014
1016struct rte_bbdev_op_pool_private {
1017 enum rte_bbdev_op_type type;
1018};
1019
1029const char*
1031
1052struct rte_mempool *
1054 unsigned int num_elements, unsigned int cache_size,
1055 int socket_id);
1056
1071static inline int
1073 struct rte_bbdev_enc_op **ops, unsigned int num_ops)
1074{
1075 struct rte_bbdev_op_pool_private *priv;
1076
1077 /* Check type */
1078 priv = (struct rte_bbdev_op_pool_private *)
1079 rte_mempool_get_priv(mempool);
1080 if (unlikely((priv->type != RTE_BBDEV_OP_TURBO_ENC) &&
1081 (priv->type != RTE_BBDEV_OP_LDPC_ENC)))
1082 return -EINVAL;
1083
1084 /* Get elements */
1085 return rte_mempool_get_bulk(mempool, (void **)ops, num_ops);
1086}
1087
1102static inline int
1104 struct rte_bbdev_dec_op **ops, unsigned int num_ops)
1105{
1106 struct rte_bbdev_op_pool_private *priv;
1107
1108 /* Check type */
1109 priv = (struct rte_bbdev_op_pool_private *)
1110 rte_mempool_get_priv(mempool);
1111 if (unlikely((priv->type != RTE_BBDEV_OP_TURBO_DEC) &&
1112 (priv->type != RTE_BBDEV_OP_LDPC_DEC)))
1113 return -EINVAL;
1114
1115 /* Get elements */
1116 return rte_mempool_get_bulk(mempool, (void **)ops, num_ops);
1117}
1118
1133static inline int
1135 struct rte_bbdev_fft_op **ops, unsigned int num_ops)
1136{
1137 struct rte_bbdev_op_pool_private *priv;
1138
1139 /* Check type */
1140 priv = (struct rte_bbdev_op_pool_private *)rte_mempool_get_priv(mempool);
1141 if (unlikely(priv->type != RTE_BBDEV_OP_FFT))
1142 return -EINVAL;
1143
1144 /* Get elements */
1145 return rte_mempool_get_bulk(mempool, (void **)ops, num_ops);
1146}
1147
1162__rte_experimental
1163static inline int
1165 struct rte_bbdev_mldts_op **ops, uint16_t num_ops)
1166{
1167 struct rte_bbdev_op_pool_private *priv;
1168
1169 /* Check type */
1170 priv = (struct rte_bbdev_op_pool_private *)rte_mempool_get_priv(mempool);
1171 if (unlikely(priv->type != RTE_BBDEV_OP_MLDTS))
1172 return -EINVAL;
1173
1174 /* Get elements */
1175 return rte_mempool_get_bulk(mempool, (void **)ops, num_ops);
1176}
1177
1188static inline void
1189rte_bbdev_dec_op_free_bulk(struct rte_bbdev_dec_op **ops, unsigned int num_ops)
1190{
1191 if (num_ops > 0)
1192 rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops);
1193}
1194
1205static inline void
1206rte_bbdev_enc_op_free_bulk(struct rte_bbdev_enc_op **ops, unsigned int num_ops)
1207{
1208 if (num_ops > 0)
1209 rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops);
1210}
1211
1222static inline void
1223rte_bbdev_fft_op_free_bulk(struct rte_bbdev_fft_op **ops, unsigned int num_ops)
1224{
1225 if (num_ops > 0)
1226 rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops);
1227}
1228
1239__rte_experimental
1240static inline void
1241rte_bbdev_mldts_op_free_bulk(struct rte_bbdev_mldts_op **ops, unsigned int num_ops)
1242{
1243 if (num_ops > 0)
1244 rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops);
1245}
1246
1247#ifdef __cplusplus
1248}
1249#endif
1250
1251#endif /* _RTE_BBDEV_OP_H_ */
static __rte_experimental int rte_bbdev_mldts_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_mldts_op **ops, uint16_t num_ops)
rte_bbdev_op_ldpcenc_flag_bitmasks
@ RTE_BBDEV_LDPC_CRC_16_ATTACH
@ RTE_BBDEV_LDPC_ENC_CONCATENATION
@ RTE_BBDEV_LDPC_INTERLEAVER_BYPASS
@ RTE_BBDEV_LDPC_CRC_24B_ATTACH
@ RTE_BBDEV_LDPC_ENC_SCATTER_GATHER
@ RTE_BBDEV_LDPC_CRC_24A_ATTACH
@ RTE_BBDEV_LDPC_RATE_MATCH
@ RTE_BBDEV_LDPC_ENC_INTERRUPTS
rte_bbdev_op_mldts_flag_bitmasks
@ RTE_BBDEV_MLDTS_REP
rte_bbdev_op_fft_flag_bitmasks
@ RTE_BBDEV_FFT_DEWINDOWING
@ RTE_BBDEV_FFT_DFT_BYPASS
@ RTE_BBDEV_FFT_FP16_OUTPUT
@ RTE_BBDEV_FFT_IDFT_BYPASS
@ RTE_BBDEV_FFT_FREQ_RESAMPLING
@ RTE_BBDEV_FFT_CS_ADJUSTMENT
@ RTE_BBDEV_FFT_FP16_INPUT
@ RTE_BBDEV_FFT_POWER_MEAS
@ RTE_BBDEV_FFT_WINDOWING_BYPASS
@ RTE_BBDEV_FFT_TIMING_OFFSET_PER_CS
@ RTE_BBDEV_FFT_WINDOWING
@ RTE_BBDEV_FFT_TIMING_ERROR
rte_bbdev_op_type
@ RTE_BBDEV_OP_FFT
@ RTE_BBDEV_OP_TURBO_DEC
@ RTE_BBDEV_OP_LDPC_DEC
@ RTE_BBDEV_OP_TURBO_ENC
@ RTE_BBDEV_OP_NONE
@ RTE_BBDEV_OP_MLDTS
@ RTE_BBDEV_OP_LDPC_ENC
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
@ RTE_BBDEV_TURBO_DEC_SCATTER_GATHER
@ RTE_BBDEV_TURBO_HALF_ITERATION_EVEN
@ RTE_BBDEV_TURBO_CONTINUE_CRC_MATCH
@ RTE_BBDEV_TURBO_DEC_INTERRUPTS
@ RTE_BBDEV_TURBO_DEC_CRC_24B_DROP
@ RTE_BBDEV_TURBO_MAP_DEC
@ RTE_BBDEV_TURBO_POS_LLR_1_BIT_SOFT_OUT
@ RTE_BBDEV_TURBO_SUBBLOCK_DEINTERLEAVE
@ RTE_BBDEV_TURBO_CRC_TYPE_24B
@ RTE_BBDEV_TURBO_SOFT_OUTPUT
@ RTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT
@ RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP
@ RTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN
@ RTE_BBDEV_TURBO_EQUALIZER
@ RTE_BBDEV_TURBO_POS_LLR_1_BIT_IN
@ RTE_BBDEV_TURBO_SOFT_OUT_SATURATE
@ RTE_BBDEV_TURBO_EARLY_TERMINATION
static int rte_bbdev_fft_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_fft_op **ops, unsigned int num_ops)
static __rte_experimental void rte_bbdev_mldts_op_free_bulk(struct rte_bbdev_mldts_op **ops, unsigned int num_ops)
static int rte_bbdev_enc_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_enc_op **ops, unsigned int num_ops)
rte_bbdev_op_ldpcdec_flag_bitmasks
@ RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK
@ RTE_BBDEV_LDPC_LLR_COMPRESSION
@ RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS
@ RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE
@ RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS
@ RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE
@ RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS
@ RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE
@ RTE_BBDEV_LDPC_HARQ_4BIT_COMPRESSION
@ RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK
@ RTE_BBDEV_LDPC_DEC_INTERRUPTS
@ RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK
@ RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE
@ RTE_BBDEV_LDPC_DEC_SCATTER_GATHER
@ RTE_BBDEV_LDPC_SOFT_OUT_ENABLE
@ RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION
@ RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE
@ RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS
@ RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK
@ RTE_BBDEV_LDPC_DECODE_BYPASS
@ RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP
rte_bbdev_op_te_flag_bitmasks
@ RTE_BBDEV_TURBO_CRC_24B_ATTACH
@ RTE_BBDEV_TURBO_RATE_MATCH
@ RTE_BBDEV_TURBO_ENC_SCATTER_GATHER
@ RTE_BBDEV_TURBO_ENC_INTERRUPTS
@ RTE_BBDEV_TURBO_CRC_24A_ATTACH
@ RTE_BBDEV_TURBO_RV_INDEX_BYPASS
static void rte_bbdev_enc_op_free_bulk(struct rte_bbdev_enc_op **ops, unsigned int num_ops)
rte_bbdev_op_cb_mode
@ RTE_BBDEV_CODE_BLOCK
@ RTE_BBDEV_TRANSPORT_BLOCK
const char * rte_bbdev_op_type_str(enum rte_bbdev_op_type op_type)
static int rte_bbdev_dec_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_dec_op **ops, unsigned int num_ops)
static void rte_bbdev_dec_op_free_bulk(struct rte_bbdev_dec_op **ops, unsigned int num_ops)
static void rte_bbdev_fft_op_free_bulk(struct rte_bbdev_fft_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)
static __rte_always_inline void rte_mempool_put_bulk(struct rte_mempool *mp, void *const *obj_table, unsigned int n)
static void * rte_mempool_get_priv(struct rte_mempool *mp)
struct rte_mempool * mempool
struct rte_mempool * mempool
struct rte_mempool * mempool
struct rte_bbdev_op_fft fft
struct rte_mempool * mempool
struct rte_bbdev_op_mldts mldts
union rte_bbdev_op_cap::@40 cap
enum rte_bbdev_op_type type
struct rte_mbuf * data
struct rte_bbdev_op_data base_input
uint16_t input_leading_padding
struct rte_bbdev_op_data base_output
uint16_t output_leading_depadding
struct rte_bbdev_op_data power_meas_output
uint16_t output_depadded_size
uint16_t ncs_reciprocal
uint16_t fp16_exp_adjust
int8_t cs_time_adjustment
uint32_t cs_theta_d[RTE_BBDEV_MAX_CS]
uint16_t input_sequence_size
int8_t freq_resample_mode
uint16_t cs_theta_0[RTE_BBDEV_MAX_CS]
struct rte_bbdev_op_data dewindowing_input
uint8_t num_antennas_log2
uint8_t window_index[RTE_BBDEV_MAX_CS_2]
uint16_t output_sequence_size
struct rte_bbdev_op_data soft_output
struct rte_bbdev_op_data harq_combined_output
struct rte_bbdev_op_data harq_combined_input
struct rte_bbdev_op_data hard_output
struct rte_bbdev_op_data input
struct rte_bbdev_op_data output
struct rte_bbdev_op_data input
struct rte_bbdev_op_data output
struct rte_bbdev_op_data r_input
struct rte_bbdev_op_data qhy_input
uint8_t q_m[RTE_BBDEV_MAX_MLD_LAYERS]
struct rte_bbdev_op_data soft_output
struct rte_bbdev_op_data hard_output
struct rte_bbdev_op_data input
struct rte_bbdev_op_data output
struct rte_bbdev_op_data input
char name[RTE_MEMPOOL_NAMESIZE]
uint32_t cache_size