xref: /dpdk/doc/guides/bbdevs/fpga_lte_fec.rst (revision 33f32941ee509f3b66c0c51c44a0288b9c4eec5b)
1efd45369SNicolas Chautru..  SPDX-License-Identifier: BSD-3-Clause
2efd45369SNicolas Chautru    Copyright(c) 2019 Intel Corporation
3efd45369SNicolas Chautru
4efd45369SNicolas ChautruIntel(R) FPGA LTE FEC Poll Mode Driver
5efd45369SNicolas Chautru======================================
6efd45369SNicolas Chautru
7efd45369SNicolas ChautruThe BBDEV FPGA LTE FEC poll mode driver (PMD) supports an FPGA implementation of a VRAN
8efd45369SNicolas ChautruTurbo Encode / Decode LTE wireless acceleration function, using Intel's PCI-e and FPGA
9efd45369SNicolas Chautrubased Vista Creek device.
10efd45369SNicolas Chautru
11efd45369SNicolas ChautruFeatures
12efd45369SNicolas Chautru--------
13efd45369SNicolas Chautru
14efd45369SNicolas ChautruFPGA LTE FEC PMD supports the following features:
15efd45369SNicolas Chautru
16efd45369SNicolas Chautru- Turbo Encode in the DL with total throughput of 4.5 Gbits/s
17efd45369SNicolas Chautru- Turbo Decode in the UL with total throughput of 1.5 Gbits/s assuming 8 decoder iterations
18efd45369SNicolas Chautru- 8 VFs per PF (physical device)
19efd45369SNicolas Chautru- Maximum of 32 UL queues per VF
20efd45369SNicolas Chautru- Maximum of 32 DL queues per VF
21efd45369SNicolas Chautru- PCIe Gen-3 x8 Interface
22efd45369SNicolas Chautru- MSI-X
23efd45369SNicolas Chautru- SR-IOV
24efd45369SNicolas Chautru
25efd45369SNicolas Chautru
26efd45369SNicolas ChautruFPGA LTE FEC PMD supports the following BBDEV capabilities:
27efd45369SNicolas Chautru
28efd45369SNicolas Chautru* For the turbo encode operation:
29efd45369SNicolas Chautru   - ``RTE_BBDEV_TURBO_CRC_24B_ATTACH`` :  set to attach CRC24B to CB(s)
30efd45369SNicolas Chautru   - ``RTE_BBDEV_TURBO_RATE_MATCH`` :  if set then do not do Rate Match bypass
31efd45369SNicolas Chautru   - ``RTE_BBDEV_TURBO_ENC_INTERRUPTS`` :  set for encoder dequeue interrupts
32efd45369SNicolas Chautru
33efd45369SNicolas Chautru
34efd45369SNicolas Chautru* For the turbo decode operation:
35efd45369SNicolas Chautru   - ``RTE_BBDEV_TURBO_CRC_TYPE_24B`` :  check CRC24B from CB(s)
36efd45369SNicolas Chautru   - ``RTE_BBDEV_TURBO_SUBBLOCK_DEINTERLEAVE`` :  perform subblock de-interleave
37efd45369SNicolas Chautru   - ``RTE_BBDEV_TURBO_DEC_INTERRUPTS`` :  set for decoder dequeue interrupts
38efd45369SNicolas Chautru   - ``RTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN`` :  set if negative LLR encoder i/p is supported
39efd45369SNicolas Chautru   - ``RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP`` :  keep CRC24B bits appended while decoding
40efd45369SNicolas Chautru
41efd45369SNicolas Chautru
42efd45369SNicolas ChautruLimitations
43efd45369SNicolas Chautru-----------
44efd45369SNicolas Chautru
45efd45369SNicolas ChautruFPGA LTE FEC does not support the following:
46efd45369SNicolas Chautru
47efd45369SNicolas Chautru- Scatter-Gather function
48efd45369SNicolas Chautru
49efd45369SNicolas Chautru
50efd45369SNicolas ChautruInstallation
51efd45369SNicolas Chautru--------------
52efd45369SNicolas Chautru
5307a2a572SCiara PowerSection 3 of the DPDK manual provides instructions on installing and compiling DPDK.
54efd45369SNicolas Chautru
55efd45369SNicolas ChautruDPDK requires hugepages to be configured as detailed in section 2 of the DPDK manual.
56efd45369SNicolas ChautruThe bbdev test application has been tested with a configuration 40 x 1GB hugepages. The
57efd45369SNicolas Chautruhugepage configuration of a server may be examined using:
58efd45369SNicolas Chautru
59efd45369SNicolas Chautru.. code-block:: console
60efd45369SNicolas Chautru
61efd45369SNicolas Chautru   grep Huge* /proc/meminfo
62efd45369SNicolas Chautru
63efd45369SNicolas Chautru
64efd45369SNicolas ChautruInitialization
65efd45369SNicolas Chautru--------------
66efd45369SNicolas Chautru
67efd45369SNicolas ChautruWhen the device first powers up, its PCI Physical Functions (PF) can be listed through this command:
68efd45369SNicolas Chautru
69efd45369SNicolas Chautru.. code-block:: console
70efd45369SNicolas Chautru
71efd45369SNicolas Chautru  sudo lspci -vd1172:5052
72efd45369SNicolas Chautru
73efd45369SNicolas ChautruThe physical and virtual functions are compatible with Linux UIO drivers:
74*33f32941SDavid Marchand``vfio_pci`` and ``igb_uio``. However, in order to work the FPGA LTE FEC device firstly needs
75efd45369SNicolas Chautruto be bound to one of these linux drivers through DPDK.
76efd45369SNicolas Chautru
77*33f32941SDavid MarchandFor more details on how to bind the PF device and create VF devices, see
78*33f32941SDavid Marchand:ref:`linux_gsg_binding_kernel`.
79efd45369SNicolas Chautru
80efd45369SNicolas Chautru
81efd45369SNicolas ChautruConfigure the VFs through PF
82efd45369SNicolas Chautru~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
83efd45369SNicolas Chautru
84efd45369SNicolas ChautruThe PCI virtual functions must be configured before working or getting assigned
85efd45369SNicolas Chautruto VMs/Containers. The configuration involves allocating the number of hardware
86efd45369SNicolas Chautruqueues, priorities, load balance, bandwidth and other settings necessary for the
87efd45369SNicolas Chautrudevice to perform FEC functions.
88efd45369SNicolas Chautru
89efd45369SNicolas ChautruThis configuration needs to be executed at least once after reboot or PCI FLR and can
90e6925585SMaxime Coquelinbe achieved by using the function ``rte_fpga_lte_fec_configure()``, which sets up the
91e6925585SMaxime Coquelinparameters defined in ``rte_fpga_lte_fec_conf`` structure:
92efd45369SNicolas Chautru
93efd45369SNicolas Chautru.. code-block:: c
94efd45369SNicolas Chautru
95e6925585SMaxime Coquelin  struct rte_fpga_lte_fec_conf {
96efd45369SNicolas Chautru      bool pf_mode_en;
97efd45369SNicolas Chautru      uint8_t vf_ul_queues_number[FPGA_LTE_FEC_NUM_VFS];
98efd45369SNicolas Chautru      uint8_t vf_dl_queues_number[FPGA_LTE_FEC_NUM_VFS];
99efd45369SNicolas Chautru      uint8_t ul_bandwidth;
100efd45369SNicolas Chautru      uint8_t dl_bandwidth;
101efd45369SNicolas Chautru      uint8_t ul_load_balance;
102efd45369SNicolas Chautru      uint8_t dl_load_balance;
103efd45369SNicolas Chautru      uint16_t flr_time_out;
104efd45369SNicolas Chautru  };
105efd45369SNicolas Chautru
106efd45369SNicolas Chautru- ``pf_mode_en``: identifies whether only PF is to be used, or the VFs. PF and
107efd45369SNicolas Chautru  VFs are mutually exclusive and cannot run simultaneously.
108efd45369SNicolas Chautru  Set to 1 for PF mode enabled.
109efd45369SNicolas Chautru  If PF mode is enabled all queues available in the device are assigned
110efd45369SNicolas Chautru  exclusively to PF and 0 queues given to VFs.
111efd45369SNicolas Chautru
112efd45369SNicolas Chautru- ``vf_*l_queues_number``: defines the hardware queue mapping for every VF.
113efd45369SNicolas Chautru
114efd45369SNicolas Chautru- ``*l_bandwidth``: in case of congestion on PCIe interface. The device
115efd45369SNicolas Chautru  allocates different bandwidth to UL and DL. The weight is configured by this
116efd45369SNicolas Chautru  setting. The unit of weight is 3 code blocks. For example, if the code block
117efd45369SNicolas Chautru  cbps (code block per second) ratio between UL and DL is 12:1, then the
118efd45369SNicolas Chautru  configuration value should be set to 36:3. The schedule algorithm is based
119efd45369SNicolas Chautru  on code block regardless the length of each block.
120efd45369SNicolas Chautru
121efd45369SNicolas Chautru- ``*l_load_balance``: hardware queues are load-balanced in a round-robin
122efd45369SNicolas Chautru  fashion. Queues get filled first-in first-out until they reach a pre-defined
123efd45369SNicolas Chautru  watermark level, if exceeded, they won't get assigned new code blocks..
124efd45369SNicolas Chautru  This watermark is defined by this setting.
125efd45369SNicolas Chautru
126efd45369SNicolas Chautru  If all hardware queues exceeds the watermark, no code blocks will be
127efd45369SNicolas Chautru  streamed in from UL/DL code block FIFO.
128efd45369SNicolas Chautru
129efd45369SNicolas Chautru- ``flr_time_out``: specifies how many 16.384us to be FLR time out. The
130efd45369SNicolas Chautru  time_out = flr_time_out x 16.384us. For instance, if you want to set 10ms for
131efd45369SNicolas Chautru  the FLR time out then set this setting to 0x262=610.
132efd45369SNicolas Chautru
133efd45369SNicolas Chautru
134e6925585SMaxime CoquelinAn example configuration code calling the function ``rte_fpga_lte_fec_configure()`` is shown
135efd45369SNicolas Chautrubelow:
136efd45369SNicolas Chautru
137efd45369SNicolas Chautru.. code-block:: c
138efd45369SNicolas Chautru
139e6925585SMaxime Coquelin  struct rte_fpga_lte_fec_conf conf;
140efd45369SNicolas Chautru  unsigned int i;
141efd45369SNicolas Chautru
142e6925585SMaxime Coquelin  memset(&conf, 0, sizeof(struct rte_fpga_lte_fec_conf));
143efd45369SNicolas Chautru  conf.pf_mode_en = 1;
144efd45369SNicolas Chautru
145efd45369SNicolas Chautru  for (i = 0; i < FPGA_LTE_FEC_NUM_VFS; ++i) {
146efd45369SNicolas Chautru      conf.vf_ul_queues_number[i] = 4;
147efd45369SNicolas Chautru      conf.vf_dl_queues_number[i] = 4;
148efd45369SNicolas Chautru  }
149efd45369SNicolas Chautru  conf.ul_bandwidth = 12;
150efd45369SNicolas Chautru  conf.dl_bandwidth = 5;
151efd45369SNicolas Chautru  conf.dl_load_balance = 64;
152efd45369SNicolas Chautru  conf.ul_load_balance = 64;
153efd45369SNicolas Chautru
154efd45369SNicolas Chautru  /* setup FPGA PF */
155e6925585SMaxime Coquelin  ret = rte_fpga_lte_fec_configure(info->dev_name, &conf);
156efd45369SNicolas Chautru  TEST_ASSERT_SUCCESS(ret,
157efd45369SNicolas Chautru      "Failed to configure 4G FPGA PF for bbdev %s",
158efd45369SNicolas Chautru      info->dev_name);
159efd45369SNicolas Chautru
160efd45369SNicolas Chautru
161efd45369SNicolas ChautruTest Application
162efd45369SNicolas Chautru----------------
163efd45369SNicolas Chautru
164efd45369SNicolas ChautruBBDEV provides a test application, ``test-bbdev.py`` and range of test data for testing
16522900d7fSNicolas Chautruthe functionality of the device, depending on the device's capabilities.
166efd45369SNicolas Chautru
16722900d7fSNicolas ChautruFor more details on how to use the test application,
16822900d7fSNicolas Chautrusee :ref:`test_bbdev_application`.
169efd45369SNicolas Chautru
170efd45369SNicolas ChautruTest Vectors
171efd45369SNicolas Chautru~~~~~~~~~~~~
172efd45369SNicolas Chautru
173efd45369SNicolas ChautruIn addition to the simple turbo decoder and turbo encoder tests, bbdev also provides
174efd45369SNicolas Chautrua range of additional tests under the test_vectors folder, which may be useful. The results
175efd45369SNicolas Chautruof these tests will depend on the FPGA LTE FEC capabilities:
176efd45369SNicolas Chautru
177efd45369SNicolas Chautru* turbo decoder tests:
178efd45369SNicolas Chautru   - ``turbo_dec_c1_k6144_r0_e10376_crc24b_sbd_negllr_high_snr.data``
179efd45369SNicolas Chautru   - ``turbo_dec_c1_k6144_r0_e10376_crc24b_sbd_negllr_low_snr.data``
180efd45369SNicolas Chautru   - ``turbo_dec_c1_k6144_r0_e34560_negllr.data``
181efd45369SNicolas Chautru   - ``turbo_dec_c1_k6144_r0_e34560_sbd_negllr.data``
182efd45369SNicolas Chautru   - ``turbo_dec_c2_k3136_r0_e4920_sbd_negllr_crc24b.data``
183efd45369SNicolas Chautru   - ``turbo_dec_c2_k3136_r0_e4920_sbd_negllr.data``
184efd45369SNicolas Chautru
185efd45369SNicolas Chautru
186efd45369SNicolas Chautru* turbo encoder tests:
187efd45369SNicolas Chautru   - ``turbo_enc_c1_k40_r0_e1190_rm.data``
188efd45369SNicolas Chautru   - ``turbo_enc_c1_k40_r0_e1194_rm.data``
189efd45369SNicolas Chautru   - ``turbo_enc_c1_k40_r0_e1196_rm.data``
190efd45369SNicolas Chautru   - ``turbo_enc_c1_k40_r0_e272_rm.data``
191efd45369SNicolas Chautru   - ``turbo_enc_c1_k6144_r0_e18444.data``
192efd45369SNicolas Chautru   - ``turbo_enc_c1_k6144_r0_e32256_crc24b_rm.data``
193efd45369SNicolas Chautru   - ``turbo_enc_c2_k5952_r0_e17868_crc24b.data``
194efd45369SNicolas Chautru   - ``turbo_enc_c3_k4800_r2_e14412_crc24b.data``
195efd45369SNicolas Chautru   - ``turbo_enc_c4_k4800_r2_e14412_crc24b.data``
196fbef5a42SNicolas Chautru
197fbef5a42SNicolas Chautru
198fbef5a42SNicolas ChautruAlternate Baseband Device configuration tool
199fbef5a42SNicolas Chautru~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
200fbef5a42SNicolas Chautru
201fbef5a42SNicolas ChautruOn top of the embedded configuration feature supported in test-bbdev using "- -init-device"
202fbef5a42SNicolas Chautruoption, there is also a tool available to perform that device configuration using a companion
203fbef5a42SNicolas Chautruapplication.
204fbef5a42SNicolas ChautruThe ``pf_bb_config`` application notably enables then to run bbdev-test from the VF
205fbef5a42SNicolas Chautruand not only limited to the PF as captured above.
206fbef5a42SNicolas Chautru
207fbef5a42SNicolas ChautruSee for more details: https://github.com/intel/pf-bb-config
208fbef5a42SNicolas Chautru
209fbef5a42SNicolas ChautruSpecifically for the BBDEV FPGA LTE FEC PMD, the command below can be used:
210fbef5a42SNicolas Chautru
211fbef5a42SNicolas Chautru.. code-block:: console
212fbef5a42SNicolas Chautru
213fbef5a42SNicolas Chautru  ./pf_bb_config FPGA_LTE -c fpga_lte/fpga_lte_config_vf.cfg
214db27370bSStephen Hemminger  ./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -n 64 -b 32 -l 1 -v ./turbo_dec_default.data
215