Skip to contentSkip to conversation

baseband/fpga_lte_fec: BBDEV FPGA driver for 4G turbo FEC

PATCH In review Smith, Eleanor 3 participants 7 messages Mar 1, 2019 – Mar 26, 2019

lore
Share & tools
lore
#0 lore raw

cover baseband/fpga_lte_fec: BBDEV FPGA driver for 4G turbo FEC

This series of patches adds a new baseband device driver for Intel(R) FPGA LTE FEC which enable the acceleration of 4G FEC turbo encoding and decoding on FPGA through the DPDK librte_bbdev API.

The FEC offloaded UL functionality includes sub block deinterleave, turbo decoding and CRC checking. The FEC offloaded DL functionality includes turbo encoding, turbo rate matching and CRC generation. The turbo encode and decoder can be performed in codeblock or transport block mode, where transport block mode includes codeblock segmentation and concatenation stages performed in software.

The Intel(R) FPGA LTE FEC is implemented on Intel(R) PAC N3000 FPGA card which is available from Intel in Q2 2019.

Smith, Eleanor (4):
Addition of driver for 4G turbo FEC with PAC N300 FPGA card Update to usertool to allow binding of baseband device Update bbdev test-app for FPGA driver testing Update device info structure to use rte_device

 app/test-bbdev/main.c                              |   15 +-
 app/test-bbdev/main.h                              |    2 +
 app/test-bbdev/test-bbdev.py                       |    7 +
 app/test-bbdev/test_bbdev_perf.c                   |   64 +
 config/common_base                                 |    6 +
 doc/guides/bbdevs/fpga_lte_fec.rst                 |  316 +++
 doc/guides/bbdevs/index.rst                        |    1 +
 doc/guides/prog_guide/bbdev.rst                    |    4 +-
 drivers/baseband/Makefile                          |    2 +
 drivers/baseband/fpga_lte_fec/Makefile             |   29 +
 drivers/baseband/fpga_lte_fec/fpga_lte_fec.c       | 2639 ++++++++++++++++++++
 drivers/baseband/fpga_lte_fec/fpga_lte_fec.h       |   73 +
 .../fpga_lte_fec/rte_pmd_fpga_lte_fec_version.map  |    3 +
 lib/librte_bbdev/rte_bbdev.c                       |    6 +-
 lib/librte_bbdev/rte_bbdev.h                       |    2 +-
 mk/rte.app.mk                                      |    3 +-
 usertools/dpdk-devbind.py                          |   10 +-
 usertools/dpdk-setup.sh                            |    6 +-
 18 files changed, 3176 insertions(+), 12 deletions(-)
 create mode 100644 doc/guides/bbdevs/fpga_lte_fec.rst
 create mode 100644 drivers/baseband/fpga_lte_fec/Makefile
 create mode 100644 drivers/baseband/fpga_lte_fec/fpga_lte_fec.c
 create mode 100644 drivers/baseband/fpga_lte_fec/fpga_lte_fec.h
 create mode 100644 drivers/baseband/fpga_lte_fec/rte_pmd_fpga_lte_fec_version.map
Signature · 12 lines
2.7.4

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
#1 lore raw

PATCH 1/4 baseband/fpga_lte_fec: addition of driver for 4G turbo FEC with PAC N300 FPGA card

Addition of a FPGA driver for acceleration of 4G turbo encoding and decoding.

