baseband/fpga_lte_fec: add driver for FEC on FPGA

Supports for FEC 4G PMD Driver on FPGA card PAC N3000

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Kamil Chalupnik <kamilx.chalupnik@intel.com>
This commit is contained in:
Nicolas Chautru 2019-06-14 09:17:36 -07:00 committed by Akhil Goyal
parent a489f5dbf4
commit efd453698c
12 changed files with 3119 additions and 1 deletions

View File

@ -537,6 +537,7 @@ CONFIG_RTE_PMD_PACKET_PREFETCH=y
# EXPERIMENTAL: API may change without prior notice
#
CONFIG_RTE_LIBRTE_BBDEV=y
CONFIG_RTE_LIBRTE_BBDEV_DEBUG=n
CONFIG_RTE_BBDEV_MAX_DEVS=128
CONFIG_RTE_BBDEV_OFFLOAD_COST=y
CONFIG_RTE_BBDEV_SDK_AVX2=n
@ -551,6 +552,11 @@ CONFIG_RTE_LIBRTE_PMD_BBDEV_NULL=y
#
CONFIG_RTE_LIBRTE_PMD_BBDEV_TURBO_SW=y
#
# Compile PMD for Intel FPGA LTE FEC bbdev device
#
CONFIG_RTE_LIBRTE_PMD_FPGA_LTE_FEC=y
#
# Compile generic crypto device library
#

View File

