xref: /dpdk/drivers/baseband/fpga_lte_fec/fpga_lte_fec.h (revision 1094dd940ec0cc4e3ce2c5cd94807350855a17f9)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2019 Intel Corporation
3  */
4 
5 #ifndef _FPGA_LTE_FEC_H_
6 #define _FPGA_LTE_FEC_H_
7 
8 #include <stdint.h>
9 #include <stdbool.h>
10 
11 #include <rte_compat.h>
12 
13 /**
14  * @file fpga_lte_fec.h
15  *
16  * Interface for Intel(R) FGPA LTE FEC device configuration at the host level,
17  * directly accessible by the application.
18  * Configuration related to LTE Turbo coding functionality is done through
19  * librte_bbdev library.
20  *
21  * @warning
22  * @b EXPERIMENTAL: this API may change without prior notice
23  */
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 /**< Number of Virtual Functions FGPA 4G FEC supports */
30 #define FPGA_LTE_FEC_NUM_VFS 8
31 
32 /**
33  * Structure to pass FPGA 4G FEC configuration.
34  */
35 struct rte_fpga_lte_fec_conf {
36 	/**< 1 if PF is used for dataplane, 0 for VFs */
37 	bool pf_mode_en;
38 	/**< Number of UL queues per VF */
39 	uint8_t vf_ul_queues_number[FPGA_LTE_FEC_NUM_VFS];
40 	/**< Number of DL queues per VF */
41 	uint8_t vf_dl_queues_number[FPGA_LTE_FEC_NUM_VFS];
42 	/**< UL bandwidth. Needed for schedule algorithm */
43 	uint8_t ul_bandwidth;
44 	/**< DL bandwidth. Needed for schedule algorithm */
45 	uint8_t dl_bandwidth;
46 	/**< UL Load Balance */
47 	uint8_t ul_load_balance;
48 	/**< DL Load Balance */
49 	uint8_t dl_load_balance;
50 	/**< FLR timeout value */
51 	uint16_t flr_time_out;
52 };
53 
54 /**
55  * Configure Intel(R) FPGA LTE FEC device
56  *
57  * @param dev_name
58  *   The name of the device. This is the short form of PCI BDF, e.g. 00:01.0.
59  *   It can also be retrieved for a bbdev device from the dev_name field in the
60  *   rte_bbdev_info structure returned by rte_bbdev_info_get().
61  * @param conf
62  *   Configuration to apply to FPGA 4G FEC.
63  *
64  * @return
65  *   Zero on success, negative value on failure.
66  */
67 __rte_experimental
68 int
69 rte_fpga_lte_fec_configure(const char *dev_name,
70 		const struct rte_fpga_lte_fec_conf *conf);
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif /* _FPGA_LTE_FEC_H_ */
77