X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_bbdev%2Frte_bbdev_op.h;h=83f62c2dc2f2ea74d0b4f7ebae7d4b823dc953f2;hb=e3908132b7903dbbf45c6d073792cccc890812e0;hp=c0c7d736680e9443e50eebf64a83e101a098e061;hpb=4935e1e9f76e14e8b3420084d357c34bb397ef53;p=dpdk.git diff --git a/lib/librte_bbdev/rte_bbdev_op.h b/lib/librte_bbdev/rte_bbdev_op.h index c0c7d73668..83f62c2dc2 100644 --- a/lib/librte_bbdev/rte_bbdev_op.h +++ b/lib/librte_bbdev/rte_bbdev_op.h @@ -25,59 +25,23 @@ extern "C" { #include #include -#define RTE_BBDEV_MAX_CODE_BLOCKS 64 - -extern int bbdev_logtype; - -/** - * Helper macro for logging - * - * @param level - * Log level: EMERG, ALERT, CRIT, ERR, WARNING, NOTICE, INFO, or DEBUG - * @param fmt - * The format string, as in printf(3). - * @param ... - * The variable arguments required by the format string. - * - * @return - * - 0 on success - * - Negative on error +/* Number of columns in sub-block interleaver (36.212, section 5.1.4.1.1) */ +#define RTE_BBDEV_C_SUBBLOCK (32) +/* Maximum size of Transport Block (36.213, Table, Table 7.1.7.2.5-1) */ +#define RTE_BBDEV_MAX_TB_SIZE (391656) +/* Maximum size of Code Block (36.212, Table 5.1.3-3) */ +#define RTE_BBDEV_MAX_CB_SIZE (6144) +/* Minimum size of Code Block (36.212, Table 5.1.3-3) */ +#define RTE_BBDEV_MIN_CB_SIZE (40) +/* Maximum size of circular buffer */ +#define RTE_BBDEV_MAX_KW (18528) +/* + * Maximum number of Code Blocks in Transport Block. It is calculated based on + * maximum size of one Code Block and one Transport Block (considering CRC24A + * and CRC24B): + * (391656 + 24) / (6144 - 24) = 64 */ -#define rte_bbdev_log(level, fmt, ...) \ - rte_log(RTE_LOG_ ## level, bbdev_logtype, fmt "\n", ##__VA_ARGS__) - -/** - * Helper macro for debug logging with extra source info - * - * @param fmt - * The format string, as in printf(3). - * @param ... - * The variable arguments required by the format string. - * - * @return - * - 0 on success - * - Negative on error - */ -#define rte_bbdev_log_debug(fmt, ...) \ - rte_bbdev_log(DEBUG, RTE_STR(__LINE__) ":%s() " fmt, __func__, \ - ##__VA_ARGS__) - -/** - * Helper macro for extra conditional logging from datapath - * - * @param fmt - * The format string, as in printf(3). - * @param ... - * The variable arguments required by the format string. - * - * @return - * - 0 on success - * - Negative on error - */ -#define rte_bbdev_log_verbose(fmt, ...) \ - (void)((RTE_LOG_DEBUG <= RTE_LOG_DP_LEVEL) ? \ - rte_log(RTE_LOG_DEBUG, \ - bbdev_logtype, ": " fmt "\n", ##__VA_ARGS__) : 0) +#define RTE_BBDEV_MAX_CODE_BLOCKS (64) /** Flags for turbo decoder operation and capability structure */ enum rte_bbdev_op_td_flag_bitmasks { @@ -138,7 +102,11 @@ enum rte_bbdev_op_td_flag_bitmasks { */ RTE_BBDEV_TURBO_MAP_DEC = (1ULL << 14), /**< Set if a device supports scatter-gather functionality */ - RTE_BBDEV_TURBO_DEC_SCATTER_GATHER = (1ULL << 15) + RTE_BBDEV_TURBO_DEC_SCATTER_GATHER = (1ULL << 15), + /**< Set to keep CRC24B bits appended while decoding. Only usable when + * decoding Transport Blocks (code_block_mode = 0). + */ + RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP = (1ULL << 16) }; /** Flags for turbo encoder operation and capability structure */ @@ -415,6 +383,10 @@ struct rte_bbdev_op_turbo_enc { struct rte_bbdev_op_cap_turbo_dec { /**< Flags from rte_bbdev_op_td_flag_bitmasks */ uint32_t capability_flags; + /** Maximal LLR absolute value. Acceptable LLR values lie in range + * [-max_llr_modulus, max_llr_modulus]. + */ + int8_t max_llr_modulus; uint8_t num_buffers_src; /**< Num input code block buffers */ /**< Num hard output code block buffers */ uint8_t num_buffers_hard_out; @@ -547,9 +519,6 @@ rte_bbdev_enc_op_alloc_bulk(struct rte_mempool *mempool, if (unlikely(ret < 0)) return ret; - rte_bbdev_log_verbose("%u encode ops allocated from %s\n", - num_ops, mempool->name); - return 0; } @@ -585,9 +554,6 @@ rte_bbdev_dec_op_alloc_bulk(struct rte_mempool *mempool, if (unlikely(ret < 0)) return ret; - rte_bbdev_log_verbose("%u encode ops allocated from %s\n", - num_ops, mempool->name); - return 0; } @@ -604,11 +570,8 @@ rte_bbdev_dec_op_alloc_bulk(struct rte_mempool *mempool, static inline void rte_bbdev_dec_op_free_bulk(struct rte_bbdev_dec_op **ops, unsigned int num_ops) { - if (num_ops > 0) { + if (num_ops > 0) rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops); - rte_bbdev_log_verbose("%u decode ops freed to %s\n", num_ops, - ops[0]->mempool->name); - } } /** @@ -624,11 +587,8 @@ rte_bbdev_dec_op_free_bulk(struct rte_bbdev_dec_op **ops, unsigned int num_ops) static inline void rte_bbdev_enc_op_free_bulk(struct rte_bbdev_enc_op **ops, unsigned int num_ops) { - if (num_ops > 0) { + if (num_ops > 0) rte_mempool_put_bulk(ops[0]->mempool, (void **)ops, num_ops); - rte_bbdev_log_verbose("%u encode ops freed to %s\n", num_ops, - ops[0]->mempool->name); - } } #ifdef __cplusplus