xref: /dpdk/doc/guides/bbdevs/fpga_5gnr_fec.rst (revision 44dc6faa796f13f8f15f4c7d52ceb50979e94bc9)
10b5927cbSNicolas Chautru..  SPDX-License-Identifier: BSD-3-Clause
20b5927cbSNicolas Chautru    Copyright(c) 2019 Intel Corporation
30b5927cbSNicolas Chautru
40b5927cbSNicolas ChautruIntel(R) FPGA 5GNR FEC Poll Mode Driver
50b5927cbSNicolas Chautru=======================================
60b5927cbSNicolas Chautru
70b5927cbSNicolas ChautruThe BBDEV FPGA 5GNR FEC poll mode driver (PMD) supports an FPGA implementation of a VRAN
80b5927cbSNicolas ChautruLDPC Encode / Decode 5GNR wireless acceleration function, using Intel's PCI-e and FPGA
90b5927cbSNicolas Chautrubased Vista Creek device.
100b5927cbSNicolas Chautru
110b5927cbSNicolas ChautruFeatures
120b5927cbSNicolas Chautru--------
130b5927cbSNicolas Chautru
140b5927cbSNicolas ChautruFPGA 5GNR FEC PMD supports the following features:
150b5927cbSNicolas Chautru
16*44dc6faaSNicolas Chautru- LDPC Encode in the DL
17*44dc6faaSNicolas Chautru- LDPC Decode in the UL
180b5927cbSNicolas Chautru- 8 VFs per PF (physical device)
190b5927cbSNicolas Chautru- Maximum of 32 UL queues per VF
200b5927cbSNicolas Chautru- Maximum of 32 DL queues per VF
210b5927cbSNicolas Chautru- PCIe Gen-3 x8 Interface
220b5927cbSNicolas Chautru- MSI-X
230b5927cbSNicolas Chautru- SR-IOV
240b5927cbSNicolas Chautru
25*44dc6faaSNicolas ChautruFPGA 5GNR FEC PMD supports the following BBDEV capabilities:
26*44dc6faaSNicolas Chautru
27*44dc6faaSNicolas Chautru* For the LDPC encode operation:
28*44dc6faaSNicolas Chautru   - ``RTE_BBDEV_LDPC_CRC_24B_ATTACH`` :  set to attach CRC24B to CB(s)
29*44dc6faaSNicolas Chautru   - ``RTE_BBDEV_LDPC_RATE_MATCH`` :  if set then do not do Rate Match bypass
30*44dc6faaSNicolas Chautru
31*44dc6faaSNicolas Chautru* For the LDPC decode operation:
32*44dc6faaSNicolas Chautru   - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK`` :  check CRC24B from CB(s)
33*44dc6faaSNicolas Chautru   - ``RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE`` :  disable early termination
34*44dc6faaSNicolas Chautru   - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP`` :  drops CRC24B bits appended while decoding
35*44dc6faaSNicolas Chautru   - ``RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE`` :  provides an input for HARQ combining
36*44dc6faaSNicolas Chautru   - ``RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE`` :  provides an input for HARQ combining
37*44dc6faaSNicolas Chautru   - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE`` :  HARQ memory input is internal
38*44dc6faaSNicolas Chautru   - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE`` :  HARQ memory output is internal
39*44dc6faaSNicolas Chautru   - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK`` :  loopback data to/from HARQ memory
40*44dc6faaSNicolas Chautru   - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS`` :  HARQ memory includes the fillers bits
41*44dc6faaSNicolas Chautru
42*44dc6faaSNicolas Chautru
430b5927cbSNicolas ChautruLimitations
440b5927cbSNicolas Chautru-----------
450b5927cbSNicolas Chautru
460b5927cbSNicolas ChautruFPGA 5GNR FEC does not support the following:
470b5927cbSNicolas Chautru
480b5927cbSNicolas Chautru- Scatter-Gather function
490b5927cbSNicolas Chautru
500b5927cbSNicolas Chautru
510b5927cbSNicolas ChautruInstallation
520b5927cbSNicolas Chautru------------
530b5927cbSNicolas Chautru
540b5927cbSNicolas ChautruSection 3 of the DPDK manual provides instuctions on installing and compiling DPDK. The
550b5927cbSNicolas Chautrudefault set of bbdev compile flags may be found in config/common_base, where for example
560b5927cbSNicolas Chautruthe flag to build the FPGA 5GNR FEC device, ``CONFIG_RTE_LIBRTE_PMD_BBDEV_FPGA_5GNR_FEC``,
570b5927cbSNicolas Chautruis already set. It is assumed DPDK has been compiled using for instance:
580b5927cbSNicolas Chautru
590b5927cbSNicolas Chautru.. code-block:: console
600b5927cbSNicolas Chautru
610b5927cbSNicolas Chautru  make install T=x86_64-native-linuxapp-gcc
620b5927cbSNicolas Chautru
630b5927cbSNicolas Chautru
640b5927cbSNicolas ChautruDPDK requires hugepages to be configured as detailed in section 2 of the DPDK manual.
650b5927cbSNicolas ChautruThe bbdev test application has been tested with a configuration 40 x 1GB hugepages. The
660b5927cbSNicolas Chautruhugepage configuration of a server may be examined using:
670b5927cbSNicolas Chautru
680b5927cbSNicolas Chautru.. code-block:: console
690b5927cbSNicolas Chautru
700b5927cbSNicolas Chautru   grep Huge* /proc/meminfo
710b5927cbSNicolas Chautru
720b5927cbSNicolas Chautru
730b5927cbSNicolas ChautruInitialization
740b5927cbSNicolas Chautru--------------
750b5927cbSNicolas Chautru
760b5927cbSNicolas ChautruWhen the device first powers up, its PCI Physical Functions (PF) can be listed through this command:
770b5927cbSNicolas Chautru
780b5927cbSNicolas Chautru.. code-block:: console
790b5927cbSNicolas Chautru
800b5927cbSNicolas Chautru  sudo lspci -vd8086:0d8f
810b5927cbSNicolas Chautru
820b5927cbSNicolas ChautruThe physical and virtual functions are compatible with Linux UIO drivers:
830b5927cbSNicolas Chautru``vfio`` and ``igb_uio``. However, in order to work the FPGA 5GNR FEC device firstly needs
840b5927cbSNicolas Chautruto be bound to one of these linux drivers through DPDK.
850b5927cbSNicolas Chautru
860b5927cbSNicolas Chautru
870b5927cbSNicolas ChautruBind PF UIO driver(s)
880b5927cbSNicolas Chautru~~~~~~~~~~~~~~~~~~~~~
890b5927cbSNicolas Chautru
900b5927cbSNicolas ChautruInstall the DPDK igb_uio driver, bind it with the PF PCI device ID and use
910b5927cbSNicolas Chautru``lspci`` to confirm the PF device is under use by ``igb_uio`` DPDK UIO driver.
920b5927cbSNicolas Chautru
930b5927cbSNicolas ChautruThe igb_uio driver may be bound to the PF PCI device using one of three methods:
940b5927cbSNicolas Chautru
950b5927cbSNicolas Chautru
960b5927cbSNicolas Chautru1. PCI functions (physical or virtual, depending on the use case) can be bound to
970b5927cbSNicolas Chautruthe UIO driver by repeating this command for every function.
980b5927cbSNicolas Chautru
990b5927cbSNicolas Chautru.. code-block:: console
1000b5927cbSNicolas Chautru
1010b5927cbSNicolas Chautru  cd <dpdk-top-level-directory>
1020b5927cbSNicolas Chautru  insmod ./build/kmod/igb_uio.ko
1030b5927cbSNicolas Chautru  echo "8086 0d8f" > /sys/bus/pci/drivers/igb_uio/new_id
1040b5927cbSNicolas Chautru  lspci -vd8086:0d8f
1050b5927cbSNicolas Chautru
1060b5927cbSNicolas Chautru
1070b5927cbSNicolas Chautru2. Another way to bind PF with DPDK UIO driver is by using the ``dpdk-devbind.py`` tool
1080b5927cbSNicolas Chautru
1090b5927cbSNicolas Chautru.. code-block:: console
1100b5927cbSNicolas Chautru
1110b5927cbSNicolas Chautru  cd <dpdk-top-level-directory>
1120b5927cbSNicolas Chautru  ./usertools/dpdk-devbind.py -b igb_uio 0000:06:00.0
1130b5927cbSNicolas Chautru
1140b5927cbSNicolas Chautruwhere the PCI device ID (example: 0000:06:00.0) is obtained using lspci -vd8086:0d8f
1150b5927cbSNicolas Chautru
1160b5927cbSNicolas Chautru
1170b5927cbSNicolas Chautru3. A third way to bind is to use ``dpdk-setup.sh`` tool
1180b5927cbSNicolas Chautru
1190b5927cbSNicolas Chautru.. code-block:: console
1200b5927cbSNicolas Chautru
1210b5927cbSNicolas Chautru  cd <dpdk-top-level-directory>
1220b5927cbSNicolas Chautru  ./usertools/dpdk-setup.sh
1230b5927cbSNicolas Chautru
1240b5927cbSNicolas Chautru  select 'Bind Ethernet/Crypto/Baseband device to IGB UIO module'
1250b5927cbSNicolas Chautru  or
1260b5927cbSNicolas Chautru  select 'Bind Ethernet/Crypto/Baseband device to VFIO module' depending on driver required
1270b5927cbSNicolas Chautru  enter PCI device ID
1280b5927cbSNicolas Chautru  select 'Display current Ethernet/Crypto/Baseband device settings' to confirm binding
1290b5927cbSNicolas Chautru
1300b5927cbSNicolas Chautru
1310b5927cbSNicolas ChautruIn the same way the FPGA 5GNR FEC PF can be bound with vfio, but vfio driver does not
1320b5927cbSNicolas Chautrusupport SR-IOV configuration right out of the box, so it will need to be patched.
1330b5927cbSNicolas Chautru
1340b5927cbSNicolas Chautru
1350b5927cbSNicolas ChautruEnable Virtual Functions
1360b5927cbSNicolas Chautru~~~~~~~~~~~~~~~~~~~~~~~~
1370b5927cbSNicolas Chautru
1380b5927cbSNicolas ChautruNow, it should be visible in the printouts that PCI PF is under igb_uio control
1390b5927cbSNicolas Chautru"``Kernel driver in use: igb_uio``"
1400b5927cbSNicolas Chautru
1410b5927cbSNicolas ChautruTo show the number of available VFs on the device, read ``sriov_totalvfs`` file..
1420b5927cbSNicolas Chautru
1430b5927cbSNicolas Chautru.. code-block:: console
1440b5927cbSNicolas Chautru
1450b5927cbSNicolas Chautru  cat /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/sriov_totalvfs
1460b5927cbSNicolas Chautru
1470b5927cbSNicolas Chautru  where 0000\:<b>\:<d>.<f> is the PCI device ID
1480b5927cbSNicolas Chautru
1490b5927cbSNicolas Chautru
1500b5927cbSNicolas ChautruTo enable VFs via igb_uio, echo the number of virtual functions intended to
1510b5927cbSNicolas Chautruenable to ``max_vfs`` file..
1520b5927cbSNicolas Chautru
1530b5927cbSNicolas Chautru.. code-block:: console
1540b5927cbSNicolas Chautru
1550b5927cbSNicolas Chautru  echo <num-of-vfs> > /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/max_vfs
1560b5927cbSNicolas Chautru
1570b5927cbSNicolas Chautru
1580b5927cbSNicolas ChautruAfterwards, all VFs must be bound to appropriate UIO drivers as required, same
1590b5927cbSNicolas Chautruway it was done with the physical function previously.
1600b5927cbSNicolas Chautru
1610b5927cbSNicolas ChautruEnabling SR-IOV via vfio driver is pretty much the same, except that the file
1620b5927cbSNicolas Chautruname is different:
1630b5927cbSNicolas Chautru
1640b5927cbSNicolas Chautru.. code-block:: console
1650b5927cbSNicolas Chautru
1660b5927cbSNicolas Chautru  echo <num-of-vfs> > /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/sriov_numvfs
167*44dc6faaSNicolas Chautru
168*44dc6faaSNicolas Chautru
169*44dc6faaSNicolas ChautruTest Vectors
170*44dc6faaSNicolas Chautru~~~~~~~~~~~~
171*44dc6faaSNicolas Chautru
172*44dc6faaSNicolas ChautruIn addition to the simple LDPC decoder and LDPC encoder tests, bbdev also provides
173*44dc6faaSNicolas Chautrua range of additional tests under the test_vectors folder, which may be useful. The results
174*44dc6faaSNicolas Chautruof these tests will depend on the FPGA 5GNR FEC capabilities.
175