30#include <rte_compat.h>
35#ifndef RTE_BBDEV_MAX_DEVS
36#define RTE_BBDEV_MAX_DEVS 128
44#define RTE_BBDEV_ENQ_STATUS_SIZE_MAX 6
87#define RTE_BBDEV_FOREACH(i) for (i = rte_bbdev_find_next(-1); \
88 i < RTE_BBDEV_MAX_DEVS; \
89 i = rte_bbdev_find_next(i))
355#define RTE_BBDEV_END_OF_CAPABILITIES_LIST() \
356 { RTE_BBDEV_OP_NONE }
415struct rte_bbdev_queue_data {
424typedef uint16_t (*rte_bbdev_enqueue_enc_ops_t)(
425 struct rte_bbdev_queue_data *q_data,
430typedef uint16_t (*rte_bbdev_enqueue_dec_ops_t)(
431 struct rte_bbdev_queue_data *q_data,
436typedef uint16_t (*rte_bbdev_enqueue_fft_ops_t)(
437 struct rte_bbdev_queue_data *q_data,
442typedef uint16_t (*rte_bbdev_dequeue_enc_ops_t)(
443 struct rte_bbdev_queue_data *q_data,
447typedef uint16_t (*rte_bbdev_dequeue_dec_ops_t)(
448 struct rte_bbdev_queue_data *q_data,
452typedef uint16_t (*rte_bbdev_dequeue_fft_ops_t)(
453 struct rte_bbdev_queue_data *q_data,
456#define RTE_BBDEV_NAME_MAX_LEN 64
464struct rte_bbdev_data {
468 struct rte_bbdev_queue_data *queues;
472 uint16_t process_cnt;
477struct rte_bbdev_callback;
478struct rte_intr_handle;
489 rte_bbdev_enqueue_enc_ops_t enqueue_enc_ops;
491 rte_bbdev_enqueue_dec_ops_t enqueue_dec_ops;
493 rte_bbdev_dequeue_enc_ops_t dequeue_enc_ops;
495 rte_bbdev_dequeue_dec_ops_t dequeue_dec_ops;
497 rte_bbdev_enqueue_enc_ops_t enqueue_ldpc_enc_ops;
499 rte_bbdev_enqueue_dec_ops_t enqueue_ldpc_dec_ops;
501 rte_bbdev_dequeue_enc_ops_t dequeue_ldpc_enc_ops;
503 rte_bbdev_dequeue_dec_ops_t dequeue_ldpc_dec_ops;
505 rte_bbdev_enqueue_fft_ops_t enqueue_fft_ops;
507 rte_bbdev_dequeue_fft_ops_t dequeue_fft_ops;
509 struct rte_bbdev_data *data;
511 struct rte_device *device;
513 struct rte_bbdev_cb_list list_cbs;
514 struct rte_intr_handle *intr_handle;
518extern struct rte_bbdev rte_bbdev_devices[];
541static inline uint16_t
545 struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
546 struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
547 return dev->enqueue_enc_ops(q_data, ops, num_ops);
571static inline uint16_t
575 struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
576 struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
577 return dev->enqueue_dec_ops(q_data, ops, num_ops);
601static inline uint16_t
605 struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
606 struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
607 return dev->enqueue_ldpc_enc_ops(q_data, ops, num_ops);
631static inline uint16_t
635 struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
636 struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
637 return dev->enqueue_ldpc_dec_ops(q_data, ops, num_ops);
662static inline uint16_t
666 struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
667 struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
668 return dev->enqueue_fft_ops(q_data, ops, num_ops);
693static inline uint16_t
697 struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
698 struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
699 return dev->dequeue_enc_ops(q_data, ops, num_ops);
725static inline uint16_t
729 struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
730 struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
731 return dev->dequeue_dec_ops(q_data, ops, num_ops);
756static inline uint16_t
760 struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
761 struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
762 return dev->dequeue_ldpc_enc_ops(q_data, ops, num_ops);
786static inline uint16_t
790 struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
791 struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
792 return dev->dequeue_ldpc_dec_ops(q_data, ops, num_ops);
817static inline uint16_t
821 struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
822 struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
823 return dev->dequeue_fft_ops(q_data, ops, num_ops);
int rte_bbdev_start(uint16_t dev_id)
@ RTE_BBDEV_DEV_FATAL_ERR
@ RTE_BBDEV_DEV_CORRECT_ERR
@ RTE_BBDEV_DEV_NOT_SUPPORTED
@ RTE_BBDEV_DEV_RECONFIG_REQ
@ RTE_BBDEV_DEV_CONFIGURED
@ RTE_BBDEV_DEV_RESTART_REQ
int rte_bbdev_queue_intr_enable(uint16_t dev_id, uint16_t queue_id)
@ RTE_BBDEV_ENQ_STATUS_INVALID_OP
@ RTE_BBDEV_ENQ_STATUS_RING_FULL
@ RTE_BBDEV_ENQ_STATUS_QUEUE_FULL
@ RTE_BBDEV_ENQ_STATUS_NONE
static __rte_experimental uint16_t rte_bbdev_dequeue_fft_ops(uint16_t dev_id, uint16_t queue_id, struct rte_bbdev_fft_op **ops, uint16_t num_ops)
int rte_bbdev_setup_queues(uint16_t dev_id, uint16_t num_queues, int socket_id)
RTE_TAILQ_HEAD(rte_bbdev_cb_list, rte_bbdev_callback)
int rte_bbdev_callback_register(uint16_t dev_id, enum rte_bbdev_event_type event, rte_bbdev_cb_fn cb_fn, void *cb_arg)
int rte_bbdev_stop(uint16_t dev_id)
int rte_bbdev_close(uint16_t dev_id)
uint16_t rte_bbdev_find_next(uint16_t dev_id)
__rte_experimental const char * rte_bbdev_device_status_str(enum rte_bbdev_device_status status)
static uint16_t rte_bbdev_dequeue_ldpc_dec_ops(uint16_t dev_id, uint16_t queue_id, struct rte_bbdev_dec_op **ops, uint16_t num_ops)
int rte_bbdev_info_get(uint16_t dev_id, struct rte_bbdev_info *dev_info)
uint16_t rte_bbdev_count(void)
int rte_bbdev_stats_reset(uint16_t dev_id)
static uint16_t rte_bbdev_enqueue_enc_ops(uint16_t dev_id, uint16_t queue_id, struct rte_bbdev_enc_op **ops, uint16_t num_ops)
@ RTE_BBDEV_EVENT_DEQUEUE
@ RTE_BBDEV_EVENT_UNKNOWN
int rte_bbdev_queue_configure(uint16_t dev_id, uint16_t queue_id, const struct rte_bbdev_queue_conf *conf)
__rte_experimental const char * rte_bbdev_enqueue_status_str(enum rte_bbdev_enqueue_status status)
void(* rte_bbdev_cb_fn)(uint16_t dev_id, enum rte_bbdev_event_type event, void *cb_arg, void *ret_param)
static uint16_t rte_bbdev_dequeue_ldpc_enc_ops(uint16_t dev_id, uint16_t queue_id, struct rte_bbdev_enc_op **ops, uint16_t num_ops)
int rte_bbdev_queue_info_get(uint16_t dev_id, uint16_t queue_id, struct rte_bbdev_queue_info *queue_info)
static uint16_t rte_bbdev_dequeue_dec_ops(uint16_t dev_id, uint16_t queue_id, struct rte_bbdev_dec_op **ops, uint16_t num_ops)
static uint16_t rte_bbdev_dequeue_enc_ops(uint16_t dev_id, uint16_t queue_id, struct rte_bbdev_enc_op **ops, uint16_t num_ops)
static uint16_t rte_bbdev_enqueue_ldpc_enc_ops(uint16_t dev_id, uint16_t queue_id, struct rte_bbdev_enc_op **ops, uint16_t num_ops)
bool rte_bbdev_is_valid(uint16_t dev_id)
int rte_bbdev_queue_start(uint16_t dev_id, uint16_t queue_id)
static uint16_t rte_bbdev_enqueue_ldpc_dec_ops(uint16_t dev_id, uint16_t queue_id, struct rte_bbdev_dec_op **ops, uint16_t num_ops)
int rte_bbdev_stats_get(uint16_t dev_id, struct rte_bbdev_stats *stats)
int rte_bbdev_callback_unregister(uint16_t dev_id, enum rte_bbdev_event_type event, rte_bbdev_cb_fn cb_fn, void *cb_arg)
static __rte_experimental uint16_t rte_bbdev_enqueue_fft_ops(uint16_t dev_id, uint16_t queue_id, struct rte_bbdev_fft_op **ops, uint16_t num_ops)
int rte_bbdev_intr_enable(uint16_t dev_id)
int rte_bbdev_queue_intr_disable(uint16_t dev_id, uint16_t queue_id)
int rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op, void *data)
static uint16_t rte_bbdev_enqueue_dec_ops(uint16_t dev_id, uint16_t queue_id, struct rte_bbdev_dec_op **ops, uint16_t num_ops)
int rte_bbdev_queue_stop(uint16_t dev_id, uint16_t queue_id)
#define RTE_BBDEV_NAME_MAX_LEN
#define __rte_cache_aligned
unsigned int max_num_queues
uint8_t max_dl_queue_priority
struct rte_bbdev_queue_conf default_queue_conf
unsigned int num_queues[RTE_BBDEV_OP_TYPE_SIZE_MAX]
unsigned int queue_priority[RTE_BBDEV_OP_TYPE_SIZE_MAX]
enum rte_cpu_flag_t * cpu_flag_reqs
uint32_t harq_buffer_size
const struct rte_bbdev_op_cap * capabilities
bool queue_intr_supported
enum rte_bbdev_device_status device_status
uint8_t max_ul_queue_priority
bool hardware_accelerated
struct rte_bbdev_driver_info drv
const struct rte_device * device
enum rte_bbdev_op_type op_type
struct rte_bbdev_queue_conf conf
uint64_t enqueue_status_count[RTE_BBDEV_ENQ_STATUS_SIZE_MAX]
uint64_t acc_offload_cycles
uint64_t enqueue_err_count
uint64_t enqueue_warn_count
uint64_t dequeue_err_count
uint64_t dequeue_warn_count