@ -0,0 +1,316 @@
.. SPDX-License-Identifier: BSD-3-Clause
Copyright(c) 2019 Intel Corporation
Intel(R) FPGA LTE FEC Poll Mode Driver
======================================
The BBDEV FPGA LTE FEC poll mode driver (PMD) supports an FPGA implementation of a VRAN
Turbo Encode / Decode LTE wireless acceleration function, using Intel's PCI-e and FPGA
based Vista Creek device.
Features
--------
FPGA LTE FEC PMD supports the following features:
- Turbo Encode in the DL with total throughput of 4.5 Gbits/s
- Turbo Decode in the UL with total throughput of 1.5 Gbits/s assuming 8 decoder iterations
- 8 VFs per PF (physical device)
- Maximum of 32 UL queues per VF
- Maximum of 32 DL queues per VF
- PCIe Gen-3 x8 Interface
- MSI-X
- SR-IOV
FPGA LTE FEC PMD supports the following BBDEV capabilities:
* For the turbo encode operation:
- ``RTE_BBDEV_TURBO_CRC_24B_ATTACH`` : set to attach CRC24B to CB(s)
- ``RTE_BBDEV_TURBO_RATE_MATCH`` : if set then do not do Rate Match bypass
- ``RTE_BBDEV_TURBO_ENC_INTERRUPTS`` : set for encoder dequeue interrupts
* For the turbo decode operation:
- ``RTE_BBDEV_TURBO_CRC_TYPE_24B`` : check CRC24B from CB(s)
- ``RTE_BBDEV_TURBO_SUBBLOCK_DEINTERLEAVE`` : perform subblock de-interleave
- ``RTE_BBDEV_TURBO_DEC_INTERRUPTS`` : set for decoder dequeue interrupts
- ``RTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN`` : set if negative LLR encoder i/p is supported
- ``RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP`` : keep CRC24B bits appended while decoding
Limitations
-----------
FPGA LTE FEC does not support the following:
- Scatter-Gather function
Installation
--------------
Section 3 of the DPDK manual provides instuctions on installing and compiling DPDK. The
default set of bbdev compile flags may be found in config/common_base, where for example
the flag to build the FPGA LTE FEC device, ``CONFIG_RTE_LIBRTE_PMD_FPGA_LTE_FEC``, is already
set. It is assumed DPDK has been compiled using for instance:
.. code-block:: console
make install T=x86_64-native-linuxapp-gcc
DPDK requires hugepages to be configured as detailed in section 2 of the DPDK manual.
The bbdev test application has been tested with a configuration 40 x 1GB hugepages. The
hugepage configuration of a server may be examined using:
.. code-block:: console
grep Huge* /proc/meminfo
Initialization
--------------
When the device first powers up, its PCI Physical Functions (PF) can be listed through this command:
.. code-block:: console
sudo lspci -vd1172:5052
The physical and virtual functions are compatible with Linux UIO drivers:
``vfio`` and ``igb_uio``. However, in order to work the FPGA LTE FEC device firstly needs
to be bound to one of these linux drivers through DPDK.
Bind PF UIO driver(s)
~~~~~~~~~~~~~~~~~~~~~
Install the DPDK igb_uio driver, bind it with the PF PCI device ID and use
``lspci`` to confirm the PF device is under use by ``igb_uio`` DPDK UIO driver.
The igb_uio driver may be bound to the PF PCI device using one of three methods:
1. PCI functions (physical or virtual, depending on the use case) can be bound to
the UIO driver by repeating this command for every function.
.. code-block:: console
cd <dpdk-top-level-directory>
insmod ./build/kmod/igb_uio.ko
echo "1172 5052" > /sys/bus/pci/drivers/igb_uio/new_id
lspci -vd1172:
2. Another way to bind PF with DPDK UIO driver is by using the ``dpdk-devbind.py`` tool
.. code-block:: console
cd <dpdk-top-level-directory>
./usertools/dpdk-devbind.py -b igb_uio 0000:06:00.0
where the PCI device ID (example: 0000:06:00.0) is obtained using lspci -vd1172:
3. A third way to bind is to use ``dpdk-setup.sh`` tool
.. code-block:: console
cd <dpdk-top-level-directory>
./usertools/dpdk-setup.sh
select 'Bind Ethernet/Crypto/Baseband device to IGB UIO module'
or
select 'Bind Ethernet/Crypto/Baseband device to VFIO module' depending on driver required
enter PCI device ID
select 'Display current Ethernet/Crypto/Baseband device settings' to confirm binding
In the same way the FPGA LTE FEC PF can be bound with vfio, but vfio driver does not
support SR-IOV configuration right out of the box, so it will need to be patched.
Enable Virtual Functions
~~~~~~~~~~~~~~~~~~~~~~~~
Now, it should be visible in the printouts that PCI PF is under igb_uio control
"``Kernel driver in use: igb_uio``"
To show the number of available VFs on the device, read ``sriov_totalvfs`` file..
.. code-block:: console
cat /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/sriov_totalvfs
where 0000\:<b>\:<d>.<f> is the PCI device ID
To enable VFs via igb_uio, echo the number of virtual functions intended to
enable to ``max_vfs`` file..
.. code-block:: console
echo <num-of-vfs> > /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/max_vfs
Afterwards, all VFs must be bound to appropriate UIO drivers as required, same
way it was done with the physical function previously.
Enabling SR-IOV via vfio driver is pretty much the same, except that the file
name is different:
.. code-block:: console
echo <num-of-vfs> > /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/sriov_numvfs
Configure the VFs through PF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The PCI virtual functions must be configured before working or getting assigned
to VMs/Containers. The configuration involves allocating the number of hardware
queues, priorities, load balance, bandwidth and other settings necessary for the
device to perform FEC functions.
This configuration needs to be executed at least once after reboot or PCI FLR and can
be achieved by using the function ``fpga_lte_fec_configure()``, which sets up the
parameters defined in ``fpga_lte_fec_conf`` structure:
.. code-block:: c
struct fpga_lte_fec_conf {
bool pf_mode_en;
uint8_t vf_ul_queues_number[FPGA_LTE_FEC_NUM_VFS];
uint8_t vf_dl_queues_number[FPGA_LTE_FEC_NUM_VFS];
uint8_t ul_bandwidth;
uint8_t dl_bandwidth;
uint8_t ul_load_balance;
uint8_t dl_load_balance;
uint16_t flr_time_out;
};
- ``pf_mode_en``: identifies whether only PF is to be used, or the VFs. PF and
VFs are mutually exclusive and cannot run simultaneously.
Set to 1 for PF mode enabled.
If PF mode is enabled all queues available in the device are assigned
exclusively to PF and 0 queues given to VFs.
- ``vf_*l_queues_number``: defines the hardware queue mapping for every VF.
- ``*l_bandwidth``: in case of congestion on PCIe interface. The device
allocates different bandwidth to UL and DL. The weight is configured by this
setting. The unit of weight is 3 code blocks. For example, if the code block
cbps (code block per second) ratio between UL and DL is 12:1, then the
configuration value should be set to 36:3. The schedule algorithm is based
on code block regardless the length of each block.
- ``*l_load_balance``: hardware queues are load-balanced in a round-robin
fashion. Queues get filled first-in first-out until they reach a pre-defined
watermark level, if exceeded, they won't get assigned new code blocks..
This watermark is defined by this setting.
If all hardware queues exceeds the watermark, no code blocks will be
streamed in from UL/DL code block FIFO.
- ``flr_time_out``: specifies how many 16.384us to be FLR time out. The
time_out = flr_time_out x 16.384us. For instance, if you want to set 10ms for
the FLR time out then set this setting to 0x262=610.
An example configuration code calling the function ``fpga_lte_fec_configure()`` is shown
below:
.. code-block:: c
struct fpga_lte_fec_conf conf;
unsigned int i;
memset(&conf, 0, sizeof(struct fpga_lte_fec_conf));
conf.pf_mode_en = 1;
for (i = 0; i < FPGA_LTE_FEC_NUM_VFS; ++i) {
conf.vf_ul_queues_number[i] = 4;
conf.vf_dl_queues_number[i] = 4;
}
conf.ul_bandwidth = 12;
conf.dl_bandwidth = 5;
conf.dl_load_balance = 64;
conf.ul_load_balance = 64;
/* setup FPGA PF */
ret = fpga_lte_fec_configure(info->dev_name, &conf);
TEST_ASSERT_SUCCESS(ret,
"Failed to configure 4G FPGA PF for bbdev %s",
info->dev_name);
Test Application
----------------
BBDEV provides a test application, ``test-bbdev.py`` and range of test data for testing
the functionality of FPGA LTE FEC turbo encode and turbo decode, depending on the device's
capabilities. The test application is located under app->test-bbdev folder and has the
following options:
.. code-block:: console
"-p", "--testapp-path": specifies path to the bbdev test app.
"-e", "--eal-params" : EAL arguments which are passed to the test app.
"-t", "--timeout" : Timeout in seconds (default=300).
"-c", "--test-cases" : Defines test cases to run. Run all if not specified.
"-v", "--test-vector" : Test vector path (default=dpdk_path+/app/test-bbdev/test_vectors/bbdev_null.data).
"-n", "--num-ops" : Number of operations to process on device (default=32).
"-b", "--burst-size" : Operations enqueue/dequeue burst size (default=32).
"-l", "--num-lcores" : Number of lcores to run (default=16).
"-i", "--init-device" : Initialise PF device with default values.
To execute the test application tool using simple turbo decode or turbo encode data,
type one of the following:
.. code-block:: console
./test-bbdev.py -c validation -n 64 -b 8 -v ./turbo_dec_default.data
./test-bbdev.py -c validation -n 64 -b 8 -v ./turbo_enc_default.data
The test application ``test-bbdev.py``, supports the ability to configure the PF device with
a default set of values, if the "-i" or "- -init-device" option is included. The default values
are defined in test_bbdev_perf.c as:
- VF_UL_QUEUE_VALUE 4
- VF_DL_QUEUE_VALUE 4
- UL_BANDWIDTH 3
- DL_BANDWIDTH 3
- UL_LOAD_BALANCE 128
- DL_LOAD_BALANCE 128
- FLR_TIMEOUT 610
Test Vectors
~~~~~~~~~~~~
In addition to the simple turbo decoder and turbo encoder tests, bbdev also provides
a range of additional tests under the test_vectors folder, which may be useful. The results
of these tests will depend on the FPGA LTE FEC capabilities:
* turbo decoder tests:
- ``turbo_dec_c1_k6144_r0_e10376_crc24b_sbd_negllr_high_snr.data``
- ``turbo_dec_c1_k6144_r0_e10376_crc24b_sbd_negllr_low_snr.data``
- ``turbo_dec_c1_k6144_r0_e34560_negllr.data``
- ``turbo_dec_c1_k6144_r0_e34560_sbd_negllr.data``
- ``turbo_dec_c2_k3136_r0_e4920_sbd_negllr_crc24b.data``
- ``turbo_dec_c2_k3136_r0_e4920_sbd_negllr.data``
* turbo encoder tests:
- ``turbo_enc_c1_k40_r0_e1190_rm.data``
- ``turbo_enc_c1_k40_r0_e1194_rm.data``
- ``turbo_enc_c1_k40_r0_e1196_rm.data``
- ``turbo_enc_c1_k40_r0_e272_rm.data``
- ``turbo_enc_c1_k6144_r0_e18444.data``
- ``turbo_enc_c1_k6144_r0_e32256_crc24b_rm.data``
- ``turbo_enc_c2_k5952_r0_e17868_crc24b.data``
- ``turbo_enc_c3_k4800_r2_e14412_crc24b.data``
- ``turbo_enc_c4_k4800_r2_e14412_crc24b.data``

