drivers/baseband: PMD for FPGA 5GNR FEC
v3 cover drivers/baseband: PMD for FPGA 5GNR FEC
v3: Incremental changes from reviews : file name change, moving few inline function to .h, adding missing inline, doxygen markup fix.
Adding new baseband PMD for FPGA 5GNR FEC implementation.
Nicolas Chautru (11):
drivers/baseband: add PMD for FPGA 5GNR FEC baseband/fpga_5gnr_fec: add register definition file baseband/fpga_5gnr_fec: add device info_get function baseband/fpga_5gnr_fec: add queue configuration baseband/fpga_5gnr_fec: add LDPC processing functions baseband/fpga_5gnr_fec: add HW error capture baseband/fpga_5gnr_fec: add debug functionality baseband/fpga_5gnr_fec: add configure function baseband/fpga_5gnr_fec: add harq loopback capability baseband/fpga_5gnr_fec: add interrupt support
doc: add feature matrix table for bbdev devices
.gitignore | 1 + app/test-bbdev/Makefile | 3 + app/test-bbdev/meson.build | 3 + app/test-bbdev/test_bbdev_perf.c | 57 + config/common_base | 5 + doc/guides/bbdevs/features/default.ini | 16 + doc/guides/bbdevs/features/fpga_5gnr_fec.ini | 11 + doc/guides/bbdevs/features/fpga_lte_fec.ini | 10 + doc/guides/bbdevs/features/mbc.ini | 14 + doc/guides/bbdevs/features/null.ini | 7 + doc/guides/bbdevs/features/turbo_sw.ini | 11 + doc/guides/bbdevs/fpga_5gnr_fec.rst | 297 +++ doc/guides/bbdevs/index.rst | 2 + doc/guides/bbdevs/overview.rst | 15 + doc/guides/conf.py | 5 + doc/guides/rel_notes/release_20_05.rst | 5 + drivers/baseband/Makefile | 2 + drivers/baseband/fpga_5gnr_fec/Makefile | 29 + drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h | 388 ++++ drivers/baseband/fpga_5gnr_fec/meson.build | 6 + drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 2187 ++++++++++++++++++++ .../rte_pmd_bbdev_fpga_5gnr_fec_version.map | 10 + .../baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h | 74 + drivers/baseband/meson.build | 2 +- mk/rte.app.mk | 1 + 25 files changed, 3160 insertions(+), 1 deletion(-) create mode 100644 doc/guides/bbdevs/features/default.ini create mode 100644 doc/guides/bbdevs/features/fpga_5gnr_fec.ini create mode 100644 doc/guides/bbdevs/features/fpga_lte_fec.ini create mode 100644 doc/guides/bbdevs/features/mbc.ini create mode 100644 doc/guides/bbdevs/features/null.ini create mode 100644 doc/guides/bbdevs/features/turbo_sw.ini create mode 100644 doc/guides/bbdevs/fpga_5gnr_fec.rst create mode 100644 doc/guides/bbdevs/overview.rst create mode 100644 drivers/baseband/fpga_5gnr_fec/Makefile create mode 100644 drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h create mode 100644 drivers/baseband/fpga_5gnr_fec/meson.build create mode 100644 drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c create mode 100644 drivers/baseband/fpga_5gnr_fec/rte_pmd_bbdev_fpga_5gnr_fec_version.map create mode 100644 drivers/baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h
Signature · 1 line
1.8.3.1
PATCH v3 1/11 drivers/baseband: add PMD for FPGA 5GNR FEC
Add stubs for the FPGA 5GNR FEC PMD
--- config/common_base | 5 + doc/guides/bbdevs/fpga_5gnr_fec.rst | 146 ++++++++++++++++ doc/guides/bbdevs/index.rst | 1 + doc/guides/rel_notes/release_20_05.rst | 5 + drivers/baseband/Makefile | 2 + drivers/baseband/fpga_5gnr_fec/Makefile | 26 +++ drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h | 41 +++++ drivers/baseband/fpga_5gnr_fec/meson.build | 6 + drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 193 +++++++++++++++++++++ .../rte_pmd_bbdev_fpga_5gnr_fec_version.map | 3 + drivers/baseband/meson.build | 2 +- mk/rte.app.mk | 1 + 12 files changed, 430 insertions(+), 1 deletion(-) create mode 100644 doc/guides/bbdevs/fpga_5gnr_fec.rst create mode 100644 drivers/baseband/fpga_5gnr_fec/Makefile create mode 100644 drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h create mode 100644 drivers/baseband/fpga_5gnr_fec/meson.build create mode 100644 drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c create mode 100644 drivers/baseband/fpga_5gnr_fec/rte_pmd_bbdev_fpga_5gnr_fec_version.map
config/common_base +5 -0
@@ -577,6 +577,11 @@ CONFIG_RTE_LIBRTE_PMD_BBDEV_TURBO_SW=y CONFIG_RTE_LIBRTE_PMD_BBDEV_FPGA_LTE_FEC=y # +# Compile PMD for Intel FPGA 5GNR FEC bbdev device +# +CONFIG_RTE_LIBRTE_PMD_BBDEV_FPGA_5GNR_FEC=y + +# # Compile generic crypto device library # CONFIG_RTE_LIBRTE_CRYPTODEV=y
doc/guides/bbdevs/fpga_5gnr_fec.rst new file +146 -0
146 lines not on this page · raw message
doc/guides/bbdevs/index.rst +1 -0
@@ -11,3 +11,4 @@ Baseband Device Drivers null turbo_sw fpga_lte_fec + fpga_5gnr_fec
doc/guides/rel_notes/release_20_05.rst +5 -0
@@ -81,6 +81,11 @@ New Features by making use of the event device capabilities. The event mode currently supports only inline IPsec protocol offload. +* **Added Intel FPGA_5GNR_FEC bbdev PMD.** + + Added a new ``fpga_5gnr_fec`` bbdev driver for the Intel\ |reg| FPGA PAC + (Programmable Acceleration Card) N3000. See the + :doc:`../bbdevs/fpga_5gnr_fec` BBDEV guide for more details on this new driver. Removed Items -------------
drivers/baseband/Makefile +2 -0
@@ -12,5 +12,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_BBDEV_TURBO_SW) += turbo_sw DEPDIRS-turbo_sw = $(core-libs) DIRS-$(CONFIG_RTE_LIBRTE_PMD_BBDEV_FPGA_LTE_FEC) += fpga_lte_fec DEPDIRS-fpga_lte_fec = $(core-libs) +DIRS-$(CONFIG_RTE_LIBRTE_PMD_BBDEV_FPGA_5GNR_FEC) += fpga_5gnr_fec +DEPDIRS-fpga_5gnr_fec = $(core-libs) include $(RTE_SDK)/mk/rte.subdir.mk
drivers/baseband/fpga_5gnr_fec/Makefile new file +26 -0
@@ -0,0 +1,26 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2019 Intel Corporation + +include $(RTE_SDK)/mk/rte.vars.mk + +# library name +LIB = librte_pmd_bbdev_fpga_5gnr_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_5gnr_fec_version.map + +# library version +LIBABIVER := 1 + +# library source files +SRCS-$(CONFIG_RTE_LIBRTE_PMD_BBDEV_FPGA_5GNR_FEC) += rte_fpga_5gnr_fec.c + +include $(RTE_SDK)/mk/rte.lib.mk
drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h new file +41 -0
41 lines not on this page · raw message
drivers/baseband/fpga_5gnr_fec/meson.build new file +6 -0
@@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation + +deps += ['bbdev', 'bus_vdev', 'ring', 'pci', 'bus_pci'] +allow_experimental_apis = true +sources = files('rte_fpga_5gnr_fec.c')
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c new file +193 -0
193 lines not on this page · raw message
drivers/baseband/fpga_5gnr_fec/rte_pmd_bbdev_fpga_5gnr_fec_version.map new file +3 -0
@@ -0,0 +1,3 @@ +DPDK_20.0 { + local: *; +};
drivers/baseband/meson.build +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Luca Boccassi <[email protected]> -drivers = ['null', 'turbo_sw', 'fpga_lte_fec'] +drivers = ['null', 'turbo_sw', 'fpga_lte_fec', 'fpga_5gnr_fec'] config_flag_fmt = 'RTE_LIBRTE_PMD_BBDEV_@0@' driver_name_fmt = 'rte_pmd_bbdev_@0@'
mk/rte.app.mk +1 -0
@@ -246,6 +246,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_BBDEV_FPGA_LTE_FEC) += -lrte_pmd_bbdev_fpga_lte_fec +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BBDEV_FPGA_5GNR_FEC) += -lrte_pmd_bbdev_fpga_5gnr_fec # TURBO SOFTWARE PMD is dependent on the FLEXRAN library _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BBDEV_TURBO_SW) += -lrte_pmd_bbdev_turbo_sw
Signature · 1 line
1.8.3.1
PATCH v3 2/11 baseband/fpga_5gnr_fec: add register definition file
In reply to Nicolas ChautruAdd in the list of registers for the device and related HW specs definitions.
--- drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h | 189 +++++++++++++++++++++++++ 1 file changed, 189 insertions(+)
drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h +189 -0
@@ -30,6 +30,195 @@#define FPGA_5GNR_FEC_PF_DEVICE_ID (0x0D8F)#define FPGA_5GNR_FEC_VF_DEVICE_ID (0x0D90) +/* Align DMA descriptors to 256 bytes - cache-aligned */ +#define FPGA_RING_DESC_ENTRY_LENGTH (8) +/* Ring size is in 256 bits (32 bytes) units */ +#define FPGA_RING_DESC_LEN_UNIT_BYTES (32) +/* Maximum size of queue */ +#define FPGA_RING_MAX_SIZE (1024) +#define FPGA_FLR_TIMEOUT_UNIT (16.384) + +#define FPGA_NUM_UL_QUEUES (32) +#define FPGA_NUM_DL_QUEUES (32) +#define FPGA_TOTAL_NUM_QUEUES (FPGA_NUM_UL_QUEUES + FPGA_NUM_DL_QUEUES) +#define FPGA_NUM_INTR_VEC (FPGA_TOTAL_NUM_QUEUES - RTE_INTR_VEC_RXTX_OFFSET) + +#define FPGA_INVALID_HW_QUEUE_ID (0xFFFFFFFF) + +#define FPGA_QUEUE_FLUSH_TIMEOUT_US (1000) +#define FPGA_HARQ_RDY_TIMEOUT (10) +#define FPGA_TIMEOUT_CHECK_INTERVAL (5) +#define FPGA_DDR_OVERFLOW (0x10) + +#define FPGA_5GNR_FEC_DDR_WR_DATA_LEN_IN_BYTES 8 +#define FPGA_5GNR_FEC_DDR_RD_DATA_LEN_IN_BYTES 8 + + +/* FPGA 5GNR FEC Register mapping on BAR0 */ +enum { +FPGA_5GNR_FEC_VERSION_ID =0x00000000 ,/* len: 4B */ +FPGA_5GNR_FEC_CONFIGURATION =0x00000004 ,/* len: 2B */ +FPGA_5GNR_FEC_QUEUE_PF_VF_MAP_DONE =0x00000008 ,/* len: 1B */ +FPGA_5GNR_FEC_LOAD_BALANCE_FACTOR =0x0000000a ,/* len: 2B */ +FPGA_5GNR_FEC_RING_DESC_LEN =0x0000000c ,/* len: 2B */ +FPGA_5GNR_FEC_FLR_TIME_OUT =0x0000000e ,/* len: 2B */ +FPGA_5GNR_FEC_VFQ_FLUSH_STATUS_LW =0x00000018 ,/* len: 4B */ +FPGA_5GNR_FEC_VFQ_FLUSH_STATUS_HI =0x0000001c ,/* len: 4B */ +FPGA_5GNR_FEC_QUEUE_MAP =0x00000040 ,/* len: 256B */ +FPGA_5GNR_FEC_RING_CTRL_REGS =0x00000200 ,/* len: 2048B */ +FPGA_5GNR_FEC_DDR4_WR_ADDR_REGS =0x00000A00 ,/* len: 4B */ +FPGA_5GNR_FEC_DDR4_WR_DATA_REGS =0x00000A08 ,/* len: 8B */ +FPGA_5GNR_FEC_DDR4_WR_DONE_REGS =0x00000A10 ,/* len: 1B */ +FPGA_5GNR_FEC_DDR4_RD_ADDR_REGS =0x00000A18 ,/* len: 4B */ +FPGA_5GNR_FEC_DDR4_RD_DONE_REGS =0x00000A20 ,/* len: 1B */ +FPGA_5GNR_FEC_DDR4_RD_RDY_REGS =0x00000A28 ,/* len: 1B */ +FPGA_5GNR_FEC_DDR4_RD_DATA_REGS =0x00000A30 ,/* len: 8B */ +FPGA_5GNR_FEC_DDR4_ADDR_RDY_REGS =0x00000A38 ,/* len: 1B */ +FPGA_5GNR_FEC_HARQ_BUF_SIZE_RDY_REGS =0x00000A40 ,/* len: 1B */ +FPGA_5GNR_FEC_HARQ_BUF_SIZE_REGS =0x00000A48 /* len: 4B */ +}; + +/* FPGA 5GNR FEC Ring Control Registers */ +enum { +FPGA_5GNR_FEC_RING_HEAD_ADDR =0x00000008 , +FPGA_5GNR_FEC_RING_SIZE =0x00000010 , +FPGA_5GNR_FEC_RING_MISC =0x00000014 , +FPGA_5GNR_FEC_RING_ENABLE =0x00000015 , +FPGA_5GNR_FEC_RING_FLUSH_QUEUE_EN =0x00000016 , +FPGA_5GNR_FEC_RING_SHADOW_TAIL =0x00000018 , +FPGA_5GNR_FEC_RING_HEAD_POINT =0x0000001C +}; + +/* FPGA 5GNR FEC DESCRIPTOR ERROR */ +enum { +DESC_ERR_NO_ERR =0x0 , +DESC_ERR_K_P_OUT_OF_RANGE =0x1 , +DESC_ERR_Z_C_NOT_LEGAL =0x2 , +DESC_ERR_DESC_OFFSET_ERR =0x3 , +DESC_ERR_DESC_READ_FAIL =0x8 , +DESC_ERR_DESC_READ_TIMEOUT =0x9 , +DESC_ERR_DESC_READ_TLP_POISONED =0xA , +DESC_ERR_CB_READ_FAIL =0xC , +DESC_ERR_CB_READ_TIMEOUT =0xD , +DESC_ERR_CB_READ_TLP_POISONED =0xE , +DESC_ERR_HBSTORE_ERR =0xF +}; + + +/* FPGA 5GNR FEC DMA Encoding Request Descriptor */ +struct __attribute__((__packed__ ))fpga_dma_enc_desc { +uint32_t done:1 , + rsrvd0:7 , + error:4 , + rsrvd1:4 , + num_null:10 , + rsrvd2:6 ; +uint32_t ncb:15 , + rsrvd3:1 , + k0:16 ; +uint32_t irq_en:1 , + crc_en:1 , + rsrvd4:1 , + qm_idx:3 , + bg_idx:1 , + zc:9 , + desc_idx:10 , + rsrvd5:6 ; +uint16_t rm_e; +uint16_t k_; +uint32_t out_addr_lw; +uint32_t out_addr_hi; +uint32_t in_addr_lw; +uint32_t in_addr_hi; + +union { +struct { +/* Virtual addresses used to retrieve SW context info */ +void *op_addr; +/* Stores information about total number of Code Blocks +* in currently processed Transport Block +*/ +uint64_t cbs_in_op; + }; + +uint8_t sw_ctxt[FPGA_RING_DESC_LEN_UNIT_BYTES * + (FPGA_RING_DESC_ENTRY_LENGTH -1 )]; + }; +}; + + +/* FPGA 5GNR DPC FEC DMA Decoding Request Descriptor */ +struct __attribute__((__packed__ ))fpga_dma_dec_desc { +uint32_t done:1 , + iter:5 , + et_pass:1 , + crcb_pass:1 , + error:4 , + qm_idx:3 , + max_iter:5 , + bg_idx:1 , + rsrvd0:1 , + harqin_en:1 , + zc:9 ; +uint32_t hbstroe_offset:22 , + num_null:10 ; +uint32_t irq_en:1 , + ncb:15 , + desc_idx:10 , + drop_crc24b:1 , + crc24b_ind:1 , + rv:2 , + et_dis:1 , + rsrvd2:1 ; +uint32_t harq_input_length:16 , + rm_e:16 ;/*the inbound data byte length*/ +uint32_t out_addr_lw; +uint32_t out_addr_hi; +uint32_t in_addr_lw; +uint32_t in_addr_hi; + +union { +struct { +/* Virtual addresses used to retrieve SW context info */ +void *op_addr; +/* Stores information about total number of Code Blocks +* in currently processed Transport Block +*/ +uint8_t cbs_in_op; + }; + +uint32_t sw_ctxt[8 * (FPGA_RING_DESC_ENTRY_LENGTH -1 )]; + }; +}; + +/* FPGA 5GNR DMA Descriptor */ +union fpga_dma_desc { +struct fpga_dma_enc_desc enc_req; +struct fpga_dma_dec_desc dec_req; +}; + +/* FPGA 5GNR FEC Ring Control Register */ +struct __attribute__((__packed__ ))fpga_ring_ctrl_reg { +uint64_t ring_base_addr; +uint64_t ring_head_addr; +uint16_t ring_size:11 ; +uint16_t rsrvd0; +union {/* Miscellaneous register */ +uint8_t misc; +uint8_t max_ul_dec:5 , + max_ul_dec_en:1 , + rsrvd1:2 ; + }; +uint8_t enable; +uint8_t flush_queue_en; +uint8_t rsrvd2; +uint16_t shadow_tail; +uint16_t rsrvd3; +uint16_t head_point; +uint16_t rsrvd4; + +}; +/* Private data structure for each FPGA FEC device */ struct fpga_5gnr_fec_device {/** Base address of MMIO registers (BAR0) */
Signature · 1 line
1.8.3.1
PATCH v3 3/11 baseband/fpga_5gnr_fec: add device info_get function
In reply to Nicolas ChautruAdd in the "info_get" function to the driver, to allow us to query the device.
No capability are available yet.
Linking bbdev-test to support the PMD with null capability.
--- app/test-bbdev/Makefile | 3 ++ app/test-bbdev/meson.build | 3 ++ drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h | 9 ++++ drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 53 ++++++++++++++++++++++ 4 files changed, 68 insertions(+)
app/test-bbdev/Makefile +3 -0
@@ -23,5 +23,8 @@ LDLIBS += -lm ifeq ($(CONFIG_RTE_LIBRTE_PMD_BBDEV_FPGA_LTE_FEC),y) LDLIBS += -lrte_pmd_bbdev_fpga_lte_fec endif +ifeq ($(CONFIG_RTE_LIBRTE_PMD_BBDEV_FPGA_5GNR_FEC),y) +LDLIBS += -lrte_pmd_bbdev_fpga_5gnr_fec +endif include $(RTE_SDK)/mk/rte.app.mk
app/test-bbdev/meson.build +3 -0
@@ -9,3 +9,6 @@ deps += ['bbdev', 'bus_vdev'] if dpdk_conf.has('RTE_LIBRTE_PMD_BBDEV_FPGA_LTE_FEC') deps += ['pmd_bbdev_fpga_lte_fec'] endif +if dpdk_conf.has('RTE_LIBRTE_PMD_BBDEV_FPGA_5GNR_FEC') + deps += ['pmd_bbdev_fpga_5gnr_fec'] +endif
drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h +9 -0
@@ -227,4 +227,13 @@ struct fpga_5gnr_fec_device { bool pf_device; }; +/* Read a register of FPGA 5GNR FEC device */ +static inline uint32_t +fpga_reg_read_32 (void *mmio_base,uint32_t offset) +{ +void *reg_addr =RTE_PTR_ADD (mmio_base, offset); +uint32_t ret = *((volatile uint32_t *)(reg_addr)); +return rte_le_to_cpu_32 (ret); +} +#endif /* _FPGA_5GNR_FEC_H_ */
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +53 -0
61 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH v3 4/11 baseband/fpga_5gnr_fec: add queue configuration
In reply to Nicolas ChautruAdding function to create and configure queues for the device. Still no capability.
--- drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h | 110 +++++++ drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 365 ++++++++++++++++++++- 2 files changed, 474 insertions(+), 1 deletion(-)
drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h +110 -0
@@ -223,10 +223,120 @@ struct __attribute__((__packed__)) fpga_ring_ctrl_reg {struct fpga_5gnr_fec_device {/** Base address of MMIO registers (BAR0) */ void *mmio_base; +/** Base address of memory for sw rings */ +void *sw_rings; +/** Physical address of sw_rings */ +rte_iova_t sw_rings_phys; +/** Number of bytes available for each queue in device. */ +uint32_t sw_ring_size; +/** Max number of entries available for each queue in device */ +uint32_t sw_ring_max_depth; +/** Base address of response tail pointer buffer */ +uint32_t *tail_ptrs; +/** Physical address of tail pointers */ +rte_iova_t tail_ptr_phys; +/** Queues flush completion flag */ +uint64_t *flush_queue_status; +/* Bitmap capturing which Queues are bound to the PF/VF */ +uint64_t q_bound_bit_map; +/* Bitmap capturing which Queues have already been assigned */ +uint64_t q_assigned_bit_map;/** True if this is a PF FPGA FEC device */ bool pf_device; }; +/* Structure associated with each queue. */ +struct __rte_cache_aligned fpga_queue { +struct fpga_ring_ctrl_reg ring_ctrl_reg;/* Ring Control Register */ +union fpga_dma_desc *ring_addr;/* Virtual address of software ring */ +uint64_t *ring_head_addr;/* Virtual address of completion_head */ +uint64_t shadow_completion_head;/* Shadow completion head value */ +uint16_t head_free_desc;/* Ring head */ +uint16_t tail;/* Ring tail */ +/* Mask used to wrap enqueued descriptors on the sw ring */ +uint32_t sw_ring_wrap_mask; +uint32_t irq_enable;/* Enable ops dequeue interrupts if set to 1 */ +uint8_t q_idx;/* Queue index */ +struct fpga_5gnr_fec_device *d; +/* MMIO register of shadow_tail used to enqueue descriptors */ +void *shadow_tail_addr; +}; + +/* Write to 16 bit MMIO register address */ +static inline void +mmio_write_16 (void *addr,uint16_t value) +{ + *((volatile uint16_t *)(addr)) =rte_cpu_to_le_16 (value); +} + +/* Write to 32 bit MMIO register address */ +static inline void +mmio_write_32 (void *addr,uint32_t value) +{ + *((volatile uint32_t *)(addr)) =rte_cpu_to_le_32 (value); +} + +/* Write to 64 bit MMIO register address */ +static inline void +mmio_write_64 (void *addr,uint64_t value) +{ + *((volatile uint64_t *)(addr)) =rte_cpu_to_le_64 (value); +} + +/* Write a 8 bit register of a FPGA 5GNR FEC device */ +static inline void +fpga_reg_write_8 (void *mmio_base,uint32_t offset,uint8_t payload) +{ +void *reg_addr =RTE_PTR_ADD (mmio_base, offset); + *((volatile uint8_t *)(reg_addr)) = payload; +} + +/* Write a 16 bit register of a FPGA 5GNR FEC device */ +static inline void +fpga_reg_write_16 (void *mmio_base,uint32_t offset,uint16_t payload) +{ +void *reg_addr =RTE_PTR_ADD (mmio_base, offset); +mmio_write_16 (reg_addr, payload); +} + +/* Write a 32 bit register of a FPGA 5GNR FEC device */ +static inline void +fpga_reg_write_32 (void *mmio_base,uint32_t offset,uint32_t payload) +{ +void *reg_addr =RTE_PTR_ADD (mmio_base, offset); +mmio_write_32 (reg_addr, payload); +} + +/* Write a 64 bit register of a FPGA 5GNR FEC device */ +static inline void +fpga_reg_write_64 (void *mmio_base,uint32_t offset,uint64_t payload) +{ +void *reg_addr =RTE_PTR_ADD (mmio_base, offset); +mmio_write_64 (reg_addr, payload); +} + +/* Write a ring control register of a FPGA 5GNR FEC device */ +static inline void +fpga_ring_reg_write (void *mmio_base,uint32_t offset, +struct fpga_ring_ctrl_reg payload) +{ +fpga_reg_write_64 (mmio_base, offset, payload.ring_base_addr); +fpga_reg_write_64 (mmio_base, offset +FPGA_5GNR_FEC_RING_HEAD_ADDR , + payload.ring_head_addr); +fpga_reg_write_16 (mmio_base, offset +FPGA_5GNR_FEC_RING_SIZE , + payload.ring_size); +fpga_reg_write_16 (mmio_base, offset +FPGA_5GNR_FEC_RING_HEAD_POINT , + payload.head_point); +fpga_reg_write_8 (mmio_base, offset +FPGA_5GNR_FEC_RING_FLUSH_QUEUE_EN , + payload.flush_queue_en); +fpga_reg_write_16 (mmio_base, offset +FPGA_5GNR_FEC_RING_SHADOW_TAIL , + payload.shadow_tail); +fpga_reg_write_8 (mmio_base, offset +FPGA_5GNR_FEC_RING_MISC , + payload.misc); +fpga_reg_write_8 (mmio_base, offset +FPGA_5GNR_FEC_RING_ENABLE , + payload.enable); +} +/* Read a register of FPGA 5GNR FEC device */ static inline uint32_t fpga_reg_read_32 (void *mmio_base,uint32_t offset)
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +364 -1
381 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH v3 5/11 baseband/fpga_5gnr_fec: add LDPC processing functions
In reply to Nicolas ChautruAdding LDPC processing operations and related documentation.
--- doc/guides/bbdevs/fpga_5gnr_fec.rst | 28 + drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h | 9 + drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 660 +++++++++++++++++++++ 3 files changed, 697 insertions(+)
doc/guides/bbdevs/fpga_5gnr_fec.rst +28 -0
@@ -13,6 +13,8 @@ Features FPGA 5GNR FEC PMD supports the following features: +- LDPC Encode in the DL +- LDPC Decode in the UL - 8 VFs per PF (physical device) - Maximum of 32 UL queues per VF - Maximum of 32 DL queues per VF
@@ -20,6 +22,24 @@ FPGA 5GNR FEC PMD supports the following features: - MSI-X - SR-IOV +FPGA 5GNR FEC PMD supports the following BBDEV capabilities: + +* For the LDPC encode operation: + - ``RTE_BBDEV_LDPC_CRC_24B_ATTACH`` : set to attach CRC24B to CB(s) + - ``RTE_BBDEV_LDPC_RATE_MATCH`` : if set then do not do Rate Match bypass + +* For the LDPC decode operation: + - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK`` : check CRC24B from CB(s) + - ``RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE`` : disable early termination + - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP`` : drops CRC24B bits appended while decoding + - ``RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE`` : provides an input for HARQ combining + - ``RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE`` : provides an input for HARQ combining + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE`` : HARQ memory input is internal + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE`` : HARQ memory output is internal + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK`` : loopback data to/from HARQ memory + - ``RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS`` : HARQ memory includes the fillers bits + + Limitations -----------
@@ -144,3 +164,11 @@ name is different: .. code-block:: console echo <num-of-vfs> > /sys/bus/pci/devices/0000\:<b>\:<d>.<f>/sriov_numvfs + + +Test Vectors +~~~~~~~~~~~~ + +In addition to the simple LDPC decoder and LDPC 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 5GNR FEC capabilities.
drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h +9 -0
@@ -53,6 +53,15 @@#define FPGA_5GNR_FEC_DDR_WR_DATA_LEN_IN_BYTES 8#define FPGA_5GNR_FEC_DDR_RD_DATA_LEN_IN_BYTES 8 +/* Constants from K0 computation from 3GPP 38.212 Table 5.4.2.1-2 */ +#define N_ZC_1 66/* N = 66 Zc for BG 1 */ +#define N_ZC_2 50/* N = 50 Zc for BG 2 */ +#define K0_1_1 17/* K0 fraction numerator for rv 1 and BG 1 */ +#define K0_1_2 13/* K0 fraction numerator for rv 1 and BG 2 */ +#define K0_2_1 33/* K0 fraction numerator for rv 2 and BG 1 */ +#define K0_2_2 25/* K0 fraction numerator for rv 2 and BG 2 */ +#define K0_3_1 56/* K0 fraction numerator for rv 3 and BG 1 */ +#define K0_3_2 43/* K0 fraction numerator for rv 3 and BG 2 */ /* FPGA 5GNR FEC Register mapping on BAR0 */ enum {
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +660 -0
684 lines not on this page · raw message
Signature · 1 line
1.8.3.1
Re: [dpdk-dev] [PATCH v3 05/11] baseband/fpga_5gnr_fec: add LDPC processing functions
Quoted 6 lines
Adding LDPC processing operations and related documentation.
Signed-off-by Nicolas Chautru <[email protected]>---
There are compilation issues while compiling the patches individually
Please fix them. Please also check meson compilation also for all individual patches.
/home/akhil/up/dpdk-next-crypto/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c: In function âdequeue_ldpc_enc_one_op_cbâ:/home/akhil/up/dpdk-next-crypto/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c:988:6: error: unused variable âdesc_errorâ [-Werror=unused-variable]
int desc_error = 0;
^~~~~~~~~~
/home/akhil/up/dpdk-next-crypto/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c:984:76: error: unused parameter âopâ [-Werror=unused-parameter]
dequeue_ldpc_enc_one_op_cb(struct fpga_queue *q, struct rte_bbdev_enc_op **op,
^~
/home/akhil/up/dpdk-next-crypto/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c: In function âdequeue_ldpc_dec_one_op_cbâ:
/home/akhil/up/dpdk-next-crypto/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c:1012:6: error: unused variable âdesc_errorâ [-Werror=unused-variable]
int desc_error = 0;
^~~~~~~~~~== Build drivers/vdpa/ifc /home/akhil/up/dpdk-next-crypto/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c: At top level:
cc1: error: unrecognized command line option â-Wno-address-of-packed-memberâ [-Werror]
cc1: all warnings being treated as errors /home/akhil/up/dpdk-next-crypto/mk/internal/rte.compile-pre.mk:114: recipe for target 'rte_fpga_5gnr_fec.o' failed make[6]: *** [rte_fpga_5gnr_fec.o] Error 1/home/akhil/up/dpdk-next-crypto/mk/rte.subdir.mk:35: recipe for target 'fpga_5gnr_fec' failed make[5]: *** [fpga_5gnr_fec] Error 2/home/akhil/up/dpdk-next-crypto/mk/rte.subdir.mk:35: recipe for target 'baseband' failed
PATCH v3 6/11 baseband/fpga_5gnr_fec: add HW error capture
In reply to Nicolas ChautruAdding HW specific parsing of error report for
negative scenarios. Not hit through unit test.
--- drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+)
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +56 -0
@@ -519,6 +519,54 @@return bitmap & bitmask; } +/* Print an error if a descriptor error has occurred. +* Return 0 on success, 1 on failure +*/ +static inline int +check_desc_error (uint32_t error_code) { +switch (error_code) { +case DESC_ERR_NO_ERR : +return 0 ; +case DESC_ERR_K_P_OUT_OF_RANGE : +rte_bbdev_log (ERR ,"Encode block size K' is out of range" ); +break ; +case DESC_ERR_Z_C_NOT_LEGAL : +rte_bbdev_log (ERR ,"Zc is illegal" ); +break ; +case DESC_ERR_DESC_OFFSET_ERR : +rte_bbdev_log (ERR , +"Queue offset does not meet the expectation in the FPGA" + ); +break ; +case DESC_ERR_DESC_READ_FAIL : +rte_bbdev_log (ERR ,"Unsuccessful completion for descriptor read" ); +break ; +case DESC_ERR_DESC_READ_TIMEOUT : +rte_bbdev_log (ERR ,"Descriptor read time-out" ); +break ; +case DESC_ERR_DESC_READ_TLP_POISONED : +rte_bbdev_log (ERR ,"Descriptor read TLP poisoned" ); +break ; +case DESC_ERR_CB_READ_FAIL : +rte_bbdev_log (ERR ,"Unsuccessful completion for code block" ); +break ; +case DESC_ERR_CB_READ_TIMEOUT : +rte_bbdev_log (ERR ,"Code block read time-out" ); +break ; +case DESC_ERR_CB_READ_TLP_POISONED : +rte_bbdev_log (ERR ,"Code block read TLP poisoned" ); +break ; +case DESC_ERR_HBSTORE_ERR : +rte_bbdev_log (ERR ,"Hbstroe exceeds HARQ buffer size." ); +break ; +default : +rte_bbdev_log (ERR ,"Descriptor error unknown error code %u" , + error_code); +break ; + } +return 1 ; +} +/* Compute value of k0. * Based on 3GPP 38.212 Table 5.4.2.1-2 * Starting position of different redundancy versions, k0
@@ -1000,6 +1048,11 @@rte_bbdev_log_debug ("DMA response desc %p" , desc); + *op = desc->enc_req.op_addr; +/* Check the descriptor error field, return 1 on error */ + desc_error =check_desc_error (desc->enc_req.error); + (*op)->status = desc_error <<RTE_BBDEV_DATA_ERROR ; +return 1 ; }
@@ -1036,6 +1089,9 @@ (*op)->status =1 <<RTE_BBDEV_CRC_ERROR ;/* et_pass = 0 when decoder fails */ (*op)->status |= !(desc->dec_req.et_pass) <<RTE_BBDEV_SYNDROME_ERROR ; +/* Check the descriptor error field, return 1 on error */ + desc_error =check_desc_error (desc->dec_req.error); + (*op)->status |= desc_error <<RTE_BBDEV_DATA_ERROR ;return 1 ; }
Signature · 1 line
1.8.3.1
PATCH v3 7/11 baseband/fpga_5gnr_fec: add debug functionality
In reply to Nicolas ChautruAdding functionality for debug mode to be more verbose and catch error from unsupported configuration.
--- drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h | 13 + drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 356 +++++++++++++++++++++ 2 files changed, 369 insertions(+)
drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h +13 -0
@@ -355,4 +355,17 @@ struct __rte_cache_aligned fpga_queue { return rte_le_to_cpu_32(ret); } +#ifdef RTE_LIBRTE_BBDEV_DEBUG + +/* Read a register of FPGA 5GNR FEC device */ +static inline uint16_t +fpga_reg_read_16 (void *mmio_base,uint32_t offset) +{ +void *reg_addr =RTE_PTR_ADD (mmio_base, offset); +uint16_t ret = *((volatile uint16_t *)(reg_addr)); +return rte_le_to_cpu_16 (ret); +} + +#endif +#endif /* _FPGA_5GNR_FEC_H_ */
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +356 -0
428 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH v3 8/11 baseband/fpga_5gnr_fec: add configure function
In reply to Nicolas ChautruAdd configure function to configure the PF from within the bbdev-test itself without external application configuration the device.
--- app/test-bbdev/test_bbdev_perf.c | 57 ++++++ doc/guides/bbdevs/fpga_5gnr_fec.rst | 123 +++++++++++++ drivers/baseband/fpga_5gnr_fec/Makefile | 3 + drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 196 +++++++++++++++++++++ .../rte_pmd_bbdev_fpga_5gnr_fec_version.map | 7 + .../baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h | 74 ++++++++ 6 files changed, 460 insertions(+) create mode 100644 drivers/baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h
app/test-bbdev/test_bbdev_perf.c +57 -0
@@ -39,6 +39,19 @@#define FLR_4G_TIMEOUT 610#endif +#ifdef RTE_LIBRTE_PMD_BBDEV_FPGA_5GNR_FEC +#include <rte_pmd_fpga_5gnr_fec.h> +#define FPGA_5GNR_PF_DRIVER_NAME ("intel_fpga_5gnr_fec_pf") +#define FPGA_5GNR_VF_DRIVER_NAME ("intel_fpga_5gnr_fec_vf") +#define VF_UL_5G_QUEUE_VALUE 4 +#define VF_DL_5G_QUEUE_VALUE 4 +#define UL_5G_BANDWIDTH 3 +#define DL_5G_BANDWIDTH 3 +#define UL_5G_LOAD_BALANCE 128 +#define DL_5G_LOAD_BALANCE 128 +#define FLR_5G_TIMEOUT 610 +#endif +#define OPS_CACHE_SIZE 256U#define OPS_POOL_SIZE_MIN 511U/* 0.5K per queue */
@@ -596,6 +609,50 @@ typedef int (test_case_function)(struct active_device *ad, info->dev_name); }#endif +#ifdef RTE_LIBRTE_PMD_BBDEV_FPGA_5GNR_FEC +if ((get_init_device () == true) && + (!strcmp (info->drv.driver_name,FPGA_5GNR_PF_DRIVER_NAME ))) { +struct fpga_5gnr_fec_conf conf; +unsigned int i; + +printf ("Configure FPGA 5GNR FEC Driver %s with default values\n" , + info->drv.driver_name); + +/* clear default configuration before initialization */ +memset (&conf,0 ,sizeof (struct fpga_5gnr_fec_conf )); + +/* Set PF mode : +* true if PF is used for data plane +* false for VFs +*/ + conf.pf_mode_en = true; + +for (i =0 ; i <FPGA_5GNR_FEC_NUM_VFS ; ++i) { +/* Number of UL queues per VF (fpga supports 8 VFs) */ + conf.vf_ul_queues_number[i] =VF_UL_5G_QUEUE_VALUE ; +/* Number of DL queues per VF (fpga supports 8 VFs) */ + conf.vf_dl_queues_number[i] =VF_DL_5G_QUEUE_VALUE ; + } + +/* UL bandwidth. Needed for schedule algorithm */ + conf.ul_bandwidth =UL_5G_BANDWIDTH ; +/* DL bandwidth */ + conf.dl_bandwidth =DL_5G_BANDWIDTH ; + +/* UL & DL load Balance Factor to 64 */ + conf.ul_load_balance =UL_5G_LOAD_BALANCE ; + conf.dl_load_balance =DL_5G_LOAD_BALANCE ; + +/**< FLR timeout value */ + conf.flr_time_out =FLR_5G_TIMEOUT ; + +/* setup FPGA PF with configuration information */ + ret =fpga_5gnr_fec_configure (info->dev_name, &conf); +TEST_ASSERT_SUCCESS (ret, +"Failed to configure 5G FPGA PF for bbdev %s" , + info->dev_name); + } +#endif nb_queues =RTE_MIN (rte_lcore_count (), info->drv.max_num_queues); nb_queues =RTE_MIN (nb_queues, (unsigned int )MAX_QUEUES );
doc/guides/bbdevs/fpga_5gnr_fec.rst +123 -0
129 lines not on this page · raw message
drivers/baseband/fpga_5gnr_fec/Makefile +3 -0
@@ -23,4 +23,7 @@ LIBABIVER := 1 # library source files SRCS-$(CONFIG_RTE_LIBRTE_PMD_BBDEV_FPGA_5GNR_FEC) += rte_fpga_5gnr_fec.c +# export include files +SYMLINK-$(CONFIG_RTE_LIBRTE_PMD_BBDEV_FPGA_5GNR_FEC)-include += rte_pmd_fpga_5gnr_fec.h + include $(RTE_SDK)/mk/rte.lib.mk
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +196 -0
208 lines not on this page · raw message
drivers/baseband/fpga_5gnr_fec/rte_pmd_bbdev_fpga_5gnr_fec_version.map +7 -0
@@ -1,3 +1,10 @@ DPDK_20.0 { local: *; }; + +EXPERIMENTAL { + global: + + fpga_5gnr_fec_configure; + +};
drivers/baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h new file +74 -0
74 lines not on this page · raw message
Signature · 1 line
1.8.3.1
Re: [dpdk-dev] [PATCH v3 08/11] baseband/fpga_5gnr_fec: add configure function
Quoted 16 lines
Add configure function to configure the PF from within the bbdev-test itself without external application configuration the device.
Signed-off-by Nicolas Chautru <[email protected]>--- app/test-bbdev/test_bbdev_perf.c | 57 ++++++ doc/guides/bbdevs/fpga_5gnr_fec.rst | 123 +++++++++++++ drivers/baseband/fpga_5gnr_fec/Makefile | 3 + drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 196 +++++++++++++++++++++ .../rte_pmd_bbdev_fpga_5gnr_fec_version.map | 7 + .../baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h | 74 ++++++++ 6 files changed, 460 insertions(+) create mode 100644
Quoted 2 lines
drivers/baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h
Header need to be installed in meson.build as well.
Re: [dpdk-dev] [PATCH v3 08/11] baseband/fpga_5gnr_fec: add configure function
Quoted 17 lines
Quoted 14 lines
Add configure function to configure the PF from within the bbdev-test itself without external application configuration the device.
Signed-off-by Nicolas Chautru <[email protected]>--- app/test-bbdev/test_bbdev_perf.c | 57 ++++++ doc/guides/bbdevs/fpga_5gnr_fec.rst | 123 +++++++++++++ drivers/baseband/fpga_5gnr_fec/Makefile | 3 + drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 196 +++++++++++++++++++++ .../rte_pmd_bbdev_fpga_5gnr_fec_version.map | 7 + .../baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h | 74 ++++++++ 6 files changed, 460 insertions(+) create mode 100644Quoted 2 lines
drivers/baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h
Quoted 1 line
Header need to be installed in meson.build as well.
Is that actually required to build with meson? It seems to build fine with it and the meson.build is the same for fpga_lte_fec (other PMD with also expect a configure function to test application). Still I will add now.
PATCH v3 9/11 baseband/fpga_5gnr_fec: add harq loopback capability
In reply to Nicolas ChautruAdding optional capability to support loopback preloading and check of the extern HARQ memory.
This function is required to run the HARQ bit exact test successfully.
--- drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 171 +++++++++++++++++++++ 1 file changed, 171 insertions(+)
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +171 -0
@@ -324,6 +324,7 @@RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE |RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE |RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE | +RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK | RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS, .llr_size = 6, .llr_decimals = 2,
@@ -1055,6 +1056,140 @@#endif static inline int +fpga_harq_write_loopback (struct fpga_5gnr_fec_device *fpga_dev, +struct rte_mbuf *harq_input,uint16_t harq_in_length, +uint32_t harq_in_offset,uint32_t harq_out_offset) +{ +uint32_t out_offset = harq_out_offset; +uint32_t in_offset = harq_in_offset; +uint32_t left_length = harq_in_length; +uint32_t reg_32, increment =0 ; +uint64_t *input =NULL ; +uint32_t last_transaction = left_length + %FPGA_5GNR_FEC_DDR_WR_DATA_LEN_IN_BYTES ; +uint64_t last_word; + +if (last_transaction >0 ) + left_length -= last_transaction; + +/* +* Get HARQ buffer size for each VF/PF: When 0x00, there is no +* available DDR space for the corresponding VF/PF. +*/ + reg_32 =fpga_reg_read_32 (fpga_dev->mmio_base, +FPGA_5GNR_FEC_HARQ_BUF_SIZE_REGS ); +if (reg_32 < harq_in_length) { + left_length = reg_32; +rte_bbdev_log (ERR ,"HARQ in length > HARQ buffer size\n" ); + } + + input = (uint64_t *)rte_pktmbuf_mtod_offset (harq_input, + uint8_t *, in_offset); + +while (left_length >0 ) { +if (fpga_reg_read_8 (fpga_dev->mmio_base, +FPGA_5GNR_FEC_DDR4_ADDR_RDY_REGS ) ==1 ) { +fpga_reg_write_32 (fpga_dev->mmio_base, +FPGA_5GNR_FEC_DDR4_WR_ADDR_REGS , + out_offset); +fpga_reg_write_64 (fpga_dev->mmio_base, +FPGA_5GNR_FEC_DDR4_WR_DATA_REGS , + input[increment]); + left_length -=FPGA_5GNR_FEC_DDR_WR_DATA_LEN_IN_BYTES ; + out_offset +=FPGA_5GNR_FEC_DDR_WR_DATA_LEN_IN_BYTES ; + increment++; +fpga_reg_write_8 (fpga_dev->mmio_base, +FPGA_5GNR_FEC_DDR4_WR_DONE_REGS ,1 ); + } + } +while (last_transaction >0 ) { +if (fpga_reg_read_8 (fpga_dev->mmio_base, +FPGA_5GNR_FEC_DDR4_ADDR_RDY_REGS ) ==1 ) { +fpga_reg_write_32 (fpga_dev->mmio_base, +FPGA_5GNR_FEC_DDR4_WR_ADDR_REGS , + out_offset); + last_word = input[increment]; + last_word &= (uint64_t )(1 << (last_transaction *4 )) + -1 ; +fpga_reg_write_64 (fpga_dev->mmio_base, +FPGA_5GNR_FEC_DDR4_WR_DATA_REGS , + last_word); +fpga_reg_write_8 (fpga_dev->mmio_base, +FPGA_5GNR_FEC_DDR4_WR_DONE_REGS ,1 ); + last_transaction =0 ; + } + } +return 1 ; +} + +static inline int +fpga_harq_read_loopback (struct fpga_5gnr_fec_device *fpga_dev, +struct rte_mbuf *harq_output,uint16_t harq_in_length, +uint32_t harq_in_offset,uint32_t harq_out_offset) +{ +uint32_t left_length, in_offset = harq_in_offset; +uint64_t reg; +uint32_t increment =0 ; +uint64_t *input =NULL ; +uint32_t last_transaction = harq_in_length + %FPGA_5GNR_FEC_DDR_WR_DATA_LEN_IN_BYTES ; + +if (last_transaction >0 ) + harq_in_length += (8 - last_transaction); + + reg =fpga_reg_read_32 (fpga_dev->mmio_base, +FPGA_5GNR_FEC_HARQ_BUF_SIZE_REGS ); +if (reg < harq_in_length) { + harq_in_length = reg; +rte_bbdev_log (ERR ,"HARQ in length > HARQ buffer size\n" ); + } + +if (!mbuf_append (harq_output, harq_output, harq_in_length)) { +rte_bbdev_log (ERR ,"HARQ output buffer warning %d %d\n" , + harq_output->buf_len - +rte_pktmbuf_headroom (harq_output), + harq_in_length); + harq_in_length = harq_output->buf_len - +rte_pktmbuf_headroom (harq_output); +if (!mbuf_append (harq_output, harq_output, harq_in_length)) { +rte_bbdev_log (ERR ,"HARQ output buffer issue %d %d\n" , + harq_output->buf_len, harq_in_length); +return -1 ; + } + } + left_length = harq_in_length; + + input = (uint64_t *)rte_pktmbuf_mtod_offset (harq_output, + uint8_t *, harq_out_offset); + +while (left_length >0 ) { +fpga_reg_write_32 (fpga_dev->mmio_base, +FPGA_5GNR_FEC_DDR4_RD_ADDR_REGS , in_offset); +fpga_reg_write_8 (fpga_dev->mmio_base, +FPGA_5GNR_FEC_DDR4_RD_DONE_REGS ,1 ); + reg =fpga_reg_read_8 (fpga_dev->mmio_base, +FPGA_5GNR_FEC_DDR4_RD_RDY_REGS ); +while (reg !=1 ) { + reg =fpga_reg_read_8 (fpga_dev->mmio_base, +FPGA_5GNR_FEC_DDR4_RD_RDY_REGS ); +if (reg ==FPGA_DDR_OVERFLOW ) { +rte_bbdev_log (ERR , +"Read address is overflow!\n" ); +return -1 ; + } + } + input[increment] =fpga_reg_read_64 (fpga_dev->mmio_base, +FPGA_5GNR_FEC_DDR4_RD_DATA_REGS ); + left_length -=FPGA_5GNR_FEC_DDR_RD_DATA_LEN_IN_BYTES ; + in_offset +=FPGA_5GNR_FEC_DDR_WR_DATA_LEN_IN_BYTES ; + increment++; +fpga_reg_write_8 (fpga_dev->mmio_base, +FPGA_5GNR_FEC_DDR4_RD_DONE_REGS ,0 ); + } +return 1 ; +} + +static inline int enqueue_ldpc_enc_one_op_cb (struct fpga_queue *q,struct rte_bbdev_enc_op *op,uint16_t desc_offset) {
@@ -1182,6 +1317,42 @@ ring_offset = ((q->tail + desc_offset) & q->sw_ring_wrap_mask); desc = q->ring_addr + ring_offset; +if (check_bit (dec->op_flags, +RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK )) { +struct rte_mbuf *harq_in = dec->harq_combined_input.data; +struct rte_mbuf *harq_out = dec->harq_combined_output.data; + harq_in_length = dec->harq_combined_input.length; +uint32_t harq_in_offset = dec->harq_combined_input.offset; +uint32_t harq_out_offset = dec->harq_combined_output.offset; + +if (check_bit (dec->op_flags, +RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_OUT_ENABLE + )) { + ret =fpga_harq_write_loopback (q->d, harq_in, + harq_in_length, harq_in_offset, + harq_out_offset); + }else if (check_bit (dec->op_flags, +RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE + )) { + ret =fpga_harq_read_loopback (q->d, harq_out, + harq_in_length, harq_in_offset, + harq_out_offset); + dec->harq_combined_output.length = harq_in_length; + }else { +rte_bbdev_log (ERR ,"OP flag Err!" ); + ret =-1 ; + } +/* Set descriptor for dequeue */ + desc->dec_req.done =1 ; + desc->dec_req.error =0 ; + desc->dec_req.op_addr = op; + desc->dec_req.cbs_in_op =1 ; +/* Mark this dummy descriptor to be dropped by HW */ + desc->dec_req.desc_idx = (ring_offset +1 ) + & q->sw_ring_wrap_mask; +return ret;/* Error or number of CB */ + } +if (m_in ==NULL || m_out ==NULL ) {rte_bbdev_log (ERR ,"Invalid mbuf pointer" ); op->status =1 <<RTE_BBDEV_DATA_ERROR ;
Signature · 1 line
1.8.3.1
PATCH v3 10/11 baseband/fpga_5gnr_fec: add interrupt support
In reply to Nicolas ChautruAdding support for interrupt capability in the PMD and the related operations.
--- drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h | 17 +++ drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 139 +++++++++++++++++++++ 2 files changed, 156 insertions(+)
drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h +17 -0
@@ -368,4 +368,21 @@ struct __rte_cache_aligned fpga_queue {#endif +/* Read a register of FPGA 5GNR FEC device */ +static inline uint8_t +fpga_reg_read_8 (void *mmio_base,uint32_t offset) +{ +void *reg_addr =RTE_PTR_ADD (mmio_base, offset); +return *((volatile uint8_t *)(reg_addr)); +} + +/* Read a register of FPGA 5GNR FEC device */ +static inline uint64_t +fpga_reg_read_64 (void *mmio_base,uint32_t offset) +{ +void *reg_addr =RTE_PTR_ADD (mmio_base, offset); +uint64_t ret = *((volatile uint64_t *)(reg_addr)); +return rte_le_to_cpu_64 (ret); +} +#endif /* _FPGA_5GNR_FEC_H_ */
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +139 -0
159 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH v3 11/11 doc: add feature matrix table for bbdev devices
In reply to Nicolas ChautruAdding missing overview page in documentation with comparison of feature set by each available PMD implementation.
--- .gitignore | 1 + doc/guides/bbdevs/features/default.ini | 16 ++++++++++++++++ doc/guides/bbdevs/features/fpga_5gnr_fec.ini | 11 +++++++++++ doc/guides/bbdevs/features/fpga_lte_fec.ini | 10 ++++++++++ doc/guides/bbdevs/features/mbc.ini | 14 ++++++++++++++ doc/guides/bbdevs/features/null.ini | 7 +++++++ doc/guides/bbdevs/features/turbo_sw.ini | 11 +++++++++++ doc/guides/bbdevs/index.rst | 1 + doc/guides/bbdevs/overview.rst | 15 +++++++++++++++ doc/guides/conf.py | 5 +++++ 10 files changed, 91 insertions(+) create mode 100644 doc/guides/bbdevs/features/default.ini create mode 100644 doc/guides/bbdevs/features/fpga_5gnr_fec.ini create mode 100644 doc/guides/bbdevs/features/fpga_lte_fec.ini create mode 100644 doc/guides/bbdevs/features/mbc.ini create mode 100644 doc/guides/bbdevs/features/null.ini create mode 100644 doc/guides/bbdevs/features/turbo_sw.ini create mode 100644 doc/guides/bbdevs/overview.rst
.gitignore +1 -0
@@ -10,6 +10,7 @@ doc/guides/cryptodevs/overview_aead_table.txt doc/guides/cryptodevs/overview_asym_table.txt doc/guides/compressdevs/overview_feature_table.txt doc/guides/vdpadevs/overview_feature_table.txt +doc/guides/bbdevs/overview_feature_table.txt # ignore generated ctags/cscope files cscope.out.po
doc/guides/bbdevs/features/default.ini new file +16 -0
@@ -0,0 +1,16 @@ +; +; Features of a default bbdev driver. +; +; This file defines the features that are valid for inclusion in +; the other driver files and also the order that they appear in +; the features table in the documentation. +; +[Features] +Turbo Decoder (4G) = +Turbo Encoder (4G) = +LDPC Decoder (5G) = +LDPC Encoder (5G) = +LLR/HARQ Compression = +External DDR Access = +HW Accelerated = +BBDEV API =
doc/guides/bbdevs/features/fpga_5gnr_fec.ini new file +11 -0
@@ -0,0 +1,11 @@ +; +; Supported features of the 'fpga_5ngr_fec' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +External DDR Access = Y +HW Accelerated = Y +BBDEV API = Y
doc/guides/bbdevs/features/fpga_lte_fec.ini new file +10 -0
@@ -0,0 +1,10 @@ +; +; Supported features of the 'fpga_lte_fec' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Turbo Decoder (4G) = Y +Turbo Encoder (4G) = Y +HW Accelerated = Y +BBDEV API = Y
doc/guides/bbdevs/features/mbc.ini new file +14 -0
@@ -0,0 +1,14 @@ +; +; Supported features of the 'mbc' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Turbo Decoder (4G) = Y +Turbo Encoder (4G) = Y +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = Y +External DDR Access = Y +HW Accelerated = Y +BBDEV API = Y
doc/guides/bbdevs/features/null.ini new file +7 -0
@@ -0,0 +1,7 @@ +; +; Supported features of the 'null' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +BBDEV API = Y
doc/guides/bbdevs/features/turbo_sw.ini new file +11 -0
@@ -0,0 +1,11 @@ +; +; Supported features of the 'turbo_sw' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Turbo Decoder (4G) = Y +Turbo Encoder (4G) = Y +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +BBDEV API = Y
doc/guides/bbdevs/index.rst +1 -0
@@ -8,6 +8,7 @@ Baseband Device Drivers :maxdepth: 2 :numbered: + overview null turbo_sw fpga_lte_fec
doc/guides/bbdevs/overview.rst new file +15 -0
@@ -0,0 +1,15 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright(c) 2020 Intel Corporation. + +Baseband Device Supported Functionality Matrices +============================================== + +Supported Feature Flags +----------------------- + +.. _table_bbdev_pmd_features: + +.. include:: overview_feature_table.txt + + +
doc/guides/conf.py +5 -0
@@ -406,6 +406,11 @@ def setup(app): 'Features', 'Features availability in vDPA drivers', 'Feature') + table_file = dirname(__file__) + '/bbdevs/overview_feature_table.txt' + generate_overview_table(table_file, 1, + 'Features', + 'Features availability in bbdev drivers', + 'Feature') if LooseVersion(sphinx_version) < LooseVersion('1.3.1'): print('Upgrade sphinx to version >= 1.3.1 for '
Signature · 1 line
1.8.3.1
Hi Nicolas,
It seems you missed a couple of patches in the series which were doing changes in BBDEV. Should I take those from v2?
Series
Regards,
Akhil
Quoted 20 lines
v3: Incremental changes from reviews : file name change, moving few inline function to .h, adding missing inline, doxygen markup fix.
Adding new baseband PMD for FPGA 5GNR FEC implementation.
Nicolas Chautru (11):
drivers/baseband: add PMD for FPGA 5GNR FEC baseband/fpga_5gnr_fec: add register definition file baseband/fpga_5gnr_fec: add deviceinfo_getfunction baseband/fpga_5gnr_fec: add queue configuration baseband/fpga_5gnr_fec: add LDPC processing functions baseband/fpga_5gnr_fec: add HW error capture baseband/fpga_5gnr_fec: add debug functionality baseband/fpga_5gnr_fec: add configure function baseband/fpga_5gnr_fec: add harq loopback capability baseband/fpga_5gnr_fec: add interrupt support
doc: add feature matrix table for bbdev devices
Hi Akhil,
You already have applied these 2 from thr other serie. So when I rebased on latest these are no longer required.
If you remember we split the initial serie into 2 separate series, but then I kept the same first 2 patches on both serie are they are required as a dependency (to make sure it builds in CI). Since you have now applied the first serie the other week, then these 2 commits are already applied and are no longer required on the v3.
Let me know if unclear
Nic
Quoted 31 lines
Hi Nicolas,
It seems you missed a couple of patches in the series which were doing changes in BBDEV.
Should I take those from v2?Series
Acked-by Akhil Goyal <[email protected]>Regards,
AkhilQuoted 19 lines
v3: Incremental changes from reviews : file name change, moving few inline function to .h, adding missing inline, doxygen markup fix.
Adding new baseband PMD for FPGA 5GNR FEC implementation.
Nicolas Chautru (11):
drivers/baseband: add PMD for FPGA 5GNR FEC baseband/fpga_5gnr_fec: add register definition file baseband/fpga_5gnr_fec: add deviceinfo_getfunction baseband/fpga_5gnr_fec: add queue configuration baseband/fpga_5gnr_fec: add LDPC processing functions baseband/fpga_5gnr_fec: add HW error capture baseband/fpga_5gnr_fec: add debug functionality baseband/fpga_5gnr_fec: add configure function baseband/fpga_5gnr_fec: add harq loopback capability baseband/fpga_5gnr_fec: add interrupt support
doc: add feature matrix table for bbdev devices
Quoted 13 lines
Hi Akhil,
You already have applied these 2 from thr other serie. So when I rebased on latest these are no longer required.
If you remember we split the initial serie into 2 separate series, but then I kept the same first 2 patches on both serie are they are required as a dependency (to make sure it builds in CI).
Since you have now applied the first serie the other week, then these 2 commits are already applied and are no longer required on the v3.
Let me know if unclear
Nic
OK my bad.. Thanks for clarifying.
Quoted 63 lines
v3: Incremental changes from reviews : file name change, moving few inline function to .h, adding missing inline, doxygen markup fix.
Adding new baseband PMD for FPGA 5GNR FEC implementation.
Nicolas Chautru (11):
drivers/baseband: add PMD for FPGA 5GNR FEC baseband/fpga_5gnr_fec: add register definition file baseband/fpga_5gnr_fec: add deviceinfo_getfunction baseband/fpga_5gnr_fec: add queue configuration baseband/fpga_5gnr_fec: add LDPC processing functions baseband/fpga_5gnr_fec: add HW error capture baseband/fpga_5gnr_fec: add debug functionality baseband/fpga_5gnr_fec: add configure function baseband/fpga_5gnr_fec: add harq loopback capability baseband/fpga_5gnr_fec: add interrupt support
doc: add feature matrix table for bbdev devices.gitignore | 1 + app/test-bbdev/Makefile | 3 + app/test-bbdev/meson.build | 3 + app/test-bbdev/test_bbdev_perf.c | 57 + config/common_base | 5 + doc/guides/bbdevs/features/default.ini | 16 + doc/guides/bbdevs/features/fpga_5gnr_fec.ini | 11 + doc/guides/bbdevs/features/fpga_lte_fec.ini | 10 + doc/guides/bbdevs/features/mbc.ini | 14 + doc/guides/bbdevs/features/null.ini | 7 + doc/guides/bbdevs/features/turbo_sw.ini | 11 + doc/guides/bbdevs/fpga_5gnr_fec.rst | 297 +++ doc/guides/bbdevs/index.rst | 2 + doc/guides/bbdevs/overview.rst | 15 + doc/guides/conf.py | 5 + doc/guides/rel_notes/release_20_05.rst | 5 + drivers/baseband/Makefile | 2 + drivers/baseband/fpga_5gnr_fec/Makefile | 29 + drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h | 388 ++++ drivers/baseband/fpga_5gnr_fec/meson.build | 6 + drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 2187 ++++++++++++++++++++ .../rte_pmd_bbdev_fpga_5gnr_fec_version.map | 10 + .../baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h | 74 + drivers/baseband/meson.build | 2 +- mk/rte.app.mk | 1 + 25 files changed, 3160 insertions(+), 1 deletion(-) create mode 100644 doc/guides/bbdevs/features/default.ini create mode 100644 doc/guides/bbdevs/features/fpga_5gnr_fec.ini create mode 100644 doc/guides/bbdevs/features/fpga_lte_fec.ini create mode 100644 doc/guides/bbdevs/features/mbc.ini create mode 100644 doc/guides/bbdevs/features/null.ini create mode 100644 doc/guides/bbdevs/features/turbo_sw.ini create mode 100644 doc/guides/bbdevs/fpga_5gnr_fec.rst create mode 100644 doc/guides/bbdevs/overview.rst create mode 100644 drivers/baseband/fpga_5gnr_fec/Makefile create mode 100644 drivers/baseband/fpga_5gnr_fec/fpga_5gnr_fec.h create mode 100644 drivers/baseband/fpga_5gnr_fec/meson.build create mode 100644 drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c create mode 100644 drivers/baseband/fpga_5gnr_fec/rte_pmd_bbdev_fpga_5gnr_fec_version.map create mode 100644
Quoted 3 lines
drivers/baseband/fpga_5gnr_fec/rte_pmd_fpga_5gnr_fec.h--
Please also update the MAINTAINERS for the newly added files.
Quoted 2 lines
Quoted 1 line
--
Please also update the
MAINTAINERSfor the newly added files.
Please ignore this. There is a blanket update in MAINTAINERS for all The bbdev drivers.