---
 config/common_base                                 |    6 +
 doc/guides/bbdevs/fpga_lte_fec.rst                 |  316 +++
 doc/guides/bbdevs/index.rst                        |    1 +
 drivers/baseband/Makefile                          |    2 +
 drivers/baseband/fpga_lte_fec/Makefile             |   29 +
 drivers/baseband/fpga_lte_fec/fpga_lte_fec.c       | 2639 ++++++++++++++++++++
 drivers/baseband/fpga_lte_fec/fpga_lte_fec.h       |   73 +
 .../fpga_lte_fec/rte_pmd_fpga_lte_fec_version.map  |    3 +
 mk/rte.app.mk                                      |    3 +-
 9 files changed, 3071 insertions(+), 1 deletion(-)
 create mode 100644 doc/guides/bbdevs/fpga_lte_fec.rst
 create mode 100644 drivers/baseband/fpga_lte_fec/Makefile
 create mode 100644 drivers/baseband/fpga_lte_fec/fpga_lte_fec.c
 create mode 100644 drivers/baseband/fpga_lte_fec/fpga_lte_fec.h
 create mode 100644 drivers/baseband/fpga_lte_fec/rte_pmd_fpga_lte_fec_version.map
config/common_base +6 -0
index 7c6da51..567ea06 100644
@@ -493,6 +493,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
 
@@ -507,6 +508,11 @@ CONFIG_RTE_LIBRTE_PMD_BBDEV_NULL=y
 CONFIG_RTE_LIBRTE_PMD_BBDEV_TURBO_SW=n
 
 #
+# Compile PMD for Intel FPGA LTE FEC bbdev device
+#
+CONFIG_RTE_LIBRTE_PMD_FPGA_LTE_FEC=y
+
+#
 # Compile generic crypto device library
 #
 CONFIG_RTE_LIBRTE_CRYPTODEV=y
doc/guides/bbdevs/fpga_lte_fec.rst new file +316 -0

316 lines not on this page · raw message

doc/guides/bbdevs/index.rst +1 -0
index 93276ed..005b95e 100644
@@ -10,3 +10,4 @@ Baseband Device Drivers
 
     null
     turbo_sw
+    fpga_lte_fec
drivers/baseband/Makefile +2 -0
index 4ec83b0..ceffc7d 100644
@@ -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
drivers/baseband/fpga_lte_fec/Makefile new file +29 -0
new file mode 100644
index 0000000..789094f
@@ -0,0 +1,29 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2018 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_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
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c new file +2639 -0

2,626 lines not on this page · raw message

drivers/baseband/fpga_lte_fec/fpga_lte_fec.h new file +73 -0

73 lines not on this page · raw message

drivers/baseband/fpga_lte_fec/rte_pmd_fpga_lte_fec_version.map new file +3 -0
new file mode 100644
index 0000000..35c51d2

Lines of this file are not shown. View the raw message.

mk/rte.app.mk +2 -1
index d0ab942..154c4be 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 12 lines
2.7.4

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Part of the diff is not shown here. View the raw message.

#2 lore raw

Re: [PATCH v1 1/4] baseband/fpga_lte_fec: addition of driver for 4G turbo FEC with PAC N300 FPGA card

Hi,

01/03/2019 18:23, Smith, Eleanor:

Quoted 4 lines

Addition of a FPGA driver for acceleration of 4G turbo encoding and decoding.

I'm really not comfortable adding a new Intel bbdev driver, while the turbo sw driver cannot be freely compiled.
I know some work is in progress in Intel to fix this compilation issue, and I am interested in checking it before proceeding with a new driver.

doc/guides/bbdevs/fpga_lte_fec.rst line 60

Quoted 8 lines
doc/guides/bbdevs/fpga_lte_fec.rst new file +8 -0
+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 for an icc 64-bit target using:
+
+.. code-block:: console
+
+  make install T=x86_64-native-linuxapp-icc

Is it possible to build this driver with gcc?
We cannot accept any maintenance operation if icc is required.

#3 lore raw

Re: [PATCH v1 1/4] baseband/fpga_lte_fec: addition of driver for 4G turbo FEC with PAC N300 FPGA card

Hi Smith,

Could you please reply to Thomas' comments.

Regards,
Akhil

Quoted 24 lines · Thomas Monjalon

Hi,

01/03/2019 18:23, Smith, Eleanor:

Quoted 4 lines

Addition of a FPGA driver for acceleration of 4G turbo encoding and decoding.