View File

@ -10,3 +10,4 @@ Baseband Device Drivers
null
turbo_sw
fpga_lte_fec

View File

@ -133,6 +133,12 @@ New Features
device to be received repeatedly at a high rate. This can be useful for quick
performance testing of DPDK apps.
* **Added a FPGA_LTE_FEC bbdev PMD.**
Added the new ``fpga_lte_fec`` bbdev driver for the Intel® FPGA PAC
(Programmable Acceleration Card) N3000. See the
:doc:`../bbdevs/fpga_lte_fec` BBDEV guide for more details on this new driver.
* **Added Intel QuickData Technology PMD**
The PMD for Intel\ |reg| QuickData Technology, part of

View File

@ -10,5 +10,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_BBDEV_NULL) += null
DEPDIRS-null = $(core-libs)
DIRS-$(CONFIG_RTE_LIBRTE_PMD_BBDEV_TURBO_SW) += turbo_sw
DEPDIRS-turbo_sw = $(core-libs)
DIRS-$(CONFIG_RTE_LIBRTE_PMD_FPGA_LTE_FEC) += fpga_lte_fec
DEPDIRS-fpga_lte_fec = $(core-libs)
include $(RTE_SDK)/mk/rte.subdir.mk

View File

@ -0,0 +1,29 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2019 Intel Corporation
include $(RTE_SDK)/mk/rte.vars.mk
# library name
LIB = librte_pmd_fpga_lte_fec.a
# build flags
CFLAGS += -DALLOW_EXPERIMENTAL_API
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
LDLIBS += -lrte_bbdev
LDLIBS += -lrte_pci -lrte_bus_pci
# versioning export map
EXPORT_MAP := rte_pmd_bbdev_fpga_lte_fec_version.map
# library version
LIBABIVER := 1
# library source files
SRCS-$(CONFIG_RTE_LIBRTE_PMD_FPGA_LTE_FEC) += fpga_lte_fec.c
# export include files
SYMLINK-$(CONFIG_RTE_LIBRTE_PMD_FPGA_LTE_FEC)-include += fpga_lte_fec.h
include $(RTE_SDK)/mk/rte.lib.mk

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,73 @@
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2019 Intel Corporation
*/
#ifndef _FPGA_LTE_FEC_H_
#define _FPGA_LTE_FEC_H_
#include <stdint.h>
#include <stdbool.h>
/**
* @file fpga_lte_fec.h
*
* Interface for Intel(R) FGPA LTE FEC device configuration at the host level,
* directly accessible by the application.
* Configuration related to LTE Turbo coding functionality is done through
* librte_bbdev library.
*
* @warning
* @b EXPERIMENTAL: this API may change without prior notice
*/
#ifdef __cplusplus
extern "C" {
#endif
/**< Number of Virtual Functions FGPA 4G FEC supports */
#define FPGA_LTE_FEC_NUM_VFS 8
/**
* Structure to pass FPGA 4G FEC configuration.
*/
struct fpga_lte_fec_conf {
/**< 1 if PF is used for dataplane, 0 for VFs */
bool pf_mode_en;
/**< Number of UL queues per VF */
uint8_t vf_ul_queues_number[FPGA_LTE_FEC_NUM_VFS];
/**< Number of DL queues per VF */
uint8_t vf_dl_queues_number[FPGA_LTE_FEC_NUM_VFS];
/**< UL bandwidth. Needed for schedule algorithm */
uint8_t ul_bandwidth;
/**< DL bandwidth. Needed for schedule algorithm */
uint8_t dl_bandwidth;
/**< UL Load Balance */
uint8_t ul_load_balance;
/**< DL Load Balance */
uint8_t dl_load_balance;
/**< FLR timeout value */
uint16_t flr_time_out;
};
/**
* Configure Intel(R) FPGA LTE FEC device
*
* @param dev_name
* The name of the device. This is the short form of PCI BDF, e.g. 00:01.0.
* It can also be retrieved for a bbdev device from the dev_name field in the
* rte_bbdev_info structure returned by rte_bbdev_info_get().
* @param conf
* Configuration to apply to FPGA 4G FEC.
*
* @return
* Zero on success, negative value on failure.
*/
int
fpga_lte_fec_configure(const char *dev_name,
const struct fpga_lte_fec_conf *conf);
#ifdef __cplusplus
}
#endif
#endif /* _FPGA_LTE_FEC_H_ */

View File

@ -0,0 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2019 Intel Corporation
deps += ['bbdev', 'bus_vdev', 'ring', 'pci', 'bus_pci']
name = 'bbdev_fpga_lte_fec'
allow_experimental_apis = true
sources = files('fpga_lte_fec.c')

View File

@ -0,0 +1,3 @@
DPDK_19.08 {
local: *;
};

View File

@ -1,7 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
drivers = ['null', 'turbo_sw']
drivers = ['null', 'turbo_sw', 'fpga_lte_fec']
config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
driver_name_fmt = 'rte_pmd_@0@'

View File

@ -226,6 +226,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_NETVSC_PMD) += -lrte_pmd_netvsc
ifeq ($(CONFIG_RTE_LIBRTE_BBDEV),y)
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BBDEV_NULL) += -lrte_pmd_bbdev_null
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_FPGA_LTE_FEC) += -lrte_pmd_fpga_lte_fec
# TURBO SOFTWARE PMD is dependent on the FLEXRAN library
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BBDEV_TURBO_SW) += -lrte_pmd_bbdev_turbo_sw