1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2020 Intel Corporation
5 #ifndef _RTE_ACC100_CFG_H_
6 #define _RTE_ACC100_CFG_H_
9 * @file rte_acc100_cfg.h
11 * Functions for configuring ACC100 HW, exposed directly to applications.
12 * Configuration related to encoding/decoding is done through the
13 * librte_bbdev library.
16 * @b EXPERIMENTAL: this API may change without prior notice
25 /**< Number of Virtual Functions ACC100 supports */
26 #define RTE_ACC100_NUM_VFS 16
29 * Definition of Queue Topology for ACC100 Configuration
30 * Some level of details is abstracted out to expose a clean interface
31 * given that comprehensive flexibility is not required
33 struct rte_acc100_queue_topology {
34 /** Number of QGroups in incremental order of priority */
37 * All QGroups have the same number of AQs here.
38 * Note : Could be made a 16-array if more flexibility is really
41 uint16_t num_aqs_per_groups;
43 * Depth of the AQs is the same of all QGroups here. Log2 Enum : 2^N
44 * Note : Could be made a 16-array if more flexibility is really
47 uint16_t aq_depth_log2;
49 * Index of the first Queue Group Index - assuming contiguity
52 int8_t first_qgroup_index;
56 * Definition of Arbitration related parameters for ACC100 Configuration
58 struct rte_acc100_arbitration {
59 /** Default Weight for VF Fairness Arbitration */
60 uint16_t round_robin_weight;
61 uint32_t gbr_threshold1; /**< Guaranteed Bitrate Threshold 1 */
62 uint32_t gbr_threshold2; /**< Guaranteed Bitrate Threshold 2 */
66 * Structure to pass ACC100 configuration.
67 * Note: all VF Bundles will have the same configuration.
69 struct rte_acc100_conf {
70 bool pf_mode_en; /**< 1 if PF is used for dataplane, 0 for VFs */
71 /** 1 if input '1' bit is represented by a positive LLR value, 0 if '1'
72 * bit is represented by a negative value.
74 bool input_pos_llr_1_bit;
75 /** 1 if output '1' bit is represented by a positive value, 0 if '1'
76 * bit is represented by a negative value.
78 bool output_pos_llr_1_bit;
79 uint16_t num_vf_bundles; /**< Number of VF bundles to setup */
80 /** Queue topology for each operation type */
81 struct rte_acc100_queue_topology q_ul_4g;
82 struct rte_acc100_queue_topology q_dl_4g;
83 struct rte_acc100_queue_topology q_ul_5g;
84 struct rte_acc100_queue_topology q_dl_5g;
85 /** Arbitration configuration for each operation type */
86 struct rte_acc100_arbitration arb_ul_4g[RTE_ACC100_NUM_VFS];
87 struct rte_acc100_arbitration arb_dl_4g[RTE_ACC100_NUM_VFS];
88 struct rte_acc100_arbitration arb_ul_5g[RTE_ACC100_NUM_VFS];
89 struct rte_acc100_arbitration arb_dl_5g[RTE_ACC100_NUM_VFS];
93 * Configure a ACC100 device
96 * The name of the device. This is the short form of PCI BDF, e.g. 00:01.0.
97 * It can also be retrieved for a bbdev device from the dev_name field in the
98 * rte_bbdev_info structure returned by rte_bbdev_info_get().
100 * Configuration to apply to ACC100 HW.
103 * Zero on success, negative value on failure.
107 rte_acc100_configure(const char *dev_name, struct rte_acc100_conf *conf);
113 #endif /* _RTE_ACC100_CFG_H_ */