xref: /dpdk/doc/guides/bbdevs/acc100.rst (revision 765f42f1)
1..  SPDX-License-Identifier: BSD-3-Clause
2    Copyright(c) 2020 Intel Corporation
3
4Intel(R) ACC100 5G/4G FEC Poll Mode Driver
5==========================================
6
7The BBDEV ACC100 5G/4G FEC poll mode driver (PMD) supports an
8implementation of a VRAN FEC wireless acceleration function.
9This device is also known as Mount Bryce.
10
11Features
12--------
13
14ACC100 5G/4G FEC PMD supports the following features:
15
16- LDPC Encode in the DL (5GNR)
17- LDPC Decode in the UL (5GNR)
18- Turbo Encode in the DL (4G)
19- Turbo Decode in the UL (4G)
20- 16 VFs per PF (physical device)
21- Maximum of 128 queues per VF
22- PCIe Gen-3 x16 Interface
23- MSI
24- SR-IOV
25
26ACC100 5G/4G FEC PMD supports the following BBDEV capabilities:
27
28* For the LDPC encode operation:
29   - ``RTE_BBDEV_LDPC_CRC_24B_ATTACH`` :  set to attach CRC24B to CB(s)
30   - ``RTE_BBDEV_LDPC_RATE_MATCH`` :  if set then do not do Rate Match bypass
31   - ``RTE_BBDEV_LDPC_INTERLEAVER_BYPASS`` : if set then bypass interleaver
32
33* For the LDPC decode operation:
34   - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK`` :  check CRC24B from CB(s)
35   - ``RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE`` :  disable early termination
36   - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP`` :  drops CRC24B bits appended while decoding
37   - ``RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE`` :  provides an input for HARQ combining
38   - ``RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE`` :  provides an input for HARQ combining
39   - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE`` :  HARQ memory input is internal
40   - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE`` :  HARQ memory output is internal
41   - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK`` :  loopback data to/from HARQ memory
42   - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS`` :  HARQ memory includes the fillers bits
43   - ``RTE_BBDEV_LDPC_DEC_SCATTER_GATHER`` :  supports scatter-gather for input/output data
44   - ``RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION`` :  supports compression of the HARQ input/output
45   - ``RTE_BBDEV_LDPC_LLR_COMPRESSION`` :  supports LLR input compression
46
47* For the turbo encode operation:
48   - ``RTE_BBDEV_TURBO_CRC_24B_ATTACH`` :  set to attach CRC24B to CB(s)
49   - ``RTE_BBDEV_TURBO_RATE_MATCH`` :  if set then do not do Rate Match bypass
50   - ``RTE_BBDEV_TURBO_ENC_INTERRUPTS`` :  set for encoder dequeue interrupts
51   - ``RTE_BBDEV_TURBO_RV_INDEX_BYPASS`` :  set to bypass RV index
52   - ``RTE_BBDEV_TURBO_ENC_SCATTER_GATHER`` :  supports scatter-gather for input/output data
53
54* For the turbo decode operation:
55   - ``RTE_BBDEV_TURBO_CRC_TYPE_24B`` :  check CRC24B from CB(s)
56   - ``RTE_BBDEV_TURBO_SUBBLOCK_DEINTERLEAVE`` :  perform subblock de-interleave
57   - ``RTE_BBDEV_TURBO_DEC_INTERRUPTS`` :  set for decoder dequeue interrupts
58   - ``RTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN`` :  set if negative LLR encoder i/p is supported
59   - ``RTE_BBDEV_TURBO_POS_LLR_1_BIT_IN`` :  set if positive LLR encoder i/p is supported
60   - ``RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP`` :  keep CRC24B bits appended while decoding
61   - ``RTE_BBDEV_TURBO_DEC_CRC_24B_DROP`` : option to drop the code block CRC after decoding
62   - ``RTE_BBDEV_TURBO_EARLY_TERMINATION`` :  set early termination feature
63   - ``RTE_BBDEV_TURBO_DEC_SCATTER_GATHER`` :  supports scatter-gather for input/output data
64   - ``RTE_BBDEV_TURBO_HALF_ITERATION_EVEN`` :  set half iteration granularity
65
66Installation
67------------
68
69Section 3 of the DPDK manual provides instructions on installing and compiling DPDK.
70
71DPDK requires hugepages to be configured as detailed in section 2 of the DPDK manual.
72The bbdev test application has been tested with a configuration 40 x 1GB hugepages. The
73hugepage configuration of a server may be examined using:
74
75.. code-block:: console
76
77   grep Huge* /proc/meminfo
78
79
80Initialization
81--------------
82
83When the device first powers up, its PCI Physical Functions (PF) can be listed through this command:
84
85.. code-block:: console
86
87  sudo lspci -vd8086:0d5c
88
89The physical and virtual functions are compatible with Linux UIO drivers:
90``vfio`` and ``igb_uio``. However, in order to work the ACC100 5G/4G
91FEC device first needs to be bound to one of these linux drivers through DPDK.
92
93
94Bind PF UIO driver(s)
95~~~~~~~~~~~~~~~~~~~~~
96
97Install the DPDK igb_uio driver, bind it with the PF PCI device ID and use
98``lspci`` to confirm the PF device is under use by ``igb_uio`` DPDK UIO driver.
99
100The igb_uio driver may be bound to the PF PCI device using one of two methods:
101
102
1031. PCI functions (physical or virtual, depending on the use case) can be bound to
104the UIO driver by repeating this command for every function.
105
106.. code-block:: console
107
108  cd <dpdk-top-level-directory>
109  insmod ./build/kmod/igb_uio.ko
110  echo "8086 0d5c" > /sys/bus/pci/drivers/igb_uio/new_id
111  lspci -vd8086:0d5c
112
113
1142. Another way to bind PF with DPDK UIO driver is by using the ``dpdk-devbind.py`` tool
115
116.. code-block:: console
117
118  cd <dpdk-top-level-directory>
119  ./usertools/dpdk-devbind.py -b igb_uio 0000:06:00.0
120
121where the PCI device ID (example: 0000:06:00.0) is obtained using lspci -vd8086:0d5c
122
123
124In a similar way the ACC100 5G/4G FEC PF may be bound with vfio-pci as any PCIe device.
125
126
127Enable Virtual Functions
128~~~~~~~~~~~~~~~~~~~~~~~~
129
130Now, it should be visible in the printouts that PCI PF is under igb_uio control
131"``Kernel driver in use: igb_uio``"
132
133To show the number of available VFs on the device, read ``sriov_totalvfs`` file..
134
135.. code-block:: console
136
137  cat /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/sriov_totalvfs
138
139  where 0000\:<b>\:<d>.<f> is the PCI device ID
140
141
142To enable VFs via igb_uio, echo the number of virtual functions intended to
143enable to ``max_vfs`` file..
144
145.. code-block:: console
146
147  echo <num-of-vfs> > /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/max_vfs
148
149
150Afterwards, all VFs must be bound to appropriate UIO drivers as required, same
151way it was done with the physical function previously.
152
153Enabling SR-IOV via vfio driver is pretty much the same, except that the file
154name is different:
155
156.. code-block:: console
157
158  echo <num-of-vfs> > /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/sriov_numvfs
159
160
161Configure the VFs through PF
162~~~~~~~~~~~~~~~~~~~~~~~~~~~~
163
164The PCI virtual functions must be configured before working or getting assigned
165to VMs/Containers. The configuration involves allocating the number of hardware
166queues, priorities, load balance, bandwidth and other settings necessary for the
167device to perform FEC functions.
168
169This configuration needs to be executed at least once after reboot or PCI FLR and can
170be achieved by using the function ``acc100_configure()``, which sets up the
171parameters defined in ``acc100_conf`` structure.
172
173Test Application
174----------------
175
176BBDEV provides a test application, ``test-bbdev.py`` and range of test data for testing
177the functionality of ACC100 5G/4G FEC encode and decode, depending on the device's
178capabilities. The test application is located under app->test-bbdev folder and has the
179following options:
180
181.. code-block:: console
182
183  "-p", "--testapp-path": specifies path to the bbdev test app.
184  "-e", "--eal-params"	: EAL arguments which are passed to the test app.
185  "-t", "--timeout"	: Timeout in seconds (default=300).
186  "-c", "--test-cases"	: Defines test cases to run. Run all if not specified.
187  "-v", "--test-vector"	: Test vector path (default=dpdk_path+/app/test-bbdev/test_vectors/bbdev_null.data).
188  "-n", "--num-ops"	: Number of operations to process on device (default=32).
189  "-b", "--burst-size"	: Operations enqueue/dequeue burst size (default=32).
190  "-s", "--snr"		: SNR in dB used when generating LLRs for bler tests.
191  "-s", "--iter_max"	: Number of iterations for LDPC decoder.
192  "-l", "--num-lcores"	: Number of lcores to run (default=16).
193  "-i", "--init-device" : Initialise PF device with default values.
194
195
196To execute the test application tool using simple decode or encode data,
197type one of the following:
198
199.. code-block:: console
200
201  ./test-bbdev.py -c validation -n 64 -b 1 -v ./ldpc_dec_default.data
202  ./test-bbdev.py -c validation -n 64 -b 1 -v ./ldpc_enc_default.data
203
204
205The test application ``test-bbdev.py``, supports the ability to configure the PF device with
206a default set of values, if the "-i" or "- -init-device" option is included. The default values
207are defined in test_bbdev_perf.c.
208
209
210Test Vectors
211~~~~~~~~~~~~
212
213In addition to the simple LDPC decoder and LDPC encoder tests, bbdev also provides
214a range of additional tests under the test_vectors folder, which may be useful. The results
215of these tests will depend on the ACC100 5G/4G FEC capabilities which may cause some
216testcases to be skipped, but no failure should be reported.
217
218
219Alternate Baseband Device configuration tool
220~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
221
222On top of the embedded configuration feature supported in test-bbdev using "- -init-device"
223option mentioned above, there is also a tool available to perform that device configuration
224using a companion application.
225The ``pf_bb_config`` application notably enables then to run bbdev-test from the VF
226and not only limited to the PF as captured above.
227
228See for more details: https://github.com/intel/pf-bb-config
229
230Specifically for the BBDEV ACC100 PMD, the command below can be used:
231
232.. code-block:: console
233
234  ./pf_bb_config ACC100 -c acc100/acc100_config_vf_5g.cfg
235  ./test-bbdev.py -e="-c 0xff0 -a${VF_PCI_ADDR}" -c validation -n 64 -b 32 -l 1 -v ./ldpc_dec_default.data
236