DPDK 22.11.0-rc2
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/* 12 CS maximum */
51#define RTE_BBDEV_MAX_CS_2 (6)
52
53/*
54 * Maximum size to be used to manage the enum rte_bbdev_op_type
55 * including padding for future enum insertion.
56 * The enum values must be explicitly kept smaller or equal to this padded maximum size.
57 */
58#define RTE_BBDEV_OP_TYPE_SIZE_MAX 8
59
128
129
145
202
222
240 RTE_BBDEV_FFT_FP16_OUTPUT = (1ULL << 7)
242
249};
250
282 struct rte_mbuf *data;
290 uint32_t offset;
303 uint32_t length;
304};
305
313 uint16_t k;
317 uint32_t e;
318};
319
325 uint32_t e;
326};
327
333 uint16_t k_neg;
337 uint16_t k_pos;
339 uint8_t c_neg;
343 uint8_t c;
345 uint8_t cab;
349 uint32_t ea;
353 uint32_t eb;
355 uint8_t r;
356};
357
363 uint32_t ea;
367 uint32_t eb;
371 uint8_t c;
373 uint8_t r;
375 uint8_t cab;
376};
377
407/* Structure rte_bbdev_op_turbo_dec 8< */
417
419 uint32_t op_flags;
420
422 uint8_t rv_index;
426 uint8_t iter_min:4;
430 uint8_t iter_max:4;
434 uint8_t iter_count;
436 uint8_t ext_scale;
440 uint8_t num_maps;
441
444 union {
449 };
450};
451/* >8 End of structure rte_bbdev_op_turbo_dec. */
452
483/* Structure rte_bbdev_op_ldpc_dec 8< */
499
501 uint32_t op_flags;
502
506 uint8_t rv_index;
510 uint8_t iter_max;
514 uint8_t iter_count;
518 uint8_t basegraph;
522 uint16_t z_c;
526 uint16_t n_cb;
530 uint8_t q_m;
534 uint16_t n_filler;
537 union {
542 };
543};
544/* >8 End of structure rte_bbdev_op_ldpc_dec. */
545
553 uint16_t k;
557 uint32_t e;
561 uint16_t ncb;
562};
563
571 uint16_t k_neg;
577 uint16_t k_pos;
579 uint8_t c_neg;
583 uint8_t c;
585 uint8_t cab;
589 uint32_t ea;
593 uint32_t eb;
597 uint16_t ncb_neg;
601 uint16_t ncb_pos;
603 uint8_t r;
604};
605
611 uint32_t e;
612};
613
619 uint32_t ea;
623 uint32_t eb;
627 uint8_t c;
629 uint8_t r;
631 uint8_t cab;
632};
633
654/* Structure rte_bbdev_op_turbo_enc 8< */
661 uint32_t op_flags;
662
664 uint8_t rv_index;
667 union {
672 };
673};
674/* >8 End of structure rte_bbdev_op_turbo_enc. */
675
690/* Structure rte_bbdev_op_ldpc_enc 8< */
696
698 uint32_t op_flags;
699
701 uint8_t rv_index;
705 uint8_t basegraph;
709 uint16_t z_c;
713 uint16_t n_cb;
717 uint8_t q_m;
721 uint16_t n_filler;
724 union {
729 };
730};
731/* >8 End of structure rte_bbdev_op_ldpc_enc. */
732
742/* Structure rte_bbdev_op_fft 8< */
751 uint32_t op_flags;
761 uint8_t window_index[RTE_BBDEV_MAX_CS_2];
763 uint16_t cs_bitmap;
767 uint8_t idft_log2;
769 uint8_t dft_log2;
775 int8_t dft_shift;
779 uint16_t power_shift;
782};
783/* >8 End of structure rte_bbdev_op_fft. */
784
799};
800
809};
810
816 int8_t llr_size;
825};
826
835};
836
845};
846
858 /* Note: RTE_BBDEV_OP_TYPE_SIZE_MAX must be larger or equal to maximum enum value */
859};
860
862enum {
863 RTE_BBDEV_DRV_ERROR,
864 RTE_BBDEV_DATA_ERROR,
865 RTE_BBDEV_CRC_ERROR,
866 RTE_BBDEV_SYNDROME_ERROR
867};
868
877 union {
882 };
883};
884
893 union {
898 };
899};
900
911};
912
916 union {
917 struct rte_bbdev_op_cap_turbo_dec turbo_dec;
918 struct rte_bbdev_op_cap_turbo_enc turbo_enc;
919 struct rte_bbdev_op_cap_ldpc_dec ldpc_dec;
920 struct rte_bbdev_op_cap_ldpc_enc ldpc_enc;
921 struct rte_bbdev_op_cap_fft fft;
922 } cap;
923};
924
926struct rte_bbdev_op_pool_private {
927 enum rte_bbdev_op_type type;
928};
929
940const char*
942
963struct rte_mempool *
965 unsigned int num_elements, unsigned int cache_size,
966 int socket_id);
967
982static inline int
984 struct rte_bbdev_enc_op **ops, uint16_t num_ops)
985{
986 struct rte_bbdev_op_pool_private *priv;
987
988 /* Check type */
989 priv = (struct rte_bbdev_op_pool_private *)
990 rte_mempool_get_priv(mempool);
991 if (unlikely((priv->type != RTE_BBDEV_OP_TURBO_ENC) &&
992 (priv->type != RTE_BBDEV_OP_LDPC_ENC)))
993 return -EINVAL;
994
995 /* Get elements */
996 return rte_mempool_get_bulk(mempool, (void **)ops, num_ops);
997}
998
1013static inline int
1015 struct rte_bbdev_dec_op **ops, uint16_t num_ops)
1016{
1017 struct rte_bbdev_op_pool_private *priv;
1018
1019 /* Check type */
1020 priv = (struct rte_bbdev_op_pool_private *)
1021 rte_mempool_get_priv(mempool);
1022 if (unlikely((priv->type != RTE_BBDEV_OP_TURBO_DEC) &&
1023 (priv->type != RTE_BBDEV_OP_LDPC_DEC)))
1024 return -EINVAL;
1025
1026 /* Get elements */
1027 return rte_mempool_get_bulk(mempool, (void **)ops, num_ops);
1028}
1029
1044__rte_experimental
1045static inline int
1047 struct rte_bbdev_fft_op **ops, uint16_t num_ops)
1048{
1049 struct rte_bbdev_op_pool_private *priv;
1050
1051 /* Check type */
1052 priv = (struct rte_bbdev_op_pool_private *)rte_mempool_get_priv(mempool);
1053 if (unlikely(priv->type != RTE_BBDEV_OP_FFT))
1054 return -EINVAL;
1055
1056 /* Get elements */
1057 return rte_mempool_get_bulk(mempool, (void **)ops, num_ops);
1058}
1059
1070static inline void
1071rte_bbdev_dec_op_free_bulk(struct rte_bbdev_dec_op **ops, unsigned int num_ops)
1072{
1073 if (num_ops > 0)
1074 rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops);
1075}
1076
1087static inline void
1088rte_bbdev_enc_op_free_bulk(struct rte_bbdev_enc_op **ops, unsigned int num_ops)
1089{
1090 if (num_ops > 0)
1091 rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops);
1092}
1093
1104__rte_experimental
1105static inline void
1106rte_bbdev_fft_op_free_bulk(struct rte_bbdev_fft_op **ops, unsigned int num_ops)
1107{
1108 if (num_ops > 0)
1109 rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops);
1110}
1111
1112#ifdef __cplusplus
1113}
1114#endif
1115
1116#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:983
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:204
@ RTE_BBDEV_LDPC_CRC_16_ATTACH
Definition: rte_bbdev_op.h:214
@ RTE_BBDEV_LDPC_ENC_CONCATENATION
Definition: rte_bbdev_op.h:220
@ RTE_BBDEV_LDPC_INTERLEAVER_BYPASS
Definition: rte_bbdev_op.h:206
@ RTE_BBDEV_LDPC_CRC_24B_ATTACH
Definition: rte_bbdev_op.h:212
@ RTE_BBDEV_LDPC_ENC_SCATTER_GATHER
Definition: rte_bbdev_op.h:218
@ RTE_BBDEV_LDPC_CRC_24A_ATTACH
Definition: rte_bbdev_op.h:210
@ RTE_BBDEV_LDPC_RATE_MATCH
Definition: rte_bbdev_op.h:208
@ RTE_BBDEV_LDPC_ENC_INTERRUPTS
Definition: rte_bbdev_op.h:216
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:224
@ RTE_BBDEV_FFT_DFT_BYPASS
Definition: rte_bbdev_op.h:230
@ RTE_BBDEV_FFT_FP16_OUTPUT
Definition: rte_bbdev_op.h:240
@ RTE_BBDEV_FFT_IDFT_BYPASS
Definition: rte_bbdev_op.h:232
@ RTE_BBDEV_FFT_CS_ADJUSTMENT
Definition: rte_bbdev_op.h:228
@ RTE_BBDEV_FFT_FP16_INPUT
Definition: rte_bbdev_op.h:238
@ RTE_BBDEV_FFT_POWER_MEAS
Definition: rte_bbdev_op.h:236
@ RTE_BBDEV_FFT_WINDOWING_BYPASS
Definition: rte_bbdev_op.h:234
@ RTE_BBDEV_FFT_WINDOWING
Definition: rte_bbdev_op.h:226
rte_bbdev_op_type
Definition: rte_bbdev_op.h:851
@ RTE_BBDEV_OP_FFT
Definition: rte_bbdev_op.h:857
@ RTE_BBDEV_OP_TURBO_DEC
Definition: rte_bbdev_op.h:853
@ RTE_BBDEV_OP_LDPC_DEC
Definition: rte_bbdev_op.h:855
@ RTE_BBDEV_OP_TURBO_ENC
Definition: rte_bbdev_op.h:854
@ RTE_BBDEV_OP_NONE
Definition: rte_bbdev_op.h:852
@ RTE_BBDEV_OP_LDPC_ENC
Definition: rte_bbdev_op.h:856
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:61
@ RTE_BBDEV_TURBO_DEC_SCATTER_GATHER
Definition: rte_bbdev_op.h:119
@ RTE_BBDEV_TURBO_HALF_ITERATION_EVEN
Definition: rte_bbdev_op.h:73
@ RTE_BBDEV_TURBO_CONTINUE_CRC_MATCH
Definition: rte_bbdev_op.h:77
@ RTE_BBDEV_TURBO_DEC_INTERRUPTS
Definition: rte_bbdev_op.h:83
@ RTE_BBDEV_TURBO_DEC_CRC_24B_DROP
Definition: rte_bbdev_op.h:126
@ RTE_BBDEV_TURBO_MAP_DEC
Definition: rte_bbdev_op.h:117
@ RTE_BBDEV_TURBO_POS_LLR_1_BIT_SOFT_OUT
Definition: rte_bbdev_op.h:105
@ RTE_BBDEV_TURBO_SUBBLOCK_DEINTERLEAVE
Definition: rte_bbdev_op.h:63
@ RTE_BBDEV_TURBO_CRC_TYPE_24B
Definition: rte_bbdev_op.h:65
@ RTE_BBDEV_TURBO_SOFT_OUTPUT
Definition: rte_bbdev_op.h:79
@ RTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT
Definition: rte_bbdev_op.h:113
@ RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP
Definition: rte_bbdev_op.h:123
@ RTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN
Definition: rte_bbdev_op.h:97
@ RTE_BBDEV_TURBO_EQUALIZER
Definition: rte_bbdev_op.h:67
@ RTE_BBDEV_TURBO_POS_LLR_1_BIT_IN
Definition: rte_bbdev_op.h:90
@ RTE_BBDEV_TURBO_SOFT_OUT_SATURATE
Definition: rte_bbdev_op.h:69
@ RTE_BBDEV_TURBO_EARLY_TERMINATION
Definition: rte_bbdev_op.h:81
rte_bbdev_op_ldpcdec_flag_bitmasks
Definition: rte_bbdev_op.h:147
@ RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK
Definition: rte_bbdev_op.h:149
@ RTE_BBDEV_LDPC_LLR_COMPRESSION
Definition: rte_bbdev_op.h:183
@ RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS
Definition: rte_bbdev_op.h:157
@ RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE
Definition: rte_bbdev_op.h:161
@ RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS
Definition: rte_bbdev_op.h:171
@ RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE
Definition: rte_bbdev_op.h:175
@ RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS
Definition: rte_bbdev_op.h:169
@ RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE
Definition: rte_bbdev_op.h:187
@ RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK
Definition: rte_bbdev_op.h:195
@ RTE_BBDEV_LDPC_DEC_INTERRUPTS
Definition: rte_bbdev_op.h:177
@ RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK
Definition: rte_bbdev_op.h:155
@ RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE
Definition: rte_bbdev_op.h:191
@ RTE_BBDEV_LDPC_DEC_SCATTER_GATHER
Definition: rte_bbdev_op.h:179
@ RTE_BBDEV_LDPC_SOFT_OUT_ENABLE
Definition: rte_bbdev_op.h:167
@ RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION
Definition: rte_bbdev_op.h:181
@ RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE
Definition: rte_bbdev_op.h:159
@ RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS
Definition: rte_bbdev_op.h:200
@ RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK
Definition: rte_bbdev_op.h:151
@ RTE_BBDEV_LDPC_DECODE_BYPASS
Definition: rte_bbdev_op.h:165
@ RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP
Definition: rte_bbdev_op.h:153
rte_bbdev_op_te_flag_bitmasks
Definition: rte_bbdev_op.h:131
@ RTE_BBDEV_TURBO_CRC_24B_ATTACH
Definition: rte_bbdev_op.h:137
@ RTE_BBDEV_TURBO_RATE_MATCH
Definition: rte_bbdev_op.h:135
@ RTE_BBDEV_TURBO_ENC_SCATTER_GATHER
Definition: rte_bbdev_op.h:143
@ RTE_BBDEV_TURBO_ENC_INTERRUPTS
Definition: rte_bbdev_op.h:141
@ RTE_BBDEV_TURBO_CRC_24A_ATTACH
Definition: rte_bbdev_op.h:139
@ RTE_BBDEV_TURBO_RV_INDEX_BYPASS
Definition: rte_bbdev_op.h:133
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:244
@ RTE_BBDEV_CODE_BLOCK
Definition: rte_bbdev_op.h:248
@ RTE_BBDEV_TRANSPORT_BLOCK
Definition: rte_bbdev_op.h:246
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:1582
static __rte_always_inline void rte_mempool_put_bulk(struct rte_mempool *mp, void *const *obj_table, unsigned int n)
Definition: rte_mempool.h:1402
static void * rte_mempool_get_priv(struct rte_mempool *mp)
Definition: rte_mempool.h:1764
struct rte_bbdev_op_ldpc_dec ldpc_dec
Definition: rte_bbdev_op.h:897
struct rte_mempool * mempool
Definition: rte_bbdev_op.h:890
struct rte_bbdev_op_turbo_dec turbo_dec
Definition: rte_bbdev_op.h:895
struct rte_bbdev_op_ldpc_enc ldpc_enc
Definition: rte_bbdev_op.h:881
struct rte_mempool * mempool
Definition: rte_bbdev_op.h:874
struct rte_bbdev_op_turbo_enc turbo_enc
Definition: rte_bbdev_op.h:879
struct rte_mempool * mempool
Definition: rte_bbdev_op.h:906
struct rte_bbdev_op_fft fft
Definition: rte_bbdev_op.h:910
union rte_bbdev_op_cap::@40 cap
enum rte_bbdev_op_type type
Definition: rte_bbdev_op.h:915
struct rte_mbuf * data
Definition: rte_bbdev_op.h:282
struct rte_bbdev_op_data base_input
Definition: rte_bbdev_op.h:745
uint16_t input_leading_padding
Definition: rte_bbdev_op.h:755
struct rte_bbdev_op_data base_output
Definition: rte_bbdev_op.h:747
uint16_t output_leading_depadding
Definition: rte_bbdev_op.h:759
struct rte_bbdev_op_data power_meas_output
Definition: rte_bbdev_op.h:749
uint16_t ncs_reciprocal
Definition: rte_bbdev_op.h:777
uint16_t cs_bitmap
Definition: rte_bbdev_op.h:763
uint16_t fp16_exp_adjust
Definition: rte_bbdev_op.h:781
int8_t cs_time_adjustment
Definition: rte_bbdev_op.h:771
uint16_t input_sequence_size
Definition: rte_bbdev_op.h:753
uint16_t power_shift
Definition: rte_bbdev_op.h:779
uint8_t num_antennas_log2
Definition: rte_bbdev_op.h:765
uint8_t window_index[RTE_BBDEV_MAX_CS_2]
Definition: rte_bbdev_op.h:761
uint16_t output_sequence_size
Definition: rte_bbdev_op.h:757
struct rte_bbdev_op_data soft_output
Definition: rte_bbdev_op.h:494
struct rte_bbdev_op_data harq_combined_output
Definition: rte_bbdev_op.h:498
struct rte_bbdev_op_dec_ldpc_tb_params tb_params
Definition: rte_bbdev_op.h:541
struct rte_bbdev_op_data harq_combined_input
Definition: rte_bbdev_op.h:496
struct rte_bbdev_op_data hard_output
Definition: rte_bbdev_op.h:492
struct rte_bbdev_op_data input
Definition: rte_bbdev_op.h:488
struct rte_bbdev_op_dec_ldpc_cb_params cb_params
Definition: rte_bbdev_op.h:539
struct rte_bbdev_op_enc_ldpc_tb_params tb_params
Definition: rte_bbdev_op.h:728
struct rte_bbdev_op_data output
Definition: rte_bbdev_op.h:695
struct rte_bbdev_op_data input
Definition: rte_bbdev_op.h:693
struct rte_bbdev_op_enc_ldpc_cb_params cb_params
Definition: rte_bbdev_op.h:726
struct rte_bbdev_op_data soft_output
Definition: rte_bbdev_op.h:416
struct rte_bbdev_op_dec_turbo_tb_params tb_params
Definition: rte_bbdev_op.h:448
struct rte_bbdev_op_dec_turbo_cb_params cb_params
Definition: rte_bbdev_op.h:446
struct rte_bbdev_op_data hard_output
Definition: rte_bbdev_op.h:414
struct rte_bbdev_op_data input
Definition: rte_bbdev_op.h:410
struct rte_bbdev_op_data output
Definition: rte_bbdev_op.h:659
struct rte_bbdev_op_enc_turbo_tb_params tb_params
Definition: rte_bbdev_op.h:671
struct rte_bbdev_op_data input
Definition: rte_bbdev_op.h:657
struct rte_bbdev_op_enc_turbo_cb_params cb_params
Definition: rte_bbdev_op.h:669
char name[RTE_MEMPOOL_NAMESIZE]
Definition: rte_mempool.h:205
uint32_t cache_size
Definition: rte_mempool.h:216