DPDK 24.11.1
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#include <stdint.h>
15
16#include <rte_compat.h>
17#include <rte_common.h>
18#include <rte_mbuf.h>
19#include <rte_memory.h>
20#include <rte_mempool.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
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< */
570/* >8 End of structure rte_bbdev_op_ldpc_dec. */
571
579 uint16_t k;
583 uint32_t e;
587 uint16_t ncb;
588};
589
597 uint16_t k_neg;
603 uint16_t k_pos;
605 uint8_t c_neg;
609 uint8_t c;
611 uint8_t cab;
615 uint32_t ea;
619 uint32_t eb;
623 uint16_t ncb_neg;
627 uint16_t ncb_pos;
629 uint8_t r;
630};
631
637 uint32_t e;
638};
639
645 uint32_t ea;
649 uint32_t eb;
653 uint8_t c;
655 uint8_t r;
657 uint8_t cab;
658};
659
680/* Structure rte_bbdev_op_turbo_enc 8< */
700/* >8 End of structure rte_bbdev_op_turbo_enc. */
701
716/* Structure rte_bbdev_op_ldpc_enc 8< */
722
724 uint32_t op_flags;
725
727 uint8_t rv_index;
731 uint8_t basegraph;
735 uint16_t z_c;
739 uint16_t n_cb;
743 uint8_t q_m;
747 uint16_t n_filler;
750 union {
755 };
756};
757/* >8 End of structure rte_bbdev_op_ldpc_enc. */
758
768/* Structure rte_bbdev_op_fft 8< */
779 uint32_t op_flags;
789 uint8_t window_index[RTE_BBDEV_MAX_CS_2];
791 uint16_t cs_bitmap;
795 uint8_t idft_log2;
797 uint8_t dft_log2;
803 int8_t dft_shift;
807 uint16_t power_shift;
815 uint16_t cs_theta_0[RTE_BBDEV_MAX_CS];
817 uint32_t cs_theta_d[RTE_BBDEV_MAX_CS];
818 /* Time offset per CS of time domain samples. */
819 int8_t time_offset[RTE_BBDEV_MAX_CS];
820};
821/* >8 End of structure rte_bbdev_op_fft. */
822
829/* Structure rte_bbdev_op_mldts 8< */
838 uint32_t op_flags;
840 uint16_t num_rbs;
842 uint16_t num_layers;
844 uint8_t q_m[RTE_BBDEV_MAX_MLD_LAYERS];
846 uint8_t r_rep;
848 uint8_t c_rep;
849};
850/* >8 End of structure rte_bbdev_op_mldts. */
851
867
877
893
903
915
925
940
942enum {
943 RTE_BBDEV_DRV_ERROR,
944 RTE_BBDEV_DATA_ERROR,
945 RTE_BBDEV_CRC_ERROR,
946 RTE_BBDEV_SYNDROME_ERROR,
947 RTE_BBDEV_ENGINE_ERROR
948};
949
958 union {
960 struct rte_bbdev_op_turbo_enc turbo_enc;
962 struct rte_bbdev_op_ldpc_enc ldpc_enc;
963 };
964};
965
974 union {
976 struct rte_bbdev_op_turbo_dec turbo_dec;
978 struct rte_bbdev_op_ldpc_dec ldpc_dec;
979 };
980};
981
993
1005
1009 union {
1010 struct rte_bbdev_op_cap_turbo_dec turbo_dec;
1011 struct rte_bbdev_op_cap_turbo_enc turbo_enc;
1012 struct rte_bbdev_op_cap_ldpc_dec ldpc_dec;
1013 struct rte_bbdev_op_cap_ldpc_enc ldpc_enc;
1014 struct rte_bbdev_op_cap_fft fft;
1015 struct rte_bbdev_op_cap_mld mld;
1017};
1018
1020struct rte_bbdev_op_pool_private {
1021 enum rte_bbdev_op_type type;
1022};
1023
1033const char*
1035
1056struct rte_mempool *
1058 unsigned int num_elements, unsigned int cache_size,
1059 int socket_id);
1060
1075static inline int
1077 struct rte_bbdev_enc_op **ops, unsigned int num_ops)
1078{
1079 struct rte_bbdev_op_pool_private *priv;
1080
1081 /* Check type */
1082 priv = (struct rte_bbdev_op_pool_private *)
1083 rte_mempool_get_priv(mempool);
1084 if (unlikely((priv->type != RTE_BBDEV_OP_TURBO_ENC) &&
1085 (priv->type != RTE_BBDEV_OP_LDPC_ENC)))
1086 return -EINVAL;
1087
1088 /* Get elements */
1089 return rte_mempool_get_bulk(mempool, (void **)ops, num_ops);
1090}
1091
1106static inline int
1108 struct rte_bbdev_dec_op **ops, unsigned int num_ops)
1109{
1110 struct rte_bbdev_op_pool_private *priv;
1111
1112 /* Check type */
1113 priv = (struct rte_bbdev_op_pool_private *)
1114 rte_mempool_get_priv(mempool);
1115 if (unlikely((priv->type != RTE_BBDEV_OP_TURBO_DEC) &&
1116 (priv->type != RTE_BBDEV_OP_LDPC_DEC)))
1117 return -EINVAL;
1118
1119 /* Get elements */
1120 return rte_mempool_get_bulk(mempool, (void **)ops, num_ops);
1121}
1122
1137static inline int
1139 struct rte_bbdev_fft_op **ops, unsigned int num_ops)
1140{
1141 struct rte_bbdev_op_pool_private *priv;
1142
1143 /* Check type */
1144 priv = (struct rte_bbdev_op_pool_private *)rte_mempool_get_priv(mempool);
1145 if (unlikely(priv->type != RTE_BBDEV_OP_FFT))
1146 return -EINVAL;
1147
1148 /* Get elements */
1149 return rte_mempool_get_bulk(mempool, (void **)ops, num_ops);
1150}
1151
1166static inline int
1168 struct rte_bbdev_mldts_op **ops, uint16_t num_ops)
1169{
1170 struct rte_bbdev_op_pool_private *priv;
1171
1172 /* Check type */
1173 priv = (struct rte_bbdev_op_pool_private *)rte_mempool_get_priv(mempool);
1174 if (unlikely(priv->type != RTE_BBDEV_OP_MLDTS))
1175 return -EINVAL;
1176
1177 /* Get elements */
1178 return rte_mempool_get_bulk(mempool, (void **)ops, num_ops);
1179}
1180
1191static inline void
1192rte_bbdev_dec_op_free_bulk(struct rte_bbdev_dec_op **ops, unsigned int num_ops)
1193{
1194 if (num_ops > 0)
1195 rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops);
1196}
1197
1208static inline void
1209rte_bbdev_enc_op_free_bulk(struct rte_bbdev_enc_op **ops, unsigned int num_ops)
1210{
1211 if (num_ops > 0)
1212 rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops);
1213}
1214
1225static inline void
1226rte_bbdev_fft_op_free_bulk(struct rte_bbdev_fft_op **ops, unsigned int num_ops)
1227{
1228 if (num_ops > 0)
1229 rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops);
1230}
1231
1242static inline void
1243rte_bbdev_mldts_op_free_bulk(struct rte_bbdev_mldts_op **ops, unsigned int num_ops)
1244{
1245 if (num_ops > 0)
1246 rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops);
1247}
1248
1249#ifdef __cplusplus
1250}
1251#endif
1252
1253#endif /* _RTE_BBDEV_OP_H_ */
static 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 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)
static void rte_bbdev_mldts_op_free_bulk(struct rte_bbdev_mldts_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::@052102230251216177373061341121143306265340276277 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