I'm really not comfortable adding a new Intel bbdev driver, while the turbo sw driver cannot be freely compiled.
I know some work is in progress in Intel to fix this compilation issue, and I am interested in checking it before proceeding with a new driver.

doc/guides/bbdevs/fpga_lte_fec.rst line 60

Quoted 8 lines
doc/guides/bbdevs/fpga_lte_fec.rst new file +8 -0
+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 for an icc 64-bit target using:
+
+.. code-block:: console
+
+  make install T=x86_64-native-linuxapp-icc

Is it possible to build this driver with gcc?
We cannot accept any maintenance operation if icc is required.

#4 lore raw

PATCH 2/4 usertools: update to usertool to allow binding of baseband device

In reply to Smith, Eleanor

This patch allows dpdk-setup.py and dpdp-devbind.py to be used to bind baseband devices.

---
 usertools/dpdk-devbind.py | 10 +++++++++-
 usertools/dpdk-setup.sh   |  6 +++---
 2 files changed, 12 insertions(+), 4 deletions(-)
usertools/dpdk-devbind.py +9 -1
index a9cd66a..0aa3121 100755
@@ -16,6 +16,8 @@
                    'SVendor': None, 'SDevice': None}
 intel_processor_class = {'Class': '0b', 'Vendor': '8086', 'Device': None,
                    'SVendor': None, 'SDevice': None}
+acceleration_class = {'Class': '12', 'Vendor': None, 'Device': None,
+               'SVendor': None, 'SDevice': None}
 cavium_sso = {'Class': '08', 'Vendor': '177d', 'Device': 'a04b,a04d',
               'SVendor': None, 'SDevice': None}
 cavium_fpa = {'Class': '08', 'Vendor': '177d', 'Device': 'a053',
@@ -33,6 +35,7 @@
 crypto_devices = [encryption_class, intel_processor_class]
 eventdev_devices = [cavium_sso, cavium_tim]
 mempool_devices = [cavium_fpa]
+baseband_devices = [acceleration_class]
 compress_devices = [cavium_zip]
 
 # global dict ethernet devices present. Dictionary indexed by PCI address.
@@ -82,7 +85,7 @@ def usage():
 
     --status-dev:
         Print the status of given device group. Supported device groups are:
-        "net", "crypto", "event", "mempool" and "compress"
+        "net", "crypto", "bbdev", "event", "mempool" and "compress"
 
     -b driver, --bind=driver:
         Select the driver to use or \"none\" to unbind the device
@@ -579,6 +582,9 @@ def show_status():
     if status_dev == "crypto" or status_dev == "all":
         show_device_status(crypto_devices, "Crypto")
 
+    if status_dev == "bbdev" or status_dev == "all":
+        show_device_status(baseband_devices, "Baseband")
+
     if status_dev == "event" or status_dev == "all":
         show_device_status(eventdev_devices, "Eventdev")
 
@@ -660,6 +666,7 @@ def do_arg_actions():
             # refresh if we have changed anything
             get_device_details(network_devices)
             get_device_details(crypto_devices)
+            get_device_details(baseband_devices)
             get_device_details(eventdev_devices)
             get_device_details(mempool_devices)
             get_device_details(compress_devices)
@@ -680,6 +687,7 @@ def main():
     clear_data()
     get_device_details(network_devices)
     get_device_details(crypto_devices)
+    get_device_details(baseband_devices)
     get_device_details(eventdev_devices)
     get_device_details(mempool_devices)
     get_device_details(compress_devices)
usertools/dpdk-setup.sh +3 -3
index 5eebbce..9819a77 100755
@@ -496,13 +496,13 @@ step2_func()
 	TEXT[5]="Setup hugepage mappings for NUMA systems"
 	FUNC[5]="set_numa_pages"
 
-	TEXT[6]="Display current Ethernet/Crypto device settings"
+	TEXT[6]="Display current Ethernet/Crypto/Baseband device settings"
 	FUNC[6]="show_devices"
 
-	TEXT[7]="Bind Ethernet/Crypto device to IGB UIO module"
+	TEXT[7]="Bind Ethernet/Crypto/Baseband device to IGB UIO module"
 	FUNC[7]="bind_devices_to_igb_uio"
 
-	TEXT[8]="Bind Ethernet/Crypto device to VFIO module"
+	TEXT[8]="Bind Ethernet/Crypto/Baseband device to VFIO module"
 	FUNC[8]="bind_devices_to_vfio"
 
 	TEXT[9]="Setup VFIO permissions"
Signature · 12 lines
2.7.4

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
#5 lore raw

PATCH 3/4 test-bbdev: update bbdev test-app for FPGA driver testing

In reply to Smith, Eleanor

This patch updates the bbdev test application to include an option to configure the PF before running FPGA tests.

---
 app/test-bbdev/main.c            | 15 +++++++++-
 app/test-bbdev/main.h            |  2 ++
 app/test-bbdev/test-bbdev.py     |  7 +++++
 app/test-bbdev/test_bbdev_perf.c | 64 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 87 insertions(+), 1 deletion(-)
app/test-bbdev/main.c +14 -1
index 7af2522..4e8b38c 100644
@@ -16,6 +16,7 @@
 
 #include "main.h"
 
+
 /* Defines how many testcases can be specified as cmdline args */
 #define MAX_CMDLINE_TESTCASES 8
 
@@ -28,6 +29,7 @@ static struct test_params {
 	unsigned int burst_sz;
 	unsigned int num_lcores;
 	char test_vector_filename[PATH_MAX];
+	bool init_device;
 } test_params;
 
 static struct test_commands_list commands_list =
@@ -140,6 +142,12 @@ get_num_lcores(void)
 	return test_params.num_lcores;
 }
 
+bool
+get_init_device(void)
+{
+	return test_params.init_device;
+}
+
 static void
 print_usage(const char *prog_name)
 {
@@ -174,11 +182,12 @@ parse_args(int argc, char **argv, struct test_params *tp)
 		{ "test-cases", 1, 0, 'c' },
 		{ "test-vector", 1, 0, 'v' },
 		{ "lcores", 1, 0, 'l' },
+		{ "init-device", 0, 0, 'i'},
 		{ "help", 0, 0, 'h' },
 		{ NULL,  0, 0, 0 }
 	};
 
-	while ((opt = getopt_long(argc, argv, "hn:b:c:v:l:", lgopts,
+	while ((opt = getopt_long(argc, argv, "hin:b:c:v:l:", lgopts,
 			&option_index)) != EOF)
 		switch (opt) {
 		case 'n':
@@ -238,6 +247,10 @@ parse_args(int argc, char **argv, struct test_params *tp)
 					"Num of lcores mustn't be greater than %u",
 					RTE_MAX_LCORE);
 			break;
+		case 'i':
+			/* indicate fpga fec config required */
+			tp->init_device = true;
+			break;
 		case 'h':
 			print_usage(argv[0]);
 			return 0;
app/test-bbdev/main.h +2 -0
index 20a55ef..e8e76b7 100644
@@ -117,4 +117,6 @@ unsigned int get_burst_sz(void);
 
 unsigned int get_num_lcores(void);
 
+bool get_init_device(void);
+
 #endif
app/test-bbdev/test-bbdev.py +7 -0
index acab9eb..a94ba9a 100755
@@ -59,6 +59,9 @@ def kill(process):
                     type=int,
                     help="Number of lcores to run.",
                     default=16)
+parser.add_argument("-i", "--init-device",
+                    action='store_true',
+                    help="Initialise PF device with default values.")
 
 args = parser.parse_args()
 
@@ -82,6 +85,10 @@ def kill(process):
     params.extend(["-c"])
     params.extend([",".join(args.test_cases)])
 
+if args.init_device:
+    params.extend(["-i"])
+
+
 exit_status = 0
 for vector in args.test_vector:
     for burst_size in args.burst_size:
app/test-bbdev/test_bbdev_perf.c +64 -0

83 lines not on this page · raw message

Signature · 12 lines
2.7.4

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
#6 lore raw

PATCH 4/4 librte_bbdev: update device info structure to use rte_device

In reply to Smith, Eleanor

This patch update bbdev API rte_bbdev_info struct to use rte_device instead of rte_bus.

---
 doc/guides/prog_guide/bbdev.rst | 4 ++--
 lib/librte_bbdev/rte_bbdev.c    | 6 +++---
 lib/librte_bbdev/rte_bbdev.h    | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
doc/guides/prog_guide/bbdev.rst +2 -2
index 9de1444..a570e48 100644
@@ -255,7 +255,7 @@ This allows the user to query a specific bbdev PMD and get all the device
 capabilities. The ``rte_bbdev_info`` structure provides two levels of
 information:
 
-- Device relevant information, like: name and related rte_bus.
+- Device relevant information, like: name and related rte_device.
 
 - Driver specific information, as defined by the ``struct rte_bbdev_driver_info``
   structure, this is where capabilities reside along with other specifics like:
@@ -266,7 +266,7 @@ information:
     struct rte_bbdev_info {
         int socket_id;
         const char *dev_name;
-        const struct rte_bus *bus;
+        const struct rte_device *device;
         uint16_t num_queues;
         bool started;
         struct rte_bbdev_driver_info drv;
lib/librte_bbdev/rte_bbdev.c +3 -3
index c4cc18d..6ca3c8e 100644
@@ -498,7 +498,7 @@ rte_bbdev_queue_configure(uint16_t dev_id, uint16_t queue_id,
 		if (conf->op_type == RTE_BBDEV_OP_TURBO_DEC &&
 			conf->priority > dev_info.max_ul_queue_priority) {
 			rte_bbdev_log(ERR,
-					"Priority (%u) of queue %u of bdev %u must be <= %u",
+					"Priority (%u) of queue %u of bbdev %u must be <= %u",
 					conf->priority, queue_id, dev_id,
 					dev_info.max_ul_queue_priority);
 			return -EINVAL;
@@ -506,7 +506,7 @@ rte_bbdev_queue_configure(uint16_t dev_id, uint16_t queue_id,
 		if (conf->op_type == RTE_BBDEV_OP_TURBO_ENC &&
 			conf->priority > dev_info.max_dl_queue_priority) {
 			rte_bbdev_log(ERR,
-					"Priority (%u) of queue %u of bdev %u must be <= %u",
+					"Priority (%u) of queue %u of bbdev %u must be <= %u",
 					conf->priority, queue_id, dev_id,
 					dev_info.max_dl_queue_priority);
 			return -EINVAL;
@@ -795,7 +795,7 @@ rte_bbdev_info_get(uint16_t dev_id, struct rte_bbdev_info *dev_info)
 	memset(dev_info, 0, sizeof(*dev_info));
 	dev_info->dev_name = dev->data->name;
 	dev_info->num_queues = dev->data->num_queues;
-	dev_info->bus = rte_bus_find_by_device(dev->device);
+	dev_info->device = dev->device;
 	dev_info->socket_id = dev->data->socket_id;
 	dev_info->started = dev->data->started;
 
lib/librte_bbdev/rte_bbdev.h +1 -1
index bec1ef6..7b3891a 100644
@@ -313,7 +313,7 @@ struct rte_bbdev_driver_info {
 struct rte_bbdev_info {
 	int socket_id;  /**< NUMA socket that device is on */
 	const char *dev_name;  /**< Unique device name */
-	const struct rte_bus *bus;  /**< Bus information */
+	const struct rte_device *device; /**< Device Information */
 	uint16_t num_queues;  /**< Number of queues currently configured */
 	bool started;  /**< Set if device is currently started */
 	struct rte_bbdev_driver_info drv;  /**< Info from device driver */
Signature · 12 lines
2.7.4

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.