[RFC PATCH 0/6] add support for CDX bus
Support AMD CDX bus, for FPGA based CDX devices. The CDX devices are memory mapped on system bus for embedded CPUs. It uses sysfs interface and the vfio-cdx driver to discover and initialize the CDX devices. The patches are intended for DPDK 23.07 release, and have been sent as an RFC as patches are yet to be merged in Linux. Linux CDX bus patches has been submitted at: https://lore.kernel.org/lkml/20230117134139.1298-4-nipun.gu...@amd.com/T/ CDX is a Hardware Architecture designed for AMD FPGA devices. It consists of mechanism for interaction between FPGA, Firmware and the APUs (Application CPUs). Firmware resides on RPU (Realtime CPUs) which interacts with the FPGA program manager and the APUs. The RPU provides memory-mapped interface (RPU if) which is used to communicate with APUs. VFIO CDX driver provides the CDX device resources like MMIO and interrupts to map to user-space. DPDK CDX bus uses sysfs interface and the vfio-cdx driver to discover and initialize the CDX devices for user-space applications. Nipun Gupta (6): bus/cdx: introduce cdx bus bus/cdx: add dma map and unmap support bus/cdx: add support for MSI bus/cdx: support plug unplug and dev iterator bus: enable cdx bus config/arm: add AMD CDX MAINTAINERS| 5 + config/arm/arm64_cdx_linux_gcc | 17 + config/arm/meson.build | 15 + drivers/bus/cdx/cdx.c | 737 + drivers/bus/cdx/cdx.h | 54 ++ drivers/bus/cdx/cdx_logs.h | 37 ++ drivers/bus/cdx/cdx_vfio.c | 606 drivers/bus/cdx/meson.build| 13 + drivers/bus/cdx/rte_bus_cdx.h | 245 drivers/bus/cdx/version.map| 21 + drivers/bus/meson.build| 1 + lib/eal/common/eal_common_interrupts.c | 21 + lib/eal/common/eal_interrupts.h| 1 + lib/eal/include/rte_interrupts.h | 32 ++ lib/eal/version.map| 2 + 15 files changed, 1807 insertions(+) create mode 100644 config/arm/arm64_cdx_linux_gcc create mode 100644 drivers/bus/cdx/cdx.c create mode 100644 drivers/bus/cdx/cdx.h create mode 100644 drivers/bus/cdx/cdx_logs.h create mode 100644 drivers/bus/cdx/cdx_vfio.c create mode 100644 drivers/bus/cdx/meson.build create mode 100644 drivers/bus/cdx/rte_bus_cdx.h create mode 100644 drivers/bus/cdx/version.map -- 2.25.1
[RFC PATCH 1/6] bus/cdx: introduce cdx bus
CDX bus supports multiple type of devices, which can be exposed to user-space via vfio-cdx. vfio-cdx provides the MMIO IO_MEMORY regions as well as the DMA interface for the device (IOMMU). This support aims to enable the DPDK to support the cdx devices in user-space using VFIO interface. Signed-off-by: Nipun Gupta --- MAINTAINERS | 5 + drivers/bus/cdx/cdx.c | 564 ++ drivers/bus/cdx/cdx.h | 54 drivers/bus/cdx/cdx_logs.h| 37 +++ drivers/bus/cdx/cdx_vfio.c| 428 ++ drivers/bus/cdx/meson.build | 13 + drivers/bus/cdx/rte_bus_cdx.h | 219 + drivers/bus/cdx/version.map | 12 + 8 files changed, 1332 insertions(+) create mode 100644 drivers/bus/cdx/cdx.c create mode 100644 drivers/bus/cdx/cdx.h create mode 100644 drivers/bus/cdx/cdx_logs.h create mode 100644 drivers/bus/cdx/cdx_vfio.c create mode 100644 drivers/bus/cdx/meson.build create mode 100644 drivers/bus/cdx/rte_bus_cdx.h create mode 100644 drivers/bus/cdx/version.map diff --git a/MAINTAINERS b/MAINTAINERS index 9a0f416d2e..9edce0e739 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -563,6 +563,11 @@ M: Parav Pandit M: Xueming Li F: drivers/bus/auxiliary/ +CDX bus driver +M: Nipun Gupta +M: Nikhil Agarwal +F: drivers/bus/cdx/ + Intel FPGA bus M: Rosen Xu F: drivers/bus/ifpga/ diff --git a/drivers/bus/cdx/cdx.c b/drivers/bus/cdx/cdx.c new file mode 100644 index 00..4c85c5dc01 --- /dev/null +++ b/drivers/bus/cdx/cdx.c @@ -0,0 +1,564 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (C) 2022-2023, Advanced Micro Devices, Inc. + */ + +/* + * Architecture Overview + * = + * CDX is a Hardware Architecture designed for AMD FPGA devices. It + * consists of sophisticated mechanism for interaction between FPGA, + * Firmware and the APUs (Application CPUs). + * + * Firmware resides on RPU (Realtime CPUs) which interacts with + * the FPGA program manager and the APUs. The RPU provides memory-mapped + * interface (RPU if) which is used to communicate with APUs. + * + * The diagram below shows an overview of the CDX architecture: + * + * +--+ + * | DPDK | + * |DPDK CDX drivers | + * | || + * | DPDK CDX bus| + * | || + * +-|+ + *| + * +-|+ + * |Application CPUs (APU) || + * | || + * | VFIO CDX driver | + * | Linux OS|| + * | Linux CDX bus | + * | || + * +-|+ + *| + *| + * +| RPU if |+ + * | || + * | V| + * | Realtime CPUs (RPU) | + * | | + * +--+ + *| + * +-|+ + * | FPGA || + * | +---+ | + * | | | | | + * | +---++---+ +---+ | + * | | dev 1 || dev 2 | | dev 3 | | + * | +---++---+ +---+ | + * +--+ + * + * The RPU firmware extracts the device information from the loaded FPGA + * image and implements a mechanism that allows the APU drivers to + * enumerate such devices (device personality and resource details) via + * a dedicated communication channel. + * + * VFIO CDX driver provides the CDX device resources like MMIO and interrupts + * to map to user-space. DPDK CDX bus uses sysfs interface and the vfio-cdx + * driver to discover and initialize the CDX devices for user-space + * applications. + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "cdx.h" +#include "cdx_logs.h" + +#define SYSFS_CDX_DEVICES "/sys/bus/cdx/devices" +#define CDX_BUS_NAME cdx + +/** + * @file + * CDX probing using Linux sysfs. + */ + +/* Add a device to CDX bus */ +static void +rte_cdx_add_device(struct rte_cdx_device *cdx_dev) +{ + TAILQ_INSERT_TAIL(&rte_cdx_bus.device_list, cdx_dev, next); +} + +static int +cdx_get_kernel_d
[RFC PATCH 2/6] bus/cdx: add dma map and unmap support
CDX bus can use VFIO interface for mapping and unmapping of DMA addresses in the IOMMU. This change adds the callback support for map and unmap APIs as well as fetching the IOMMU class. Signed-off-by: Nipun Gupta --- drivers/bus/cdx/cdx.c | 40 1 file changed, 40 insertions(+) diff --git a/drivers/bus/cdx/cdx.c b/drivers/bus/cdx/cdx.c index 4c85c5dc01..cb04639b0d 100644 --- a/drivers/bus/cdx/cdx.c +++ b/drivers/bus/cdx/cdx.c @@ -549,12 +549,52 @@ cdx_find_device(const struct rte_device *start, rte_dev_cmp_t cmp, return NULL; } +static int +cdx_dma_map(struct rte_device *dev, void *addr, uint64_t iova, size_t len) +{ + struct rte_cdx_device *cdx_dev = RTE_DEV_TO_CDX_DEV(dev); + + if (!cdx_dev) { + rte_errno = EINVAL; + return -1; + } + + return rte_vfio_container_dma_map(RTE_VFIO_DEFAULT_CONTAINER_FD, + (uintptr_t)addr, iova, len); +} + +static int +cdx_dma_unmap(struct rte_device *dev, void *addr, uint64_t iova, size_t len) +{ + struct rte_cdx_device *cdx_dev = RTE_DEV_TO_CDX_DEV(dev); + + if (!cdx_dev) { + rte_errno = EINVAL; + return -1; + } + + return rte_vfio_container_dma_unmap(RTE_VFIO_DEFAULT_CONTAINER_FD, + (uintptr_t)addr, iova, len); +} + +static enum rte_iova_mode +rte_cdx_get_iommu_class(void) +{ + if (TAILQ_EMPTY(&rte_cdx_bus.device_list)) + return RTE_IOVA_DC; + + return RTE_IOVA_VA; +} + struct rte_cdx_bus rte_cdx_bus = { .bus = { .scan = rte_cdx_scan, .probe = cdx_probe, .find_device = cdx_find_device, .parse = cdx_parse, + .dma_map = cdx_dma_map, + .dma_unmap = cdx_dma_unmap, + .get_iommu_class = rte_cdx_get_iommu_class, }, .device_list = TAILQ_HEAD_INITIALIZER(rte_cdx_bus.device_list), .driver_list = TAILQ_HEAD_INITIALIZER(rte_cdx_bus.driver_list), -- 2.25.1
[RFC PATCH 3/6] bus/cdx: add support for MSI
MSI's are exposed to the devices using VFIO (vfio-cdx). This patch uses the same to add support for MSI for the devices on the cdx bus. Signed-off-by: Nipun Gupta --- drivers/bus/cdx/cdx.c | 11 ++ drivers/bus/cdx/cdx_vfio.c | 182 - drivers/bus/cdx/rte_bus_cdx.h | 25 drivers/bus/cdx/version.map| 9 ++ lib/eal/common/eal_common_interrupts.c | 21 +++ lib/eal/common/eal_interrupts.h| 1 + lib/eal/include/rte_interrupts.h | 32 + lib/eal/version.map| 2 + 8 files changed, 281 insertions(+), 2 deletions(-) diff --git a/drivers/bus/cdx/cdx.c b/drivers/bus/cdx/cdx.c index cb04639b0d..d0adfb74ef 100644 --- a/drivers/bus/cdx/cdx.c +++ b/drivers/bus/cdx/cdx.c @@ -224,6 +224,15 @@ cdx_scan_one(const char *dirname, const char *dev_name) goto err; } + /* Allocate interrupt instance for cdx device */ + dev->intr_handle = + rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_PRIVATE); + if (dev->intr_handle == NULL) { + CDX_BUS_ERR("Failed to create interrupt instance for %s\n", + dev->device.name); + return -ENOMEM; + } + /* * Check if device is bound to 'vfio-cdx' driver, so that user-space * can gracefully access the device. @@ -415,6 +424,8 @@ rte_cdx_probe_one_driver(struct rte_cdx_driver *dr, return ret; error_probe: + rte_intr_instance_free(dev->intr_handle); + dev->intr_handle = NULL; cdx_vfio_unmap_resource(dev); error_map_device: return ret; diff --git a/drivers/bus/cdx/cdx_vfio.c b/drivers/bus/cdx/cdx_vfio.c index f52adc4655..fd90da6727 100644 --- a/drivers/bus/cdx/cdx_vfio.c +++ b/drivers/bus/cdx/cdx_vfio.c @@ -60,6 +60,10 @@ struct mapped_cdx_resource { /** mapped cdx device list */ TAILQ_HEAD(mapped_cdx_res_list, mapped_cdx_resource); +/* irq set buffer length for MSI interrupts */ +#define MSI_IRQ_SET_BUF_LEN (sizeof(struct vfio_irq_set) + \ + sizeof(int) * (RTE_MAX_RXTX_INTR_VEC_ID + 1)) + static struct rte_tailq_elem cdx_vfio_tailq = { .name = "VFIO_CDX_RESOURCE_LIST", }; @@ -108,6 +112,27 @@ cdx_vfio_unmap_resource_primary(struct rte_cdx_device *dev) char cdx_addr[PATH_MAX] = {0}; struct mapped_cdx_resource *vfio_res = NULL; struct mapped_cdx_res_list *vfio_res_list; + int ret, vfio_dev_fd; + + if (rte_intr_fd_get(dev->intr_handle) < 0) + return -1; + + if (close(rte_intr_fd_get(dev->intr_handle)) < 0) { + CDX_BUS_ERR("Error when closing eventfd file descriptor for %s", + dev->device.name); + return -1; + } + + vfio_dev_fd = rte_intr_dev_fd_get(dev->intr_handle); + if (vfio_dev_fd < 0) + return -1; + + ret = rte_vfio_release_device(rte_cdx_get_sysfs_path(), dev->device.name, + vfio_dev_fd); + if (ret < 0) { + CDX_BUS_ERR("Cannot release VFIO device"); + return ret; + } vfio_res_list = RTE_TAILQ_CAST(cdx_vfio_tailq.head, mapped_cdx_res_list); @@ -130,6 +155,18 @@ cdx_vfio_unmap_resource_secondary(struct rte_cdx_device *dev) { struct mapped_cdx_resource *vfio_res = NULL; struct mapped_cdx_res_list *vfio_res_list; + int ret, vfio_dev_fd; + + vfio_dev_fd = rte_intr_dev_fd_get(dev->intr_handle); + if (vfio_dev_fd < 0) + return -1; + + ret = rte_vfio_release_device(rte_cdx_get_sysfs_path(), dev->device.name, + vfio_dev_fd); + if (ret < 0) { + CDX_BUS_ERR("Cannot release VFIO device"); + return ret; + } vfio_res_list = RTE_TAILQ_CAST(cdx_vfio_tailq.head, mapped_cdx_res_list); @@ -154,9 +191,80 @@ cdx_vfio_unmap_resource(struct rte_cdx_device *dev) return cdx_vfio_unmap_resource_secondary(dev); } +/* set up interrupt support (but not enable interrupts) */ static int -cdx_rte_vfio_setup_device(int vfio_dev_fd) +cdx_vfio_setup_interrupts(struct rte_cdx_device *dev, int vfio_dev_fd, + int num_irqs) { + int i, ret; + + if (num_irqs == 0) + return 0; + + /* start from MSI interrupt type */ + for (i = 0; i < num_irqs; i++) { + struct vfio_irq_info irq = { .argsz = sizeof(irq) }; + int fd = -1; + + irq.index = i; + + ret = ioctl(vfio_dev_fd, VFIO_DEVICE_GET_IRQ_INFO, &irq); + if (ret < 0) { + CDX_BUS_ERR("Cannot get VFIO IRQ info, error %i (%s)", +
[RFC PATCH 4/6] bus/cdx: support plug unplug and dev iterator
Add support for plugging and unplugging CDX devices on the CDX bus. Also, CDX dev iterator support has been added for the CDX bus. Signed-off-by: Nipun Gupta --- drivers/bus/cdx/cdx.c | 142 +++--- drivers/bus/cdx/rte_bus_cdx.h | 1 + 2 files changed, 133 insertions(+), 10 deletions(-) diff --git a/drivers/bus/cdx/cdx.c b/drivers/bus/cdx/cdx.c index d0adfb74ef..151d35ffd3 100644 --- a/drivers/bus/cdx/cdx.c +++ b/drivers/bus/cdx/cdx.c @@ -69,6 +69,7 @@ #include #include #include +#include #include #include #include @@ -81,6 +82,15 @@ #define SYSFS_CDX_DEVICES "/sys/bus/cdx/devices" #define CDX_BUS_NAME cdx +enum cdx_params { + RTE_CDX_PARAM_NAME, +}; + +static const char * const cdx_params_keys[] = { + [RTE_CDX_PARAM_NAME] = "name", + NULL, +}; + /** * @file * CDX probing using Linux sysfs. @@ -88,7 +98,7 @@ /* Add a device to CDX bus */ static void -rte_cdx_add_device(struct rte_cdx_device *cdx_dev) +cdx_add_device(struct rte_cdx_device *cdx_dev) { TAILQ_INSERT_TAIL(&rte_cdx_bus.device_list, cdx_dev, next); } @@ -258,7 +268,7 @@ cdx_scan_one(const char *dirname, const char *dev_name) } dev->id.device_id = (uint16_t)tmp; - rte_cdx_add_device(dev); + cdx_add_device(dev); return 0; @@ -275,7 +285,7 @@ cdx_scan_one(const char *dirname, const char *dev_name) * list. */ static int -rte_cdx_scan(void) +cdx_scan(void) { struct dirent *e; DIR *dir; @@ -355,7 +365,7 @@ cdx_unmap_resource(void *requested_addr, size_t size) * Match the CDX Driver and Device using device id and vendor id. */ static int -rte_cdx_match(const struct rte_cdx_driver *cdx_drv, +cdx_match(const struct rte_cdx_driver *cdx_drv, const struct rte_cdx_device *cdx_dev) { const struct rte_cdx_id *id_table; @@ -381,7 +391,7 @@ rte_cdx_match(const struct rte_cdx_driver *cdx_drv, * driver. */ static int -rte_cdx_probe_one_driver(struct rte_cdx_driver *dr, +cdx_probe_one_driver(struct rte_cdx_driver *dr, struct rte_cdx_device *dev) { const char *dev_name = dev->device.name; @@ -392,7 +402,7 @@ rte_cdx_probe_one_driver(struct rte_cdx_driver *dr, return -EINVAL; /* The device is not blocked; Check if driver supports it */ - if (!rte_cdx_match(dr, dev)) + if (!cdx_match(dr, dev)) /* Match of device and driver failed */ return 1; @@ -420,6 +430,7 @@ rte_cdx_probe_one_driver(struct rte_cdx_driver *dr, } else { dev->device.driver = &dr->driver; } + dev->driver = dr; return ret; @@ -446,7 +457,7 @@ cdx_probe_all_drivers(struct rte_cdx_device *dev) return -EINVAL; FOREACH_DRIVER_ON_CDXBUS(dr) { - rc = rte_cdx_probe_one_driver(dr, dev); + rc = cdx_probe_one_driver(dr, dev); if (rc < 0) /* negative value is an error */ return rc; @@ -560,6 +571,71 @@ cdx_find_device(const struct rte_device *start, rte_dev_cmp_t cmp, return NULL; } +/* Remove a device from CDX bus */ +static void +cdx_remove_device(struct rte_cdx_device *cdx_dev) +{ + TAILQ_REMOVE(&rte_cdx_bus.device_list, cdx_dev, next); +} + +/* + * If vendor/device ID match, call the remove() function of the + * driver. + */ +static int +cdx_detach_dev(struct rte_cdx_device *dev) +{ + struct rte_cdx_driver *dr; + int ret = 0; + + if (dev == NULL) + return -EINVAL; + + dr = dev->driver; + + CDX_BUS_DEBUG("detach device %s using driver: %s", + dev->device.name, dr->driver.name); + + if (dr->remove) { + ret = dr->remove(dev); + if (ret < 0) + return ret; + } + + /* clear driver structure */ + dev->driver = NULL; + dev->device.driver = NULL; + + rte_cdx_unmap_device(dev); + + rte_intr_instance_free(dev->intr_handle); + dev->intr_handle = NULL; + + return 0; +} + +static int +cdx_plug(struct rte_device *dev) +{ + return cdx_probe_all_drivers(RTE_DEV_TO_CDX_DEV(dev)); +} + +static int +cdx_unplug(struct rte_device *dev) +{ + struct rte_cdx_device *cdx_dev; + int ret; + + cdx_dev = RTE_DEV_TO_CDX_DEV(dev); + ret = cdx_detach_dev(cdx_dev); + if (ret == 0) { + cdx_remove_device(cdx_dev); + rte_devargs_remove(dev->devargs); + free(cdx_dev); + } + return ret; +} + static int cdx_dma_map(struct rte_device *dev, void *addr, uint64_t iova, size_t len) { @@ -589,7 +665,7 @@ cdx_dma_unmap(struct rte_device *dev, void *addr, uint64_t iova, size_t len) } static enum rte_iova_mode -rte_cdx_get_iom
[RFC PATCH 5/6] bus: enable cdx bus
enable compilation of cdx bus Signed-off-by: Nipun Gupta --- drivers/bus/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bus/meson.build b/drivers/bus/meson.build index 45eab5233d..884470234c 100644 --- a/drivers/bus/meson.build +++ b/drivers/bus/meson.build @@ -7,6 +7,7 @@ drivers = [ 'fslmc', 'ifpga', 'pci', +'cdx', 'vdev', 'vmbus', ] -- 2.25.1
[RFC PATCH 6/6] config/arm: add AMD CDX
Adding support for AMD CDX devices Signed-off-by: Nipun Gupta --- config/arm/arm64_cdx_linux_gcc | 17 + config/arm/meson.build | 15 +++ 2 files changed, 32 insertions(+) create mode 100644 config/arm/arm64_cdx_linux_gcc diff --git a/config/arm/arm64_cdx_linux_gcc b/config/arm/arm64_cdx_linux_gcc new file mode 100644 index 00..8e6d619dae --- /dev/null +++ b/config/arm/arm64_cdx_linux_gcc @@ -0,0 +1,17 @@ +[binaries] +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-g++'] +ar = 'aarch64-linux-gnu-ar' +as = 'aarch64-linux-gnu-as' +strip = 'aarch64-linux-gnu-strip' +pkgconfig = 'aarch64-linux-gnu-pkg-config' +pcap-config = '' + +[host_machine] +system = 'linux' +cpu_family = 'aarch64' +cpu = 'armv8-a' +endian = 'little' + +[properties] +platform = 'cdx' diff --git a/config/arm/meson.build b/config/arm/meson.build index 6442ec9596..76806b2820 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -63,6 +63,7 @@ part_number_config_arm = { '0xd09': {'compiler_options': ['-mcpu=cortex-a73']}, '0xd0a': {'compiler_options': ['-mcpu=cortex-a75']}, '0xd0b': {'compiler_options': ['-mcpu=cortex-a76']}, +'0xd42': {'compiler_options': ['-mcpu=cortex-a78']}, '0xd0c': { 'march': 'armv8.2-a', 'march_features': ['crypto'], @@ -302,6 +303,18 @@ soc_bluefield = { 'numa': false } +soc_cdx = { +'description': 'AMD CDX', +'implementer': '0x41', +'part_number': '0xd42', +'flags': [ +['RTE_MACHINE', '"cdx"'], +['RTE_MAX_LCORE', 16], +['RTE_MAX_NUMA_NODES', 1] +], +'numa': false +} + soc_centriq2400 = { 'description': 'Qualcomm Centriq 2400', 'implementer': '0x51', @@ -448,6 +461,7 @@ generic: Generic un-optimized build for armv8 aarch64 execution mode. generic_aarch32: Generic un-optimized build for armv8 aarch32 execution mode. armada: Marvell ARMADA bluefield: NVIDIA BlueField +cdx: AMD CDX centriq2400: Qualcomm Centriq 2400 cn9k:Marvell OCTEON 9 cn10k: Marvell OCTEON 10 @@ -474,6 +488,7 @@ socs = { 'generic_aarch32': soc_generic_aarch32, 'armada': soc_armada, 'bluefield': soc_bluefield, +'cdx': soc_cdx, 'centriq2400': soc_centriq2400, 'cn9k': soc_cn9k, 'cn10k' : soc_cn10k, -- 2.25.1
Re: [dpdk-dev] [PATCH v3 7/8] app/bbdev: add parameter to take input in network order
> -Original Message- > From: Chautru, Nicolas > Sent: Wednesday, April 14, 2021 6:30 AM > To: Hemant Agrawal ; dev@dpdk.org; > gak...@marvell.com > Cc: david.march...@redhat.com; Nipun Gupta > Subject: RE: [PATCH v3 7/8] app/bbdev: add parameter to take input in network > order > > If you want this, should this be a new BBDEV capability option? > If not how can you enforce compatibility if you just bypass this in the test > vector > parsing? Agree, we can add BBDEV capability option. > > > -Original Message- > > From: Hemant Agrawal > > Sent: Monday, April 12, 2021 10:17 PM > > To: dev@dpdk.org; gak...@marvell.com; Chautru, Nicolas > > > > Cc: david.march...@redhat.com; Nipun Gupta > > Subject: [PATCH v3 7/8] app/bbdev: add parameter to take input in network > > order > > > > From: Nipun Gupta > > > > Test bbdev application is reading the input and output from the test vector > > files in the same endianness which is of the system. > > This patch adds an option to provide data in the network order i.e. big > > endian format > > > > Signed-off-by: Nipun Gupta > > --- > > app/test-bbdev/test_bbdev_vector.c | 18 -- app/test- > > bbdev/test_bbdev_vector.h | 2 ++ > > 2 files changed, 18 insertions(+), 2 deletions(-) > > > > diff --git a/app/test-bbdev/test_bbdev_vector.c b/app/test- > > bbdev/test_bbdev_vector.c > > index 50d1da00f7..fe04bd6b95 100644 > > --- a/app/test-bbdev/test_bbdev_vector.c > > +++ b/app/test-bbdev/test_bbdev_vector.c > > @@ -53,7 +53,8 @@ starts_with(const char *str, const char *pre) > > > > /* tokenization test values separated by a comma */ static int - > > parse_values(char *tokens, uint32_t **data, uint32_t *data_length) > > +parse_values(char *tokens, uint32_t **data, uint32_t *data_length, > > +int network_order) > > { > > uint32_t n_tokens = 0; > > uint32_t data_size = 32; > > @@ -94,6 +95,14 @@ parse_values(char *tokens, uint32_t **data, uint32_t > > *data_length) > > } > > > > *data_length = *data_length + (strlen(tok) - strlen("0x"))/2; > > + if (network_order) { > > + if ((strlen(tok) - strlen("0x"))/2 == 4) > > + values[n_tokens] = > > + rte_cpu_to_be_32(values[n_tokens]); > > + else if ((strlen(tok) - strlen("0x"))/2 == 2) > > + values[n_tokens] = > > + rte_cpu_to_be_16(values[n_tokens]); > > + } > > > > tok = strtok(NULL, VALUE_DELIMITER); > > if (tok == NULL) > > @@ -416,7 +425,8 @@ parse_data_entry(const char *key_token, char > > *token, > > /* Clear new op data struct */ > > memset(op_data + *nb_ops, 0, sizeof(struct op_data_buf)); > > > > - ret = parse_values(token, &data, &data_length); > > + ret = parse_values(token, &data, &data_length, > > + vector->network_order); > > if (!ret) { > > op_data[*nb_ops].addr = data; > > op_data[*nb_ops].length = data_length; @@ -728,6 +738,10 > > @@ parse_ldpc_encoder_params(const char *key_token, char *token, > > ret = parse_expected_status(token, &status, vector- > > >op_type); > > if (!ret) > > vector->expected_status = status; > > + } else if (!strcmp(key_token, "network_order")) { > > + vector->mask |= TEST_BBDEV_VF_NETWORK_ORDER; > > + vector->network_order = (uint8_t) strtoul(token, &err, 0); > > + ret = ((err == NULL) || (*err != '\0')) ? -1 : 0; > > } else { > > printf("Not valid ldpc enc key: '%s'\n", key_token); > > return -1; > > diff --git a/app/test-bbdev/test_bbdev_vector.h b/app/test- > > bbdev/test_bbdev_vector.h > > index 4e5dbf5d50..aa53f0bb0d 100644 > > --- a/app/test-bbdev/test_bbdev_vector.h > > +++ b/app/test-bbdev/test_bbdev_vector.h > > @@ -35,6 +35,7 @@ enum { > > TEST_BBDEV_VF_CODE_BLOCK_MODE = (1ULL << 23), > > TEST_BBDEV_VF_OP_FLAGS = (1ULL << 24), > > TEST_BBDEV_VF_EXPECTED_STATUS = (1ULL << 25), > > + TEST_BBDEV_VF_NETWORK_ORDER = (1ULL << 26), > > }; > > > > enum op_data_type { > > @@ -60,6 +61,7 @@ struct test_bbdev_vector { > > enum rte_bbdev_op_type op_type; > > int expected_status; > > int mask; > > + int network_order; > > union { > > struct rte_bbdev_op_turbo_dec turbo_dec; > > struct rte_bbdev_op_turbo_enc turbo_enc; > > -- > > 2.17.1
Re: [dpdk-dev] [PATCH v3 8/8] app/bbdev: add test vectors for transport blocks
Hi, Apart from network order, these test vectors also add Transport Block modes. SO these seems legitimate to be added to the test cases. Regards, Nipun > -Original Message- > From: Chautru, Nicolas > Sent: Wednesday, April 14, 2021 6:40 AM > To: Hemant Agrawal ; dev@dpdk.org; > gak...@marvell.com > Cc: david.march...@redhat.com; Nipun Gupta > Subject: RE: [PATCH v3 8/8] app/bbdev: add test vectors for transport blocks > > > > -Original Message- > > From: Hemant Agrawal > > Sent: Monday, April 12, 2021 10:17 PM > > > > From: Nipun Gupta > > > > This patch adds two test vectors for transport block in network byte > > order: > > - LDPC encode for Transport Block > > - LDPC decode for Transport block > > > > Signed-off-by: Nipun Gupta > > --- > > app/test-bbdev/test_vectors/ldpc_dec_tb.data | 362 ++ > > app/test-bbdev/test_vectors/ldpc_enc_tb.data | 482 > > +++ > > 2 files changed, 844 insertions(+) > > create mode 100644 app/test-bbdev/test_vectors/ldpc_dec_tb.data > > create mode 100644 app/test-bbdev/test_vectors/ldpc_enc_tb.data > > > Do we get anything new from these additional vectors? > How does this help to change the network order in vector then change it again > when it is parsed? This is the same data going into bbdev api. > Also these vectors would be quite big (relatively large C). > Ideally you want all existing vectors matching your PMD capability to be run > seamlessly. > Let me know what I may miss, this looks unrequired. > > (...) > > > -- > > 2.17.1
Re: [dpdk-dev] dpdk-graph-crypto-perf on ARM platform
Hi Ciara, Just for information, Kaleido and plotly v4.9+ worked for us. Thanks, Nipun > -Original Message- > From: Nipun Gupta > Sent: Wednesday, February 24, 2021 4:35 PM > To: Power, Ciara ; dev@dpdk.org > Cc: Vanshika Shukla ; Hemant Agrawal > ; Doherty, Declan ; > Dybkowski, AdamX > Subject: RE: dpdk-graph-crypto-perf on ARM platform > > Hi Ciara, > > Thanks for the info. > We will try with Kaleido and plotly v4.9+. > > Regards, > Nipun > > > -Original Message- > > From: Power, Ciara > > Sent: Wednesday, February 24, 2021 4:29 PM > > To: Nipun Gupta ; dev@dpdk.org > > Cc: Vanshika Shukla ; Hemant Agrawal > > ; Doherty, Declan ; > > Dybkowski, AdamX > > Subject: RE: dpdk-graph-crypto-perf on ARM platform > > > > Hi Nipun, > > > > Unfortunately I don't have an ARM platform available to test this. > > I believe installing the Kaleido and Plotly modules using pip3 should work: > > pip3 install plotly > > pip3 install kaleido > > > > The Kaleido package is a replacement for Orca, and for Plotly v4.9+ , the > default > > is to use Kaleido if it is found, and only resorts to Orca otherwise. > > Installing the two modules above will hopefully fix your issue. > > > > Thanks, > > Ciara > > > > > > >-Original Message- > > >From: dev On Behalf Of Nipun Gupta > > >Sent: Tuesday 23 February 2021 15:39 > > >To: dev@dpdk.org > > >Cc: Vanshika Shukla ; Hemant Agrawal > > > > > >Subject: [dpdk-dev] dpdk-graph-crypto-perf on ARM platform > > > > > >Has anyone tried using 'dpdk-graph-crypto-perf' on any of the ARM platform? > > >There seems to be some dependencies on tools/utilities orca and plotly > > >which > > >seems missing for ARM. > > > > > >Regards, > > >Nipun
[PATCH] app/testpmd: update raw flow to take hex input
From: Nipun Gupta This patch enables method to provide key and mask for raw rules to be provided as hexadecimal values. There is new parameter pattern_mask added to support this. Signed-off-by: Nipun Gupta --- app/test-pmd/cmdline_flow.c | 15 +++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 13 + 2 files changed, 28 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index bbe3dc0115..cfa68abc40 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -166,6 +166,7 @@ enum index { ITEM_RAW_OFFSET, ITEM_RAW_LIMIT, ITEM_RAW_PATTERN, + ITEM_RAW_PATTERN_HEX, ITEM_ETH, ITEM_ETH_DST, ITEM_ETH_SRC, @@ -1107,6 +1108,7 @@ static const enum index item_raw[] = { ITEM_RAW_OFFSET, ITEM_RAW_LIMIT, ITEM_RAW_PATTERN, + ITEM_RAW_PATTERN_HEX, ITEM_NEXT, ZERO, }; @@ -2664,6 +2666,19 @@ static const struct token token_list[] = { ARGS_ENTRY_ARB(sizeof(struct rte_flow_item_raw), ITEM_RAW_PATTERN_SIZE)), }, + [ITEM_RAW_PATTERN_HEX] = { + .name = "pattern_hex", + .help = "hex string to look for", + .next = NEXT(item_raw, +NEXT_ENTRY(COMMON_HEX), +NEXT_ENTRY(ITEM_PARAM_IS, + ITEM_PARAM_SPEC, + ITEM_PARAM_MASK)), + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_raw, pattern), +ARGS_ENTRY(struct rte_flow_item_raw, length), +ARGS_ENTRY_ARB(sizeof(struct rte_flow_item_raw), + ITEM_RAW_PATTERN_SIZE)), + }, [ITEM_ETH] = { .name = "eth", .help = "match Ethernet header", diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 44228cd7d2..68c216c805 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -3634,6 +3634,7 @@ This section lists supported pattern items and their attributes, if any. - ``offset {integer}``: absolute or relative offset for pattern. - ``limit {unsigned}``: search area limit for start of pattern. - ``pattern {string}``: byte string to look for. + - ``pattern_hex {string}``: byte string (provided in hexadecimal) to look for. - ``eth``: match Ethernet header. @@ -5080,6 +5081,18 @@ PPPoL2TPv2oUDP RSS rules can be created by the following commands:: testpmd> flow create 0 ingress pattern eth / ipv6 / udp / l2tpv2 / ppp / ipv6 / end actions rss types ipv6 end queues end / end +Sample RAW rule +~~~ + +A RAW rule can be creted as following using ``pattern_hex`` key and mask. + +:: + +testpmd> flow create 0 group 0 priority 1 ingress pattern raw relative is 0 search is 0 offset + is 0 limit is 0 pattern_hex spec 0a0a0a0a + pattern_hex mask / end actions + queue index 4 / end + BPF Functions -- -- 2.17.1
[PATCH] examples/l3fwd: fix Rx burst size for event mode
From: Nipun Gupta While dequeing the packets from the event device, burst size is provided in the API. This was not getting properly conigured in the application. This patch correctly configures the burst size. Fixes: aaf58cb85b62 ("examples/l3fwd: add event port and queue setup") Cc: sta...@dpdk.org Signed-off-by: Nipun Gupta --- examples/l3fwd/l3fwd_event_internal_port.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/l3fwd/l3fwd_event_internal_port.c b/examples/l3fwd/l3fwd_event_internal_port.c index 1e8f46bc11..32cf657148 100644 --- a/examples/l3fwd/l3fwd_event_internal_port.c +++ b/examples/l3fwd/l3fwd_event_internal_port.c @@ -118,6 +118,8 @@ l3fwd_event_port_setup_internal_port(void) event_p_conf.event_port_cfg |= RTE_EVENT_PORT_CFG_DISABLE_IMPL_REL; + evt_rsrc->deq_depth = def_p_conf.dequeue_depth; + for (event_p_id = 0; event_p_id < evt_rsrc->evp.nb_ports; event_p_id++) { ret = rte_event_port_setup(event_d_id, event_p_id, -- 2.17.1
RE: [PATCH v2 70/83] raw/dpaa2_qdma: remove unnecessary NULL checks
Acked-by: Nipun Gupta > -Original Message- > From: Stephen Hemminger > Sent: 24 January 2022 23:17 > To: dev@dpdk.org > Cc: Stephen Hemminger ; Nipun Gupta > > Subject: [PATCH v2 70/83] raw/dpaa2_qdma: remove unnecessary NULL checks > > Remove redundant NULL pointer checks before free functions > found by nullfree.cocci > > Signed-off-by: Stephen Hemminger > --- > drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 15 +-- > 1 file changed, 5 insertions(+), 10 deletions(-) > > diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c > b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c > index ebc2cd5d0ddc..b2260439a4ef 100644 > --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c > +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c > @@ -1115,11 +1115,9 @@ dpaa2_qdma_reset(struct rte_rawdev *rawdev) > > /* Reset and free virtual queues */ > for (i = 0; i < qdma_dev->max_vqs; i++) { > - if (qdma_dev->vqs[i].status_ring) > - rte_ring_free(qdma_dev->vqs[i].status_ring); > + rte_ring_free(qdma_dev->vqs[i].status_ring); > } > - if (qdma_dev->vqs) > - rte_free(qdma_dev->vqs); > + rte_free(qdma_dev->vqs); > qdma_dev->vqs = NULL; > > /* Reset per core info */ > @@ -1314,8 +1312,7 @@ dpaa2_qdma_queue_setup(struct rte_rawdev > *rawdev, > > if (qdma_dev->vqs[i].hw_queue == NULL) { > DPAA2_QDMA_ERR("No H/W queue available for VQ"); > - if (qdma_dev->vqs[i].status_ring) > - rte_ring_free(qdma_dev->vqs[i].status_ring); > + rte_ring_free(qdma_dev->vqs[i].status_ring); > qdma_dev->vqs[i].status_ring = NULL; > rte_spinlock_unlock(&qdma_dev->lock); > return -ENODEV; > @@ -1516,14 +1513,12 @@ dpaa2_qdma_queue_release(struct rte_rawdev > *rawdev, > if (qdma_vq->exclusive_hw_queue) > free_hw_queue(qdma_vq->hw_queue); > else { > - if (qdma_vq->status_ring) > - rte_ring_free(qdma_vq->status_ring); > + rte_ring_free(qdma_vq->status_ring); > > put_hw_queue(qdma_vq->hw_queue); > } > > - if (qdma_vq->fle_pool) > - rte_mempool_free(qdma_vq->fle_pool); > + rte_mempool_free(qdma_vq->fle_pool); > > memset(qdma_vq, 0, sizeof(struct qdma_virt_queue)); > > -- > 2.30.2
RE: [PATCH v3 10/15] net/dpaa2: support recycle loopback port
Hi David, Sure, we will send a patch asap. Regards, Nipun > -Original Message- > From: David Marchand > Sent: 01 February 2022 14:58 > To: Nipun Gupta ; Jun Yang > Cc: dev ; Thomas Monjalon ; Yigit, > Ferruh ; Hemant Agrawal ; > Stephen Hemminger > Subject: Re: [PATCH v3 10/15] net/dpaa2: support recycle loopback port > > Hello guys, > > On Mon, Jan 3, 2022 at 11:02 AM wrote: > > diff --git a/drivers/net/dpaa2/dpaa2_recycle.c > b/drivers/net/dpaa2/dpaa2_recycle.c > > new file mode 100644 > > index 00..e274d24ead > > --- /dev/null > > +++ b/drivers/net/dpaa2/dpaa2_recycle.c > > @@ -0,0 +1,780 @@ > > +/* * SPDX-License-Identifier: BSD-3-Clause > > + * > > + * Copyright 2019-2021 NXP > > + * > > + */ > > + > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include "dpaa2_pmd_logs.h" > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include "dpaa2_ethdev.h" > > +#include "dpaa2_sparser.h" > > +#include > > + > > +#include > > +#include > > +#include > > + > > +#define PAGE_SIZE (sysconf(_SC_PAGESIZE)) > > +#define PAGE_MASK (~(PAGE_SIZE - 1)) > > This patch breaks compilation in Alpine Linux in next-net and main > repositories. > Can you provide a fix? > Thanks. > > > This was initially reported by UNH: > https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmails.dpd > k.org%2Farchives%2Ftest-report%2F2022- > January%2F250111.html&data=04%7C01%7Cnipun.gupta%40nxp.com%7C > a8213a91a0014639650d08d9e5652600%7C686ea1d3bc2b4c6fa92cd99c5c3016 > 35%7C0%7C0%7C637793044866714334%7CUnknown%7CTWFpbGZsb3d8eyJWI > joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C300 > 0&sdata=b%2BT8BinlyFWaYSLaaOLtNTN9TA0epJAxN0Si9jbom7I%3D& > ;reserved=0 > > FAILED: > drivers/a715181@@tmp_rte_net_dpaa2@sta/net_dpaa2_dpaa2_recycle.c.o > ccache cc -Idrivers/a715181@@tmp_rte_net_dpaa2@sta -Idrivers > -I../drivers -Idrivers/net/dpaa2 -I../drivers/net/dpaa2 > -I../drivers/net/dpaa2/base -I../drivers/net/dpaa2/mc -Ilib/ethdev > -I../lib/ethdev -I. -I../ -Iconfig -I../config -Ilib/eal/include > -I../lib/eal/include -Ilib/eal/linux/include > -I../lib/eal/linux/include -Ilib/eal/x86/include > -I../lib/eal/x86/include -Ilib/eal/common -I../lib/eal/common > -Ilib/eal -I../lib/eal -Ilib/kvargs -I../lib/kvargs > -Ilib/telemetry/../metrics -I../lib/telemetry/../metrics > -Ilib/telemetry -I../lib/telemetry -Ilib/net -I../lib/net -Ilib/mbuf > -I../lib/mbuf -Ilib/mempool -I../lib/mempool -Ilib/ring -I../lib/ring > -Ilib/meter -I../lib/meter -Idrivers/bus/pci -I../drivers/bus/pci > -I../drivers/bus/pci/linux -Ilib/pci -I../lib/pci -Idrivers/bus/vdev > -I../drivers/bus/vdev -Idrivers/mempool/dpaa2 > -I../drivers/mempool/dpaa2 -Idrivers/bus/fslmc -I../drivers/bus/fslmc > -I../drivers/bus/fslmc/mc -I../drivers/bus/fslmc/qbman/include > -I../drivers/bus/fslmc/portal -Idrivers/common/dpaax > -I../drivers/common/dpaax -I../drivers/common/dpaax/caamflib > -Ilib/eventdev -I../lib/eventdev -Ilib/hash -I../lib/hash -Ilib/rcu > -I../lib/rcu -Ilib/timer -I../lib/timer -Ilib/cryptodev > -I../lib/cryptodev -fdiagnostics-color=always -pipe > -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -O3 -include > rte_config.h -Wextra -Wcast-qual -Wdeprecated -Wformat > -Wformat-nonliteral -Wformat-security -Wmissing-declarations > -Wmissing-prototypes -Wnested-externs -Wold-style-definition > -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef > -Wwrite-strings -Wno-address-of-packed-member -Wno-packed-not-aligned > -Wno-missing-field-initializers -Wno-zero-length-bounds -D_GNU_SOURCE > -fPIC -march=native -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API > -Wno-format-truncation -DRTE_LOG_DEFAULT_LOGTYPE=pmd.net.dpaa2 -MD > -MQ > 'drivers/a715181@@tmp_rte_net_dpaa2@sta/net_dpaa2_dpaa2_recycle.c.o' > -MF > 'drivers/a715181@@tmp_rte_net_dpaa2@sta/net_dpaa2_dpaa2_recycle.c.o.d' > -o > 'drivers/a715181@@tmp_rte_net_dpaa2@sta/net_dpaa2_dpaa2_recycle.c.o' > -c ../drivers/net/dpaa2/dpaa2_recycle.c > ../drivers/net/dpaa2/dpaa2_recycle.c:35: error: "PAGE_SIZE" redefined > [-Werror] >35 | #define PAGE_SIZE (sysconf(_SC_PAGESIZE)) > | > In file included from /usr/include/fortify/stdlib.h:29, > from ../lib/eal/include/rte_common.h:20, > from ../lib/mbuf/rte_mbuf.h:36, > from ../drivers/net/dpaa2/dpaa2_recycle.c:10: > /usr/include/limits.h:97: note: this is the location of the previous > definition >97 | #define PAGE_SIZE PAGESIZE > | > cc1: all warnings being treated as errors > > > > -- > David Marchand
RE: [PATCH] net/dpaa2: fix build with musl
Acked-by: Nipun Gupta > -Original Message- > From: Thomas Monjalon > Sent: 01 February 2022 15:24 > To: dev@dpdk.org > Cc: Jun Yang ; Nipun Gupta ; > Hemant Agrawal ; David Marchand > ; Sachin Saxena (OSS) > > Subject: [PATCH] net/dpaa2: fix build with musl > > PAGE_SIZE is already defined in musl libc: > > drivers/net/dpaa2/dpaa2_recycle.c:35: error: "PAGE_SIZE" redefined > /usr/include/limits.h:97: note: >this is the location of the previous definition >97 | #define PAGE_SIZE PAGESIZE > > Fixes: f023d059769f ("net/dpaa2: support recycle loopback port") > > Reported-by: David Marchand > Signed-off-by: Thomas Monjalon > --- > drivers/net/dpaa2/dpaa2_recycle.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/net/dpaa2/dpaa2_recycle.c > b/drivers/net/dpaa2/dpaa2_recycle.c > index c5e9e9721d..336506dc0d 100644 > --- a/drivers/net/dpaa2/dpaa2_recycle.c > +++ b/drivers/net/dpaa2/dpaa2_recycle.c > @@ -32,7 +32,9 @@ > #include > #include > > +#ifndef PAGE_SIZE > #define PAGE_SIZE(sysconf(_SC_PAGESIZE)) > +#endif > #define PAGE_MASK(~(PAGE_SIZE - 1)) > > #define LSX_SERDES_LAN_NB8 > -- > 2.34.1
[dpdk-dev] [PATCH v11 0/8] baseband: add NXP LA12xx driver
From: Nipun Gupta This series introduces the BBDEV LA12xx poll mode driver (PMD) to support an implementation for offloading High Phy processing functions like LDPC Encode / Decode 5GNR wireless acceleration function, using PCI based LA12xx Software defined radio. Please check the documentation patch for more info. The driver currently implements basic feature to offload only the 5G LDPC encode/decode. A new capability has been added to check if the driver can support the input data in little/big endian byte order. v2: add test case changes v3: fix 32 bit compilation v4: capability for network byte order, doc patch merged inline. v5: add llr_size and llr_decimals, removed LLR compression flag, update testbbdev to handle endianness, rebased on top of 20.08 v6: added BE as device info instead of capability, updated test to have 2 codeblocks v7: fixed checkpatch errors v8: remove additional test vectors, update reverse_op function name, make be_support param as bool, other minor changes in la12xx driver v9: add little endianness capability as well (patch by Nicolas Chautru), fix 32 bit (i386) compilation, fix get of nb_segs, add endianness info in testbbdev doc. v10: use default RTE_BIG_ENDIAN/RTE_LITTLE_ENDIAN defined, add data_endianness info for BBDEV null device v11: split la12xx doc in separate patches and fixed some nits Hemant Agrawal (5): baseband/la12xx: add devargs for max queues baseband/la12xx: add support for multiple modems baseband/la12xx: add queue and modem config support baseband/la12xx: add enqueue and dequeue support app/bbdev: enable la12xx for bbdev Nicolas Chautru (1): bbdev: add device info related to data endianness Nipun Gupta (2): baseband: introduce NXP LA12xx driver app/bbdev: handle endianness of test data MAINTAINERS | 10 + app/test-bbdev/meson.build|3 + app/test-bbdev/test_bbdev_perf.c | 43 + doc/guides/bbdevs/features/la12xx.ini | 13 + doc/guides/bbdevs/index.rst |1 + doc/guides/bbdevs/la12xx.rst | 124 ++ doc/guides/rel_notes/release_21_11.rst|6 + doc/guides/tools/testbbdev.rst|3 + drivers/baseband/acc100/rte_acc100_pmd.c |1 + .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c |1 + drivers/baseband/fpga_lte_fec/fpga_lte_fec.c |1 + drivers/baseband/la12xx/bbdev_la12xx.c| 1104 + drivers/baseband/la12xx/bbdev_la12xx.h| 51 + drivers/baseband/la12xx/bbdev_la12xx_ipc.h| 244 .../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 28 + drivers/baseband/la12xx/meson.build |6 + drivers/baseband/la12xx/version.map |3 + drivers/baseband/meson.build |1 + drivers/baseband/null/bbdev_null.c|6 + .../baseband/turbo_sw/bbdev_turbo_software.c |1 + lib/bbdev/rte_bbdev.h |4 + 21 files changed, 1654 insertions(+) create mode 100644 doc/guides/bbdevs/features/la12xx.ini create mode 100644 doc/guides/bbdevs/la12xx.rst create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.c create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.h create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_ipc.h create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h create mode 100644 drivers/baseband/la12xx/meson.build create mode 100644 drivers/baseband/la12xx/version.map -- 2.17.1
[dpdk-dev] [PATCH v11 1/8] bbdev: add device info related to data endianness
From: Nicolas Chautru Adding device information to capture explicitly the assumption of the input/output data byte endianness being processed. Signed-off-by: Nicolas Chautru Signed-off-by: Nipun Gupta --- doc/guides/rel_notes/release_21_11.rst | 1 + drivers/baseband/acc100/rte_acc100_pmd.c | 1 + drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 1 + drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 1 + drivers/baseband/null/bbdev_null.c | 6 ++ drivers/baseband/turbo_sw/bbdev_turbo_software.c | 1 + lib/bbdev/rte_bbdev.h | 4 7 files changed, 15 insertions(+) diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index 4c56cdfeaa..957bd78d61 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -229,6 +229,7 @@ API Changes the crypto/security operation. This field will be used to communicate events such as soft expiry with IPsec in lookaside mode. +* bbdev: Added device info related to data byte endianness processing. ABI Changes --- diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c index 4e2feefc3c..05fe6f8b6f 100644 --- a/drivers/baseband/acc100/rte_acc100_pmd.c +++ b/drivers/baseband/acc100/rte_acc100_pmd.c @@ -1089,6 +1089,7 @@ acc100_dev_info_get(struct rte_bbdev *dev, #else dev_info->harq_buffer_size = 0; #endif + dev_info->data_endianness = RTE_LITTLE_ENDIAN; acc100_check_ir(d); } diff --git a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c index 6485cc824a..ee457f3071 100644 --- a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +++ b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c @@ -372,6 +372,7 @@ fpga_dev_info_get(struct rte_bbdev *dev, dev_info->default_queue_conf = default_queue_conf; dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs = NULL; + dev_info->data_endianness = RTE_LITTLE_ENDIAN; /* Calculates number of queues assigned to device */ dev_info->max_num_queues = 0; diff --git a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c index 350c4248eb..703bb611a0 100644 --- a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +++ b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c @@ -644,6 +644,7 @@ fpga_dev_info_get(struct rte_bbdev *dev, dev_info->default_queue_conf = default_queue_conf; dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs = NULL; + dev_info->data_endianness = RTE_LITTLE_ENDIAN; /* Calculates number of queues assigned to device */ dev_info->max_num_queues = 0; diff --git a/drivers/baseband/null/bbdev_null.c b/drivers/baseband/null/bbdev_null.c index 53c538ba44..753d920e18 100644 --- a/drivers/baseband/null/bbdev_null.c +++ b/drivers/baseband/null/bbdev_null.c @@ -77,6 +77,12 @@ info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) dev_info->cpu_flag_reqs = NULL; dev_info->min_alignment = 0; + /* BBDEV null device does not process the data, so +* endianness setting is not relevant, but setting it +* here for code completeness. +*/ + dev_info->data_endianness = RTE_LITTLE_ENDIAN; + rte_bbdev_log_debug("got device info from %u", dev->data->dev_id); } diff --git a/drivers/baseband/turbo_sw/bbdev_turbo_software.c b/drivers/baseband/turbo_sw/bbdev_turbo_software.c index e1db2bf205..b234bb751a 100644 --- a/drivers/baseband/turbo_sw/bbdev_turbo_software.c +++ b/drivers/baseband/turbo_sw/bbdev_turbo_software.c @@ -253,6 +253,7 @@ info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) dev_info->capabilities = bbdev_capabilities; dev_info->min_alignment = 64; dev_info->harq_buffer_size = 0; + dev_info->data_endianness = RTE_LITTLE_ENDIAN; rte_bbdev_log_debug("got device info from %u\n", dev->data->dev_id); } diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h index 3ebf62e697..e863bd913f 100644 --- a/lib/bbdev/rte_bbdev.h +++ b/lib/bbdev/rte_bbdev.h @@ -309,6 +309,10 @@ struct rte_bbdev_driver_info { uint16_t min_alignment; /** HARQ memory available in kB */ uint32_t harq_buffer_size; + /** Byte endianness (RTE_BIG_ENDIAN/RTE_LITTLE_ENDIAN) supported +* for input/output data +*/ + uint8_t data_endianness; /** Default queue configuration used if none is supplied */ struct rte_bbdev_queue_conf default_queue_conf; /** Device operation capabilities */ -- 2.17.1
[dpdk-dev] [PATCH v11 2/8] baseband: introduce NXP LA12xx driver
From: Nipun Gupta This patch introduce the baseband device drivers for NXP's LA1200 series software defined baseband modem. Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- MAINTAINERS | 10 ++ doc/guides/bbdevs/index.rst | 1 + doc/guides/bbdevs/la12xx.rst | 71 drivers/baseband/la12xx/bbdev_la12xx.c| 108 ++ .../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 28 + drivers/baseband/la12xx/meson.build | 6 + drivers/baseband/la12xx/version.map | 3 + drivers/baseband/meson.build | 1 + 8 files changed, 228 insertions(+) create mode 100644 doc/guides/bbdevs/la12xx.rst create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.c create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h create mode 100644 drivers/baseband/la12xx/meson.build create mode 100644 drivers/baseband/la12xx/version.map diff --git a/MAINTAINERS b/MAINTAINERS index ed8becce85..ff632479c5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1289,6 +1289,16 @@ F: drivers/event/opdl/ F: doc/guides/eventdevs/opdl.rst +Baseband Drivers + + +NXP LA12xx driver +M: Nipun Gupta +M: Hemant Agrawal +F: drivers/baseband/la12xx/ +F: doc/guides/bbdevs/la12xx.rst + + Rawdev Drivers -- diff --git a/doc/guides/bbdevs/index.rst b/doc/guides/bbdevs/index.rst index 4445cbd1b0..cedd706fa6 100644 --- a/doc/guides/bbdevs/index.rst +++ b/doc/guides/bbdevs/index.rst @@ -14,3 +14,4 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 +la12xx diff --git a/doc/guides/bbdevs/la12xx.rst b/doc/guides/bbdevs/la12xx.rst new file mode 100644 index 00..9ac6f0a0cd --- /dev/null +++ b/doc/guides/bbdevs/la12xx.rst @@ -0,0 +1,71 @@ +.. SPDX-License-Identifier: BSD-3-Clause +Copyright 2021 NXP + +NXP LA12xx Poll Mode Driver +=== + +The BBDEV LA12xx poll mode driver (PMD) supports an implementation for +offloading High Phy processing functions like LDPC Encode / Decode 5GNR wireless +acceleration function, using PCI based LA12xx Software defined radio. + +More information can be found at `NXP Official Website +<https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/layerscape-processors/layerscape-access-la1200-programmable-baseband-processor:LA1200>`_. + +Features + + +LA12xx PMD supports the following features: + +- Maximum of 8 LDPC decode (UL) queues +- Maximum of 8 LDPC encode (DL) queues +- PCIe Gen-3 x8 Interface + +Installation + + +Section 3 of the DPDK manual provides instructions on installing and compiling DPDK. + +DPDK requires hugepages to be configured as detailed in section 2 of the DPDK manual. + +Initialization +-- + +The device can be listed on the host console with: + + +Use the following lspci command to get the multiple LA12xx processor ids. The +device ID of the LA12xx baseband processor is "1c30". + +.. code-block:: console + + sudo lspci -nn + +... +0001:01:00.0 Power PC [0b20]: Freescale Semiconductor Inc Device [1957:1c30] ( +rev 10) +... +0002:01:00.0 Power PC [0b20]: Freescale Semiconductor Inc Device [1957:1c30] ( +rev 10) + + +Prerequisites +- + +Currently supported by DPDK: + +- NXP LA1224 BSP **1.0+**. +- NXP LA1224 PCIe Modem card connected to ARM host. + +- Follow the DPDK :ref:`Getting Started Guide for Linux ` to setup the basic DPDK environment. + +Enabling logs +- + +For enabling logs, use the following EAL parameter: + +.. code-block:: console + + ./your_bbdev_application --log-level=la12xx: + +Using ``bb.la12xx`` as log matching criteria, all Baseband PMD logs can be +enabled which are lower than logging ``level``. diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c new file mode 100644 index 00..d3d7a4df37 --- /dev/null +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -0,0 +1,108 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020-2021 NXP + */ + +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include + +#define DRIVER_NAME baseband_la12xx + +/* private data structure */ +struct bbdev_la12xx_private { + unsigned int max_nb_queues; /**< Max number of queues */ +}; +/* Create device */ +static int +la12xx_bbdev_create(struct rte_vdev_device *vdev) +{ + struct rte_bbdev *bbdev; + const char *name = rte_vdev_device_name(vdev); + + PMD_INIT_FUNC_TRACE(); + + bbdev = rte_bbdev_allocate(name); + if (bbdev == NULL) + return -ENODEV; + + bbdev->data->dev_private = rte_zmalloc(name, + sizeof(struct bbdev_la12xx_private), + RTE_CACHE_LINE_SIZE); + if (bbdev->data->dev_private == NULL) { + rte_bbdev_release(bb
[dpdk-dev] [PATCH v11 3/8] baseband/la12xx: add devargs for max queues
From: Hemant Agrawal This patch adds dev args to take max queues as input Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- doc/guides/bbdevs/la12xx.rst | 4 ++ drivers/baseband/la12xx/bbdev_la12xx.c | 73 +- 2 files changed, 75 insertions(+), 2 deletions(-) diff --git a/doc/guides/bbdevs/la12xx.rst b/doc/guides/bbdevs/la12xx.rst index 9ac6f0a0cd..3725078567 100644 --- a/doc/guides/bbdevs/la12xx.rst +++ b/doc/guides/bbdevs/la12xx.rst @@ -58,6 +58,10 @@ Currently supported by DPDK: - Follow the DPDK :ref:`Getting Started Guide for Linux ` to setup the basic DPDK environment. +* Use dev arg option ``max_nb_queues=x`` to specify the maximum number of queues + to be used for communication with offload device i.e. modem. default is 16. + e.g. ``--vdev=baseband_la12xx,max_nb_queues=4`` + Enabling logs - diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index d3d7a4df37..f5c835eeb8 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -17,13 +17,73 @@ #define DRIVER_NAME baseband_la12xx +/* Initialisation params structure that can be used by LA12xx BBDEV driver */ +struct bbdev_la12xx_params { + uint8_t queues_num; /*< LA12xx BBDEV queues number */ +}; + +#define LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" + +static const char * const bbdev_la12xx_valid_params[] = { + LA12XX_MAX_NB_QUEUES_ARG, +}; + /* private data structure */ struct bbdev_la12xx_private { unsigned int max_nb_queues; /**< Max number of queues */ }; +static inline int +parse_u16_arg(const char *key, const char *value, void *extra_args) +{ + uint16_t *u16 = extra_args; + + uint64_t result; + if ((value == NULL) || (extra_args == NULL)) + return -EINVAL; + errno = 0; + result = strtoul(value, NULL, 0); + if ((result >= (1 << 16)) || (errno != 0)) { + rte_bbdev_log(ERR, "Invalid value %" PRIu64 " for %s", + result, key); + return -ERANGE; + } + *u16 = (uint16_t)result; + return 0; +} + +/* Parse parameters used to create device */ +static int +parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, + const char *input_args) +{ + struct rte_kvargs *kvlist = NULL; + int ret = 0; + + if (params == NULL) + return -EINVAL; + if (input_args) { + kvlist = rte_kvargs_parse(input_args, + bbdev_la12xx_valid_params); + if (kvlist == NULL) + return -EFAULT; + + ret = rte_kvargs_process(kvlist, bbdev_la12xx_valid_params[0], + &parse_u16_arg, ¶ms->queues_num); + if (ret < 0) + goto exit; + + } + +exit: + if (kvlist) + rte_kvargs_free(kvlist); + return ret; +} + /* Create device */ static int -la12xx_bbdev_create(struct rte_vdev_device *vdev) +la12xx_bbdev_create(struct rte_vdev_device *vdev, + struct bbdev_la12xx_params *init_params __rte_unused) { struct rte_bbdev *bbdev; const char *name = rte_vdev_device_name(vdev); @@ -60,7 +120,11 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev) static int la12xx_bbdev_probe(struct rte_vdev_device *vdev) { + struct bbdev_la12xx_params init_params = { + 8 + }; const char *name; + const char *input_args; PMD_INIT_FUNC_TRACE(); @@ -71,7 +135,10 @@ la12xx_bbdev_probe(struct rte_vdev_device *vdev) if (name == NULL) return -EINVAL; - return la12xx_bbdev_create(vdev); + input_args = rte_vdev_device_args(vdev); + parse_bbdev_la12xx_params(&init_params, input_args); + + return la12xx_bbdev_create(vdev, &init_params); } /* Uninitialise device */ @@ -105,4 +172,6 @@ static struct rte_vdev_driver bbdev_la12xx_pmd_drv = { }; RTE_PMD_REGISTER_VDEV(DRIVER_NAME, bbdev_la12xx_pmd_drv); +RTE_PMD_REGISTER_PARAM_STRING(DRIVER_NAME, + LA12XX_MAX_NB_QUEUES_ARG"="); RTE_LOG_REGISTER_DEFAULT(bbdev_la12xx_logtype, NOTICE); -- 2.17.1
[dpdk-dev] [PATCH v11 4/8] baseband/la12xx: add support for multiple modems
From: Hemant Agrawal This patch add support for multiple modems by assigning a modem id as dev args in vdev creation. Signed-off-by: Hemant Agrawal --- doc/guides/bbdevs/la12xx.rst | 5 ++ drivers/baseband/la12xx/bbdev_la12xx.c | 64 +++--- drivers/baseband/la12xx/bbdev_la12xx.h | 56 +++ drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 20 +++ 4 files changed, 138 insertions(+), 7 deletions(-) create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.h create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_ipc.h diff --git a/doc/guides/bbdevs/la12xx.rst b/doc/guides/bbdevs/la12xx.rst index 3725078567..1a711ef5e3 100644 --- a/doc/guides/bbdevs/la12xx.rst +++ b/doc/guides/bbdevs/la12xx.rst @@ -58,6 +58,11 @@ Currently supported by DPDK: - Follow the DPDK :ref:`Getting Started Guide for Linux ` to setup the basic DPDK environment. +* Use dev arg option ``modem=0`` to identify the modem instance for a given + device. This is required only if more than 1 modem cards are attached to host. + this is optional and the default value is 0. + e.g. ``--vdev=baseband_la12xx,modem=0`` + * Use dev arg option ``max_nb_queues=x`` to specify the maximum number of queues to be used for communication with offload device i.e. modem. default is 16. e.g. ``--vdev=baseband_la12xx,max_nb_queues=4`` diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index f5c835eeb8..58defa54f0 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -14,24 +14,26 @@ #include #include +#include +#include #define DRIVER_NAME baseband_la12xx /* Initialisation params structure that can be used by LA12xx BBDEV driver */ struct bbdev_la12xx_params { uint8_t queues_num; /*< LA12xx BBDEV queues number */ + int8_t modem_id; /*< LA12xx modem instance id */ }; #define LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" +#define LA12XX_VDEV_MODEM_ID_ARG "modem" +#define LA12XX_MAX_MODEM 4 static const char * const bbdev_la12xx_valid_params[] = { LA12XX_MAX_NB_QUEUES_ARG, + LA12XX_VDEV_MODEM_ID_ARG, }; -/* private data structure */ -struct bbdev_la12xx_private { - unsigned int max_nb_queues; /**< Max number of queues */ -}; static inline int parse_u16_arg(const char *key, const char *value, void *extra_args) { @@ -51,6 +53,28 @@ parse_u16_arg(const char *key, const char *value, void *extra_args) return 0; } +/* Parse integer from integer argument */ +static int +parse_integer_arg(const char *key __rte_unused, + const char *value, void *extra_args) +{ + int i; + char *end; + + errno = 0; + + i = strtol(value, &end, 10); + if (*end != 0 || errno != 0 || i < 0 || i > LA12XX_MAX_MODEM) { + rte_bbdev_log(ERR, "Supported Port IDS are 0 to %d", + LA12XX_MAX_MODEM - 1); + return -EINVAL; + } + + *((uint32_t *)extra_args) = i; + + return 0; +} + /* Parse parameters used to create device */ static int parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, @@ -72,6 +96,16 @@ parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, if (ret < 0) goto exit; + ret = rte_kvargs_process(kvlist, + bbdev_la12xx_valid_params[1], + &parse_integer_arg, + ¶ms->modem_id); + + if (params->modem_id >= LA12XX_MAX_MODEM) { + rte_bbdev_log(ERR, "Invalid modem id, must be < %u", + LA12XX_MAX_MODEM); + goto exit; + } } exit: @@ -83,10 +117,11 @@ parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, /* Create device */ static int la12xx_bbdev_create(struct rte_vdev_device *vdev, - struct bbdev_la12xx_params *init_params __rte_unused) + struct bbdev_la12xx_params *init_params) { struct rte_bbdev *bbdev; const char *name = rte_vdev_device_name(vdev); + struct bbdev_la12xx_private *priv; PMD_INIT_FUNC_TRACE(); @@ -102,6 +137,20 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev, return -ENOMEM; } + priv = bbdev->data->dev_private; + priv->modem_id = init_params->modem_id; + /* if modem id is not configured */ + if (priv->modem_id == -1) + priv->modem_id = bbdev->data->dev_id; + + /* Reset Global variables */ + priv->num_ldpc_enc_queues = 0; + priv->num_ldpc_dec_queues = 0; + priv->num_valid_queues = 0; + priv->max_nb_queues = init_params->queues_num; + + rte_bbdev_log(INFO, "Setting Up %s: DevId=%d, ModemId=%d", + name, bbdev->data->dev_id, pri
[dpdk-dev] [PATCH v11 5/8] baseband/la12xx: add queue and modem config support
From: Hemant Agrawal This patch add support for connecting with modem and creating the ipc channel as queues with modem for the exchange of data. Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- drivers/baseband/la12xx/bbdev_la12xx.c | 559 - drivers/baseband/la12xx/bbdev_la12xx.h | 17 +- drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 189 ++- 3 files changed, 752 insertions(+), 13 deletions(-) diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index 58defa54f0..7e312cf2e7 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -3,6 +3,11 @@ */ #include +#include +#include +#include +#include +#include #include #include @@ -29,11 +34,556 @@ struct bbdev_la12xx_params { #define LA12XX_VDEV_MODEM_ID_ARG "modem" #define LA12XX_MAX_MODEM 4 +#define LA12XX_MAX_CORES 4 +#define LA12XX_LDPC_ENC_CORE 0 +#define LA12XX_LDPC_DEC_CORE 1 + +#define LA12XX_MAX_LDPC_ENC_QUEUES 4 +#define LA12XX_MAX_LDPC_DEC_QUEUES 4 + static const char * const bbdev_la12xx_valid_params[] = { LA12XX_MAX_NB_QUEUES_ARG, LA12XX_VDEV_MODEM_ID_ARG, }; +static const struct rte_bbdev_op_cap bbdev_capabilities[] = { + { + .type = RTE_BBDEV_OP_LDPC_ENC, + .cap.ldpc_enc = { + .capability_flags = + RTE_BBDEV_LDPC_RATE_MATCH | + RTE_BBDEV_LDPC_CRC_24A_ATTACH | + RTE_BBDEV_LDPC_CRC_24B_ATTACH, + .num_buffers_src = + RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, + .num_buffers_dst = + RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, + } + }, + { + .type = RTE_BBDEV_OP_LDPC_DEC, + .cap.ldpc_dec = { + .capability_flags = + RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK | + RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK | + RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP, + .num_buffers_src = + RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, + .num_buffers_hard_out = + RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, + .llr_size = 8, + .llr_decimals = 1, + } + }, + RTE_BBDEV_END_OF_CAPABILITIES_LIST() +}; + +static struct rte_bbdev_queue_conf default_queue_conf = { + .queue_size = MAX_CHANNEL_DEPTH, +}; + +/* Get device info */ +static void +la12xx_info_get(struct rte_bbdev *dev __rte_unused, + struct rte_bbdev_driver_info *dev_info) +{ + PMD_INIT_FUNC_TRACE(); + + dev_info->driver_name = RTE_STR(DRIVER_NAME); + dev_info->max_num_queues = LA12XX_MAX_QUEUES; + dev_info->queue_size_lim = MAX_CHANNEL_DEPTH; + dev_info->hardware_accelerated = true; + dev_info->max_dl_queue_priority = 0; + dev_info->max_ul_queue_priority = 0; + dev_info->data_endianness = RTE_BIG_ENDIAN; + dev_info->default_queue_conf = default_queue_conf; + dev_info->capabilities = bbdev_capabilities; + dev_info->cpu_flag_reqs = NULL; + dev_info->min_alignment = 64; + + rte_bbdev_log_debug("got device info from %u", dev->data->dev_id); +} + +/* Release queue */ +static int +la12xx_queue_release(struct rte_bbdev *dev, uint16_t q_id) +{ + RTE_SET_USED(dev); + RTE_SET_USED(q_id); + + PMD_INIT_FUNC_TRACE(); + + return 0; +} + +#define HUGEPG_OFFSET(A) \ + ((uint64_t) ((unsigned long) (A) \ + - ((uint64_t)ipc_priv->hugepg_start.host_vaddr))) + +static int +ipc_queue_configure(uint32_t channel_id, + ipc_t instance, + struct bbdev_la12xx_q_priv *q_priv) +{ + ipc_userspace_t *ipc_priv = (ipc_userspace_t *)instance; + ipc_instance_t *ipc_instance = ipc_priv->instance; + ipc_ch_t *ch; + void *vaddr; + uint32_t i = 0; + uint32_t msg_size = sizeof(struct bbdev_ipc_enqueue_op); + + PMD_INIT_FUNC_TRACE(); + + rte_bbdev_log_debug("%x %p", ipc_instance->initialized, + ipc_priv->instance); + ch = &(ipc_instance->ch_list[channel_id]); + + rte_bbdev_log_debug("channel: %u, depth: %u, msg size: %u", + channel_id, q_priv->queue_size, msg_size); + + /* Start init of channel */ + ch->md.ring_size = rte_cpu_to_be_32(q_priv->queue_size); + ch->md.pi = 0; + ch->md.ci = 0; + ch->md.msg_size = msg_size; + for (i = 0; i < q_priv-
[dpdk-dev] [PATCH v11 6/8] baseband/la12xx: add enqueue and dequeue support
From: Hemant Agrawal Add support for enqueue and dequeue the LDPC enc/dec from the modem device. Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- doc/guides/bbdevs/features/la12xx.ini | 13 + doc/guides/bbdevs/la12xx.rst | 44 +++ doc/guides/rel_notes/release_21_11.rst | 5 + drivers/baseband/la12xx/bbdev_la12xx.c | 320 + drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 37 +++ 5 files changed, 419 insertions(+) create mode 100644 doc/guides/bbdevs/features/la12xx.ini diff --git a/doc/guides/bbdevs/features/la12xx.ini b/doc/guides/bbdevs/features/la12xx.ini new file mode 100644 index 00..0aec5eecb6 --- /dev/null +++ b/doc/guides/bbdevs/features/la12xx.ini @@ -0,0 +1,13 @@ +; +; Supported features of the 'la12xx' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Turbo Decoder (4G) = N +Turbo Encoder (4G) = N +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = N +HW Accelerated = Y +BBDEV API = Y diff --git a/doc/guides/bbdevs/la12xx.rst b/doc/guides/bbdevs/la12xx.rst index 1a711ef5e3..fe1bca4c5c 100644 --- a/doc/guides/bbdevs/la12xx.rst +++ b/doc/guides/bbdevs/la12xx.rst @@ -78,3 +78,47 @@ For enabling logs, use the following EAL parameter: Using ``bb.la12xx`` as log matching criteria, all Baseband PMD logs can be enabled which are lower than logging ``level``. + +Test Application + + +BBDEV provides a test application, ``test-bbdev.py`` and range of test data for testing +the functionality of LA12xx for FEC encode and decode, depending on the device +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). + "-s", "--snr": SNR in dB used when generating LLRs for bler tests. + "-s", "--iter_max" : Number of iterations for LDPC decoder. + "-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 decode or encode data, +type one of the following: + +.. code-block:: console + + ./test-bbdev.py -e="--vdev=baseband_la12xx,socket_id=0,max_nb_queues=8" -c validation -n 64 -b 1 -v ./ldpc_dec_default.data + ./test-bbdev.py -e="--vdev=baseband_la12xx,socket_id=0,max_nb_queues=8" -c validation -n 64 -b 1 -v ./ldpc_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. + + +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 LA12xx FEC capabilities which may cause some +testcases to be skipped, but no failure should be reported. diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index 957bd78d61..d7e0bdc09b 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -159,6 +159,11 @@ New Features * Added tests to verify tunnel header verification in IPsec inbound. * Added tests to verify inner checksum. +* **Added NXP LA12xx baseband PMD.** + + * Added a new baseband PMD driver for NXP LA12xx Software defined radio. + * See the :doc:`../bbdevs/la12xx` for more details. + Removed Items - diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index 7e312cf2e7..4b05b5d3f2 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -120,6 +120,10 @@ la12xx_queue_release(struct rte_bbdev *dev, uint16_t q_id) ((uint64_t) ((unsigned long) (A) \ - ((uint64_t)ipc_priv->hugepg_start.host_vaddr))) +#define MODEM_P2V(A) \ + ((uint64_t) ((unsigned long) (A) \ +
[dpdk-dev] [PATCH v11 7/8] app/bbdev: enable la12xx for bbdev
From: Hemant Agrawal this patch adds la12xx driver in test bbdev Signed-off-by: Hemant Agrawal --- app/test-bbdev/meson.build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/test-bbdev/meson.build b/app/test-bbdev/meson.build index edb9deef84..a726a5b3fa 100644 --- a/app/test-bbdev/meson.build +++ b/app/test-bbdev/meson.build @@ -23,3 +23,6 @@ endif if dpdk_conf.has('RTE_BASEBAND_ACC100') deps += ['baseband_acc100'] endif +if dpdk_conf.has('RTE_LIBRTE_PMD_BBDEV_LA12XX') + deps += ['baseband_la12xx'] +endif -- 2.17.1
[dpdk-dev] [PATCH v11 8/8] app/bbdev: handle endianness of test data
From: Nipun Gupta With data input, output and harq also supported in big endian format, this patch updates the testbbdev application to handle the endianness conversion as directed by the the driver being used. The test vectors assumes the data in the little endian order, and thus if the driver supports big endian data processing, conversion from little endian to big is handled by the testbbdev application. Signed-off-by: Nipun Gupta --- app/test-bbdev/test_bbdev_perf.c | 43 doc/guides/tools/testbbdev.rst | 3 +++ 2 files changed, 46 insertions(+) diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c index 469597b8b3..7b4529789b 100644 --- a/app/test-bbdev/test_bbdev_perf.c +++ b/app/test-bbdev/test_bbdev_perf.c @@ -227,6 +227,45 @@ clear_soft_out_cap(uint32_t *op_flags) *op_flags &= ~RTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT; } +/* This API is to convert all the test vector op data entries + * to big endian format. It is used when the device supports + * the input in the big endian format. + */ +static inline void +convert_op_data_to_be(void) +{ + struct op_data_entries *op; + enum op_data_type type; + uint8_t nb_segs, *rem_data, temp; + uint32_t *data, len; + int complete, rem, i, j; + + for (type = DATA_INPUT; type < DATA_NUM_TYPES; ++type) { + nb_segs = test_vector.entries[type].nb_segments; + op = &test_vector.entries[type]; + + /* Invert byte endianness for all the segments */ + for (i = 0; i < nb_segs; ++i) { + len = op->segments[i].length; + data = op->segments[i].addr; + + /* Swap complete u32 bytes */ + complete = len / 4; + for (j = 0; j < complete; j++) + data[j] = rte_bswap32(data[j]); + + /* Swap any remaining bytes */ + rem = len % 4; + rem_data = (uint8_t *)&data[j]; + for (j = 0; j < rem/2; j++) { + temp = rem_data[j]; + rem_data[j] = rem_data[rem - j - 1]; + rem_data[rem - j - 1] = temp; + } + } + } +} + static int check_dev_cap(const struct rte_bbdev_info *dev_info) { @@ -234,6 +273,7 @@ check_dev_cap(const struct rte_bbdev_info *dev_info) unsigned int nb_inputs, nb_soft_outputs, nb_hard_outputs, nb_harq_inputs, nb_harq_outputs; const struct rte_bbdev_op_cap *op_cap = dev_info->drv.capabilities; + uint8_t dev_data_endianness = dev_info->drv.data_endianness; nb_inputs = test_vector.entries[DATA_INPUT].nb_segments; nb_soft_outputs = test_vector.entries[DATA_SOFT_OUTPUT].nb_segments; @@ -245,6 +285,9 @@ check_dev_cap(const struct rte_bbdev_info *dev_info) if (op_cap->type != test_vector.op_type) continue; + if (dev_data_endianness == RTE_BIG_ENDIAN) + convert_op_data_to_be(); + if (op_cap->type == RTE_BBDEV_OP_TURBO_DEC) { const struct rte_bbdev_op_cap_turbo_dec *cap = &op_cap->cap.turbo_dec; diff --git a/doc/guides/tools/testbbdev.rst b/doc/guides/tools/testbbdev.rst index d397d991ff..83a0312062 100644 --- a/doc/guides/tools/testbbdev.rst +++ b/doc/guides/tools/testbbdev.rst @@ -332,6 +332,9 @@ Variable op_type has to be defined as a first variable in file. It specifies what type of operations will be executed. For 4G decoder op_type has to be set to ``RTE_BBDEV_OP_TURBO_DEC`` and for 4G encoder to ``RTE_BBDEV_OP_TURBO_ENC``. +Bbdev-test adjusts the byte endianness based on the PMD capability (data_endianness) +and all the test vectors input/output data are assumed to be LE by default + Full details of the meaning and valid values for the below fields are documented in *rte_bbdev_op.h* -- 2.17.1
[PATCH v2 0/6] move DPAA2 QDMA driver freom raw to dma
From: Nipun Gupta This change removes the DPAA2 QDMA raw driver and adds the QDMA driver in dma set of drivers. The underlying I/O framework remains intact, whereas the configuration part is done as per the DMA API support. Changes in v2: - Fix checkpath errors - Fix documentation compilation Nipun Gupta (6): raw/dpaa2_qdma: remove dpaa2 QDMA driver from raw dma/dpaa2: introduce DPAA2 DMA driver skeleton dma/dpaa2: support basic operations dma/dpaa2: add PMD apis for additional configuration dma/dpaa2: support DMA operations dma/dpaa2: support statistics MAINTAINERS | 11 +- doc/api/doxy-api.conf.in |2 +- doc/guides/rawdevs/dpaa2_qdma.rst | 74 - drivers/bus/fslmc/rte_fslmc.h |1 + .../dpaa2_qdma => dma/dpaa2}/dpaa2_qdma.c | 1248 - .../dpaa2_qdma => dma/dpaa2}/dpaa2_qdma.h | 195 ++- .../dpaa2}/dpaa2_qdma_logs.h |2 +- drivers/dma/dpaa2/meson.build | 18 + drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h| 173 +++ drivers/dma/dpaa2/version.map | 11 + drivers/dma/meson.build |1 + drivers/raw/dpaa2_qdma/meson.build|7 - drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h | 204 --- drivers/raw/dpaa2_qdma/version.map|7 - drivers/raw/meson.build |1 - 15 files changed, 852 insertions(+), 1103 deletions(-) delete mode 100644 doc/guides/rawdevs/dpaa2_qdma.rst rename drivers/{raw/dpaa2_qdma => dma/dpaa2}/dpaa2_qdma.c (57%) rename drivers/{raw/dpaa2_qdma => dma/dpaa2}/dpaa2_qdma.h (77%) rename drivers/{raw/dpaa2_qdma => dma/dpaa2}/dpaa2_qdma_logs.h (97%) create mode 100644 drivers/dma/dpaa2/meson.build create mode 100644 drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h create mode 100644 drivers/dma/dpaa2/version.map delete mode 100644 drivers/raw/dpaa2_qdma/meson.build delete mode 100644 drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h delete mode 100644 drivers/raw/dpaa2_qdma/version.map -- 2.17.1
[PATCH v2 1/6] raw/dpaa2_qdma: remove dpaa2 QDMA driver from raw
From: Nipun Gupta With DMA devices supported as a separate flavor of devices, the DPAA2 QDMA driver is moved in the DMA devices. This change removes the DPAA2 QDMA driver from raw devices. Signed-off-by: Nipun Gupta --- MAINTAINERS |5 - doc/api/doxy-api-index.md |1 - doc/api/doxy-api.conf.in|1 - doc/guides/rawdevs/dpaa2_qdma.rst | 74 - drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 1834 --- drivers/raw/dpaa2_qdma/dpaa2_qdma.h | 288 --- drivers/raw/dpaa2_qdma/dpaa2_qdma_logs.h| 46 - drivers/raw/dpaa2_qdma/meson.build |7 - drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h | 204 --- drivers/raw/dpaa2_qdma/version.map |7 - drivers/raw/meson.build |1 - 11 files changed, 2468 deletions(-) delete mode 100644 doc/guides/rawdevs/dpaa2_qdma.rst delete mode 100644 drivers/raw/dpaa2_qdma/dpaa2_qdma.c delete mode 100644 drivers/raw/dpaa2_qdma/dpaa2_qdma.h delete mode 100644 drivers/raw/dpaa2_qdma/dpaa2_qdma_logs.h delete mode 100644 drivers/raw/dpaa2_qdma/meson.build delete mode 100644 drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h delete mode 100644 drivers/raw/dpaa2_qdma/version.map diff --git a/MAINTAINERS b/MAINTAINERS index 7c4f541dba..e67215f490 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1379,11 +1379,6 @@ M: Nipun Gupta F: drivers/raw/dpaa2_cmdif/ F: doc/guides/rawdevs/dpaa2_cmdif.rst -NXP DPAA2 QDMA -M: Nipun Gupta -F: drivers/raw/dpaa2_qdma/ -F: doc/guides/rawdevs/dpaa2_qdma.rst - Packet processing - diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md index 4245b9635c..6c1ca981bc 100644 --- a/doc/api/doxy-api-index.md +++ b/doc/api/doxy-api-index.md @@ -53,7 +53,6 @@ The public API headers are grouped by topics: [mlx5] (@ref rte_pmd_mlx5.h), [dpaa2_mempool] (@ref rte_dpaa2_mempool.h), [dpaa2_cmdif](@ref rte_pmd_dpaa2_cmdif.h), - [dpaa2_qdma] (@ref rte_pmd_dpaa2_qdma.h), [crypto_scheduler] (@ref rte_cryptodev_scheduler.h), [dlb2] (@ref rte_pmd_dlb2.h), [ifpga] (@ref rte_pmd_ifpga.h) diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in index db2ca9b6ed..a73aac2410 100644 --- a/doc/api/doxy-api.conf.in +++ b/doc/api/doxy-api.conf.in @@ -21,7 +21,6 @@ INPUT = @TOPDIR@/doc/api/doxy-api-index.md \ @TOPDIR@/drivers/net/mlx5 \ @TOPDIR@/drivers/net/softnic \ @TOPDIR@/drivers/raw/dpaa2_cmdif \ - @TOPDIR@/drivers/raw/dpaa2_qdma \ @TOPDIR@/drivers/raw/ifpga \ @TOPDIR@/drivers/raw/ioat \ @TOPDIR@/lib/eal/include \ diff --git a/doc/guides/rawdevs/dpaa2_qdma.rst b/doc/guides/rawdevs/dpaa2_qdma.rst deleted file mode 100644 index 1b619ea1e1..00 --- a/doc/guides/rawdevs/dpaa2_qdma.rst +++ /dev/null @@ -1,74 +0,0 @@ -.. SPDX-License-Identifier: BSD-3-Clause -Copyright 2018 NXP - -NXP DPAA2 QDMA Driver -= - -The DPAA2 QDMA is an implementation of the rawdev API, that provide means -to initiate a DMA transaction from CPU. The initiated DMA is performed -without CPU being involved in the actual DMA transaction. This is achieved -via using the DPDMAI device exposed by MC. - -More information can be found at `NXP Official Website -<http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/qoriq-arm-processors:QORIQ-ARM>`_. - -Features - - -The DPAA2 QDMA implements following features in the rawdev API; - -- Supports issuing DMA of data within memory without hogging CPU while - performing DMA operation. -- Supports configuring to optionally get status of the DMA translation on - per DMA operation basis. - -Supported DPAA2 SoCs - - -- LX2160A -- LS2084A/LS2044A -- LS2088A/LS2048A -- LS1088A/LS1048A - -Prerequisites -- - -See :doc:`../platform/dpaa2` for setup information - -- Follow the DPDK :ref:`Getting Started Guide for Linux ` to setup the basic DPDK environment. - -.. note:: - - Some part of fslmc bus code (mc flib - object library) routines are - dual licensed (BSD & GPLv2). - - -Enabling logs -- - -For enabling logs, use the following EAL parameter: - -.. code-block:: console - - ./your_qdma_application --log-level=pmd.raw.dpaa2.qdma, - -Using ``pmd.raw.dpaa2.qdma`` as log matching criteria, all Event PMD logs can be -enabled which are lower than logging ``level``. - - -Initialization --- - -The DPAA2 QDMA is exposed as a vdev device which consists of dpdmai devices. -On EAL initialization, dpdmai devices will be probed and populated into the -rawdevices. The rawdev ID of the device can be obtained using - -* Invoking ``rte_rawdev_get_dev_id("dpdmai.x")``
[PATCH v2 2/6] dma/dpaa2: introduce DPAA2 DMA driver skeleton
From: Nipun Gupta The DPAA2 DMA driver is an implementation of the dmadev APIs, that provide means to initiate a DMA transaction from CPU. Earlier this was part of RAW driver, but with DMA drivers added as separate flavor of drivers, this driver is being moved to DMA drivers. Signed-off-by: Nipun Gupta --- MAINTAINERS | 6 + drivers/bus/fslmc/rte_fslmc.h | 1 + drivers/dma/dpaa2/dpaa2_qdma.c | 275 drivers/dma/dpaa2/dpaa2_qdma.h | 316 drivers/dma/dpaa2/dpaa2_qdma_logs.h | 46 drivers/dma/dpaa2/meson.build | 16 ++ drivers/dma/dpaa2/version.map | 3 + drivers/dma/meson.build | 1 + 8 files changed, 664 insertions(+) create mode 100644 drivers/dma/dpaa2/dpaa2_qdma.c create mode 100644 drivers/dma/dpaa2/dpaa2_qdma.h create mode 100644 drivers/dma/dpaa2/dpaa2_qdma_logs.h create mode 100644 drivers/dma/dpaa2/meson.build create mode 100644 drivers/dma/dpaa2/version.map diff --git a/MAINTAINERS b/MAINTAINERS index e67215f490..432ca49fb3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1198,6 +1198,12 @@ M: Nipun Gupta F: drivers/dma/dpaa/ F: doc/guides/dmadevs/dpaa.rst +NXP DPAA2 QDMA +M: Nipun Gupta +M: Hemant Agrawal +F: drivers/dma/dpaa2_qdma/ +F: doc/guides/dmadevs/dpaa2_qdma.rst + RegEx Drivers - diff --git a/drivers/bus/fslmc/rte_fslmc.h b/drivers/bus/fslmc/rte_fslmc.h index 12b586b13b..8c67bfba55 100644 --- a/drivers/bus/fslmc/rte_fslmc.h +++ b/drivers/bus/fslmc/rte_fslmc.h @@ -123,6 +123,7 @@ struct rte_dpaa2_device { union { struct rte_eth_dev *eth_dev;/**< ethernet device */ struct rte_cryptodev *cryptodev;/**< Crypto Device */ + struct rte_dma_dev *dmadev; /**< DMA Device */ struct rte_rawdev *rawdev; /**< Raw Device */ }; enum rte_dpaa2_dev_type dev_type; /**< Device Type */ diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c new file mode 100644 index 00..9fa48ddfa4 --- /dev/null +++ b/drivers/dma/dpaa2/dpaa2_qdma.c @@ -0,0 +1,275 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2018-2022 NXP + */ + +#include +#include +#include +#include +#include +#include "dpaa2_qdma.h" +#include "dpaa2_qdma_logs.h" +/* Dynamic log type identifier */ +int dpaa2_qdma_logtype; + +uint32_t dpaa2_coherent_no_alloc_cache; +uint32_t dpaa2_coherent_alloc_cache; + +static int +dpaa2_qdma_reset(struct rte_dma_dev *dev) +{ + struct dpaa2_dpdmai_dev *dpdmai_dev = dev->data->dev_private; + struct qdma_device *qdma_dev = dpdmai_dev->qdma_dev; + int i; + + DPAA2_QDMA_FUNC_TRACE(); + + /* In case QDMA device is not in stopped state, return -EBUSY */ + if (qdma_dev->state == 1) { + DPAA2_QDMA_ERR( + "Device is in running state. Stop before reset."); + return -EBUSY; + } + + /* In case there are pending jobs on any VQ, return -EBUSY */ + for (i = 0; i < qdma_dev->num_vqs; i++) { + if (qdma_dev->vqs[i].in_use && (qdma_dev->vqs[i].num_enqueues != + qdma_dev->vqs[i].num_dequeues)) { + DPAA2_QDMA_ERR("Jobs are still pending on VQ: %d", i); + return -EBUSY; + } + } + + /* Reset and free virtual queues */ + for (i = 0; i < qdma_dev->num_vqs; i++) { + if (qdma_dev->vqs[i].status_ring) + rte_ring_free(qdma_dev->vqs[i].status_ring); + } + if (qdma_dev->vqs) + rte_free(qdma_dev->vqs); + qdma_dev->vqs = NULL; + + /* Reset QDMA device structure */ + qdma_dev->num_vqs = 0; + + return 0; +} + +static struct rte_dma_dev_ops dpaa2_qdma_ops = { +}; + +static int +dpaa2_dpdmai_dev_uninit(struct rte_dma_dev *dev) +{ + struct dpaa2_dpdmai_dev *dpdmai_dev = dev->data->dev_private; + int ret; + + DPAA2_QDMA_FUNC_TRACE(); + + ret = dpdmai_disable(&dpdmai_dev->dpdmai, CMD_PRI_LOW, +dpdmai_dev->token); + if (ret) + DPAA2_QDMA_ERR("dmdmai disable failed"); + + /* Set up the DQRR storage for Rx */ + struct dpaa2_queue *rxq = &(dpdmai_dev->rx_queue[0]); + + if (rxq->q_storage) { + dpaa2_free_dq_storage(rxq->q_storage); + rte_free(rxq->q_storage); + } + + /* Close the device at underlying layer*/ + ret = dpdmai_close(&dpdmai_dev->dpdmai, CMD_PRI_LOW, dpdmai_dev->token); + if (ret) + DPAA2_QDMA_ERR("Failure closing dpdmai device"); + + return 0; +} + +static int +dpaa2_dpdmai_dev_init(struct rte_dma_de
[PATCH v2 3/6] dma/dpaa2: support basic operations
From: Nipun Gupta This patch support basic DMA operations which includes device capability and channel setup. Signed-off-by: Nipun Gupta --- drivers/dma/dpaa2/dpaa2_qdma.c | 182 + 1 file changed, 182 insertions(+) diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c index 9fa48ddfa4..785d8aea7b 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.c +++ b/drivers/dma/dpaa2/dpaa2_qdma.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "dpaa2_qdma.h" #include "dpaa2_qdma_logs.h" @@ -15,6 +16,171 @@ int dpaa2_qdma_logtype; uint32_t dpaa2_coherent_no_alloc_cache; uint32_t dpaa2_coherent_alloc_cache; +static int +dpaa2_qdma_info_get(const struct rte_dma_dev *dev, + struct rte_dma_info *dev_info, + uint32_t info_sz) +{ + RTE_SET_USED(dev); + RTE_SET_USED(info_sz); + + dev_info->dev_capa = RTE_DMA_CAPA_MEM_TO_MEM | +RTE_DMA_CAPA_MEM_TO_DEV | +RTE_DMA_CAPA_DEV_TO_DEV | +RTE_DMA_CAPA_DEV_TO_MEM | +RTE_DMA_CAPA_SILENT | +RTE_DMA_CAPA_OPS_COPY; + dev_info->max_vchans = DPAA2_QDMA_MAX_VHANS; + dev_info->max_desc = DPAA2_QDMA_MAX_DESC; + dev_info->min_desc = DPAA2_QDMA_MIN_DESC; + + return 0; +} + +static int +dpaa2_qdma_configure(struct rte_dma_dev *dev, +const struct rte_dma_conf *dev_conf, +uint32_t conf_sz) +{ + char name[32]; /* RTE_MEMZONE_NAMESIZE = 32 */ + struct dpaa2_dpdmai_dev *dpdmai_dev = dev->data->dev_private; + struct qdma_device *qdma_dev = dpdmai_dev->qdma_dev; + + DPAA2_QDMA_FUNC_TRACE(); + + RTE_SET_USED(conf_sz); + + /* In case QDMA device is not in stopped state, return -EBUSY */ + if (qdma_dev->state == 1) { + DPAA2_QDMA_ERR( + "Device is in running state. Stop before config."); + return -1; + } + + /* Allocate Virtual Queues */ + sprintf(name, "qdma_%d_vq", dev->data->dev_id); + qdma_dev->vqs = rte_malloc(name, + (sizeof(struct qdma_virt_queue) * dev_conf->nb_vchans), + RTE_CACHE_LINE_SIZE); + if (!qdma_dev->vqs) { + DPAA2_QDMA_ERR("qdma_virtual_queues allocation failed"); + return -ENOMEM; + } + qdma_dev->num_vqs = dev_conf->nb_vchans; + + return 0; +} + +static int +dpaa2_qdma_vchan_setup(struct rte_dma_dev *dev, uint16_t vchan, + const struct rte_dma_vchan_conf *conf, + uint32_t conf_sz) +{ + struct dpaa2_dpdmai_dev *dpdmai_dev = dev->data->dev_private; + struct qdma_device *qdma_dev = dpdmai_dev->qdma_dev; + uint32_t pool_size; + char ring_name[32]; + char pool_name[64]; + int fd_long_format = 1; + int sg_enable = 0; + + DPAA2_QDMA_FUNC_TRACE(); + + RTE_SET_USED(conf_sz); + + if (qdma_dev->vqs[vchan].flags & DPAA2_QDMA_VQ_FD_SG_FORMAT) + sg_enable = 1; + + if (qdma_dev->vqs[vchan].flags & DPAA2_QDMA_VQ_FD_SHORT_FORMAT) + fd_long_format = 0; + + if (dev->data->dev_conf.enable_silent) + qdma_dev->vqs[vchan].flags |= DPAA2_QDMA_VQ_NO_RESPONSE; + + if (sg_enable) { + if (qdma_dev->num_vqs != 1) { + DPAA2_QDMA_ERR( + "qDMA SG format only supports physical queue!"); + return -ENODEV; + } + if (!fd_long_format) { + DPAA2_QDMA_ERR( + "qDMA SG format only supports long FD format!"); + return -ENODEV; + } + pool_size = QDMA_FLE_SG_POOL_SIZE; + } else { + pool_size = QDMA_FLE_SINGLE_POOL_SIZE; + } + + if (qdma_dev->num_vqs == 1) + qdma_dev->vqs[vchan].exclusive_hw_queue = 1; + else { + /* Allocate a Ring for Virtual Queue in VQ mode */ + snprintf(ring_name, sizeof(ring_name), "status ring %d %d", +dev->data->dev_id, vchan); + qdma_dev->vqs[vchan].status_ring = rte_ring_create(ring_name, + conf->nb_desc, rte_socket_id(), 0); + if (!qdma_dev->vqs[vchan].status_ring) { + DPAA2_QDMA_ERR("Status ring creation failed for vq"); + return rte_errno; + } + } + + snprintf(pool_name, sizeof(pool_name), + "qdma_fle_pool_dev%d_qid%d", dpdmai_dev-
[PATCH v2 4/6] dma/dpaa2: add PMD apis for additional configuration
From: Nipun Gupta Add additional PMD APIs for DPAA2 QDMA driver for configuring RBP, Ultra Short format, and Scatter Gather support Signed-off-by: Nipun Gupta --- doc/api/doxy-api-index.md | 1 + doc/api/doxy-api.conf.in | 1 + drivers/dma/dpaa2/dpaa2_qdma.c | 38 ++ drivers/dma/dpaa2/meson.build | 2 + drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h | 96 ++ drivers/dma/dpaa2/version.map | 6 ++ 6 files changed, 144 insertions(+) create mode 100644 drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md index 6c1ca981bc..4245b9635c 100644 --- a/doc/api/doxy-api-index.md +++ b/doc/api/doxy-api-index.md @@ -53,6 +53,7 @@ The public API headers are grouped by topics: [mlx5] (@ref rte_pmd_mlx5.h), [dpaa2_mempool] (@ref rte_dpaa2_mempool.h), [dpaa2_cmdif](@ref rte_pmd_dpaa2_cmdif.h), + [dpaa2_qdma] (@ref rte_pmd_dpaa2_qdma.h), [crypto_scheduler] (@ref rte_cryptodev_scheduler.h), [dlb2] (@ref rte_pmd_dlb2.h), [ifpga] (@ref rte_pmd_ifpga.h) diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in index a73aac2410..93425e38eb 100644 --- a/doc/api/doxy-api.conf.in +++ b/doc/api/doxy-api.conf.in @@ -7,6 +7,7 @@ USE_MDFILE_AS_MAINPAGE = @TOPDIR@/doc/api/doxy-api-index.md INPUT = @TOPDIR@/doc/api/doxy-api-index.md \ @TOPDIR@/drivers/bus/vdev \ @TOPDIR@/drivers/crypto/scheduler \ + @TOPDIR@/drivers/dma/dpaa2 \ @TOPDIR@/drivers/event/dlb2 \ @TOPDIR@/drivers/mempool/dpaa2 \ @TOPDIR@/drivers/net/ark \ diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c index 785d8aea7b..54db806736 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.c +++ b/drivers/dma/dpaa2/dpaa2_qdma.c @@ -7,7 +7,10 @@ #include #include #include + #include + +#include "rte_pmd_dpaa2_qdma.h" #include "dpaa2_qdma.h" #include "dpaa2_qdma_logs.h" /* Dynamic log type identifier */ @@ -71,6 +74,41 @@ dpaa2_qdma_configure(struct rte_dma_dev *dev, return 0; } +/* Enable FD in Ultra Short format */ +void +rte_dpaa2_qdma_vchan_fd_us_enable(int16_t dev_id, uint16_t vchan) +{ + struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id]; + struct dpaa2_dpdmai_dev *dpdmai_dev = obj->dev_private; + struct qdma_device *qdma_dev = dpdmai_dev->qdma_dev; + + qdma_dev->vqs[vchan].flags |= DPAA2_QDMA_VQ_FD_SHORT_FORMAT; +} + +/* Enable internal SG processing */ +void +rte_dpaa2_qdma_vchan_internal_sg_enable(int16_t dev_id, uint16_t vchan) +{ + struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id]; + struct dpaa2_dpdmai_dev *dpdmai_dev = obj->dev_private; + struct qdma_device *qdma_dev = dpdmai_dev->qdma_dev; + + qdma_dev->vqs[vchan].flags |= DPAA2_QDMA_VQ_FD_SG_FORMAT; +} + +/* Enable RBP */ +void +rte_dpaa2_qdma_vchan_rbp_enable(int16_t dev_id, uint16_t vchan, + struct rte_dpaa2_qdma_rbp *rbp_config) +{ + struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id]; + struct dpaa2_dpdmai_dev *dpdmai_dev = obj->dev_private; + struct qdma_device *qdma_dev = dpdmai_dev->qdma_dev; + + memcpy(&qdma_dev->vqs[vchan].rbp, rbp_config, + sizeof(struct rte_dpaa2_qdma_rbp)); +} + static int dpaa2_qdma_vchan_setup(struct rte_dma_dev *dev, uint16_t vchan, const struct rte_dma_vchan_conf *conf, diff --git a/drivers/dma/dpaa2/meson.build b/drivers/dma/dpaa2/meson.build index 2b82563e85..a99151e2a5 100644 --- a/drivers/dma/dpaa2/meson.build +++ b/drivers/dma/dpaa2/meson.build @@ -14,3 +14,5 @@ sources = files('dpaa2_qdma.c') if cc.has_argument('-Wno-pointer-arith') cflags += '-Wno-pointer-arith' endif + +headers = files('rte_pmd_dpaa2_qdma.h') diff --git a/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h b/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h new file mode 100644 index 00..a75cdd7e36 --- /dev/null +++ b/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h @@ -0,0 +1,96 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2021-2022 NXP + */ + +#ifndef _RTE_PMD_DPAA2_QDMA_H_ +#define _RTE_PMD_DPAA2_QDMA_H_ + +/** States if the source addresses is physical. */ +#define RTE_DPAA2_QDMA_JOB_SRC_PHY (1ULL << 30) + +/** States if the destination addresses is physical. */ +#define RTE_DPAA2_QDMA_JOB_DEST_PHY(1ULL << 31) + +struct rte_dpaa2_qdma_rbp { + uint32_t use_ultrashort:1; + uint32_t enable:1; + /** +* dportid: +* PCI-Express 1 +* 0001 PCI-Express 2 +* 0010 PCI-Express 3 +* 0011 PCI-Express 4
[PATCH v2 5/6] dma/dpaa2: support DMA operations
From: Nipun Gupta This patch support copy, submit, completed and completed status functionality of DMA driver. Signed-off-by: Nipun Gupta --- drivers/dma/dpaa2/dpaa2_qdma.c | 1173 drivers/dma/dpaa2/dpaa2_qdma.h | 71 +- drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h | 77 ++ drivers/dma/dpaa2/version.map |2 + 4 files changed, 1258 insertions(+), 65 deletions(-) diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c index 54db806736..f1f92b5465 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.c +++ b/drivers/dma/dpaa2/dpaa2_qdma.c @@ -13,12 +13,1102 @@ #include "rte_pmd_dpaa2_qdma.h" #include "dpaa2_qdma.h" #include "dpaa2_qdma_logs.h" + +#define DPAA2_QDMA_PREFETCH "prefetch" + /* Dynamic log type identifier */ int dpaa2_qdma_logtype; uint32_t dpaa2_coherent_no_alloc_cache; uint32_t dpaa2_coherent_alloc_cache; +static inline int +qdma_populate_fd_pci(phys_addr_t src, phys_addr_t dest, +uint32_t len, struct qbman_fd *fd, +struct rte_dpaa2_qdma_rbp *rbp, int ser) +{ + fd->simple_pci.saddr_lo = lower_32_bits((uint64_t) (src)); + fd->simple_pci.saddr_hi = upper_32_bits((uint64_t) (src)); + + fd->simple_pci.len_sl = len; + + fd->simple_pci.bmt = 1; + fd->simple_pci.fmt = 3; + fd->simple_pci.sl = 1; + fd->simple_pci.ser = ser; + + fd->simple_pci.sportid = rbp->sportid; /*pcie 3 */ + fd->simple_pci.srbp = rbp->srbp; + if (rbp->srbp) + fd->simple_pci.rdttype = 0; + else + fd->simple_pci.rdttype = dpaa2_coherent_alloc_cache; + + /*dest is pcie memory */ + fd->simple_pci.dportid = rbp->dportid; /*pcie 3 */ + fd->simple_pci.drbp = rbp->drbp; + if (rbp->drbp) + fd->simple_pci.wrttype = 0; + else + fd->simple_pci.wrttype = dpaa2_coherent_no_alloc_cache; + + fd->simple_pci.daddr_lo = lower_32_bits((uint64_t) (dest)); + fd->simple_pci.daddr_hi = upper_32_bits((uint64_t) (dest)); + + return 0; +} + +static inline int +qdma_populate_fd_ddr(phys_addr_t src, phys_addr_t dest, +uint32_t len, struct qbman_fd *fd, int ser) +{ + fd->simple_ddr.saddr_lo = lower_32_bits((uint64_t) (src)); + fd->simple_ddr.saddr_hi = upper_32_bits((uint64_t) (src)); + + fd->simple_ddr.len = len; + + fd->simple_ddr.bmt = 1; + fd->simple_ddr.fmt = 3; + fd->simple_ddr.sl = 1; + fd->simple_ddr.ser = ser; + /** +* src If RBP=0 {NS,RDTTYPE[3:0]}: 0_1011 +* Coherent copy of cacheable memory, + * lookup in downstream cache, no allocate +* on miss +*/ + fd->simple_ddr.rns = 0; + fd->simple_ddr.rdttype = dpaa2_coherent_alloc_cache; + /** +* dest If RBP=0 {NS,WRTTYPE[3:0]}: 0_0111 +* Coherent write of cacheable memory, +* lookup in downstream cache, no allocate on miss +*/ + fd->simple_ddr.wns = 0; + fd->simple_ddr.wrttype = dpaa2_coherent_no_alloc_cache; + + fd->simple_ddr.daddr_lo = lower_32_bits((uint64_t) (dest)); + fd->simple_ddr.daddr_hi = upper_32_bits((uint64_t) (dest)); + + return 0; +} + +static void +dpaa2_qdma_populate_fle(struct qbman_fle *fle, + uint64_t fle_iova, + struct rte_dpaa2_qdma_rbp *rbp, + uint64_t src, uint64_t dest, + size_t len, uint32_t flags, uint32_t fmt) +{ + struct qdma_sdd *sdd; + uint64_t sdd_iova; + + sdd = (struct qdma_sdd *) + ((uintptr_t)(uint64_t)fle - QDMA_FLE_FLE_OFFSET + + QDMA_FLE_SDD_OFFSET); + sdd_iova = fle_iova - QDMA_FLE_FLE_OFFSET + QDMA_FLE_SDD_OFFSET; + + /* first frame list to source descriptor */ + DPAA2_SET_FLE_ADDR(fle, sdd_iova); + DPAA2_SET_FLE_LEN(fle, (2 * (sizeof(struct qdma_sdd; + + /* source and destination descriptor */ + if (rbp && rbp->enable) { + /* source */ + sdd->read_cmd.portid = rbp->sportid; + sdd->rbpcmd_simple.pfid = rbp->spfid; + sdd->rbpcmd_simple.vfid = rbp->svfid; + + if (rbp->srbp) { + sdd->read_cmd.rbp = rbp->srbp; + sdd->read_cmd.rdtype = DPAA2_RBP_MEM_RW; + } else { + sdd->read_cmd.rdtype = dpaa2_coherent_no_alloc_cache; + } + sdd++; + /* destination */ + sdd->write_cmd.portid = rbp->dportid; + sdd->rbpcmd_simple.pfid = rbp->dpfid; + sdd->rbpcmd_simple.vfid = rbp->dvfid;
[PATCH v2 6/6] dma/dpaa2: support statistics
From: Nipun Gupta This patch support DMA read and reset statistics operations. Signed-off-by: Nipun Gupta --- drivers/dma/dpaa2/dpaa2_qdma.c | 34 ++ 1 file changed, 34 insertions(+) diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c index f1f92b5465..a93a60565d 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.c +++ b/drivers/dma/dpaa2/dpaa2_qdma.c @@ -1427,6 +1427,38 @@ dpaa2_qdma_close(__rte_unused struct rte_dma_dev *dev) return 0; } +static int +dpaa2_qdma_stats_get(const struct rte_dma_dev *dmadev, uint16_t vchan, + struct rte_dma_stats *rte_stats, uint32_t size) +{ + struct dpaa2_dpdmai_dev *dpdmai_dev = dmadev->data->dev_private; + struct qdma_device *qdma_dev = dpdmai_dev->qdma_dev; + struct qdma_virt_queue *qdma_vq = &qdma_dev->vqs[vchan]; + struct rte_dma_stats *stats = &qdma_vq->stats; + + RTE_SET_USED(size); + + /* TODO - directly use stats */ + stats->submitted = qdma_vq->num_enqueues; + stats->completed = qdma_vq->num_dequeues; + *rte_stats = *stats; + + return 0; +} + +static int +dpaa2_qdma_stats_reset(struct rte_dma_dev *dmadev, uint16_t vchan) +{ + struct dpaa2_dpdmai_dev *dpdmai_dev = dmadev->data->dev_private; + struct qdma_device *qdma_dev = dpdmai_dev->qdma_dev; + struct qdma_virt_queue *qdma_vq = &qdma_dev->vqs[vchan]; + + qdma_vq->num_enqueues = 0; + qdma_vq->num_dequeues = 0; + + return 0; +} + static uint16_t dpaa2_qdma_burst_capacity(const void *dev_private, uint16_t vchan) { @@ -1444,6 +1476,8 @@ static struct rte_dma_dev_ops dpaa2_qdma_ops = { .dev_stop = dpaa2_qdma_stop, .dev_close= dpaa2_qdma_close, .vchan_setup = dpaa2_qdma_vchan_setup, + .stats_get= dpaa2_qdma_stats_get, + .stats_reset = dpaa2_qdma_stats_reset, }; static int -- 2.17.1
[PATCH v3 0/6] move DPAA2 QDMA driver freom raw to dma
From: Nipun Gupta This change removes the DPAA2 QDMA raw driver and adds the QDMA driver in dma set of drivers. The underlying I/O framework remains intact, whereas the configuration part is done as per the DMA API support. Changes in v2: - Fix checkpath errors - Fix documentation compilation Changes in v3: - Add the missing doc/dmadevs/dpaa2.rst file Nipun Gupta (6): raw/dpaa2_qdma: remove dpaa2 QDMA driver from raw dma/dpaa2: introduce DPAA2 DMA driver skeleton dma/dpaa2: support basic operations dma/dpaa2: add PMD apis for additional configuration dma/dpaa2: support DMA operations dma/dpaa2: support statistics MAINTAINERS | 11 +- doc/api/doxy-api.conf.in |2 +- .../dpaa2_qdma.rst => dmadevs/dpaa2.rst} | 17 +- doc/guides/dmadevs/index.rst |1 + doc/guides/platform/dpaa2.rst |4 +- doc/guides/rawdevs/index.rst |1 - drivers/bus/fslmc/rte_fslmc.h |1 + .../dpaa2_qdma => dma/dpaa2}/dpaa2_qdma.c | 1248 - .../dpaa2_qdma => dma/dpaa2}/dpaa2_qdma.h | 195 ++- .../dpaa2}/dpaa2_qdma_logs.h |2 +- drivers/dma/dpaa2/meson.build | 18 + drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h| 173 +++ drivers/dma/dpaa2/version.map | 11 + drivers/dma/meson.build |1 + drivers/raw/dpaa2_qdma/meson.build|7 - drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h | 204 --- drivers/raw/dpaa2_qdma/version.map|7 - drivers/raw/meson.build |1 - 18 files changed, 864 insertions(+), 1040 deletions(-) rename doc/guides/{rawdevs/dpaa2_qdma.rst => dmadevs/dpaa2.rst} (75%) rename drivers/{raw/dpaa2_qdma => dma/dpaa2}/dpaa2_qdma.c (57%) rename drivers/{raw/dpaa2_qdma => dma/dpaa2}/dpaa2_qdma.h (77%) rename drivers/{raw/dpaa2_qdma => dma/dpaa2}/dpaa2_qdma_logs.h (97%) create mode 100644 drivers/dma/dpaa2/meson.build create mode 100644 drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h create mode 100644 drivers/dma/dpaa2/version.map delete mode 100644 drivers/raw/dpaa2_qdma/meson.build delete mode 100644 drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h delete mode 100644 drivers/raw/dpaa2_qdma/version.map -- 2.17.1
[PATCH v3 2/6] dma/dpaa2: introduce DPAA2 DMA driver skeleton
From: Nipun Gupta The DPAA2 DMA driver is an implementation of the dmadev APIs, that provide means to initiate a DMA transaction from CPU. Earlier this was part of RAW driver, but with DMA drivers added as separate flavor of drivers, this driver is being moved to DMA drivers. Signed-off-by: Nipun Gupta --- MAINTAINERS | 6 + doc/guides/dmadevs/dpaa2.rst| 64 ++ doc/guides/dmadevs/index.rst| 1 + doc/guides/platform/dpaa2.rst | 4 + drivers/bus/fslmc/rte_fslmc.h | 1 + drivers/dma/dpaa2/dpaa2_qdma.c | 275 drivers/dma/dpaa2/dpaa2_qdma.h | 316 drivers/dma/dpaa2/dpaa2_qdma_logs.h | 46 drivers/dma/dpaa2/meson.build | 16 ++ drivers/dma/dpaa2/version.map | 3 + drivers/dma/meson.build | 1 + 11 files changed, 733 insertions(+) create mode 100644 doc/guides/dmadevs/dpaa2.rst create mode 100644 drivers/dma/dpaa2/dpaa2_qdma.c create mode 100644 drivers/dma/dpaa2/dpaa2_qdma.h create mode 100644 drivers/dma/dpaa2/dpaa2_qdma_logs.h create mode 100644 drivers/dma/dpaa2/meson.build create mode 100644 drivers/dma/dpaa2/version.map diff --git a/MAINTAINERS b/MAINTAINERS index e67215f490..432ca49fb3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1198,6 +1198,12 @@ M: Nipun Gupta F: drivers/dma/dpaa/ F: doc/guides/dmadevs/dpaa.rst +NXP DPAA2 QDMA +M: Nipun Gupta +M: Hemant Agrawal +F: drivers/dma/dpaa2_qdma/ +F: doc/guides/dmadevs/dpaa2_qdma.rst + RegEx Drivers - diff --git a/doc/guides/dmadevs/dpaa2.rst b/doc/guides/dmadevs/dpaa2.rst new file mode 100644 index 00..84e0db10d6 --- /dev/null +++ b/doc/guides/dmadevs/dpaa2.rst @@ -0,0 +1,64 @@ +.. SPDX-License-Identifier: BSD-3-Clause +Copyright 2018-2022 NXP + +NXP DPAA2 QDMA Driver += + +The DPAA2 QDMA is an implementation of the dmadev API, that provide means +to initiate a DMA transaction from CPU. The initiated DMA is performed +without CPU being involved in the actual DMA transaction. This is achieved +via using the DPDMAI device exposed by MC. + +More information can be found at `NXP Official Website +<http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/qoriq-arm-processors:QORIQ-ARM>`_. + +Supported DPAA2 SoCs + + +- LX2160A +- LS2084A/LS2044A +- LS2088A/LS2048A +- LS1088A/LS1048A + +Prerequisites +- + +See :doc:`../platform/dpaa2` for setup information + +- Follow the DPDK :ref:`Getting Started Guide for Linux ` to setup the basic DPDK environment. + +.. note:: + + Some part of fslmc bus code (mc flib - object library) routines are + dual licensed (BSD & GPLv2). + + +Enabling logs +- + +For enabling logs, use the following EAL parameter: + +.. code-block:: console + + ./your_qdma_application --log-level=pmd.dma.dpaa2.qdma, + +Using ``pmd.dma.dpaa2.qdma`` as log matching criteria, all Event PMD logs can be +enabled which are lower than logging ``level``. + + +Initialization +-- + +The DPAA2 QDMA is exposed as a dma device which consists of dpdmai devices. +On EAL initialization, dpdmai devices will be probed and populated into the +dmadevices. The dmadev ID of the device can be obtained using + +* Invoking ``rte_dma_get_dev_id_by_name("dpdmai.x")`` from the application + where x is the object ID of the DPDMAI object created by MC. Use can + use this index for further rawdev function calls. + +Platform Requirement + + +DPAA2 drivers for DPDK can only work on NXP SoCs as listed in the +``Supported DPAA2 SoCs``. diff --git a/doc/guides/dmadevs/index.rst b/doc/guides/dmadevs/index.rst index 6b6406f590..5bd25b32b9 100644 --- a/doc/guides/dmadevs/index.rst +++ b/doc/guides/dmadevs/index.rst @@ -13,6 +13,7 @@ an application through DMA API. cnxk dpaa + dpaa2 hisilicon idxd ioat diff --git a/doc/guides/platform/dpaa2.rst b/doc/guides/platform/dpaa2.rst index 9c8a1e8b0c..a9fcad6ca2 100644 --- a/doc/guides/platform/dpaa2.rst +++ b/doc/guides/platform/dpaa2.rst @@ -40,6 +40,10 @@ Common Offload HW Block Drivers See :doc:`../rawdevs/dpaa2_cmdif` for NXP dpaa2 AIOP command interface driver information. +5. **DMA Driver** + + See :doc:`../dmadevs/dpaa2` for NXP dpaa2 QDMA driver information. + Steps To Setup Platform --- diff --git a/drivers/bus/fslmc/rte_fslmc.h b/drivers/bus/fslmc/rte_fslmc.h index 12b586b13b..8c67bfba55 100644 --- a/drivers/bus/fslmc/rte_fslmc.h +++ b/drivers/bus/fslmc/rte_fslmc.h @@ -123,6 +123,7 @@ struct rte_dpaa2_device { union { struct rte_eth_dev *eth_dev;/**< ethernet device */ struct rte_cryptodev *cryptodev;/**< Crypto Device */ + struct rte_dma_dev *dmadev; /**< DMA Device */ struct rte_rawdev *rawdev; /**< Raw D
[PATCH v3 1/6] raw/dpaa2_qdma: remove dpaa2 QDMA driver from raw
From: Nipun Gupta With DMA devices supported as a separate flavor of devices, the DPAA2 QDMA driver is moved in the DMA devices. This change removes the DPAA2 QDMA driver from raw devices. Signed-off-by: Nipun Gupta --- MAINTAINERS |5 - doc/api/doxy-api-index.md |1 - doc/api/doxy-api.conf.in|1 - doc/guides/platform/dpaa2.rst |4 - doc/guides/rawdevs/dpaa2_qdma.rst | 74 - doc/guides/rawdevs/index.rst|1 - drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 1834 --- drivers/raw/dpaa2_qdma/dpaa2_qdma.h | 288 --- drivers/raw/dpaa2_qdma/dpaa2_qdma_logs.h| 46 - drivers/raw/dpaa2_qdma/meson.build |7 - drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h | 204 --- drivers/raw/dpaa2_qdma/version.map |7 - drivers/raw/meson.build |1 - 13 files changed, 2473 deletions(-) delete mode 100644 doc/guides/rawdevs/dpaa2_qdma.rst delete mode 100644 drivers/raw/dpaa2_qdma/dpaa2_qdma.c delete mode 100644 drivers/raw/dpaa2_qdma/dpaa2_qdma.h delete mode 100644 drivers/raw/dpaa2_qdma/dpaa2_qdma_logs.h delete mode 100644 drivers/raw/dpaa2_qdma/meson.build delete mode 100644 drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h delete mode 100644 drivers/raw/dpaa2_qdma/version.map diff --git a/MAINTAINERS b/MAINTAINERS index 7c4f541dba..e67215f490 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1379,11 +1379,6 @@ M: Nipun Gupta F: drivers/raw/dpaa2_cmdif/ F: doc/guides/rawdevs/dpaa2_cmdif.rst -NXP DPAA2 QDMA -M: Nipun Gupta -F: drivers/raw/dpaa2_qdma/ -F: doc/guides/rawdevs/dpaa2_qdma.rst - Packet processing - diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md index 4245b9635c..6c1ca981bc 100644 --- a/doc/api/doxy-api-index.md +++ b/doc/api/doxy-api-index.md @@ -53,7 +53,6 @@ The public API headers are grouped by topics: [mlx5] (@ref rte_pmd_mlx5.h), [dpaa2_mempool] (@ref rte_dpaa2_mempool.h), [dpaa2_cmdif](@ref rte_pmd_dpaa2_cmdif.h), - [dpaa2_qdma] (@ref rte_pmd_dpaa2_qdma.h), [crypto_scheduler] (@ref rte_cryptodev_scheduler.h), [dlb2] (@ref rte_pmd_dlb2.h), [ifpga] (@ref rte_pmd_ifpga.h) diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in index db2ca9b6ed..a73aac2410 100644 --- a/doc/api/doxy-api.conf.in +++ b/doc/api/doxy-api.conf.in @@ -21,7 +21,6 @@ INPUT = @TOPDIR@/doc/api/doxy-api-index.md \ @TOPDIR@/drivers/net/mlx5 \ @TOPDIR@/drivers/net/softnic \ @TOPDIR@/drivers/raw/dpaa2_cmdif \ - @TOPDIR@/drivers/raw/dpaa2_qdma \ @TOPDIR@/drivers/raw/ifpga \ @TOPDIR@/drivers/raw/ioat \ @TOPDIR@/lib/eal/include \ diff --git a/doc/guides/platform/dpaa2.rst b/doc/guides/platform/dpaa2.rst index f1526bd30e..9c8a1e8b0c 100644 --- a/doc/guides/platform/dpaa2.rst +++ b/doc/guides/platform/dpaa2.rst @@ -40,10 +40,6 @@ Common Offload HW Block Drivers See :doc:`../rawdevs/dpaa2_cmdif` for NXP dpaa2 AIOP command interface driver information. -5. **Rawdev QDMA Driver** - - See :doc:`../rawdevs/dpaa2_qdma` for NXP dpaa2 QDMA driver information. - Steps To Setup Platform --- diff --git a/doc/guides/rawdevs/dpaa2_qdma.rst b/doc/guides/rawdevs/dpaa2_qdma.rst deleted file mode 100644 index 1b619ea1e1..00 --- a/doc/guides/rawdevs/dpaa2_qdma.rst +++ /dev/null @@ -1,74 +0,0 @@ -.. SPDX-License-Identifier: BSD-3-Clause -Copyright 2018 NXP - -NXP DPAA2 QDMA Driver -= - -The DPAA2 QDMA is an implementation of the rawdev API, that provide means -to initiate a DMA transaction from CPU. The initiated DMA is performed -without CPU being involved in the actual DMA transaction. This is achieved -via using the DPDMAI device exposed by MC. - -More information can be found at `NXP Official Website -<http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/qoriq-arm-processors:QORIQ-ARM>`_. - -Features - - -The DPAA2 QDMA implements following features in the rawdev API; - -- Supports issuing DMA of data within memory without hogging CPU while - performing DMA operation. -- Supports configuring to optionally get status of the DMA translation on - per DMA operation basis. - -Supported DPAA2 SoCs - - -- LX2160A -- LS2084A/LS2044A -- LS2088A/LS2048A -- LS1088A/LS1048A - -Prerequisites -- - -See :doc:`../platform/dpaa2` for setup information - -- Follow the DPDK :ref:`Getting Started Guide for Linux ` to setup the basic DPDK environment. - -.. note:: - - Some part of fslmc bus code (mc flib - object library) routines are - dual licensed (BSD & GPLv2). - - -Enabling logs ---
[PATCH v3 3/6] dma/dpaa2: support basic operations
From: Nipun Gupta This patch support basic DMA operations which includes device capability and channel setup. Signed-off-by: Nipun Gupta --- drivers/dma/dpaa2/dpaa2_qdma.c | 182 + 1 file changed, 182 insertions(+) diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c index 9fa48ddfa4..785d8aea7b 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.c +++ b/drivers/dma/dpaa2/dpaa2_qdma.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "dpaa2_qdma.h" #include "dpaa2_qdma_logs.h" @@ -15,6 +16,171 @@ int dpaa2_qdma_logtype; uint32_t dpaa2_coherent_no_alloc_cache; uint32_t dpaa2_coherent_alloc_cache; +static int +dpaa2_qdma_info_get(const struct rte_dma_dev *dev, + struct rte_dma_info *dev_info, + uint32_t info_sz) +{ + RTE_SET_USED(dev); + RTE_SET_USED(info_sz); + + dev_info->dev_capa = RTE_DMA_CAPA_MEM_TO_MEM | +RTE_DMA_CAPA_MEM_TO_DEV | +RTE_DMA_CAPA_DEV_TO_DEV | +RTE_DMA_CAPA_DEV_TO_MEM | +RTE_DMA_CAPA_SILENT | +RTE_DMA_CAPA_OPS_COPY; + dev_info->max_vchans = DPAA2_QDMA_MAX_VHANS; + dev_info->max_desc = DPAA2_QDMA_MAX_DESC; + dev_info->min_desc = DPAA2_QDMA_MIN_DESC; + + return 0; +} + +static int +dpaa2_qdma_configure(struct rte_dma_dev *dev, +const struct rte_dma_conf *dev_conf, +uint32_t conf_sz) +{ + char name[32]; /* RTE_MEMZONE_NAMESIZE = 32 */ + struct dpaa2_dpdmai_dev *dpdmai_dev = dev->data->dev_private; + struct qdma_device *qdma_dev = dpdmai_dev->qdma_dev; + + DPAA2_QDMA_FUNC_TRACE(); + + RTE_SET_USED(conf_sz); + + /* In case QDMA device is not in stopped state, return -EBUSY */ + if (qdma_dev->state == 1) { + DPAA2_QDMA_ERR( + "Device is in running state. Stop before config."); + return -1; + } + + /* Allocate Virtual Queues */ + sprintf(name, "qdma_%d_vq", dev->data->dev_id); + qdma_dev->vqs = rte_malloc(name, + (sizeof(struct qdma_virt_queue) * dev_conf->nb_vchans), + RTE_CACHE_LINE_SIZE); + if (!qdma_dev->vqs) { + DPAA2_QDMA_ERR("qdma_virtual_queues allocation failed"); + return -ENOMEM; + } + qdma_dev->num_vqs = dev_conf->nb_vchans; + + return 0; +} + +static int +dpaa2_qdma_vchan_setup(struct rte_dma_dev *dev, uint16_t vchan, + const struct rte_dma_vchan_conf *conf, + uint32_t conf_sz) +{ + struct dpaa2_dpdmai_dev *dpdmai_dev = dev->data->dev_private; + struct qdma_device *qdma_dev = dpdmai_dev->qdma_dev; + uint32_t pool_size; + char ring_name[32]; + char pool_name[64]; + int fd_long_format = 1; + int sg_enable = 0; + + DPAA2_QDMA_FUNC_TRACE(); + + RTE_SET_USED(conf_sz); + + if (qdma_dev->vqs[vchan].flags & DPAA2_QDMA_VQ_FD_SG_FORMAT) + sg_enable = 1; + + if (qdma_dev->vqs[vchan].flags & DPAA2_QDMA_VQ_FD_SHORT_FORMAT) + fd_long_format = 0; + + if (dev->data->dev_conf.enable_silent) + qdma_dev->vqs[vchan].flags |= DPAA2_QDMA_VQ_NO_RESPONSE; + + if (sg_enable) { + if (qdma_dev->num_vqs != 1) { + DPAA2_QDMA_ERR( + "qDMA SG format only supports physical queue!"); + return -ENODEV; + } + if (!fd_long_format) { + DPAA2_QDMA_ERR( + "qDMA SG format only supports long FD format!"); + return -ENODEV; + } + pool_size = QDMA_FLE_SG_POOL_SIZE; + } else { + pool_size = QDMA_FLE_SINGLE_POOL_SIZE; + } + + if (qdma_dev->num_vqs == 1) + qdma_dev->vqs[vchan].exclusive_hw_queue = 1; + else { + /* Allocate a Ring for Virtual Queue in VQ mode */ + snprintf(ring_name, sizeof(ring_name), "status ring %d %d", +dev->data->dev_id, vchan); + qdma_dev->vqs[vchan].status_ring = rte_ring_create(ring_name, + conf->nb_desc, rte_socket_id(), 0); + if (!qdma_dev->vqs[vchan].status_ring) { + DPAA2_QDMA_ERR("Status ring creation failed for vq"); + return rte_errno; + } + } + + snprintf(pool_name, sizeof(pool_name), + "qdma_fle_pool_dev%d_qid%d", dpdmai_dev-
[PATCH v3 4/6] dma/dpaa2: add PMD apis for additional configuration
From: Nipun Gupta Add additional PMD APIs for DPAA2 QDMA driver for configuring RBP, Ultra Short format, and Scatter Gather support Signed-off-by: Nipun Gupta --- doc/api/doxy-api-index.md | 1 + doc/api/doxy-api.conf.in | 1 + drivers/dma/dpaa2/dpaa2_qdma.c | 38 ++ drivers/dma/dpaa2/meson.build | 2 + drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h | 96 ++ drivers/dma/dpaa2/version.map | 6 ++ 6 files changed, 144 insertions(+) create mode 100644 drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md index 6c1ca981bc..4245b9635c 100644 --- a/doc/api/doxy-api-index.md +++ b/doc/api/doxy-api-index.md @@ -53,6 +53,7 @@ The public API headers are grouped by topics: [mlx5] (@ref rte_pmd_mlx5.h), [dpaa2_mempool] (@ref rte_dpaa2_mempool.h), [dpaa2_cmdif](@ref rte_pmd_dpaa2_cmdif.h), + [dpaa2_qdma] (@ref rte_pmd_dpaa2_qdma.h), [crypto_scheduler] (@ref rte_cryptodev_scheduler.h), [dlb2] (@ref rte_pmd_dlb2.h), [ifpga] (@ref rte_pmd_ifpga.h) diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in index a73aac2410..93425e38eb 100644 --- a/doc/api/doxy-api.conf.in +++ b/doc/api/doxy-api.conf.in @@ -7,6 +7,7 @@ USE_MDFILE_AS_MAINPAGE = @TOPDIR@/doc/api/doxy-api-index.md INPUT = @TOPDIR@/doc/api/doxy-api-index.md \ @TOPDIR@/drivers/bus/vdev \ @TOPDIR@/drivers/crypto/scheduler \ + @TOPDIR@/drivers/dma/dpaa2 \ @TOPDIR@/drivers/event/dlb2 \ @TOPDIR@/drivers/mempool/dpaa2 \ @TOPDIR@/drivers/net/ark \ diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c index 785d8aea7b..54db806736 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.c +++ b/drivers/dma/dpaa2/dpaa2_qdma.c @@ -7,7 +7,10 @@ #include #include #include + #include + +#include "rte_pmd_dpaa2_qdma.h" #include "dpaa2_qdma.h" #include "dpaa2_qdma_logs.h" /* Dynamic log type identifier */ @@ -71,6 +74,41 @@ dpaa2_qdma_configure(struct rte_dma_dev *dev, return 0; } +/* Enable FD in Ultra Short format */ +void +rte_dpaa2_qdma_vchan_fd_us_enable(int16_t dev_id, uint16_t vchan) +{ + struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id]; + struct dpaa2_dpdmai_dev *dpdmai_dev = obj->dev_private; + struct qdma_device *qdma_dev = dpdmai_dev->qdma_dev; + + qdma_dev->vqs[vchan].flags |= DPAA2_QDMA_VQ_FD_SHORT_FORMAT; +} + +/* Enable internal SG processing */ +void +rte_dpaa2_qdma_vchan_internal_sg_enable(int16_t dev_id, uint16_t vchan) +{ + struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id]; + struct dpaa2_dpdmai_dev *dpdmai_dev = obj->dev_private; + struct qdma_device *qdma_dev = dpdmai_dev->qdma_dev; + + qdma_dev->vqs[vchan].flags |= DPAA2_QDMA_VQ_FD_SG_FORMAT; +} + +/* Enable RBP */ +void +rte_dpaa2_qdma_vchan_rbp_enable(int16_t dev_id, uint16_t vchan, + struct rte_dpaa2_qdma_rbp *rbp_config) +{ + struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id]; + struct dpaa2_dpdmai_dev *dpdmai_dev = obj->dev_private; + struct qdma_device *qdma_dev = dpdmai_dev->qdma_dev; + + memcpy(&qdma_dev->vqs[vchan].rbp, rbp_config, + sizeof(struct rte_dpaa2_qdma_rbp)); +} + static int dpaa2_qdma_vchan_setup(struct rte_dma_dev *dev, uint16_t vchan, const struct rte_dma_vchan_conf *conf, diff --git a/drivers/dma/dpaa2/meson.build b/drivers/dma/dpaa2/meson.build index 2b82563e85..a99151e2a5 100644 --- a/drivers/dma/dpaa2/meson.build +++ b/drivers/dma/dpaa2/meson.build @@ -14,3 +14,5 @@ sources = files('dpaa2_qdma.c') if cc.has_argument('-Wno-pointer-arith') cflags += '-Wno-pointer-arith' endif + +headers = files('rte_pmd_dpaa2_qdma.h') diff --git a/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h b/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h new file mode 100644 index 00..a75cdd7e36 --- /dev/null +++ b/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h @@ -0,0 +1,96 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2021-2022 NXP + */ + +#ifndef _RTE_PMD_DPAA2_QDMA_H_ +#define _RTE_PMD_DPAA2_QDMA_H_ + +/** States if the source addresses is physical. */ +#define RTE_DPAA2_QDMA_JOB_SRC_PHY (1ULL << 30) + +/** States if the destination addresses is physical. */ +#define RTE_DPAA2_QDMA_JOB_DEST_PHY(1ULL << 31) + +struct rte_dpaa2_qdma_rbp { + uint32_t use_ultrashort:1; + uint32_t enable:1; + /** +* dportid: +* PCI-Express 1 +* 0001 PCI-Express 2 +* 0010 PCI-Express 3 +* 0011 PCI-Express 4
[PATCH v3 5/6] dma/dpaa2: support DMA operations
From: Nipun Gupta This patch support copy, submit, completed and completed status functionality of DMA driver. Signed-off-by: Nipun Gupta --- doc/guides/dmadevs/dpaa2.rst | 10 + drivers/dma/dpaa2/dpaa2_qdma.c | 1173 drivers/dma/dpaa2/dpaa2_qdma.h | 71 +- drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h | 77 ++ drivers/dma/dpaa2/version.map |2 + 5 files changed, 1268 insertions(+), 65 deletions(-) diff --git a/doc/guides/dmadevs/dpaa2.rst b/doc/guides/dmadevs/dpaa2.rst index 84e0db10d6..0fad9fabe0 100644 --- a/doc/guides/dmadevs/dpaa2.rst +++ b/doc/guides/dmadevs/dpaa2.rst @@ -12,6 +12,16 @@ via using the DPDMAI device exposed by MC. More information can be found at `NXP Official Website <http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/qoriq-arm-processors:QORIQ-ARM>`_. +Features + + +The DPAA2 QDMA implements following features in the dmadev API; + +- Supports issuing DMA of data within memory without hogging CPU while + performing DMA operation. +- Supports configuring to optionally get status of the DMA translation on + per DMA operation basis. + Supported DPAA2 SoCs diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c index 54db806736..f1f92b5465 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.c +++ b/drivers/dma/dpaa2/dpaa2_qdma.c @@ -13,12 +13,1102 @@ #include "rte_pmd_dpaa2_qdma.h" #include "dpaa2_qdma.h" #include "dpaa2_qdma_logs.h" + +#define DPAA2_QDMA_PREFETCH "prefetch" + /* Dynamic log type identifier */ int dpaa2_qdma_logtype; uint32_t dpaa2_coherent_no_alloc_cache; uint32_t dpaa2_coherent_alloc_cache; +static inline int +qdma_populate_fd_pci(phys_addr_t src, phys_addr_t dest, +uint32_t len, struct qbman_fd *fd, +struct rte_dpaa2_qdma_rbp *rbp, int ser) +{ + fd->simple_pci.saddr_lo = lower_32_bits((uint64_t) (src)); + fd->simple_pci.saddr_hi = upper_32_bits((uint64_t) (src)); + + fd->simple_pci.len_sl = len; + + fd->simple_pci.bmt = 1; + fd->simple_pci.fmt = 3; + fd->simple_pci.sl = 1; + fd->simple_pci.ser = ser; + + fd->simple_pci.sportid = rbp->sportid; /*pcie 3 */ + fd->simple_pci.srbp = rbp->srbp; + if (rbp->srbp) + fd->simple_pci.rdttype = 0; + else + fd->simple_pci.rdttype = dpaa2_coherent_alloc_cache; + + /*dest is pcie memory */ + fd->simple_pci.dportid = rbp->dportid; /*pcie 3 */ + fd->simple_pci.drbp = rbp->drbp; + if (rbp->drbp) + fd->simple_pci.wrttype = 0; + else + fd->simple_pci.wrttype = dpaa2_coherent_no_alloc_cache; + + fd->simple_pci.daddr_lo = lower_32_bits((uint64_t) (dest)); + fd->simple_pci.daddr_hi = upper_32_bits((uint64_t) (dest)); + + return 0; +} + +static inline int +qdma_populate_fd_ddr(phys_addr_t src, phys_addr_t dest, +uint32_t len, struct qbman_fd *fd, int ser) +{ + fd->simple_ddr.saddr_lo = lower_32_bits((uint64_t) (src)); + fd->simple_ddr.saddr_hi = upper_32_bits((uint64_t) (src)); + + fd->simple_ddr.len = len; + + fd->simple_ddr.bmt = 1; + fd->simple_ddr.fmt = 3; + fd->simple_ddr.sl = 1; + fd->simple_ddr.ser = ser; + /** +* src If RBP=0 {NS,RDTTYPE[3:0]}: 0_1011 +* Coherent copy of cacheable memory, + * lookup in downstream cache, no allocate +* on miss +*/ + fd->simple_ddr.rns = 0; + fd->simple_ddr.rdttype = dpaa2_coherent_alloc_cache; + /** +* dest If RBP=0 {NS,WRTTYPE[3:0]}: 0_0111 +* Coherent write of cacheable memory, +* lookup in downstream cache, no allocate on miss +*/ + fd->simple_ddr.wns = 0; + fd->simple_ddr.wrttype = dpaa2_coherent_no_alloc_cache; + + fd->simple_ddr.daddr_lo = lower_32_bits((uint64_t) (dest)); + fd->simple_ddr.daddr_hi = upper_32_bits((uint64_t) (dest)); + + return 0; +} + +static void +dpaa2_qdma_populate_fle(struct qbman_fle *fle, + uint64_t fle_iova, + struct rte_dpaa2_qdma_rbp *rbp, + uint64_t src, uint64_t dest, + size_t len, uint32_t flags, uint32_t fmt) +{ + struct qdma_sdd *sdd; + uint64_t sdd_iova; + + sdd = (struct qdma_sdd *) + ((uintptr_t)(uint64_t)fle - QDMA_FLE_FLE_OFFSET + + QDMA_FLE_SDD_OFFSET); + sdd_iova = fle_iova - QDMA_FLE_FLE_OFFSET + QDMA_FLE_SDD_OFFSET; + + /* first frame list to source descriptor */ + DPAA2_SET_FLE_ADDR(fle, sdd_iova); + DPAA2_SET_FLE_LEN(fle, (2 * (sizeof(struct qdma_sdd; + + /* source and destina
[PATCH v3 6/6] dma/dpaa2: support statistics
From: Nipun Gupta This patch support DMA read and reset statistics operations. Signed-off-by: Nipun Gupta --- doc/guides/dmadevs/dpaa2.rst | 1 + drivers/dma/dpaa2/dpaa2_qdma.c | 34 ++ 2 files changed, 35 insertions(+) diff --git a/doc/guides/dmadevs/dpaa2.rst b/doc/guides/dmadevs/dpaa2.rst index 0fad9fabe0..d2c26231e2 100644 --- a/doc/guides/dmadevs/dpaa2.rst +++ b/doc/guides/dmadevs/dpaa2.rst @@ -21,6 +21,7 @@ The DPAA2 QDMA implements following features in the dmadev API; performing DMA operation. - Supports configuring to optionally get status of the DMA translation on per DMA operation basis. +- Supports statistics. Supported DPAA2 SoCs diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c index f1f92b5465..a93a60565d 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.c +++ b/drivers/dma/dpaa2/dpaa2_qdma.c @@ -1427,6 +1427,38 @@ dpaa2_qdma_close(__rte_unused struct rte_dma_dev *dev) return 0; } +static int +dpaa2_qdma_stats_get(const struct rte_dma_dev *dmadev, uint16_t vchan, + struct rte_dma_stats *rte_stats, uint32_t size) +{ + struct dpaa2_dpdmai_dev *dpdmai_dev = dmadev->data->dev_private; + struct qdma_device *qdma_dev = dpdmai_dev->qdma_dev; + struct qdma_virt_queue *qdma_vq = &qdma_dev->vqs[vchan]; + struct rte_dma_stats *stats = &qdma_vq->stats; + + RTE_SET_USED(size); + + /* TODO - directly use stats */ + stats->submitted = qdma_vq->num_enqueues; + stats->completed = qdma_vq->num_dequeues; + *rte_stats = *stats; + + return 0; +} + +static int +dpaa2_qdma_stats_reset(struct rte_dma_dev *dmadev, uint16_t vchan) +{ + struct dpaa2_dpdmai_dev *dpdmai_dev = dmadev->data->dev_private; + struct qdma_device *qdma_dev = dpdmai_dev->qdma_dev; + struct qdma_virt_queue *qdma_vq = &qdma_dev->vqs[vchan]; + + qdma_vq->num_enqueues = 0; + qdma_vq->num_dequeues = 0; + + return 0; +} + static uint16_t dpaa2_qdma_burst_capacity(const void *dev_private, uint16_t vchan) { @@ -1444,6 +1476,8 @@ static struct rte_dma_dev_ops dpaa2_qdma_ops = { .dev_stop = dpaa2_qdma_stop, .dev_close= dpaa2_qdma_close, .vchan_setup = dpaa2_qdma_vchan_setup, + .stats_get= dpaa2_qdma_stats_get, + .stats_reset = dpaa2_qdma_stats_reset, }; static int -- 2.17.1
[PATCH] maintainers: update for nxp devices
From: Nipun Gupta Update and add maintainers for NXP devices and RAW device API Signed-off-by: Nipun Gupta --- MAINTAINERS | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index f34f6fa2e9..030100ebc7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -515,7 +515,7 @@ F: app/test/test_event_crypto_adapter.c F: doc/guides/prog_guide/event_crypto_adapter.rst Raw device API -M: Nipun Gupta +M: Sachin Saxena M: Hemant Agrawal F: lib/rawdev/ F: drivers/raw/skeleton/ @@ -1200,12 +1200,12 @@ F: doc/guides/dmadevs/cnxk.rst NXP DPAA DMA M: Gagandeep Singh -M: Nipun Gupta +M: Sachin Saxena F: drivers/dma/dpaa/ F: doc/guides/dmadevs/dpaa.rst NXP DPAA2 QDMA -M: Nipun Gupta +M: Gagandeep Singh M: Hemant Agrawal F: drivers/dma/dpaa2/ F: doc/guides/dmadevs/dpaa2.rst @@ -1278,13 +1278,13 @@ F: doc/guides/eventdevs/cnxk.rst NXP DPAA eventdev M: Hemant Agrawal -M: Nipun Gupta +M: Sachin Saxena F: drivers/event/dpaa/ F: doc/guides/eventdevs/dpaa.rst NXP DPAA2 eventdev M: Hemant Agrawal -M: Nipun Gupta +M: Sachin Saxena F: drivers/event/dpaa2/ F: doc/guides/eventdevs/dpaa2.rst @@ -1334,7 +1334,7 @@ F: doc/guides/bbdevs/null.rst F: doc/guides/bbdevs/features/null.ini NXP LA12xx -M: Nipun Gupta +M: Gagandeep Singh M: Hemant Agrawal T: git://dpdk.org/next/dpdk-next-crypto F: drivers/baseband/la12xx/ @@ -1387,7 +1387,7 @@ F: examples/ntb/ F: doc/guides/sample_app_ug/ntb.rst NXP DPAA2 CMDIF -M: Nipun Gupta +M: Gagandeep Singh F: drivers/raw/dpaa2_cmdif/ F: doc/guides/rawdevs/dpaa2_cmdif.rst -- 2.17.1
[dpdk-dev] [PATCH v5 0/9] baseband: add NXP LA12xx driver
This series introduces the BBDEV LA12xx poll mode driver (PMD) to support an implementation for offloading High Phy processing functions like LDPC Encode / Decode 5GNR wireless acceleration function, using PCI based LA12xx Software defined radio. Please check the documentation patch for more info. The driver currently implements basic feature to offload only the 5G LDPC encode/decode. A new capability has been added to check if the driver can support the input data in network byte order. Two test vectors are also added as an example with input data in network byte. v2: add test case changes v3: fix 32 bit compilation v4: capability for network byte order, doc patch merged inline. v5: add llr_size and llr_decimals, removed LLR compression flag, update testbbdev to handle endianness, rebased on top of 20.08 Hemant Agrawal (6): baseband: introduce NXP LA12xx driver baseband/la12xx: add devargs for max queues baseband/la12xx: add support for multiple modems baseband/la12xx: add queue and modem config support baseband/la12xx: add enqueue and dequeue support app/bbdev: enable la12xx for bbdev Nipun Gupta (3): bbdev: add big endian processing data capability app/bbdev: handle endianness of test data app/bbdev: add test vectors for transport blocks MAINTAINERS | 10 + app/test-bbdev/meson.build|3 + app/test-bbdev/test_bbdev_perf.c | 84 ++ app/test-bbdev/test_bbdev_vector.c|4 + app/test-bbdev/test_vectors/ldpc_dec_tb.data | 122 ++ app/test-bbdev/test_vectors/ldpc_enc_tb.data | 60 + doc/guides/bbdevs/features/default.ini|1 + doc/guides/bbdevs/features/la12xx.ini | 14 + doc/guides/bbdevs/index.rst |1 + doc/guides/bbdevs/la12xx.rst | 127 ++ doc/guides/prog_guide/bbdev.rst |6 + doc/guides/rel_notes/release_21_11.rst|5 + drivers/baseband/la12xx/bbdev_la12xx.c| 1100 + drivers/baseband/la12xx/bbdev_la12xx.h| 51 + drivers/baseband/la12xx/bbdev_la12xx_ipc.h| 244 .../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 26 + drivers/baseband/la12xx/meson.build |6 + drivers/baseband/la12xx/version.map |3 + drivers/baseband/meson.build |1 + lib/bbdev/rte_bbdev_op.h | 14 +- 20 files changed, 1880 insertions(+), 2 deletions(-) create mode 100644 app/test-bbdev/test_vectors/ldpc_dec_tb.data create mode 100644 app/test-bbdev/test_vectors/ldpc_enc_tb.data create mode 100644 doc/guides/bbdevs/features/la12xx.ini create mode 100644 doc/guides/bbdevs/la12xx.rst create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.c create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.h create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_ipc.h create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h create mode 100644 drivers/baseband/la12xx/meson.build create mode 100644 drivers/baseband/la12xx/version.map -- 2.17.1
[dpdk-dev] [PATCH v5 1/9] bbdev: add big endian processing data capability
This patch intoduces a new capability of the bbdev device to process the LDPC data in big endian order. Signed-off-by: Hemant Agrawal Signed-off-by: Nipun Gupta --- doc/guides/bbdevs/features/default.ini | 1 + doc/guides/prog_guide/bbdev.rst| 6 ++ lib/bbdev/rte_bbdev_op.h | 14 -- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/doc/guides/bbdevs/features/default.ini b/doc/guides/bbdevs/features/default.ini index 5fe267a625..ae5aacf8f7 100644 --- a/doc/guides/bbdevs/features/default.ini +++ b/doc/guides/bbdevs/features/default.ini @@ -14,3 +14,4 @@ LLR/HARQ Compression = External DDR Access= HW Accelerated = BBDEV API = +Big Endian Processing = diff --git a/doc/guides/prog_guide/bbdev.rst b/doc/guides/prog_guide/bbdev.rst index 9619280ffc..6540b514bb 100644 --- a/doc/guides/prog_guide/bbdev.rst +++ b/doc/guides/prog_guide/bbdev.rst @@ -747,6 +747,9 @@ given below. |RTE_BBDEV_LDPC_ENC_CONCATENATION| | Set if a device supports concatenation of non byte aligned output | ++ +|RTE_BBDEV_LDPC_ENC_BIG_ENDIAN | +| Set if a device supports Big Endian data processing| +++ The structure passed for each LDPC encode operation is given below, with the operation flags forming a bitmask in the ``op_flags`` field. @@ -942,6 +945,9 @@ given below. |RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK| | Set if a device supports loopback access to HARQ internal memory | ++ +|RTE_BBDEV_LDPC_DEC_BIG_ENDIAN | +| Set if a device supports Big Endian data processing| +++ The structure passed for each LDPC decode operation is given below, with the operation flags forming a bitmask in the ``op_flags`` field. diff --git a/lib/bbdev/rte_bbdev_op.h b/lib/bbdev/rte_bbdev_op.h index f946842727..9e9b5be81f 100644 --- a/lib/bbdev/rte_bbdev_op.h +++ b/lib/bbdev/rte_bbdev_op.h @@ -186,7 +186,12 @@ enum rte_bbdev_op_ldpcdec_flag_bitmasks { * for HARQ memory. If not set, it is assumed the filler bits are not * in HARQ memory and handled directly by the LDPC decoder. */ - RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL << 18) + RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL << 18), + /** Set if a device supports Big Endian data processing. +* If not set Little Endian data processing is supported by +* default. +*/ + RTE_BBDEV_LDPC_DEC_BIG_ENDIAN = (1ULL << 8) }; /** Flags for LDPC encoder operation and capability structure */ @@ -206,7 +211,12 @@ enum rte_bbdev_op_ldpcenc_flag_bitmasks { /** Set if a device supports scatter-gather functionality. */ RTE_BBDEV_LDPC_ENC_SCATTER_GATHER = (1ULL << 6), /** Set if a device supports concatenation of non byte aligned output */ - RTE_BBDEV_LDPC_ENC_CONCATENATION = (1ULL << 7) + RTE_BBDEV_LDPC_ENC_CONCATENATION = (1ULL << 7), + /** Set if a device supports Big Endian data processing +* If not set Little Endian data processing is supported by +* default. +*/ + RTE_BBDEV_LDPC_ENC_BIG_ENDIAN = (1ULL << 8) }; /** Flags for the Code Block/Transport block mode */ -- 2.17.1
[dpdk-dev] [PATCH v5 2/9] baseband: introduce NXP LA12xx driver
From: Hemant Agrawal This patch introduce the baseband device drivers for NXP's LA1200 series software defined baseband modem. Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- MAINTAINERS | 9 ++ drivers/baseband/la12xx/bbdev_la12xx.c| 109 ++ .../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 26 + drivers/baseband/la12xx/meson.build | 6 + drivers/baseband/la12xx/version.map | 3 + drivers/baseband/meson.build | 1 + 6 files changed, 154 insertions(+) create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.c create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h create mode 100644 drivers/baseband/la12xx/meson.build create mode 100644 drivers/baseband/la12xx/version.map diff --git a/MAINTAINERS b/MAINTAINERS index 266f5ac1da..a63e672c9e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1288,6 +1288,15 @@ F: drivers/event/opdl/ F: doc/guides/eventdevs/opdl.rst +Baseband Drivers + + +NXP LA12xx driver +M: Hemant Agrawal +M: Nipun Gupta +F: drivers/baseband/la12xx/ + + Rawdev Drivers -- diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c new file mode 100644 index 00..7050b17728 --- /dev/null +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -0,0 +1,109 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020-2021 NXP + */ + +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include + +#define DRIVER_NAME baseband_la12xx + +RTE_LOG_REGISTER(bbdev_la12xx_logtype, pmd.bb.la12xx, NOTICE); + +/* private data structure */ +struct bbdev_la12xx_private { + unsigned int max_nb_queues; /**< Max number of queues */ +}; +/* Create device */ +static int +la12xx_bbdev_create(struct rte_vdev_device *vdev) +{ + struct rte_bbdev *bbdev; + const char *name = rte_vdev_device_name(vdev); + + PMD_INIT_FUNC_TRACE(); + + bbdev = rte_bbdev_allocate(name); + if (bbdev == NULL) + return -ENODEV; + + bbdev->data->dev_private = rte_zmalloc(name, + sizeof(struct bbdev_la12xx_private), + RTE_CACHE_LINE_SIZE); + if (bbdev->data->dev_private == NULL) { + rte_bbdev_release(bbdev); + return -ENOMEM; + } + + bbdev->dev_ops = NULL; + bbdev->device = &vdev->device; + bbdev->data->socket_id = 0; + bbdev->intr_handle = NULL; + + /* register rx/tx burst functions for data path */ + bbdev->dequeue_enc_ops = NULL; + bbdev->dequeue_dec_ops = NULL; + bbdev->enqueue_enc_ops = NULL; + bbdev->enqueue_dec_ops = NULL; + + return 0; +} + +/* Initialise device */ +static int +la12xx_bbdev_probe(struct rte_vdev_device *vdev) +{ + const char *name; + + PMD_INIT_FUNC_TRACE(); + + if (vdev == NULL) + return -EINVAL; + + name = rte_vdev_device_name(vdev); + if (name == NULL) + return -EINVAL; + + return la12xx_bbdev_create(vdev); +} + +/* Uninitialise device */ +static int +la12xx_bbdev_remove(struct rte_vdev_device *vdev) +{ + struct rte_bbdev *bbdev; + const char *name; + + PMD_INIT_FUNC_TRACE(); + + if (vdev == NULL) + return -EINVAL; + + name = rte_vdev_device_name(vdev); + if (name == NULL) + return -EINVAL; + + bbdev = rte_bbdev_get_named_dev(name); + if (bbdev == NULL) + return -EINVAL; + + rte_free(bbdev->data->dev_private); + + return rte_bbdev_release(bbdev); +} + +static struct rte_vdev_driver bbdev_la12xx_pmd_drv = { + .probe = la12xx_bbdev_probe, + .remove = la12xx_bbdev_remove +}; + +RTE_PMD_REGISTER_VDEV(DRIVER_NAME, bbdev_la12xx_pmd_drv); diff --git a/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h new file mode 100644 index 00..9dfa1cc458 --- /dev/null +++ b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020 NXP + */ + +#ifndef _BBDEV_LA12XX_PMD_LOGS_H_ +#define _BBDEV_LA12XX_PMD_LOGS_H_ + +#define rte_bbdev_log(level, fmt, ...) \ + rte_log(RTE_LOG_ ## level, bbdev_la12xx_logtype, fmt "\n", \ + ##__VA_ARGS__) + +#ifdef RTE_LIBRTE_BBDEV_DEBUG +#define rte_bbdev_log_debug(fmt, ...) \ + rte_bbdev_log(DEBUG, "la12xx_pmd: " fmt, \ + ##__VA_ARGS__) +#else +#define rte_bbdev_log_debug(fmt, ...) +#endif + +#define PMD_INIT_FUNC_TRACE() rte_bbdev_log_debug(">>") + +/* DP Logs, toggled out at compile time if level lower than current level */ +#define rte_bbdev_dp_log(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, fmt, ## arg
[dpdk-dev] [PATCH v5 3/9] baseband/la12xx: add devargs for max queues
From: Hemant Agrawal This patch adds dev args to take max queues as input Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- drivers/baseband/la12xx/bbdev_la12xx.c | 72 +- 1 file changed, 70 insertions(+), 2 deletions(-) diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index 7050b17728..8886b35429 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -19,13 +19,72 @@ RTE_LOG_REGISTER(bbdev_la12xx_logtype, pmd.bb.la12xx, NOTICE); +/* Initialisation params structure that can be used by LA12xx BBDEV driver */ +struct bbdev_la12xx_params { + uint8_t queues_num; /*< LA12xx BBDEV queues number */ +}; + +#define LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" + +static const char * const bbdev_la12xx_valid_params[] = { + LA12XX_MAX_NB_QUEUES_ARG, +}; + /* private data structure */ struct bbdev_la12xx_private { unsigned int max_nb_queues; /**< Max number of queues */ }; +static inline int +parse_u16_arg(const char *key, const char *value, void *extra_args) +{ + uint16_t *u16 = extra_args; + + unsigned int long result; + if ((value == NULL) || (extra_args == NULL)) + return -EINVAL; + errno = 0; + result = strtoul(value, NULL, 0); + if ((result >= (1 << 16)) || (errno != 0)) { + rte_bbdev_log(ERR, "Invalid value %lu for %s", result, key); + return -ERANGE; + } + *u16 = (uint16_t)result; + return 0; +} + +/* Parse parameters used to create device */ +static int +parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, + const char *input_args) +{ + struct rte_kvargs *kvlist = NULL; + int ret = 0; + + if (params == NULL) + return -EINVAL; + if (input_args) { + kvlist = rte_kvargs_parse(input_args, + bbdev_la12xx_valid_params); + if (kvlist == NULL) + return -EFAULT; + + ret = rte_kvargs_process(kvlist, bbdev_la12xx_valid_params[0], + &parse_u16_arg, ¶ms->queues_num); + if (ret < 0) + goto exit; + + } + +exit: + if (kvlist) + rte_kvargs_free(kvlist); + return ret; +} + /* Create device */ static int -la12xx_bbdev_create(struct rte_vdev_device *vdev) +la12xx_bbdev_create(struct rte_vdev_device *vdev, + struct bbdev_la12xx_params *init_params __rte_unused) { struct rte_bbdev *bbdev; const char *name = rte_vdev_device_name(vdev); @@ -62,7 +121,11 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev) static int la12xx_bbdev_probe(struct rte_vdev_device *vdev) { + struct bbdev_la12xx_params init_params = { + 8 + }; const char *name; + const char *input_args; PMD_INIT_FUNC_TRACE(); @@ -73,7 +136,10 @@ la12xx_bbdev_probe(struct rte_vdev_device *vdev) if (name == NULL) return -EINVAL; - return la12xx_bbdev_create(vdev); + input_args = rte_vdev_device_args(vdev); + parse_bbdev_la12xx_params(&init_params, input_args); + + return la12xx_bbdev_create(vdev, &init_params); } /* Uninitialise device */ @@ -107,3 +173,5 @@ static struct rte_vdev_driver bbdev_la12xx_pmd_drv = { }; RTE_PMD_REGISTER_VDEV(DRIVER_NAME, bbdev_la12xx_pmd_drv); +RTE_PMD_REGISTER_PARAM_STRING(DRIVER_NAME, + LA12XX_MAX_NB_QUEUES_ARG"="); -- 2.17.1
[dpdk-dev] [PATCH v5 4/9] baseband/la12xx: add support for multiple modems
From: Hemant Agrawal This patch add support for multiple modems by assigning a modem id as dev args in vdev creation. Signed-off-by: Hemant Agrawal --- drivers/baseband/la12xx/bbdev_la12xx.c | 64 +++--- drivers/baseband/la12xx/bbdev_la12xx.h | 56 +++ drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 20 +++ 3 files changed, 133 insertions(+), 7 deletions(-) create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.h create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_ipc.h diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index 8886b35429..f26f3f2a08 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -14,6 +14,8 @@ #include #include +#include +#include #define DRIVER_NAME baseband_la12xx @@ -22,18 +24,18 @@ RTE_LOG_REGISTER(bbdev_la12xx_logtype, pmd.bb.la12xx, NOTICE); /* Initialisation params structure that can be used by LA12xx BBDEV driver */ struct bbdev_la12xx_params { uint8_t queues_num; /*< LA12xx BBDEV queues number */ + int8_t modem_id; /*< LA12xx modem instance id */ }; #define LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" +#define LA12XX_VDEV_MODEM_ID_ARG "modem" +#define LA12XX_MAX_MODEM 4 static const char * const bbdev_la12xx_valid_params[] = { LA12XX_MAX_NB_QUEUES_ARG, + LA12XX_VDEV_MODEM_ID_ARG, }; -/* private data structure */ -struct bbdev_la12xx_private { - unsigned int max_nb_queues; /**< Max number of queues */ -}; static inline int parse_u16_arg(const char *key, const char *value, void *extra_args) { @@ -52,6 +54,28 @@ parse_u16_arg(const char *key, const char *value, void *extra_args) return 0; } +/* Parse integer from integer argument */ +static int +parse_integer_arg(const char *key __rte_unused, + const char *value, void *extra_args) +{ + int i; + char *end; + + errno = 0; + + i = strtol(value, &end, 10); + if (*end != 0 || errno != 0 || i < 0 || i > LA12XX_MAX_MODEM) { + rte_bbdev_log(ERR, "Supported Port IDS are 0 to %d", + LA12XX_MAX_MODEM - 1); + return -EINVAL; + } + + *((uint32_t *)extra_args) = i; + + return 0; +} + /* Parse parameters used to create device */ static int parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, @@ -73,6 +97,16 @@ parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, if (ret < 0) goto exit; + ret = rte_kvargs_process(kvlist, + bbdev_la12xx_valid_params[1], + &parse_integer_arg, + ¶ms->modem_id); + + if (params->modem_id >= LA12XX_MAX_MODEM) { + rte_bbdev_log(ERR, "Invalid modem id, must be < %u", + LA12XX_MAX_MODEM); + goto exit; + } } exit: @@ -84,10 +118,11 @@ parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, /* Create device */ static int la12xx_bbdev_create(struct rte_vdev_device *vdev, - struct bbdev_la12xx_params *init_params __rte_unused) + struct bbdev_la12xx_params *init_params) { struct rte_bbdev *bbdev; const char *name = rte_vdev_device_name(vdev); + struct bbdev_la12xx_private *priv; PMD_INIT_FUNC_TRACE(); @@ -103,6 +138,20 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev, return -ENOMEM; } + priv = bbdev->data->dev_private; + priv->modem_id = init_params->modem_id; + /* if modem id is not configured */ + if (priv->modem_id == -1) + priv->modem_id = bbdev->data->dev_id; + + /* Reset Global variables */ + priv->num_ldpc_enc_queues = 0; + priv->num_ldpc_dec_queues = 0; + priv->num_valid_queues = 0; + priv->max_nb_queues = init_params->queues_num; + + rte_bbdev_log(INFO, "Setting Up %s: DevId=%d, ModemId=%d", + name, bbdev->data->dev_id, priv->modem_id); bbdev->dev_ops = NULL; bbdev->device = &vdev->device; bbdev->data->socket_id = 0; @@ -122,7 +171,7 @@ static int la12xx_bbdev_probe(struct rte_vdev_device *vdev) { struct bbdev_la12xx_params init_params = { - 8 + 8, -1, }; const char *name; const char *input_args; @@ -174,4 +223,5 @@ static struct rte_vdev_driver bbdev_la12xx_pmd_drv = { RTE_PMD_REGISTER_VDEV(DRIVER_NAME, bbdev_la12xx_pmd_drv); RTE_PMD_REGISTER_PARAM_STRING(DRIVER_NAME, - LA12XX_MAX_NB_QUEUES_ARG"="); + LA12XX_MAX_NB_QUEUES_ARG"=" + LA12XX_VDEV_MODEM_ID_ARG "= "); diff --git a/drivers/baseband/la12xx/bbdev_la12xx.h b/drivers/baseband/la12xx/bbdev_la12xx.h new file mo
[dpdk-dev] [PATCH v5 5/9] baseband/la12xx: add queue and modem config support
From: Hemant Agrawal This patch add support for connecting with modem and creating the ipc channel as queues with modem for the exchange of data. Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- MAINTAINERS| 1 + doc/guides/bbdevs/index.rst| 1 + doc/guides/bbdevs/la12xx.rst | 81 +++ doc/guides/rel_notes/release_21_11.rst | 5 + drivers/baseband/la12xx/bbdev_la12xx.c | 553 - drivers/baseband/la12xx/bbdev_la12xx.h | 11 +- drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 189 ++- 7 files changed, 831 insertions(+), 10 deletions(-) create mode 100644 doc/guides/bbdevs/la12xx.rst diff --git a/MAINTAINERS b/MAINTAINERS index a63e672c9e..2c243c10fe 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1295,6 +1295,7 @@ NXP LA12xx driver M: Hemant Agrawal M: Nipun Gupta F: drivers/baseband/la12xx/ +F: doc/guides/bbdevs/la12xx.rst Rawdev Drivers diff --git a/doc/guides/bbdevs/index.rst b/doc/guides/bbdevs/index.rst index 4445cbd1b0..cedd706fa6 100644 --- a/doc/guides/bbdevs/index.rst +++ b/doc/guides/bbdevs/index.rst @@ -14,3 +14,4 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 +la12xx diff --git a/doc/guides/bbdevs/la12xx.rst b/doc/guides/bbdevs/la12xx.rst new file mode 100644 index 00..3c9ac5c047 --- /dev/null +++ b/doc/guides/bbdevs/la12xx.rst @@ -0,0 +1,81 @@ +.. SPDX-License-Identifier: BSD-3-Clause +Copyright 2021 NXP + +NXP LA12xx Poll Mode Driver +=== + +The BBDEV LA12xx poll mode driver (PMD) supports an implementation for +offloading High Phy processing functions like LDPC Encode / Decode 5GNR wireless +acceleration function, using PCI based LA12xx Software defined radio. + +More information can be found at `NXP Official Website +<https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/layerscape-processors/layerscape-access-la1200-programmable-baseband-processor:LA1200>`_. + +Features + + +LA12xx PMD supports the following features: + +- Maximum of 8 UL queues +- Maximum of 8 DL queues +- PCIe Gen-3 x8 Interface +- MSI-X + +Installation + + +Section 3 of the DPDK manual provides instructions on installing and compiling DPDK. + +DPDK requires hugepages to be configured as detailed in section 2 of the DPDK manual. + +Initialization +-- + +The device can be listed on the host console with: + + +Use the following lspci command to get the multiple LA12xx processor ids. The +device ID of the LA12xx baseband processor is "1c30". + +.. code-block:: console + + sudo lspci -nn + +... +0001:01:00.0 Power PC [0b20]: Freescale Semiconductor Inc Device [1957:1c30] ( +rev 10) +... +0002:01:00.0 Power PC [0b20]: Freescale Semiconductor Inc Device [1957:1c30] ( +rev 10) + + +Prerequisites +- + +Currently supported by DPDK: + +- NXP LA1224 BSP **1.0+**. +- NXP LA1224 PCIe Modem card connected to ARM host. + +- Follow the DPDK :ref:`Getting Started Guide for Linux ` to setup the basic DPDK environment. + +* Use dev arg option ``modem=0`` to identify the modem instance for a given + device. This is required only if more than 1 modem cards are attached to host. + this is optional and the default value is 0. + e.g. ``--vdev=baseband_la12xx,modem=0`` + +* Use dev arg option ``max_nb_queues=x`` to specify the maximum number of queues + to be used for communication with offload device i.e. modem. default is 16. + e.g. ``--vdev=baseband_la12xx,max_nb_queues=4`` + +Enabling logs +- + +For enabling logs, use the following EAL parameter: + +.. code-block:: console + + ./your_bbdev_application --log-level=la12xx: + +Using ``bb.la12xx`` as log matching criteria, all Baseband PMD logs can be +enabled which are lower than logging ``level``. diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index 675b573834..a0e0ebbeb8 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -62,6 +62,11 @@ New Features * Added bus-level parsing of the devargs syntax. * Kept compatibility with the legacy syntax as parsing fallback. +* **Added NXP LA12xx baseband PMD.** + + * Added a new baseband PMD driver for NXP LA12xx Software defined radio. + * See the :doc:`../bbdevs/la12xx` for more details. + Removed Items - diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index f26f3f2a08..57e957a93a 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -3,6 +3,11 @@ */ #include +#include +#include +#include +#include +#include #include #include @@ -31,11 +36,550 @@ struct bbdev_la12xx_params { #define LA12XX_VDEV_MODEM_ID_ARG "modem" #define LA12XX_MAX_MODEM 4 +#define LA12XX_MAX_CORES 4 +#define LA12XX_
[dpdk-dev] [PATCH v5 6/9] baseband/la12xx: add enqueue and dequeue support
From: Hemant Agrawal Add support for enqueue and dequeue the LDPC enc/dec from the modem device. Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- doc/guides/bbdevs/features/la12xx.ini | 14 + doc/guides/bbdevs/la12xx.rst | 46 +++ drivers/baseband/la12xx/bbdev_la12xx.c | 334 - drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 37 +++ 4 files changed, 425 insertions(+), 6 deletions(-) create mode 100644 doc/guides/bbdevs/features/la12xx.ini diff --git a/doc/guides/bbdevs/features/la12xx.ini b/doc/guides/bbdevs/features/la12xx.ini new file mode 100644 index 00..412af99bad --- /dev/null +++ b/doc/guides/bbdevs/features/la12xx.ini @@ -0,0 +1,14 @@ +; +; Supported features of the 'la12xx' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Turbo Decoder (4G) = N +Turbo Encoder (4G) = N +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = N +HW Accelerated = Y +BBDEV API = Y +Big Endian Processing = Y diff --git a/doc/guides/bbdevs/la12xx.rst b/doc/guides/bbdevs/la12xx.rst index 3c9ac5c047..c39be0e51f 100644 --- a/doc/guides/bbdevs/la12xx.rst +++ b/doc/guides/bbdevs/la12xx.rst @@ -16,6 +16,8 @@ Features LA12xx PMD supports the following features: +- LDPC Encode in the DL +- LDPC Decode in the UL - Maximum of 8 UL queues - Maximum of 8 DL queues - PCIe Gen-3 x8 Interface @@ -79,3 +81,47 @@ For enabling logs, use the following EAL parameter: Using ``bb.la12xx`` as log matching criteria, all Baseband PMD logs can be enabled which are lower than logging ``level``. + +Test Application + + +BBDEV provides a test application, ``test-bbdev.py`` and range of test data for testing +the functionality of LA12xx for FEC encode and decode, depending on the device +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). + "-s", "--snr": SNR in dB used when generating LLRs for bler tests. + "-s", "--iter_max" : Number of iterations for LDPC decoder. + "-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 decode or encode data, +type one of the following: + +.. code-block:: console + + ./test-bbdev.py -e="--vdev=baseband_la12xx,socket_id=0,max_nb_queues=8" -c validation -n 64 -b 1 -v ./ldpc_dec_default.data + ./test-bbdev.py -e="--vdev=baseband_la12xx,socket_id=0,max_nb_queues=8" -c validation -n 64 -b 1 -v ./ldpc_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. + + +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 LA12xx FEC capabilities which may cause some +testcases to be skipped, but no failure should be reported. diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index 57e957a93a..1f64ee9b1e 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -54,7 +54,8 @@ static const struct rte_bbdev_op_cap bbdev_capabilities[] = { .cap.ldpc_enc = { .capability_flags = RTE_BBDEV_LDPC_CRC_24A_ATTACH | - RTE_BBDEV_LDPC_CRC_24B_ATTACH, + RTE_BBDEV_LDPC_CRC_24B_ATTACH | + RTE_BBDEV_LDPC_ENC_BIG_ENDIAN, .num_buffers_src = RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, .num_buffers_dst = @@ -67,7 +68,8 @@ static const struct rte_bbdev_op_cap bbdev_capabi
[dpdk-dev] [PATCH v5 7/9] app/bbdev: enable la12xx for bbdev
From: Hemant Agrawal this patch adds la12xx driver in test bbdev Signed-off-by: Hemant Agrawal --- app/test-bbdev/meson.build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/test-bbdev/meson.build b/app/test-bbdev/meson.build index edb9deef84..a726a5b3fa 100644 --- a/app/test-bbdev/meson.build +++ b/app/test-bbdev/meson.build @@ -23,3 +23,6 @@ endif if dpdk_conf.has('RTE_BASEBAND_ACC100') deps += ['baseband_acc100'] endif +if dpdk_conf.has('RTE_LIBRTE_PMD_BBDEV_LA12XX') + deps += ['baseband_la12xx'] +endif -- 2.17.1
[dpdk-dev] [PATCH v5 8/9] app/bbdev: handle endianness of test data
With data input, output and harq also supported in big endian format, this patch updates the testbbdev application to handle the endianness conversion as directed by the test vector and the driver being used. For instance, if the driver supports big endian data processing, but the test vector does not mention the data as a big endian format, conversion from little endian to big will be handled by the testbbdev application. Signed-off-by: Nipun Gupta --- app/test-bbdev/test_bbdev_perf.c | 84 ++ app/test-bbdev/test_bbdev_vector.c | 4 ++ 2 files changed, 88 insertions(+) diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c index 469597b8b3..836e07d747 100644 --- a/app/test-bbdev/test_bbdev_perf.c +++ b/app/test-bbdev/test_bbdev_perf.c @@ -227,6 +227,71 @@ clear_soft_out_cap(uint32_t *op_flags) *op_flags &= ~RTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT; } +static void +clear_ldpc_endianness_flag(uint32_t *op_flags) +{ + *op_flags &= ~RTE_BBDEV_LDPC_ENC_BIG_ENDIAN; + *op_flags &= ~RTE_BBDEV_LDPC_DEC_BIG_ENDIAN; +} + +static inline void +reverse_op(struct op_data_entries *op) +{ + uint8_t nb_segs = op->nb_segments; + uint32_t *data, len; + int complete, rem, i, j; + uint8_t *rem_data, temp; + + /* Validate each mbuf segment length */ + for (i = 0; i < nb_segs; ++i) { + len = op->segments[i].length; + data = op->segments[i].addr; + + /* Swap complete u32 bytes */ + complete = len / 4; + for (j = 0; j < complete; j++) + data[j] = rte_bswap32(data[j]); + + /* Swap any remaining data for last seg */ + if (i == (nb_segs - 1)) { + rem = len % 4; + rem_data = (uint8_t *)&data[j]; + for (j = 0; j < rem/2; j++) { + temp = rem_data[j]; + rem_data[j] = rem_data[rem - j - 1]; + rem_data[rem - j - 1] = temp; + } + } + } +} + +static inline void +reverse_all_ops(void) +{ + unsigned int nb_inputs, nb_soft_outputs, nb_hard_outputs, + nb_harq_inputs, nb_harq_outputs; + + nb_inputs = test_vector.entries[DATA_INPUT].nb_segments; + if (nb_inputs) + reverse_op(&test_vector.entries[DATA_INPUT]); + + nb_soft_outputs = test_vector.entries[DATA_SOFT_OUTPUT].nb_segments; + if (nb_soft_outputs) + reverse_op(&test_vector.entries[DATA_SOFT_OUTPUT]); + + nb_hard_outputs = test_vector.entries[DATA_HARD_OUTPUT].nb_segments; + if (nb_hard_outputs) + reverse_op(&test_vector.entries[DATA_HARD_OUTPUT]); + + nb_harq_inputs = test_vector.entries[DATA_HARQ_INPUT].nb_segments; + if (nb_harq_inputs) + reverse_op(&test_vector.entries[DATA_HARQ_INPUT]); + + nb_harq_outputs = test_vector.entries[DATA_HARQ_OUTPUT].nb_segments; + if (nb_harq_outputs) + reverse_op(&test_vector.entries[DATA_HARQ_OUTPUT]); +} + static int check_dev_cap(const struct rte_bbdev_info *dev_info) { @@ -324,6 +389,16 @@ check_dev_cap(const struct rte_bbdev_info *dev_info) const struct rte_bbdev_op_cap_ldpc_enc *cap = &op_cap->cap.ldpc_enc; + if ((test_vector.ldpc_enc.op_flags & + RTE_BBDEV_LDPC_ENC_BIG_ENDIAN) != + (cap->capability_flags & + RTE_BBDEV_LDPC_ENC_BIG_ENDIAN)) { + reverse_all_ops(); + clear_ldpc_endianness_flag( + &test_vector.ldpc_enc.op_flags); + + } + if (!flags_match(test_vector.ldpc_enc.op_flags, cap->capability_flags)){ printf("Flag Mismatch\n"); @@ -352,6 +427,15 @@ check_dev_cap(const struct rte_bbdev_info *dev_info) const struct rte_bbdev_op_cap_ldpc_dec *cap = &op_cap->cap.ldpc_dec; + if ((test_vector.ldpc_dec.op_flags & + RTE_BBDEV_LDPC_DEC_BIG_ENDIAN) != + (cap->capability_flags & + RTE_BBDEV_LDPC_DEC_BIG_ENDIAN)) { + reverse_all_ops(); + clear_ldpc_endianness_flag( + &test_vector.ldpc_dec.op_flags); + } +
[dpdk-dev] [PATCH v5 9/9] app/bbdev: add test vectors for transport blocks
This patch adds two test vectors for transport block in network byte order: - LDPC encode for Transport Block - LDPC decode for Transport block Signed-off-by: Nipun Gupta --- app/test-bbdev/test_vectors/ldpc_dec_tb.data | 122 +++ app/test-bbdev/test_vectors/ldpc_enc_tb.data | 60 + 2 files changed, 182 insertions(+) create mode 100644 app/test-bbdev/test_vectors/ldpc_dec_tb.data create mode 100644 app/test-bbdev/test_vectors/ldpc_enc_tb.data diff --git a/app/test-bbdev/test_vectors/ldpc_dec_tb.data b/app/test-bbdev/test_vectors/ldpc_dec_tb.data new file mode 100644 index 00..b991e8f305 --- /dev/null +++ b/app/test-bbdev/test_vectors/ldpc_dec_tb.data @@ -0,0 +1,122 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2020 NXP + +op_type = +RTE_BBDEV_OP_LDPC_DEC + +input0 = +0x817f8181, 0x7f7f8181, 0x817f7f81, 0x81817f81, 0x81817f81, 0x817f7f81, 0x7f7f7f7f, 0x7f7f7f81, +0x817f7f81, 0x817f7f81, 0x7f7f817f, 0x7f7f7f81, 0x81817f7f, 0x81818181, 0x817f8181, 0x7f817f81, +0x81817f7f, 0x7f7f817f, 0x81817f81, 0x817f8181, 0x7f7f7f81, 0x817f817f, 0x7f817f7f, 0x7f817f7f, +0x7f817f7f, 0x81817f7f, 0x7f818181, 0x817f7f7f, 0x8181817f, 0x81817f7f, 0x7f817f81, 0x7f7f7f7f, +0x7f817f7f, 0x81817f7f, 0x81818181, 0x817f817f, 0x81817f7f, 0x7f81817f, 0x7f7f7f7f, 0x7f7f7f7f, +0x7f818181, 0x7f7f7f81, 0x81817f81, 0x7f817f7f, 0x7f7f7f7f, 0x817f817f, 0x817f817f, 0x7f7f817f, +0x81817f81, 0x7f7f7f7f, 0x7f81817f, 0x817f817f, 0x7f7f8181, 0x7f7f7f7f, 0x817f7f7f, 0x81818181, +0x817f8181, 0x7f7f817f, 0x7f7f8181, 0x7f7f7f7f, 0x7f818181, 0x817f8181, 0x817f7f81, 0x817f8181, +0x817f7f81, 0x81817f7f, 0x7f7f8181, 0x81818181, 0x817f817f, 0x817f7f7f, 0x81818181, 0x7f817f81, +0x7f7f7f81, 0x81817f81, 0x7f817f7f, 0x7f818181, 0x7f7f7f81, 0x817f817f, 0x81818181, 0x81818181, +0x81817f81, 0x81817f81, 0x7f7f8181, 0x817f7f7f, 0x7f81817f, 0x817f817f, 0x81817f7f, 0x817f7f81, +0x81817f7f, 0x7f7f7f81, 0x7f817f81, 0x7f817f81, 0x817f7f7f, 0x7f818181, 0x81818181, 0x7f7f7f7f, +0x7f7f7f7f, 0x8181817f, 0x7f7f7f81, 0x7f817f81, 0x81817f81, 0x7f7f817f, 0x7f81817f, 0x817f8181, +0x7f81817f, 0x7f81817f, 0x817f7f7f, 0x7f81817f, 0x817f7f81, 0x817f7f81, 0x7f817f7f, 0x8181817f, +0x7f81817f, 0x7f7f8181, 0x817f8181, 0x817f7f7f, 0x817f7f81, 0x7f81817f, 0x7f7f817f, 0x7f817f7f, +0x7f7f8181, 0x81818181, 0x7f818181, 0x7f7f817f, 0x7f818181, 0x81818181, 0x7f817f7f, 0x817f817f, +0x817f817f, 0x817f7f7f, 0x81817f81, 0x81817f7f, 0x81817f81, 0x7f817f81, 0x7f817f7f, 0x7f817f7f, +0x817f7f7f, 0x817f7f7f, 0x7f7f7f7f, 0x7f7f7f81, 0x7f7f8181, 0x7f817f81, 0x7f817f7f, 0x817f7f7f, +0x7f7f8181, 0x8181817f, 0x7f7f8181, 0x7f7f7f81, 0x817f7f7f, 0x7f7f7f81, 0x817f8181, 0x7f7f817f, +0x7f81817f, 0x817f817f, 0x7f817f81, 0x7f7f8181, 0x7f818181, 0x7f817f81, 0x81818181, 0x81817f7f, +0x7f81817f, 0x7f81817f, 0x7f7f8181, 0x81818181, 0x817f8181, 0x7f7f817f, 0x7f817f7f, 0x7f7f8181, +0x7f81817f, 0x7f7f817f, 0x7f7f7f7f, 0x7f818181, 0x81817f7f, 0x8181817f, 0x7f81817f, 0x8181817f, +0x81817f81, 0x7f7f7f7f, 0x81818181, 0x7f7f817f, 0x7f81817f, 0x7f7f7f7f, 0x81817f81, 0x817f7f81, +0x817f7f81, 0x817f7f81, 0x81818181, 0x7f7f7f7f, 0x81817f81, 0x817f7f7f, 0x8181817f, 0x7f7f7f81, +0x81817f81, 0x817f7f81, 0x81818181, 0x7f7f7f7f, 0x81817f7f, 0x81817f81, 0x7f7f7f81, 0x7f7f7f7f, +0x817f817f, 0x7f818181, 0x8181817f, 0x81817f81, 0x7f7f7f81, 0x7f817f7f, 0x7f7f7f7f, 0x7f817f81, +0x8181817f, 0x7f7f7f7f, 0x81817f7f, 0x7f7f7f81, 0x7f81817f, 0x7f7f7f7f, 0x7f7f7f81, 0x817f8181, +0x7f7f8181, 0x7f7f7f81, 0x7f7f8181, 0x7f817f7f, 0x81818181, 0x7f81817f, 0x7f818181, 0x7f818181, +0x7f818181, 0x817f7f81, 0x7f7f8181, 0x81818181, 0x7f7f7f7f, 0x7f7f7f7f, 0x817f8181, 0x81818181, +0x7f7f817f, 0x817f8181, 0x81817f7f, 0x817f817f, 0x7f7f817f, 0x7f7f7f7f, 0x817f8181, 0x817f8181, +0x817f8181, 0x81818181, 0x7f7f817f, 0x7f817f81, 0x817f7f81, 0x7f7f7f81, 0x81817f81, 0x7f818181, +0x81817f7f, 0x7f818181, 0x81818181, 0x817f817f, 0x7f817f7f, 0x81818181, 0x817f8181, 0x7f7f7f7f, +0x7f817f81, 0x817f7f7f, 0x7f818181, 0x8181817f, 0x817f817f, 0x7f817f7f, 0x817f7f81, 0x7f818181, +0x817f7f7f, 0x817f7f81, 0x7f7f7f81, 0x81817f81, 0x7f81817f, 0x7f818181, 0x81817f7f, 0x817f7f81, +0x81817f81, 0x7f7f8181, 0x7f7f8181, 0x7f817f81, 0x7f7f817f, 0x817f7f7f, 0x7f7f7f7f, 0x817f7f7f, +0x7f7f8181, 0x817f8181, 0x817f8181, 0x7f817f81, 0x817f8181, 0x8181817f, 0x81817f7f, 0x7f817f7f, +0x7f817f7f, 0x7f817f81, 0x817f817f, 0x817f7f7f, 0x8181817f, 0x817f817f, 0x817f7f81, 0x81817f7f, +0x7f817f7f, 0x7f7f7f7f, 0x7f817f7f, 0x7f7f817f, 0x7f818181, 0x8181817f, 0x817f7f7f, 0x7f817f81, +0x7f7f8181, 0x81817f7f, 0x7f7f817f, 0x7f7f817f, 0x7f817f7f, 0x7f7f817f, 0x7f818181, 0x7f817f7f, +0x817f7f7f, 0x7f817f81, 0x81818181, 0x7f818181, 0x817f8181, 0x8181817f, 0x8181817f, 0x817f7f7f, +0x81817f81, 0x817f7f7f, 0x7f81817f, 0x817f8181, 0x7f818181, 0x7f817f7f, 0x81817f7f, 0x7f81817f, +0x81817f81, 0x7f7f7f81, 0x7f7f7f7f, 0x81818181, 0x817f7f7f, 0x81817f81, 0x817f7f81, 0x81817f7f, +0x81818181, 0x7f7f7f7f, 0x817f817f, 0x7f817f81
Re: [dpdk-dev] [PATCH v5 1/9] bbdev: add big endian processing data capability
> -Original Message- > From: Chautru, Nicolas > Sent: Tuesday, September 14, 2021 12:10 AM > To: Nipun Gupta ; dev@dpdk.org; gak...@marvell.com > Cc: david.march...@redhat.com; Hemant Agrawal > ; Tom Rix > Subject: RE: [PATCH v5 1/9] bbdev: add big endian processing data capability > > > > > -Original Message- > > From: Nipun Gupta > > Sent: Sunday, September 12, 2021 5:15 AM > > To: dev@dpdk.org; gak...@marvell.com; Chautru, Nicolas > > > > Cc: david.march...@redhat.com; hemant.agra...@nxp.com; Nipun Gupta > > > > Subject: [PATCH v5 1/9] bbdev: add big endian processing data capability > > > > This patch intoduces a new capability of the bbdev device to process the > > LDPC data in big endian order. > > Hi Gupta, > > As mentioned in previous patch iteration earlier this year I believe this is > not > really an operation flag but more a different device capability. > ie. you would have the same formalism for all operation (5GDL, 5GUL, 4GDL, > ...) > for that PMD/hw and that is not something you will change dynamically as an > option. > I would suggest to add this under "struct rte_bbdev_driver_info" which can be > used to capture device specific capability and information. In term of > processing > and operation, everything is the same except endianness assumption for the > input/output data. Okay, it can be done this way. Then it would be assumption of the driver, that the operation is in the format as per the driver info. Ill change it in respin. > > > > > > Signed-off-by: Hemant Agrawal > > Signed-off-by: Nipun Gupta > > --- > > doc/guides/bbdevs/features/default.ini | 1 + > > doc/guides/prog_guide/bbdev.rst| 6 ++ > > lib/bbdev/rte_bbdev_op.h | 14 -- > > 3 files changed, 19 insertions(+), 2 deletions(-) > > > > diff --git a/doc/guides/bbdevs/features/default.ini > > b/doc/guides/bbdevs/features/default.ini > > index 5fe267a625..ae5aacf8f7 100644 > > --- a/doc/guides/bbdevs/features/default.ini > > +++ b/doc/guides/bbdevs/features/default.ini > > @@ -14,3 +14,4 @@ LLR/HARQ Compression = > > External DDR Access= > > HW Accelerated = > > BBDEV API = > > +Big Endian Processing = > > diff --git a/doc/guides/prog_guide/bbdev.rst > > b/doc/guides/prog_guide/bbdev.rst index 9619280ffc..6540b514bb 100644 > > --- a/doc/guides/prog_guide/bbdev.rst > > +++ b/doc/guides/prog_guide/bbdev.rst > > @@ -747,6 +747,9 @@ given below. > > |RTE_BBDEV_LDPC_ENC_CONCATENATION| > > | Set if a device supports concatenation of non byte aligned output | > > +-- > > --+ > > +|RTE_BBDEV_LDPC_ENC_BIG_ENDIAN | > > +| Set if a device supports Big Endian data processing| > > +++ > > > > The structure passed for each LDPC encode operation is given below, with > > the operation flags forming a bitmask in the ``op_flags`` field. > > @@ -942,6 +945,9 @@ given below. > > |RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK| > > | Set if a device supports loopback access to HARQ internal memory | > > ++ > > +|RTE_BBDEV_LDPC_DEC_BIG_ENDIAN | > > +| Set if a device supports Big Endian data processing| > > +++ > > > > The structure passed for each LDPC decode operation is given below, with > > the operation flags forming a bitmask in the ``op_flags`` field. > > diff --git a/lib/bbdev/rte_bbdev_op.h b/lib/bbdev/rte_bbdev_op.h index > > f946842727..9e9b5be81f 100644 > > --- a/lib/bbdev/rte_bbdev_op.h > > +++ b/lib/bbdev/rte_bbdev_op.h > > @@ -186,7 +186,12 @@ enum rte_bbdev_op_ldpcdec_flag_bitmasks { > > * for HARQ memory. If not set, it is assumed the filler bits are not > > * in HARQ memory and handled directly by the LDPC decoder. > > */ > > - RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL << > > 18) > > + RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS = (1ULL << > > 18), > > + /** Set if a device supports Big Endian data processing. > > +* If not set Little Endian data processing is supported by > > +* default. > > +*/ > > + R
Re: [dpdk-dev] [PATCH v5 5/9] baseband/la12xx: add queue and modem config support
> -Original Message- > From: Chautru, Nicolas > Sent: Tuesday, September 14, 2021 12:26 AM > To: Nipun Gupta ; dev@dpdk.org; gak...@marvell.com > Cc: david.march...@redhat.com; Hemant Agrawal > Subject: RE: [PATCH v5 5/9] baseband/la12xx: add queue and modem config > support > > > > > -Original Message- > > From: Nipun Gupta > > Sent: Sunday, September 12, 2021 5:15 AM > > To: dev@dpdk.org; gak...@marvell.com; Chautru, Nicolas > > > > Cc: david.march...@redhat.com; hemant.agra...@nxp.com; Nipun Gupta > > > > Subject: [PATCH v5 5/9] baseband/la12xx: add queue and modem config > > support > > > > From: Hemant Agrawal > > > > This patch add support for connecting with modem and creating the ipc > > channel as queues with modem for the exchange of data. > > > > Signed-off-by: Nipun Gupta > > Signed-off-by: Hemant Agrawal > > --- > > MAINTAINERS| 1 + > > doc/guides/bbdevs/index.rst| 1 + > > doc/guides/bbdevs/la12xx.rst | 81 +++ > > doc/guides/rel_notes/release_21_11.rst | 5 + > > drivers/baseband/la12xx/bbdev_la12xx.c | 553 - > > drivers/baseband/la12xx/bbdev_la12xx.h | 11 +- > > drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 189 ++- > > 7 files changed, 831 insertions(+), 10 deletions(-) create mode 100644 > > doc/guides/bbdevs/la12xx.rst > > > > diff --git a/MAINTAINERS b/MAINTAINERS > > index a63e672c9e..2c243c10fe 100644 > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > > @@ -1295,6 +1295,7 @@ NXP LA12xx driver > > M: Hemant Agrawal > > M: Nipun Gupta > > F: drivers/baseband/la12xx/ > > +F: doc/guides/bbdevs/la12xx.rst > > > > > > Rawdev Drivers > > diff --git a/doc/guides/bbdevs/index.rst b/doc/guides/bbdevs/index.rst > > index 4445cbd1b0..cedd706fa6 100644 > > --- a/doc/guides/bbdevs/index.rst > > +++ b/doc/guides/bbdevs/index.rst > > @@ -14,3 +14,4 @@ Baseband Device Drivers > > fpga_lte_fec > > fpga_5gnr_fec > > acc100 > > +la12xx > > diff --git a/doc/guides/bbdevs/la12xx.rst b/doc/guides/bbdevs/la12xx.rst > > new file mode 100644 index 00..3c9ac5c047 > > --- /dev/null > > +++ b/doc/guides/bbdevs/la12xx.rst > > @@ -0,0 +1,81 @@ > > +.. SPDX-License-Identifier: BSD-3-Clause > > +Copyright 2021 NXP > > + > > +NXP LA12xx Poll Mode Driver > > +=== > > + > > +The BBDEV LA12xx poll mode driver (PMD) supports an implementation for > > +offloading High Phy processing functions like LDPC Encode / Decode 5GNR > > +wireless acceleration function, using PCI based LA12xx Software defined > > radio. > > + > > +More information can be found at `NXP Official Website > > > +<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww. > nxp.com%2Fproducts%2Fprocessors-and-microcontrollers%2Farm- > &data=04%7C01%7Cnipun.gupta%40nxp.com%7C92cc367c64324a156f730 > 8d976e8373d%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C6376715 > 62002990761%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjo > iV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=4HYKiRKBu > Y4VkVvN73UKM8ZP13NcBEx81ZbME9LiWhI%3D&reserved=0 > > processors/layerscape-processors/layerscape-access-la1200-programmable- > > baseband-processor:LA1200>`_. > > + > > +Features > > + > > + > > +LA12xx PMD supports the following features: > > + > > +- Maximum of 8 UL queues > > +- Maximum of 8 DL queues > > +- PCIe Gen-3 x8 Interface > > +- MSI-X > > + > > +Installation > > + > > + > > +Section 3 of the DPDK manual provides instructions on installing and > > compiling DPDK. > > + > > +DPDK requires hugepages to be configured as detailed in section 2 of the > > DPDK manual. > > + > > +Initialization > > +-- > > + > > +The device can be listed on the host console with: > > + > > + > > +Use the following lspci command to get the multiple LA12xx processor > > +ids. The device ID of the LA12xx baseband processor is "1c30". > > + > > +.. code-block:: console > > + > > + sudo lspci -nn > > + > > +... > > +0001:01:00.0 Power PC [0b20]: Freescale Semiconductor Inc Device > > +[1957:1c30] ( rev 10) ... > > +0002:01:00.0 Power PC [0b20]: Freescale Semiconductor Inc Device > > +[1957:1c30] ( rev 10) > > + > >
Re: [dpdk-dev] [PATCH v5 9/9] app/bbdev: add test vectors for transport blocks
> -Original Message- > From: Chautru, Nicolas > Sent: Tuesday, September 14, 2021 12:32 AM > To: Nipun Gupta ; dev@dpdk.org; gak...@marvell.com > Cc: david.march...@redhat.com; Hemant Agrawal > Subject: RE: [PATCH v5 9/9] app/bbdev: add test vectors for transport blocks > > > > > -Original Message- > > From: Nipun Gupta > > Sent: Sunday, September 12, 2021 5:15 AM > > To: dev@dpdk.org; gak...@marvell.com; Chautru, Nicolas > > > > Cc: david.march...@redhat.com; hemant.agra...@nxp.com; Nipun Gupta > > > > Subject: [PATCH v5 9/9] app/bbdev: add test vectors for transport blocks > > > > This patch adds two test vectors for transport block in network byte > > order: > > - LDPC encode for Transport Block > > - LDPC decode for Transport block > > See comments on previous patchsets related to the same topic: > - This test vector includes Ratematching hence previous pmd exposed > capability > were not correct It is supported in our driver, I will add it in the capabilities. > - This is really is a single CB vector (not a TB made of multiple CBs). More > generally I don't believe there is new functionality here compared to existing > vectors. (keep in mind that the endianness can be managed as a device > capability and would not require new vectors). I agree, it is a single CB, otherwise the test vector file becomes large. But all the TB parameters are supported, which is not the case with the previous tests. I prefer to add a bigger test vector with multiple CBs. But then I hear that file size is a problem. I don't think it should be a problem. Let me respin with a larger size TB. > > Thanks > Nic > > > > > Signed-off-by: Nipun Gupta > > --- > > app/test-bbdev/test_vectors/ldpc_dec_tb.data | 122 > > +++ app/test-bbdev/test_vectors/ldpc_enc_tb.data | > > 60 + > > 2 files changed, 182 insertions(+) > > create mode 100644 app/test-bbdev/test_vectors/ldpc_dec_tb.data > > create mode 100644 app/test-bbdev/test_vectors/ldpc_enc_tb.data > > > > diff --git a/app/test-bbdev/test_vectors/ldpc_dec_tb.data b/app/test- > > bbdev/test_vectors/ldpc_dec_tb.data > > new file mode 100644 > > index 00..b991e8f305 > > --- /dev/null > > +++ b/app/test-bbdev/test_vectors/ldpc_dec_tb.data > > @@ -0,0 +1,122 @@ > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright 2020 NXP > > + > > +op_type = > > +RTE_BBDEV_OP_LDPC_DEC > > + > > +input0 = > > +0x817f8181, 0x7f7f8181, 0x817f7f81, 0x81817f81, 0x81817f81, 0x817f7f81, > > +0x7f7f7f7f, 0x7f7f7f81, 0x817f7f81, 0x817f7f81, 0x7f7f817f, 0x7f7f7f81, > > +0x81817f7f, 0x81818181, 0x817f8181, 0x7f817f81, 0x81817f7f, 0x7f7f817f, > > +0x81817f81, 0x817f8181, 0x7f7f7f81, 0x817f817f, 0x7f817f7f, 0x7f817f7f, > > +0x7f817f7f, 0x81817f7f, 0x7f818181, 0x817f7f7f, 0x8181817f, 0x81817f7f, > > +0x7f817f81, 0x7f7f7f7f, 0x7f817f7f, 0x81817f7f, 0x81818181, 0x817f817f, > > +0x81817f7f, 0x7f81817f, 0x7f7f7f7f, 0x7f7f7f7f, 0x7f818181, 0x7f7f7f81, > > +0x81817f81, 0x7f817f7f, 0x7f7f7f7f, 0x817f817f, 0x817f817f, 0x7f7f817f, > > +0x81817f81, 0x7f7f7f7f, 0x7f81817f, 0x817f817f, 0x7f7f8181, 0x7f7f7f7f, > > +0x817f7f7f, 0x81818181, 0x817f8181, 0x7f7f817f, 0x7f7f8181, 0x7f7f7f7f, > > +0x7f818181, 0x817f8181, 0x817f7f81, 0x817f8181, 0x817f7f81, 0x81817f7f, > > +0x7f7f8181, 0x81818181, 0x817f817f, 0x817f7f7f, 0x81818181, 0x7f817f81, > > +0x7f7f7f81, 0x81817f81, 0x7f817f7f, 0x7f818181, 0x7f7f7f81, 0x817f817f, > > +0x81818181, 0x81818181, 0x81817f81, 0x81817f81, 0x7f7f8181, 0x817f7f7f, > > +0x7f81817f, 0x817f817f, 0x81817f7f, 0x817f7f81, 0x81817f7f, 0x7f7f7f81, > > +0x7f817f81, 0x7f817f81, 0x817f7f7f, 0x7f818181, 0x81818181, 0x7f7f7f7f, > > +0x7f7f7f7f, 0x8181817f, 0x7f7f7f81, 0x7f817f81, 0x81817f81, 0x7f7f817f, > > +0x7f81817f, 0x817f8181, 0x7f81817f, 0x7f81817f, 0x817f7f7f, 0x7f81817f, > > +0x817f7f81, 0x817f7f81, 0x7f817f7f, 0x8181817f, 0x7f81817f, 0x7f7f8181, > > +0x817f8181, 0x817f7f7f, 0x817f7f81, 0x7f81817f, 0x7f7f817f, 0x7f817f7f, > > +0x7f7f8181, 0x81818181, 0x7f818181, 0x7f7f817f, 0x7f818181, 0x81818181, > > +0x7f817f7f, 0x817f817f, 0x817f817f, 0x817f7f7f, 0x81817f81, 0x81817f7f, > > +0x81817f81, 0x7f817f81, 0x7f817f7f, 0x7f817f7f, 0x817f7f7f, 0x817f7f7f, > > +0x7f7f7f7f, 0x7f7f7f81, 0x7f7f8181, 0x7f817f81, 0x7f817f7f, 0x817f7f7f, > > +0x7f7f8181, 0x8181817f, 0x7f7f8181, 0x7f7f7f81, 0x817f7f7f, 0x7f7f7f81, > > +0x817f8181, 0x7f7f817f, 0x7f81817f, 0x817f817f, 0x7f817f81, 0x7f7f8181, > > +0x7f818181, 0x7f817f81, 0x81818181, 0x81817f7f, 0x7f81817f, 0x7f81817f, > > +0x7f7f8181, 0x81818181,
[dpdk-dev] [PATCH v6 1/9] bbdev: add big endian processing data processing info
From: Nipun Gupta This patch intoduces a new info pertaining to bbdev device to process the data in big endian order. Signed-off-by: Nipun Gupta --- lib/bbdev/rte_bbdev.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h index 7017124414..3acc008d06 100644 --- a/lib/bbdev/rte_bbdev.h +++ b/lib/bbdev/rte_bbdev.h @@ -309,6 +309,8 @@ struct rte_bbdev_driver_info { uint16_t min_alignment; /** HARQ memory available in kB */ uint32_t harq_buffer_size; + /** Device support input, output and HARQ data as big-endian */ + uint8_t support_be_data; /** Default queue configuration used if none is supplied */ struct rte_bbdev_queue_conf default_queue_conf; /** Device operation capabilities */ -- 2.17.1
[dpdk-dev] [PATCH v6 0/9] baseband: add NXP LA12xx driver
From: Nipun Gupta This series introduces the BBDEV LA12xx poll mode driver (PMD) to support an implementation for offloading High Phy processing functions like LDPC Encode / Decode 5GNR wireless acceleration function, using PCI based LA12xx Software defined radio. Please check the documentation patch for more info. The driver currently implements basic feature to offload only the 5G LDPC encode/decode. A new capability has been added to check if the driver can support the input data in network byte order. Two test vectors are also added as an example with input data in network byte. v2: add test case changes v3: fix 32 bit compilation v4: capability for network byte order, doc patch merged inline. v5: add llr_size and llr_decimals, removed LLR compression flag, update testbbdev to handle endianness, rebased on top of 20.08 v6: added BE as device info instead of capability, updated test to have 2 codeblocks Hemant Agrawal (6): baseband: introduce NXP LA12xx driver baseband/la12xx: add devargs for max queues baseband/la12xx: add support for multiple modems baseband/la12xx: add queue and modem config support baseband/la12xx: add enqueue and dequeue support app/bbdev: enable la12xx for bbdev Nipun Gupta (3): bbdev: add big endian processing data processing info app/bbdev: handle endianness of test data app/bbdev: add test vectors for transport blocks MAINTAINERS | 10 + app/test-bbdev/meson.build|3 + app/test-bbdev/test_bbdev_perf.c | 62 + app/test-bbdev/test_vectors/ldpc_dec_tb.data | 265 app/test-bbdev/test_vectors/ldpc_enc_tb.data | 95 ++ doc/guides/bbdevs/features/la12xx.ini | 13 + doc/guides/bbdevs/index.rst |1 + doc/guides/bbdevs/la12xx.rst | 126 ++ doc/guides/rel_notes/release_21_11.rst|5 + drivers/baseband/la12xx/bbdev_la12xx.c| 1098 + drivers/baseband/la12xx/bbdev_la12xx.h| 51 + drivers/baseband/la12xx/bbdev_la12xx_ipc.h| 244 .../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 26 + drivers/baseband/la12xx/meson.build |6 + drivers/baseband/la12xx/version.map |3 + drivers/baseband/meson.build |1 + lib/bbdev/rte_bbdev.h |2 + 17 files changed, 2011 insertions(+) create mode 100644 app/test-bbdev/test_vectors/ldpc_dec_tb.data create mode 100644 app/test-bbdev/test_vectors/ldpc_enc_tb.data create mode 100644 doc/guides/bbdevs/features/la12xx.ini create mode 100644 doc/guides/bbdevs/la12xx.rst create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.c create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.h create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_ipc.h create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h create mode 100644 drivers/baseband/la12xx/meson.build create mode 100644 drivers/baseband/la12xx/version.map -- 2.17.1
[dpdk-dev] [PATCH v6 2/9] baseband: introduce NXP LA12xx driver
From: Hemant Agrawal This patch introduce the baseband device drivers for NXP's LA1200 series software defined baseband modem. Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- MAINTAINERS | 9 ++ drivers/baseband/la12xx/bbdev_la12xx.c| 109 ++ .../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 26 + drivers/baseband/la12xx/meson.build | 6 + drivers/baseband/la12xx/version.map | 3 + drivers/baseband/meson.build | 1 + 6 files changed, 154 insertions(+) create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.c create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h create mode 100644 drivers/baseband/la12xx/meson.build create mode 100644 drivers/baseband/la12xx/version.map diff --git a/MAINTAINERS b/MAINTAINERS index 266f5ac1da..cbae1bc23a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1288,6 +1288,15 @@ F: drivers/event/opdl/ F: doc/guides/eventdevs/opdl.rst +Baseband Drivers + + +NXP LA12xx driver +M: Nipun Gupta +M: Hemant Agrawal +F: drivers/baseband/la12xx/ + + Rawdev Drivers -- diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c new file mode 100644 index 00..7050b17728 --- /dev/null +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -0,0 +1,109 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020-2021 NXP + */ + +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include + +#define DRIVER_NAME baseband_la12xx + +RTE_LOG_REGISTER(bbdev_la12xx_logtype, pmd.bb.la12xx, NOTICE); + +/* private data structure */ +struct bbdev_la12xx_private { + unsigned int max_nb_queues; /**< Max number of queues */ +}; +/* Create device */ +static int +la12xx_bbdev_create(struct rte_vdev_device *vdev) +{ + struct rte_bbdev *bbdev; + const char *name = rte_vdev_device_name(vdev); + + PMD_INIT_FUNC_TRACE(); + + bbdev = rte_bbdev_allocate(name); + if (bbdev == NULL) + return -ENODEV; + + bbdev->data->dev_private = rte_zmalloc(name, + sizeof(struct bbdev_la12xx_private), + RTE_CACHE_LINE_SIZE); + if (bbdev->data->dev_private == NULL) { + rte_bbdev_release(bbdev); + return -ENOMEM; + } + + bbdev->dev_ops = NULL; + bbdev->device = &vdev->device; + bbdev->data->socket_id = 0; + bbdev->intr_handle = NULL; + + /* register rx/tx burst functions for data path */ + bbdev->dequeue_enc_ops = NULL; + bbdev->dequeue_dec_ops = NULL; + bbdev->enqueue_enc_ops = NULL; + bbdev->enqueue_dec_ops = NULL; + + return 0; +} + +/* Initialise device */ +static int +la12xx_bbdev_probe(struct rte_vdev_device *vdev) +{ + const char *name; + + PMD_INIT_FUNC_TRACE(); + + if (vdev == NULL) + return -EINVAL; + + name = rte_vdev_device_name(vdev); + if (name == NULL) + return -EINVAL; + + return la12xx_bbdev_create(vdev); +} + +/* Uninitialise device */ +static int +la12xx_bbdev_remove(struct rte_vdev_device *vdev) +{ + struct rte_bbdev *bbdev; + const char *name; + + PMD_INIT_FUNC_TRACE(); + + if (vdev == NULL) + return -EINVAL; + + name = rte_vdev_device_name(vdev); + if (name == NULL) + return -EINVAL; + + bbdev = rte_bbdev_get_named_dev(name); + if (bbdev == NULL) + return -EINVAL; + + rte_free(bbdev->data->dev_private); + + return rte_bbdev_release(bbdev); +} + +static struct rte_vdev_driver bbdev_la12xx_pmd_drv = { + .probe = la12xx_bbdev_probe, + .remove = la12xx_bbdev_remove +}; + +RTE_PMD_REGISTER_VDEV(DRIVER_NAME, bbdev_la12xx_pmd_drv); diff --git a/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h new file mode 100644 index 00..9dfa1cc458 --- /dev/null +++ b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020 NXP + */ + +#ifndef _BBDEV_LA12XX_PMD_LOGS_H_ +#define _BBDEV_LA12XX_PMD_LOGS_H_ + +#define rte_bbdev_log(level, fmt, ...) \ + rte_log(RTE_LOG_ ## level, bbdev_la12xx_logtype, fmt "\n", \ + ##__VA_ARGS__) + +#ifdef RTE_LIBRTE_BBDEV_DEBUG +#define rte_bbdev_log_debug(fmt, ...) \ + rte_bbdev_log(DEBUG, "la12xx_pmd: " fmt, \ + ##__VA_ARGS__) +#else +#define rte_bbdev_log_debug(fmt, ...) +#endif + +#define PMD_INIT_FUNC_TRACE() rte_bbdev_log_debug(">>") + +/* DP Logs, toggled out at compile time if level lower than current level */ +#define rte_bbdev_dp_log(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, fmt, ## arg
[dpdk-dev] [PATCH v6 3/9] baseband/la12xx: add devargs for max queues
From: Hemant Agrawal This patch adds dev args to take max queues as input Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- drivers/baseband/la12xx/bbdev_la12xx.c | 72 +- 1 file changed, 70 insertions(+), 2 deletions(-) diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index 7050b17728..8886b35429 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -19,13 +19,72 @@ RTE_LOG_REGISTER(bbdev_la12xx_logtype, pmd.bb.la12xx, NOTICE); +/* Initialisation params structure that can be used by LA12xx BBDEV driver */ +struct bbdev_la12xx_params { + uint8_t queues_num; /*< LA12xx BBDEV queues number */ +}; + +#define LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" + +static const char * const bbdev_la12xx_valid_params[] = { + LA12XX_MAX_NB_QUEUES_ARG, +}; + /* private data structure */ struct bbdev_la12xx_private { unsigned int max_nb_queues; /**< Max number of queues */ }; +static inline int +parse_u16_arg(const char *key, const char *value, void *extra_args) +{ + uint16_t *u16 = extra_args; + + unsigned int long result; + if ((value == NULL) || (extra_args == NULL)) + return -EINVAL; + errno = 0; + result = strtoul(value, NULL, 0); + if ((result >= (1 << 16)) || (errno != 0)) { + rte_bbdev_log(ERR, "Invalid value %lu for %s", result, key); + return -ERANGE; + } + *u16 = (uint16_t)result; + return 0; +} + +/* Parse parameters used to create device */ +static int +parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, + const char *input_args) +{ + struct rte_kvargs *kvlist = NULL; + int ret = 0; + + if (params == NULL) + return -EINVAL; + if (input_args) { + kvlist = rte_kvargs_parse(input_args, + bbdev_la12xx_valid_params); + if (kvlist == NULL) + return -EFAULT; + + ret = rte_kvargs_process(kvlist, bbdev_la12xx_valid_params[0], + &parse_u16_arg, ¶ms->queues_num); + if (ret < 0) + goto exit; + + } + +exit: + if (kvlist) + rte_kvargs_free(kvlist); + return ret; +} + /* Create device */ static int -la12xx_bbdev_create(struct rte_vdev_device *vdev) +la12xx_bbdev_create(struct rte_vdev_device *vdev, + struct bbdev_la12xx_params *init_params __rte_unused) { struct rte_bbdev *bbdev; const char *name = rte_vdev_device_name(vdev); @@ -62,7 +121,11 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev) static int la12xx_bbdev_probe(struct rte_vdev_device *vdev) { + struct bbdev_la12xx_params init_params = { + 8 + }; const char *name; + const char *input_args; PMD_INIT_FUNC_TRACE(); @@ -73,7 +136,10 @@ la12xx_bbdev_probe(struct rte_vdev_device *vdev) if (name == NULL) return -EINVAL; - return la12xx_bbdev_create(vdev); + input_args = rte_vdev_device_args(vdev); + parse_bbdev_la12xx_params(&init_params, input_args); + + return la12xx_bbdev_create(vdev, &init_params); } /* Uninitialise device */ @@ -107,3 +173,5 @@ static struct rte_vdev_driver bbdev_la12xx_pmd_drv = { }; RTE_PMD_REGISTER_VDEV(DRIVER_NAME, bbdev_la12xx_pmd_drv); +RTE_PMD_REGISTER_PARAM_STRING(DRIVER_NAME, + LA12XX_MAX_NB_QUEUES_ARG"="); -- 2.17.1
[dpdk-dev] [PATCH v6 7/9] app/bbdev: enable la12xx for bbdev
From: Hemant Agrawal this patch adds la12xx driver in test bbdev Signed-off-by: Hemant Agrawal --- app/test-bbdev/meson.build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/test-bbdev/meson.build b/app/test-bbdev/meson.build index edb9deef84..a726a5b3fa 100644 --- a/app/test-bbdev/meson.build +++ b/app/test-bbdev/meson.build @@ -23,3 +23,6 @@ endif if dpdk_conf.has('RTE_BASEBAND_ACC100') deps += ['baseband_acc100'] endif +if dpdk_conf.has('RTE_LIBRTE_PMD_BBDEV_LA12XX') + deps += ['baseband_la12xx'] +endif -- 2.17.1
[dpdk-dev] [PATCH v6 4/9] baseband/la12xx: add support for multiple modems
From: Hemant Agrawal This patch add support for multiple modems by assigning a modem id as dev args in vdev creation. Signed-off-by: Hemant Agrawal --- drivers/baseband/la12xx/bbdev_la12xx.c | 64 +++--- drivers/baseband/la12xx/bbdev_la12xx.h | 56 +++ drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 20 +++ 3 files changed, 133 insertions(+), 7 deletions(-) create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.h create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_ipc.h diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index 8886b35429..f26f3f2a08 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -14,6 +14,8 @@ #include #include +#include +#include #define DRIVER_NAME baseband_la12xx @@ -22,18 +24,18 @@ RTE_LOG_REGISTER(bbdev_la12xx_logtype, pmd.bb.la12xx, NOTICE); /* Initialisation params structure that can be used by LA12xx BBDEV driver */ struct bbdev_la12xx_params { uint8_t queues_num; /*< LA12xx BBDEV queues number */ + int8_t modem_id; /*< LA12xx modem instance id */ }; #define LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" +#define LA12XX_VDEV_MODEM_ID_ARG "modem" +#define LA12XX_MAX_MODEM 4 static const char * const bbdev_la12xx_valid_params[] = { LA12XX_MAX_NB_QUEUES_ARG, + LA12XX_VDEV_MODEM_ID_ARG, }; -/* private data structure */ -struct bbdev_la12xx_private { - unsigned int max_nb_queues; /**< Max number of queues */ -}; static inline int parse_u16_arg(const char *key, const char *value, void *extra_args) { @@ -52,6 +54,28 @@ parse_u16_arg(const char *key, const char *value, void *extra_args) return 0; } +/* Parse integer from integer argument */ +static int +parse_integer_arg(const char *key __rte_unused, + const char *value, void *extra_args) +{ + int i; + char *end; + + errno = 0; + + i = strtol(value, &end, 10); + if (*end != 0 || errno != 0 || i < 0 || i > LA12XX_MAX_MODEM) { + rte_bbdev_log(ERR, "Supported Port IDS are 0 to %d", + LA12XX_MAX_MODEM - 1); + return -EINVAL; + } + + *((uint32_t *)extra_args) = i; + + return 0; +} + /* Parse parameters used to create device */ static int parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, @@ -73,6 +97,16 @@ parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, if (ret < 0) goto exit; + ret = rte_kvargs_process(kvlist, + bbdev_la12xx_valid_params[1], + &parse_integer_arg, + ¶ms->modem_id); + + if (params->modem_id >= LA12XX_MAX_MODEM) { + rte_bbdev_log(ERR, "Invalid modem id, must be < %u", + LA12XX_MAX_MODEM); + goto exit; + } } exit: @@ -84,10 +118,11 @@ parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, /* Create device */ static int la12xx_bbdev_create(struct rte_vdev_device *vdev, - struct bbdev_la12xx_params *init_params __rte_unused) + struct bbdev_la12xx_params *init_params) { struct rte_bbdev *bbdev; const char *name = rte_vdev_device_name(vdev); + struct bbdev_la12xx_private *priv; PMD_INIT_FUNC_TRACE(); @@ -103,6 +138,20 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev, return -ENOMEM; } + priv = bbdev->data->dev_private; + priv->modem_id = init_params->modem_id; + /* if modem id is not configured */ + if (priv->modem_id == -1) + priv->modem_id = bbdev->data->dev_id; + + /* Reset Global variables */ + priv->num_ldpc_enc_queues = 0; + priv->num_ldpc_dec_queues = 0; + priv->num_valid_queues = 0; + priv->max_nb_queues = init_params->queues_num; + + rte_bbdev_log(INFO, "Setting Up %s: DevId=%d, ModemId=%d", + name, bbdev->data->dev_id, priv->modem_id); bbdev->dev_ops = NULL; bbdev->device = &vdev->device; bbdev->data->socket_id = 0; @@ -122,7 +171,7 @@ static int la12xx_bbdev_probe(struct rte_vdev_device *vdev) { struct bbdev_la12xx_params init_params = { - 8 + 8, -1, }; const char *name; const char *input_args; @@ -174,4 +223,5 @@ static struct rte_vdev_driver bbdev_la12xx_pmd_drv = { RTE_PMD_REGISTER_VDEV(DRIVER_NAME, bbdev_la12xx_pmd_drv); RTE_PMD_REGISTER_PARAM_STRING(DRIVER_NAME, - LA12XX_MAX_NB_QUEUES_ARG"="); + LA12XX_MAX_NB_QUEUES_ARG"=" + LA12XX_VDEV_MODEM_ID_ARG "= "); diff --git a/drivers/baseband/la12xx/bbdev_la12xx.h b/drivers/baseband/la12xx/bbdev_la12xx.h new file mo
[dpdk-dev] [PATCH v6 8/9] app/bbdev: handle endianness of test data
From: Nipun Gupta With data input, output and harq also supported in big endian format, this patch updates the testbbdev application to handle the endianness conversion as directed by the the driver being used. If the driver supports big endian data processing, conversion from little endian to big is handled by the testbbdev application. Signed-off-by: Nipun Gupta --- app/test-bbdev/test_bbdev_perf.c | 62 1 file changed, 62 insertions(+) diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c index 469597b8b3..a0f565ee3f 100644 --- a/app/test-bbdev/test_bbdev_perf.c +++ b/app/test-bbdev/test_bbdev_perf.c @@ -227,6 +227,64 @@ clear_soft_out_cap(uint32_t *op_flags) *op_flags &= ~RTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT; } +static inline void +reverse_op(struct op_data_entries *op) +{ + uint8_t nb_segs = op->nb_segments; + uint32_t *data, len; + int complete, rem, i, j; + uint8_t *rem_data, temp; + + /* Validate each mbuf segment length */ + for (i = 0; i < nb_segs; ++i) { + len = op->segments[i].length; + data = op->segments[i].addr; + + /* Swap complete u32 bytes */ + complete = len / 4; + for (j = 0; j < complete; j++) + data[j] = rte_bswap32(data[j]); + + /* Swap any remaining data for last seg */ + if (i == (nb_segs - 1)) { + rem = len % 4; + rem_data = (uint8_t *)&data[j]; + for (j = 0; j < rem/2; j++) { + temp = rem_data[j]; + rem_data[j] = rem_data[rem - j - 1]; + rem_data[rem - j - 1] = temp; + } + } + } +} + +static inline void +reverse_all_ops(void) +{ + unsigned int nb_inputs, nb_soft_outputs, nb_hard_outputs, + nb_harq_inputs, nb_harq_outputs; + + nb_inputs = test_vector.entries[DATA_INPUT].nb_segments; + if (nb_inputs) + reverse_op(&test_vector.entries[DATA_INPUT]); + + nb_soft_outputs = test_vector.entries[DATA_SOFT_OUTPUT].nb_segments; + if (nb_soft_outputs) + reverse_op(&test_vector.entries[DATA_SOFT_OUTPUT]); + + nb_hard_outputs = test_vector.entries[DATA_HARD_OUTPUT].nb_segments; + if (nb_hard_outputs) + reverse_op(&test_vector.entries[DATA_HARD_OUTPUT]); + + nb_harq_inputs = test_vector.entries[DATA_HARQ_INPUT].nb_segments; + if (nb_harq_inputs) + reverse_op(&test_vector.entries[DATA_HARQ_INPUT]); + + nb_harq_outputs = test_vector.entries[DATA_HARQ_OUTPUT].nb_segments; + if (nb_harq_outputs) + reverse_op(&test_vector.entries[DATA_HARQ_OUTPUT]); +} + static int check_dev_cap(const struct rte_bbdev_info *dev_info) { @@ -234,6 +292,7 @@ check_dev_cap(const struct rte_bbdev_info *dev_info) unsigned int nb_inputs, nb_soft_outputs, nb_hard_outputs, nb_harq_inputs, nb_harq_outputs; const struct rte_bbdev_op_cap *op_cap = dev_info->drv.capabilities; + uint8_t be_data = dev_info->drv.support_be_data; nb_inputs = test_vector.entries[DATA_INPUT].nb_segments; nb_soft_outputs = test_vector.entries[DATA_SOFT_OUTPUT].nb_segments; @@ -245,6 +304,9 @@ check_dev_cap(const struct rte_bbdev_info *dev_info) if (op_cap->type != test_vector.op_type) continue; + if (be_data) + reverse_all_ops(); + if (op_cap->type == RTE_BBDEV_OP_TURBO_DEC) { const struct rte_bbdev_op_cap_turbo_dec *cap = &op_cap->cap.turbo_dec; -- 2.17.1
[dpdk-dev] [PATCH v6 6/9] baseband/la12xx: add enqueue and dequeue support
From: Hemant Agrawal Add support for enqueue and dequeue the LDPC enc/dec from the modem device. Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- doc/guides/bbdevs/features/la12xx.ini | 13 + doc/guides/bbdevs/la12xx.rst | 47 ++- drivers/baseband/la12xx/bbdev_la12xx.c | 328 - drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 37 +++ 4 files changed, 420 insertions(+), 5 deletions(-) create mode 100644 doc/guides/bbdevs/features/la12xx.ini diff --git a/doc/guides/bbdevs/features/la12xx.ini b/doc/guides/bbdevs/features/la12xx.ini new file mode 100644 index 00..0aec5eecb6 --- /dev/null +++ b/doc/guides/bbdevs/features/la12xx.ini @@ -0,0 +1,13 @@ +; +; Supported features of the 'la12xx' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Turbo Decoder (4G) = N +Turbo Encoder (4G) = N +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = N +HW Accelerated = Y +BBDEV API = Y diff --git a/doc/guides/bbdevs/la12xx.rst b/doc/guides/bbdevs/la12xx.rst index 3c9ac5c047..b111ec0dd6 100644 --- a/doc/guides/bbdevs/la12xx.rst +++ b/doc/guides/bbdevs/la12xx.rst @@ -16,10 +16,11 @@ Features LA12xx PMD supports the following features: +- LDPC Encode in the DL +- LDPC Decode in the UL - Maximum of 8 UL queues - Maximum of 8 DL queues - PCIe Gen-3 x8 Interface -- MSI-X Installation @@ -79,3 +80,47 @@ For enabling logs, use the following EAL parameter: Using ``bb.la12xx`` as log matching criteria, all Baseband PMD logs can be enabled which are lower than logging ``level``. + +Test Application + + +BBDEV provides a test application, ``test-bbdev.py`` and range of test data for testing +the functionality of LA12xx for FEC encode and decode, depending on the device +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). + "-s", "--snr": SNR in dB used when generating LLRs for bler tests. + "-s", "--iter_max" : Number of iterations for LDPC decoder. + "-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 decode or encode data, +type one of the following: + +.. code-block:: console + + ./test-bbdev.py -e="--vdev=baseband_la12xx,socket_id=0,max_nb_queues=8" -c validation -n 64 -b 1 -v ./ldpc_dec_default.data + ./test-bbdev.py -e="--vdev=baseband_la12xx,socket_id=0,max_nb_queues=8" -c validation -n 64 -b 1 -v ./ldpc_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. + + +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 LA12xx FEC capabilities which may cause some +testcases to be skipped, but no failure should be reported. diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index c758fe3833..fa16660a77 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -122,6 +122,10 @@ la12xx_queue_release(struct rte_bbdev *dev, uint16_t q_id) ((uint64_t) ((unsigned long) (A) \ - ((uint64_t)ipc_priv->hugepg_start.host_vaddr))) +#define MODEM_P2V(A) \ + ((uint64_t) ((unsigned long) (A) \ + + (unsigned long)(ipc_priv->peb_start.host_vaddr))) + static int ipc_queue_configure(uint32_t channel_id, ipc_t instance, struct bbdev_la12xx_q_priv *q_priv) { @@ -336,6 +340,318 @@ static const struct rte_bbdev_ops pmd_ops = { .queue_release = la12xx_queue_release, .start = la12xx_start }; + +static inline int +is_bd_ring_ful
[dpdk-dev] [PATCH v6 9/9] app/bbdev: add test vectors for transport blocks
From: Nipun Gupta This patch adds two test vectors for transport block in network byte order: - LDPC encode for Transport Block - LDPC decode for Transport block Signed-off-by: Nipun Gupta --- app/test-bbdev/test_vectors/ldpc_dec_tb.data | 265 +++ app/test-bbdev/test_vectors/ldpc_enc_tb.data | 95 +++ 2 files changed, 360 insertions(+) create mode 100644 app/test-bbdev/test_vectors/ldpc_dec_tb.data create mode 100644 app/test-bbdev/test_vectors/ldpc_enc_tb.data diff --git a/app/test-bbdev/test_vectors/ldpc_dec_tb.data b/app/test-bbdev/test_vectors/ldpc_dec_tb.data new file mode 100644 index 00..5882e8aafe --- /dev/null +++ b/app/test-bbdev/test_vectors/ldpc_dec_tb.data @@ -0,0 +1,265 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2021 NXP + +op_type = +RTE_BBDEV_OP_LDPC_DEC + +input0 = +0x7f818181, 0x7f7f817f, 0x7f817f81, 0x817f8181, 0x817f7f81, 0x817f7f81, 0x7f817f7f, 0x7f7f7f81, +0x7f7f7f7f, 0x817f7f7f, 0x7f7f8181, 0x817f7f7f, 0x7f7f817f, 0x8181817f, 0x817f7f81, 0x7f7f8181, +0x81817f81, 0x7f7f7f81, 0x81817f7f, 0x7f81817f, 0x817f7f81, 0x7f817f81, 0x8181817f, 0x7f7f7f81, +0x7f7f817f, 0x81817f7f, 0x7f81817f, 0x7f7f817f, 0x817f817f, 0x7f7f817f, 0x7f7f7f81, 0x7f7f7f81, +0x7f817f7f, 0x7f818181, 0x7f818181, 0x8181817f, 0x7f7f8181, 0x7f7f7f7f, 0x7f817f7f, 0x81818181, +0x7f7f817f, 0x7f7f7f7f, 0x817f8181, 0x7f7f7f81, 0x817f817f, 0x817f8181, 0x81817f7f, 0x7f7f7f7f, +0x81817f7f, 0x7f81817f, 0x817f7f7f, 0x817f7f81, 0x7f817f7f, 0x817f817f, 0x81817f81, 0x817f7f7f, +0x817f7f81, 0x817f817f, 0x8181817f, 0x81818181, 0x81818181, 0x817f7f7f, 0x7f817f81, 0x817f7f7f, +0x7f817f7f, 0x7f817f7f, 0x7f818181, 0x7f818181, 0x817f817f, 0x81817f81, 0x7f81817f, 0x817f817f, +0x7f81817f, 0x817f7f81, 0x7f7f817f, 0x817f8181, 0x817f7f81, 0x81817f7f, 0x8181817f, 0x7f7f7f7f, +0x817f7f81, 0x7f81817f, 0x7f7f7f7f, 0x7f817f81, 0x7f817f81, 0x817f7f7f, 0x81818181, 0x7f7f8181, +0x7f818181, 0x81817f7f, 0x7f817f81, 0x7f81817f, 0x7f7f8181, 0x7f7f817f, 0x7f7f817f, 0x81817f81, +0x7f818181, 0x8181817f, 0x7f817f81, 0x7f7f8181, 0x7f7f8181, 0x817f7f81, 0x7f7f7f7f, 0x7f817f7f, +0x7f7f8181, 0x7f817f7f, 0x7f818181, 0x81817f7f, 0x817f7f7f, 0x81817f81, 0x7f817f7f, 0x7f81817f, +0x7f81817f, 0x817f7f81, 0x7f817f7f, 0x817f817f, 0x7f7f817f, 0x817f7f81, 0x817f817f, 0x817f8181, +0x817f817f, 0x7f817f7f, 0x7f817f7f, 0x8181817f, 0x7f818181, 0x7f817f7f, 0x7f818181, 0x7f7f817f, +0x817f8181, 0x8181817f, 0x7f817f7f, 0x7f7f817f, 0x7f7f817f, 0x7f7f8181, 0x817f7f7f, 0x817f8181, +0x7f7f817f, 0x7f7f7f81, 0x817f7f81, 0x7f7f7f81, 0x7f7f7f7f, 0x817f8181, 0x81818181, 0x81817f81, +0x817f7f81, 0x7f7f817f, 0x7f817f7f, 0x7f7f8181, 0x7f7f7f81, 0x7f817f81, 0x817f8181, 0x81817f7f, +0x7f7f817f, 0x7f817f81, 0x7f817f81, 0x7f7f7f81, 0x81818181, 0x81817f7f, 0x7f7f817f, 0x7f817f81, +0x7f7f8181, 0x7f81817f, 0x817f8181, 0x7f7f8181, 0x7f7f7f81, 0x8181817f, 0x7f817f81, 0x81817f7f, +0x817f7f81, 0x817f8181, 0x817f7f7f, 0x7f7f817f, 0x817f7f7f, 0x81817f81, 0x7f7f7f7f, 0x817f7f7f, +0x817f7f81, 0x7f817f81, 0x8181817f, 0x81817f7f, 0x817f7f81, 0x7f818181, 0x7f7f817f, 0x7f818181, +0x7f7f7f7f, 0x7f7f8181, 0x7f7f817f, 0x7f817f81, 0x817f7f7f, 0x817f817f, 0x7f7f7f81, 0x7f7f7f81, +0x7f7f817f, 0x817f8181, 0x81817f81, 0x817f7f7f, 0x7f7f7f81, 0x817f7f7f, 0x7f7f7f7f, 0x7f7f817f, +0x81817f81, 0x7f7f7f81, 0x81817f7f, 0x81818181, 0x817f7f81, 0x817f817f, 0x817f7f7f, 0x7f7f7f7f, +0x7f81817f, 0x8181817f, 0x7f7f817f, 0x817f7f81, 0x7f81817f, 0x817f7f81, 0x7f7f817f, 0x7f818181, +0x817f7f7f, 0x817f7f81, 0x81817f81, 0x81817f81, 0x8181817f, 0x7f817f7f, 0x7f7f7f81, 0x8181817f, +0x7f817f81, 0x8181817f, 0x7f7f7f81, 0x817f8181, 0x817f7f81, 0x81817f81, 0x7f7f817f, 0x7f7f817f, +0x817f7f7f, 0x817f8181, 0x7f817f7f, 0x817f7f81, 0x7f7f7f81, 0x7f7f7f7f, 0x817f8181, 0x7f817f81, +0x81817f81, 0x7f7f7f81, 0x817f7f7f, 0x817f817f, 0x81817f7f, 0x817f7f81, 0x7f81817f, 0x817f817f, +0x81817f81, 0x8181817f, 0x7f818181, 0x7f81817f, 0x8181817f, 0x817f7f7f, 0x7f817f7f, 0x8181817f, +0x7f7f7f7f, 0x81817f7f, 0x7f7f7f81, 0x817f7f81, 0x7f7f7f81, 0x7f817f7f, 0x7f7f7f7f, 0x817f7f81, +0x7f818181, 0x817f7f7f, 0x7f7f7f81, 0x817f7f7f, 0x81818181, 0x81817f7f, 0x7f817f81, 0x7f7f7f81, +0x7f818181, 0x817f8181, 0x81817f81, 0x8181817f, 0x7f7f8181, 0x817f7f81, 0x7f81817f, 0x7f7f817f, +0x7f7f8181, 0x7f817f7f, 0x8181817f, 0x7f817f81, 0x7f817f7f, 0x7f7f8181, 0x7f818181, 0x7f7f8181, +0x817f7f81, 0x81817f81, 0x7f81817f, 0x81817f81, 0x817f7f7f, 0x7f818181, 0x8181817f, 0x817f8181, +0x7f7f7f81, 0x7f81817f, 0x81817f7f, 0x7f817f81, 0x7f7f817f, 0x7f7f8181, 0x7f81817f, 0x7f81817f, +0x7f818181, 0x817f7f7f, 0x817f8181, 0x7f7f8181, 0x8181817f, 0x7f817f81, 0x817f8181, 0x817f817f, +0x7f7f817f, 0x81817f81, 0x7f817f7f, 0x7f81817f, 0x817f817f, 0x81817f81, 0x7f7f7f7f, 0x8181817f, +0x7f817f81, 0x7f817f7f, 0x7f817f81, 0x7f817f7f, 0x7f7f7f81, 0x817f817f, 0x7f81817f, 0x817f7f81, +0x81818181, 0x7f817f81, 0x7f7f7f81, 0x7f81817f, 0x817f7f7f, 0x817f7f81, 0x817f7f7f, 0x81817f81, +0x7f7f817f, 0x817f8181, 0x81818181
[dpdk-dev] [PATCH v6 5/9] baseband/la12xx: add queue and modem config support
From: Hemant Agrawal This patch add support for connecting with modem and creating the ipc channel as queues with modem for the exchange of data. Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- MAINTAINERS| 1 + doc/guides/bbdevs/index.rst| 1 + doc/guides/bbdevs/la12xx.rst | 81 +++ doc/guides/rel_notes/release_21_11.rst | 5 + drivers/baseband/la12xx/bbdev_la12xx.c | 553 - drivers/baseband/la12xx/bbdev_la12xx.h | 17 +- drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 189 ++- 7 files changed, 834 insertions(+), 13 deletions(-) create mode 100644 doc/guides/bbdevs/la12xx.rst diff --git a/MAINTAINERS b/MAINTAINERS index cbae1bc23a..ee3349a15f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1295,6 +1295,7 @@ NXP LA12xx driver M: Nipun Gupta M: Hemant Agrawal F: drivers/baseband/la12xx/ +F: doc/guides/bbdevs/la12xx.rst Rawdev Drivers diff --git a/doc/guides/bbdevs/index.rst b/doc/guides/bbdevs/index.rst index 4445cbd1b0..cedd706fa6 100644 --- a/doc/guides/bbdevs/index.rst +++ b/doc/guides/bbdevs/index.rst @@ -14,3 +14,4 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 +la12xx diff --git a/doc/guides/bbdevs/la12xx.rst b/doc/guides/bbdevs/la12xx.rst new file mode 100644 index 00..3c9ac5c047 --- /dev/null +++ b/doc/guides/bbdevs/la12xx.rst @@ -0,0 +1,81 @@ +.. SPDX-License-Identifier: BSD-3-Clause +Copyright 2021 NXP + +NXP LA12xx Poll Mode Driver +=== + +The BBDEV LA12xx poll mode driver (PMD) supports an implementation for +offloading High Phy processing functions like LDPC Encode / Decode 5GNR wireless +acceleration function, using PCI based LA12xx Software defined radio. + +More information can be found at `NXP Official Website +<https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/layerscape-processors/layerscape-access-la1200-programmable-baseband-processor:LA1200>`_. + +Features + + +LA12xx PMD supports the following features: + +- Maximum of 8 UL queues +- Maximum of 8 DL queues +- PCIe Gen-3 x8 Interface +- MSI-X + +Installation + + +Section 3 of the DPDK manual provides instructions on installing and compiling DPDK. + +DPDK requires hugepages to be configured as detailed in section 2 of the DPDK manual. + +Initialization +-- + +The device can be listed on the host console with: + + +Use the following lspci command to get the multiple LA12xx processor ids. The +device ID of the LA12xx baseband processor is "1c30". + +.. code-block:: console + + sudo lspci -nn + +... +0001:01:00.0 Power PC [0b20]: Freescale Semiconductor Inc Device [1957:1c30] ( +rev 10) +... +0002:01:00.0 Power PC [0b20]: Freescale Semiconductor Inc Device [1957:1c30] ( +rev 10) + + +Prerequisites +- + +Currently supported by DPDK: + +- NXP LA1224 BSP **1.0+**. +- NXP LA1224 PCIe Modem card connected to ARM host. + +- Follow the DPDK :ref:`Getting Started Guide for Linux ` to setup the basic DPDK environment. + +* Use dev arg option ``modem=0`` to identify the modem instance for a given + device. This is required only if more than 1 modem cards are attached to host. + this is optional and the default value is 0. + e.g. ``--vdev=baseband_la12xx,modem=0`` + +* Use dev arg option ``max_nb_queues=x`` to specify the maximum number of queues + to be used for communication with offload device i.e. modem. default is 16. + e.g. ``--vdev=baseband_la12xx,max_nb_queues=4`` + +Enabling logs +- + +For enabling logs, use the following EAL parameter: + +.. code-block:: console + + ./your_bbdev_application --log-level=la12xx: + +Using ``bb.la12xx`` as log matching criteria, all Baseband PMD logs can be +enabled which are lower than logging ``level``. diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index 675b573834..a0e0ebbeb8 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -62,6 +62,11 @@ New Features * Added bus-level parsing of the devargs syntax. * Kept compatibility with the legacy syntax as parsing fallback. +* **Added NXP LA12xx baseband PMD.** + + * Added a new baseband PMD driver for NXP LA12xx Software defined radio. + * See the :doc:`../bbdevs/la12xx` for more details. + Removed Items - diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index f26f3f2a08..c758fe3833 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -3,6 +3,11 @@ */ #include +#include +#include +#include +#include +#include #include #include @@ -31,11 +36,550 @@ struct bbdev_la12xx_params { #define LA12XX_VDEV_MODEM_ID_ARG "modem" #define LA12XX_MAX_MODEM 4 +#define LA12XX_MAX_CORES 4 +#define LA12XX_
[dpdk-dev] [PATCH 00/11] NXP DPAAx Bus and PMD changes
From: Nipun Gupta This series adds new functionality related to flow redirection, multiple ordered tx enqueues, generating HW hash key etc. It also updates the MC firmware version and includes a fix in dpaxx library. Gagandeep Singh (1): common/dpaax: fix paddr to vaddr invalid conversion Hemant Agrawal (4): bus/fslmc: updated MC FW to 10.28 bus/fslmc: add qbman debug APIs support net/dpaa2: add debug print for MTU set for jumbo net/dpaa2: add function to generate HW hash key Jun Yang (2): net/dpaa2: support Tx flow redirection action net/dpaa2: support multiple Tx queues enqueue for ordered Nipun Gupta (2): raw/dpaa2_qdma: use correct params for config and queue setup raw/dpaa2_qdma: remove checks for lcore ID Rohit Raj (1): net/dpaa: add comments to explain driver behaviour Vanshika Shukla (1): net/dpaa2: update RSS to support additional distributions drivers/bus/fslmc/mc/dpdmai.c | 4 +- drivers/bus/fslmc/mc/fsl_dpdmai.h | 21 +- drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h | 15 +- drivers/bus/fslmc/mc/fsl_dpmng.h | 4 +- drivers/bus/fslmc/mc/fsl_dpopr.h | 7 +- .../bus/fslmc/qbman/include/fsl_qbman_debug.h | 203 +- drivers/bus/fslmc/qbman/qbman_debug.c | 623 ++ drivers/bus/fslmc/qbman/qbman_portal.c| 6 + drivers/common/dpaax/dpaax_iova_table.h | 8 +- drivers/event/dpaa2/dpaa2_eventdev.c | 12 +- drivers/net/dpaa/dpaa_fmc.c | 8 +- drivers/net/dpaa2/base/dpaa2_hw_dpni.c| 70 +- drivers/net/dpaa2/base/dpaa2_tlu_hash.c | 149 + drivers/net/dpaa2/dpaa2_ethdev.c | 9 +- drivers/net/dpaa2/dpaa2_ethdev.h | 11 +- drivers/net/dpaa2/dpaa2_flow.c| 116 +++- drivers/net/dpaa2/dpaa2_rxtx.c| 142 drivers/net/dpaa2/mc/dpdmux.c | 43 ++ drivers/net/dpaa2/mc/dpni.c | 48 +- drivers/net/dpaa2/mc/dprtc.c | 78 ++- drivers/net/dpaa2/mc/fsl_dpdmux.h | 6 + drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h | 9 + drivers/net/dpaa2/mc/fsl_dpkg.h | 6 +- drivers/net/dpaa2/mc/fsl_dpni.h | 147 - drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 55 +- drivers/net/dpaa2/mc/fsl_dprtc.h | 19 +- drivers/net/dpaa2/mc/fsl_dprtc_cmd.h | 25 +- drivers/net/dpaa2/meson.build | 1 + drivers/net/dpaa2/rte_pmd_dpaa2.h | 19 + drivers/net/dpaa2/version.map | 3 + drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 26 +- drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h | 8 +- 32 files changed, 1788 insertions(+), 113 deletions(-) create mode 100644 drivers/net/dpaa2/base/dpaa2_tlu_hash.c -- 2.17.1
[dpdk-dev] [PATCH 01/11] bus/fslmc: updated MC FW to 10.28
From: Hemant Agrawal Updating MC firmware support APIs to be latest. It supports improved DPDMUX (SRIOV equivalent) for traffic split between dpnis and additional PTP APIs. Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/mc/dpdmai.c | 4 +- drivers/bus/fslmc/mc/fsl_dpdmai.h | 21 - drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h | 15 ++-- drivers/bus/fslmc/mc/fsl_dpmng.h | 4 +- drivers/bus/fslmc/mc/fsl_dpopr.h | 7 +- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/mc/dpdmux.c | 43 + drivers/net/dpaa2/mc/dpni.c | 48 ++ drivers/net/dpaa2/mc/dprtc.c | 78 +++- drivers/net/dpaa2/mc/fsl_dpdmux.h | 6 ++ drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h | 9 ++ drivers/net/dpaa2/mc/fsl_dpkg.h | 6 +- drivers/net/dpaa2/mc/fsl_dpni.h | 124 ++ drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 55 +--- drivers/net/dpaa2/mc/fsl_dprtc.h | 19 +++- drivers/net/dpaa2/mc/fsl_dprtc_cmd.h | 25 +- 16 files changed, 401 insertions(+), 65 deletions(-) diff --git a/drivers/bus/fslmc/mc/dpdmai.c b/drivers/bus/fslmc/mc/dpdmai.c index dcb9d516a1..9c2f3bf9d5 100644 --- a/drivers/bus/fslmc/mc/dpdmai.c +++ b/drivers/bus/fslmc/mc/dpdmai.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2021 NXP */ #include @@ -116,6 +116,7 @@ int dpdmai_create(struct fsl_mc_io *mc_io, cmd_params->num_queues = cfg->num_queues; cmd_params->priorities[0] = cfg->priorities[0]; cmd_params->priorities[1] = cfg->priorities[1]; + cmd_params->options = cpu_to_le32(cfg->adv.options); /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -299,6 +300,7 @@ int dpdmai_get_attributes(struct fsl_mc_io *mc_io, attr->id = le32_to_cpu(rsp_params->id); attr->num_of_priorities = rsp_params->num_of_priorities; attr->num_of_queues = rsp_params->num_of_queues; + attr->options = le32_to_cpu(rsp_params->options); return 0; } diff --git a/drivers/bus/fslmc/mc/fsl_dpdmai.h b/drivers/bus/fslmc/mc/fsl_dpdmai.h index 19328c00a0..5af8ed48c0 100644 --- a/drivers/bus/fslmc/mc/fsl_dpdmai.h +++ b/drivers/bus/fslmc/mc/fsl_dpdmai.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2021 NXP */ #ifndef __FSL_DPDMAI_H @@ -36,15 +36,32 @@ int dpdmai_close(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token); +/* DPDMAI options */ + +/** + * Enable individual Congestion Groups usage per each priority queue + * If this option is not enabled then only one CG is used for all priority + * queues + * If this option is enabled then a separate specific CG is used for each + * individual priority queue. + * In this case the priority queue must be specified via congestion notification + * API + */ +#define DPDMAI_OPT_CG_PER_PRIORITY 0x0001 + /** * struct dpdmai_cfg - Structure representing DPDMAI configuration * @priorities: Priorities for the DMA hardware processing; valid priorities are * configured with values 1-8; the entry following last valid entry * should be configured with 0 + * @options: dpdmai options */ struct dpdmai_cfg { uint8_t num_queues; uint8_t priorities[DPDMAI_PRIO_NUM]; + struct { + uint32_t options; + } adv; }; int dpdmai_create(struct fsl_mc_io *mc_io, @@ -81,11 +98,13 @@ int dpdmai_reset(struct fsl_mc_io *mc_io, * struct dpdmai_attr - Structure representing DPDMAI attributes * @id: DPDMAI object ID * @num_of_priorities: number of priorities + * @options: dpdmai options */ struct dpdmai_attr { int id; uint8_t num_of_priorities; uint8_t num_of_queues; + uint32_t options; }; __rte_internal diff --git a/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h b/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h index 7e122de4ef..c8f6b990f8 100644 --- a/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h +++ b/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h @@ -1,32 +1,33 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2017-2018, 2020-2021 NXP */ - #ifndef _FSL_DPDMAI_CMD_H #define _FSL_DPDMAI_CMD_H /* DPDMAI Version */ #define DPDMAI_VER_MAJOR 3 -#define DPDMAI_VER_MINOR 3 +#define DPDMAI_VER_MINOR 4 /* Command versioning */ #define DPDMAI_CMD_BASE_VERSION1 #define DPDMAI_CMD_VERSION_2 2 +#define DPDMAI_CMD_VERSION_3 3 #define DPDMAI_CMD_ID_OFFSET 4 #define DPDMAI_CMD(id) ((id << DPDMAI_CMD_ID_OFFSET) | DPDMAI_CMD_BASE_VERSION) #define DPDMAI_CMD_V2(id) ((id << DPDMAI_CMD_ID_OFFSET) | DPDMAI_CMD_VERSION_2) +#define DPDMAI_CMD_V3(id) ((id << DPDMAI_CMD_ID_OFFSET) | DPDMAI_CMD_VERSION_3) /* Command IDs */ #define DPDMAI_CMDID_CLOSE DPDMAI_CMD(0x8
[dpdk-dev] [PATCH 02/11] net/dpaa2: support Tx flow redirection action
From: Jun Yang TX redirection support by flow action RTE_FLOW_ACTION_TYPE_PHY_PORT and RTE_FLOW_ACTION_TYPE_PORT_ID This action is executed by HW to forward packets between ports. If the ingress packets match the rule, the packets are switched without software involved and perf is improved as well. Signed-off-by: Jun Yang --- drivers/net/dpaa2/dpaa2_ethdev.c | 5 ++ drivers/net/dpaa2/dpaa2_ethdev.h | 1 + drivers/net/dpaa2/dpaa2_flow.c | 116 +++ drivers/net/dpaa2/mc/fsl_dpni.h | 23 ++ 4 files changed, 132 insertions(+), 13 deletions(-) diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 560b79151b..9cf55c0f0b 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -2822,6 +2822,11 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) return ret; } +int dpaa2_dev_is_dpaa2(struct rte_eth_dev *dev) +{ + return dev->device->driver == &rte_dpaa2_pmd.driver; +} + static int rte_dpaa2_probe(struct rte_dpaa2_driver *dpaa2_drv, struct rte_dpaa2_device *dpaa2_dev) diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index b9c729f6cd..3f34d7ecff 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -240,6 +240,7 @@ uint16_t dummy_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts); void dpaa2_dev_free_eqresp_buf(uint16_t eqresp_ci); void dpaa2_flow_clean(struct rte_eth_dev *dev); uint16_t dpaa2_dev_tx_conf(void *queue) __rte_unused; +int dpaa2_dev_is_dpaa2(struct rte_eth_dev *dev); int dpaa2_timesync_enable(struct rte_eth_dev *dev); int dpaa2_timesync_disable(struct rte_eth_dev *dev); diff --git a/drivers/net/dpaa2/dpaa2_flow.c b/drivers/net/dpaa2/dpaa2_flow.c index bfe17c350a..5de886ec5e 100644 --- a/drivers/net/dpaa2/dpaa2_flow.c +++ b/drivers/net/dpaa2/dpaa2_flow.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018-2020 NXP + * Copyright 2018-2021 NXP */ #include @@ -30,10 +30,10 @@ int mc_l4_port_identification; static char *dpaa2_flow_control_log; -static int dpaa2_flow_miss_flow_id = +static uint16_t dpaa2_flow_miss_flow_id = DPNI_FS_MISS_DROP; -#define FIXED_ENTRY_SIZE 54 +#define FIXED_ENTRY_SIZE DPNI_MAX_KEY_SIZE enum flow_rule_ipaddr_type { FLOW_NONE_IPADDR, @@ -83,9 +83,18 @@ static const enum rte_flow_action_type dpaa2_supported_action_type[] = { RTE_FLOW_ACTION_TYPE_END, RTE_FLOW_ACTION_TYPE_QUEUE, + RTE_FLOW_ACTION_TYPE_PHY_PORT, + RTE_FLOW_ACTION_TYPE_PORT_ID, RTE_FLOW_ACTION_TYPE_RSS }; +static const +enum rte_flow_action_type dpaa2_supported_fs_action_type[] = { + RTE_FLOW_ACTION_TYPE_QUEUE, + RTE_FLOW_ACTION_TYPE_PHY_PORT, + RTE_FLOW_ACTION_TYPE_PORT_ID +}; + /* Max of enum rte_flow_item_type + 1, for both IPv4 and IPv6*/ #define DPAA2_FLOW_ITEM_TYPE_GENERIC_IP (RTE_FLOW_ITEM_TYPE_META + 1) @@ -2937,6 +2946,19 @@ dpaa2_configure_flow_raw(struct rte_flow *flow, return 0; } +static inline int dpaa2_fs_action_supported( + enum rte_flow_action_type action) +{ + int i; + + for (i = 0; i < (int)(sizeof(dpaa2_supported_fs_action_type) / + sizeof(enum rte_flow_action_type)); i++) { + if (action == dpaa2_supported_fs_action_type[i]) + return 1; + } + + return 0; +} /* The existing QoS/FS entry with IP address(es) * needs update after * new extract(s) are inserted before IP @@ -3115,7 +3137,7 @@ dpaa2_flow_entry_update( } } - if (curr->action != RTE_FLOW_ACTION_TYPE_QUEUE) { + if (!dpaa2_fs_action_supported(curr->action)) { curr = LIST_NEXT(curr, next); continue; } @@ -3253,6 +3275,43 @@ dpaa2_flow_verify_attr( return 0; } +static inline struct rte_eth_dev * +dpaa2_flow_redirect_dev(struct dpaa2_dev_priv *priv, + const struct rte_flow_action *action) +{ + const struct rte_flow_action_phy_port *phy_port; + const struct rte_flow_action_port_id *port_id; + int idx = -1; + struct rte_eth_dev *dest_dev; + + if (action->type == RTE_FLOW_ACTION_TYPE_PHY_PORT) { + phy_port = (const struct rte_flow_action_phy_port *) + action->conf; + if (!phy_port->original) + idx = phy_port->index; + } else if (action->type == RTE_FLOW_ACTION_TYPE_PORT_ID) { + port_id = (const struct rte_flow_action_port_id *) + action->conf; + if (!port_id->original) + idx = port_id->id; + } else { + return NULL; + } + + if (idx >= 0) { + if (!rte_eth_dev_is_valid_port(idx)) +
[dpdk-dev] [PATCH 03/11] bus/fslmc: add qbman debug APIs support
From: Hemant Agrawal Add support for debugging qbman FQs Signed-off-by: Youri Querry Signed-off-by: Roy Pledge Signed-off-by: Hemant Agrawal Signed-off-by: Nipun Gupta --- .../bus/fslmc/qbman/include/fsl_qbman_debug.h | 203 +- drivers/bus/fslmc/qbman/qbman_debug.c | 623 ++ drivers/bus/fslmc/qbman/qbman_portal.c| 6 + 3 files changed, 826 insertions(+), 6 deletions(-) diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_debug.h b/drivers/bus/fslmc/qbman/include/fsl_qbman_debug.h index 54096e8774..fa02bc928e 100644 --- a/drivers/bus/fslmc/qbman/include/fsl_qbman_debug.h +++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_debug.h @@ -1,13 +1,118 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright (C) 2015 Freescale Semiconductor, Inc. - * Copyright 2020 NXP + * Copyright 2018-2020 NXP */ #ifndef _FSL_QBMAN_DEBUG_H #define _FSL_QBMAN_DEBUG_H -#include struct qbman_swp; +/* Buffer pool query commands */ +struct qbman_bp_query_rslt { + uint8_t verb; + uint8_t rslt; + uint8_t reserved[4]; + uint8_t bdi; + uint8_t state; + uint32_t fill; + uint32_t hdptr; + uint16_t swdet; + uint16_t swdxt; + uint16_t hwdet; + uint16_t hwdxt; + uint16_t swset; + uint16_t swsxt; + uint16_t vbpid; + uint16_t icid; + uint64_t bpscn_addr; + uint64_t bpscn_ctx; + uint16_t hw_targ; + uint8_t dbe; + uint8_t reserved2; + uint8_t sdcnt; + uint8_t hdcnt; + uint8_t sscnt; + uint8_t reserved3[9]; +}; + +int qbman_bp_query(struct qbman_swp *s, uint32_t bpid, + struct qbman_bp_query_rslt *r); +int qbman_bp_get_bdi(struct qbman_bp_query_rslt *r); +int qbman_bp_get_va(struct qbman_bp_query_rslt *r); +int qbman_bp_get_wae(struct qbman_bp_query_rslt *r); +uint16_t qbman_bp_get_swdet(struct qbman_bp_query_rslt *r); +uint16_t qbman_bp_get_swdxt(struct qbman_bp_query_rslt *r); +uint16_t qbman_bp_get_hwdet(struct qbman_bp_query_rslt *r); +uint16_t qbman_bp_get_hwdxt(struct qbman_bp_query_rslt *r); +uint16_t qbman_bp_get_swset(struct qbman_bp_query_rslt *r); +uint16_t qbman_bp_get_swsxt(struct qbman_bp_query_rslt *r); +uint16_t qbman_bp_get_vbpid(struct qbman_bp_query_rslt *r); +uint16_t qbman_bp_get_icid(struct qbman_bp_query_rslt *r); +int qbman_bp_get_pl(struct qbman_bp_query_rslt *r); +uint64_t qbman_bp_get_bpscn_addr(struct qbman_bp_query_rslt *r); +uint64_t qbman_bp_get_bpscn_ctx(struct qbman_bp_query_rslt *r); +uint16_t qbman_bp_get_hw_targ(struct qbman_bp_query_rslt *r); +int qbman_bp_has_free_bufs(struct qbman_bp_query_rslt *r); +uint32_t qbman_bp_num_free_bufs(struct qbman_bp_query_rslt *r); +int qbman_bp_is_depleted(struct qbman_bp_query_rslt *r); +int qbman_bp_is_surplus(struct qbman_bp_query_rslt *r); +uint32_t qbman_bp_get_hdptr(struct qbman_bp_query_rslt *r); +uint32_t qbman_bp_get_sdcnt(struct qbman_bp_query_rslt *r); +uint32_t qbman_bp_get_hdcnt(struct qbman_bp_query_rslt *r); +uint32_t qbman_bp_get_sscnt(struct qbman_bp_query_rslt *r); + +/* FQ query function for programmable fields */ +struct qbman_fq_query_rslt { + uint8_t verb; + uint8_t rslt; + uint8_t reserved[8]; + uint16_t cgid; + uint16_t dest_wq; + uint8_t reserved2; + uint8_t fq_ctrl; + uint16_t ics_cred; + uint16_t td_thresh; + uint16_t oal_oac; + uint8_t reserved3; + uint8_t mctl; + uint64_t fqd_ctx; + uint16_t icid; + uint16_t reserved4; + uint32_t vfqid; + uint32_t fqid_er; + uint16_t opridsz; + uint8_t reserved5[18]; +}; + +int qbman_fq_query(struct qbman_swp *s, uint32_t fqid, + struct qbman_fq_query_rslt *r); +uint8_t qbman_fq_attr_get_fqctrl(struct qbman_fq_query_rslt *r); +uint16_t qbman_fq_attr_get_cgrid(struct qbman_fq_query_rslt *r); +uint16_t qbman_fq_attr_get_destwq(struct qbman_fq_query_rslt *r); +uint16_t qbman_fq_attr_get_tdthresh(struct qbman_fq_query_rslt *r); +int qbman_fq_attr_get_oa_ics(struct qbman_fq_query_rslt *r); +int qbman_fq_attr_get_oa_cgr(struct qbman_fq_query_rslt *r); +uint16_t qbman_fq_attr_get_oal(struct qbman_fq_query_rslt *r); +int qbman_fq_attr_get_bdi(struct qbman_fq_query_rslt *r); +int qbman_fq_attr_get_ff(struct qbman_fq_query_rslt *r); +int qbman_fq_attr_get_va(struct qbman_fq_query_rslt *r); +int qbman_fq_attr_get_ps(struct qbman_fq_query_rslt *r); +int qbman_fq_attr_get_pps(struct qbman_fq_query_rslt *r); +uint16_t qbman_fq_attr_get_icid(struct qbman_fq_query_rslt *r); +int qbman_fq_attr_get_pl(struct qbman_fq_query_rslt *r); +uint32_t qbman_fq_attr_get_vfqid(struct qbman_fq_query_rslt *r); +uint32_t qbman_fq_attr_get_erfqid(struct qbman_fq_query_rslt *r); +uint16_t qbman_fq_attr_get_opridsz(struct qbman_fq_query_rslt *r); + +/* FQ query command for non-programmable fields*/ +enum qbman_fq_schedstate_e { + qbman_fq_schedstate_oos = 0
[dpdk-dev] [PATCH 05/11] net/dpaa2: add debug print for MTU set for jumbo
From: Hemant Agrawal This patch adds a debug print for MTU configured on the device when jumbo frames are enabled. Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 9cf55c0f0b..275656fbe4 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -573,6 +573,8 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev) dev->data->dev_conf.rxmode.max_rx_pkt_len - RTE_ETHER_HDR_LEN - RTE_ETHER_CRC_LEN - VLAN_TAG_SIZE; + DPAA2_PMD_INFO("MTU configured for the device: %d", + dev->data->mtu); } else { return -1; } -- 2.17.1
[dpdk-dev] [PATCH 04/11] net/dpaa2: support multiple Tx queues enqueue for ordered
From: Jun Yang Support the tx enqueue in order queue mode, where the queue id for each event may be different. Signed-off-by: Jun Yang --- drivers/event/dpaa2/dpaa2_eventdev.c | 12 ++- drivers/net/dpaa2/dpaa2_ethdev.h | 3 + drivers/net/dpaa2/dpaa2_rxtx.c | 142 +++ drivers/net/dpaa2/version.map| 1 + 4 files changed, 154 insertions(+), 4 deletions(-) diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index 5ccf22f77f..28f3bbca9a 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2017,2019 NXP + * Copyright 2017,2019-2021 NXP */ #include @@ -1002,16 +1002,20 @@ dpaa2_eventdev_txa_enqueue(void *port, struct rte_event ev[], uint16_t nb_events) { - struct rte_mbuf *m = (struct rte_mbuf *)ev[0].mbuf; + void *txq[32]; + struct rte_mbuf *m[32]; uint8_t qid, i; RTE_SET_USED(port); for (i = 0; i < nb_events; i++) { - qid = rte_event_eth_tx_adapter_txq_get(m); - rte_eth_tx_burst(m->port, qid, &m, 1); + m[i] = (struct rte_mbuf *)ev[i].mbuf; + qid = rte_event_eth_tx_adapter_txq_get(m[i]); + txq[i] = rte_eth_devices[m[i]->port].data->tx_queues[qid]; } + dpaa2_dev_tx_multi_txq_ordered(txq, m, nb_events); + return nb_events; } diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index 3f34d7ecff..07a6811dd2 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -236,6 +236,9 @@ void dpaa2_dev_process_ordered_event(struct qbman_swp *swp, uint16_t dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts); uint16_t dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts); +uint16_t dpaa2_dev_tx_multi_txq_ordered(void **queue, + struct rte_mbuf **bufs, uint16_t nb_pkts); + uint16_t dummy_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts); void dpaa2_dev_free_eqresp_buf(uint16_t eqresp_ci); void dpaa2_flow_clean(struct rte_eth_dev *dev); diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index f40369e2c3..447063b3c3 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -1445,6 +1445,148 @@ dpaa2_set_enqueue_descriptor(struct dpaa2_queue *dpaa2_q, *dpaa2_seqn(m) = DPAA2_INVALID_MBUF_SEQN; } +__rte_internal uint16_t +dpaa2_dev_tx_multi_txq_ordered(void **queue, + struct rte_mbuf **bufs, uint16_t nb_pkts) +{ + /* Function to transmit the frames to multiple queues respectively.*/ + uint32_t loop, retry_count; + int32_t ret; + struct qbman_fd fd_arr[MAX_TX_RING_SLOTS]; + uint32_t frames_to_send; + struct rte_mempool *mp; + struct qbman_eq_desc eqdesc[MAX_TX_RING_SLOTS]; + struct dpaa2_queue *dpaa2_q[MAX_TX_RING_SLOTS]; + struct qbman_swp *swp; + uint16_t bpid; + struct rte_mbuf *mi; + struct rte_eth_dev_data *eth_data; + struct dpaa2_dev_priv *priv; + struct dpaa2_queue *order_sendq; + + if (unlikely(!DPAA2_PER_LCORE_DPIO)) { + ret = dpaa2_affine_qbman_swp(); + if (ret) { + DPAA2_PMD_ERR( + "Failed to allocate IO portal, tid: %d\n", + rte_gettid()); + return 0; + } + } + swp = DPAA2_PER_LCORE_PORTAL; + + for (loop = 0; loop < nb_pkts; loop++) { + dpaa2_q[loop] = (struct dpaa2_queue *)queue[loop]; + eth_data = dpaa2_q[loop]->eth_data; + priv = eth_data->dev_private; + qbman_eq_desc_clear(&eqdesc[loop]); + if (*dpaa2_seqn(*bufs) && priv->en_ordered) { + order_sendq = (struct dpaa2_queue *)priv->tx_vq[0]; + dpaa2_set_enqueue_descriptor(order_sendq, +(*bufs), +&eqdesc[loop]); + } else { + qbman_eq_desc_set_no_orp(&eqdesc[loop], +DPAA2_EQ_RESP_ERR_FQ); + qbman_eq_desc_set_fq(&eqdesc[loop], +dpaa2_q[loop]->fqid); + } + + retry_count = 0; + while (qbman_result_SCN_state(dpaa2_q[loop]->cscn)) { + retry_count++; + /* Retry for some time before giving up */ + if (retry_count > CONG_RETRY_COUNT) + goto send_frames; + }
[dpdk-dev] [PATCH 06/11] net/dpaa2: add function to generate HW hash key
From: Hemant Agrawal This patch add support to generate the hash key in software equivalent to WRIOP key generation. Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/base/dpaa2_tlu_hash.c | 149 drivers/net/dpaa2/meson.build | 1 + drivers/net/dpaa2/rte_pmd_dpaa2.h | 19 +++ drivers/net/dpaa2/version.map | 2 + 4 files changed, 171 insertions(+) create mode 100644 drivers/net/dpaa2/base/dpaa2_tlu_hash.c diff --git a/drivers/net/dpaa2/base/dpaa2_tlu_hash.c b/drivers/net/dpaa2/base/dpaa2_tlu_hash.c new file mode 100644 index 00..e92f4f03ed --- /dev/null +++ b/drivers/net/dpaa2/base/dpaa2_tlu_hash.c @@ -0,0 +1,149 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2021 NXP + */ +#include +#include +#include +#include + +static unsigned int sbox(unsigned int x) +{ + unsigned int a, b, c, d; + unsigned int oa, ob, oc, od; + + a = x & 0x1; + b = (x >> 1) & 0x1; + c = (x >> 2) & 0x1; + d = (x >> 3) & 0x1; + + oa = ((a & ~b & ~c & d) | (~a & b) | (~a & ~c & ~d) | (b & c)) & 0x1; + ob = ((a & ~b & d) | (~a & c & ~d) | (b & ~c)) & 0x1; + oc = ((a & ~b & c) | (a & ~b & ~d) | (~a & b & ~d) | (~a & c & ~d) | +(b & c & d)) & 0x1; + od = ((a & ~b & c) | (~a & b & ~c) | (a & b & ~d) | (~a & c & d)) & 0x1; + + return ((od << 3) | (oc << 2) | (ob << 1) | oa); +} + +static unsigned int sbox_tbl[16]; + +static int pbox_tbl[16] = {5, 9, 0, 13, + 7, 2, 11, 14, + 1, 4, 12, 8, + 3, 15, 6, 10 }; + +static unsigned int mix_tbl[8][16]; + +static unsigned int stage(unsigned int input) +{ + int sbox_out = 0; + int pbox_out = 0; + + // mix + input ^= input >> 16; // xor lower + input ^= input << 16; // move original lower to upper + + // printf("%08x\n",input); + + for (int i = 0; i < 32; i += 4)// sbox stage + sbox_out |= (sbox_tbl[(input >> i) & 0xf]) << i; + + // permutation + for (int i = 0; i < 16; i++) + pbox_out |= ((sbox_out >> i) & 0x10001) << pbox_tbl[i]; + + return pbox_out; +} + +static unsigned int fast_stage(unsigned int input) +{ + int pbox_out = 0; + + // mix + input ^= input >> 16; // xor lower + input ^= input << 16; // move original lower to upper + + for (int i = 0; i < 32; i += 4) // sbox stage + pbox_out |= mix_tbl[i >> 2][(input >> i) & 0xf]; + + return pbox_out; +} + +static unsigned int fast_hash32(unsigned int x) +{ + for (int i = 0; i < 4; i++) + x = fast_stage(x); + return x; +} + +static unsigned int +byte_crc32(unsigned char data/* new byte for the crc calculation */, + unsigned old_crc/* crc result of the last iteration */) +{ + int i; + unsigned int crc, polynom = 0xedb88320; + /* the polynomial is built on the reversed version of +* the CRC polynomial with out the x64 element. +*/ + + crc = old_crc; + for (i = 0; i < 8; i++, data >>= 1) + crc = (crc >> 1) ^ (((crc ^ data) & 0x1) ? polynom : 0); + /* xor with polynomial is lsb of crc^data is 1 */ + + return crc; +} + +static unsigned int crc32_table[256]; + +static void init_crc32_table(void) +{ + int i; + + for (i = 0; i < 256; i++) + crc32_table[i] = byte_crc32((unsigned char)i, 0LL); +} + +static unsigned int +crc32_string(unsigned char *data, +int size, unsigned int old_crc) +{ + unsigned int crc; + + crc = old_crc; + for (int i = 0; i < size; i++) + crc = (crc >> 8) ^ crc32_table[(crc ^ data[i]) & 0xff]; + + return crc; +} + +static void hash_init(void) +{ + init_crc32_table(); + + for (int i = 0; i < 16; i++) + sbox_tbl[i] = sbox(i); + + for (int i = 0; i < 32; i += 4) + for (int j = 0; j < 16; j++) { + // (a,b) + // (b,a^b)=(X,Y) + // (X^Y,X) + unsigned int input = (0x ^ (8 << i)) | (j << i); + + input ^= input << 16; // (X^Y,Y) + input ^= input >> 16; // (X^Y,X) + mix_tbl[i >> 2][j] = stage(input); + //printf("aaa %08x\n", stage(input)); + } +} + +uint32_t rte_pmd_dpaa2_get_tlu_hash(uint8_t *data, int size) +{ + static int init; + + if (~init) + hash_init(); + init = 1; + return fast_hash32(crc32_string(data, size, 0x0)); +} diff --git a/drivers/net/dpaa2/meson.build b/drivers/net/dpaa2/meson.build index 20eaf0b8e4..4a6397d09e 100644 --- a/drivers/net/dpaa2/meson.build +++ b/drivers/net/dpaa2/meson.build @@ -20,6 +20,7 @@ sources = files( 'mc/dpkg.c', 'mc/dpdmux.c', 'mc/dpni.c', + 'base/d
[dpdk-dev] [PATCH 07/11] net/dpaa2: update RSS to support additional distributions
From: Vanshika Shukla This patch updates the RSS support to support following additional distributions: - VLAN - ESP - AH - PPPOE Signed-off-by: Vanshika Shukla --- drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 70 +- drivers/net/dpaa2/dpaa2_ethdev.h | 7 ++- 2 files changed, 75 insertions(+), 2 deletions(-) diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c index 641e7027f1..08f49af768 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c @@ -210,6 +210,10 @@ dpaa2_distset_to_dpkg_profile_cfg( int l2_configured = 0, l3_configured = 0; int l4_configured = 0, sctp_configured = 0; int mpls_configured = 0; + int vlan_configured = 0; + int esp_configured = 0; + int ah_configured = 0; + int pppoe_configured = 0; memset(kg_cfg, 0, sizeof(struct dpkg_profile_cfg)); while (req_dist_set) { @@ -217,6 +221,7 @@ dpaa2_distset_to_dpkg_profile_cfg( dist_field = 1ULL << loop; switch (dist_field) { case ETH_RSS_L2_PAYLOAD: + case ETH_RSS_ETH: if (l2_configured) break; @@ -231,7 +236,70 @@ dpaa2_distset_to_dpkg_profile_cfg( kg_cfg->extracts[i].extract.from_hdr.type = DPKG_FULL_FIELD; i++; - break; + break; + + case ETH_RSS_PPPOE: + if (pppoe_configured) + break; + kg_cfg->extracts[i].extract.from_hdr.prot = + NET_PROT_PPPOE; + kg_cfg->extracts[i].extract.from_hdr.field = + NH_FLD_PPPOE_SID; + kg_cfg->extracts[i].type = + DPKG_EXTRACT_FROM_HDR; + kg_cfg->extracts[i].extract.from_hdr.type = + DPKG_FULL_FIELD; + i++; + break; + + case ETH_RSS_ESP: + if (esp_configured) + break; + esp_configured = 1; + + kg_cfg->extracts[i].extract.from_hdr.prot = + NET_PROT_IPSEC_ESP; + kg_cfg->extracts[i].extract.from_hdr.field = + NH_FLD_IPSEC_ESP_SPI; + kg_cfg->extracts[i].type = + DPKG_EXTRACT_FROM_HDR; + kg_cfg->extracts[i].extract.from_hdr.type = + DPKG_FULL_FIELD; + i++; + break; + + case ETH_RSS_AH: + if (ah_configured) + break; + ah_configured = 1; + + kg_cfg->extracts[i].extract.from_hdr.prot = + NET_PROT_IPSEC_AH; + kg_cfg->extracts[i].extract.from_hdr.field = + NH_FLD_IPSEC_AH_SPI; + kg_cfg->extracts[i].type = + DPKG_EXTRACT_FROM_HDR; + kg_cfg->extracts[i].extract.from_hdr.type = + DPKG_FULL_FIELD; + i++; + break; + + case ETH_RSS_C_VLAN: + case ETH_RSS_S_VLAN: + if (vlan_configured) + break; + vlan_configured = 1; + + kg_cfg->extracts[i].extract.from_hdr.prot = + NET_PROT_VLAN; + kg_cfg->extracts[i].extract.from_hdr.field = + NH_FLD_VLAN_TCI; + kg_cfg->extracts[i].type = + DPKG_EXTRACT_FROM_HDR; + kg_cfg->extracts[i].extract.from_hdr.type = + DPKG_FULL_FIELD; + i++; + break; case ETH_RSS_MPLS: diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index 07a6811dd2..e1fe14c8b4 100644 --- a/drivers/net/dpaa2/dpaa2_e
[dpdk-dev] [PATCH 08/11] net/dpaa: add comments to explain driver behaviour
From: Rohit Raj This patch adds comment to explain how dpaa_port_fmc_ccnode_parse function is working to get the HW queue from FMC policy file Signed-off-by: Rohit Raj --- drivers/net/dpaa/dpaa_fmc.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/dpaa/dpaa_fmc.c b/drivers/net/dpaa/dpaa_fmc.c index 5195053361..f8c9360311 100644 --- a/drivers/net/dpaa/dpaa_fmc.c +++ b/drivers/net/dpaa/dpaa_fmc.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2017-2020 NXP + * Copyright 2017-2021 NXP */ /* System headers */ @@ -338,6 +338,12 @@ static int dpaa_port_fmc_ccnode_parse(struct fman_if *fif, fqid = keys_params->key_params[j].cc_next_engine_params .params.enqueue_params.new_fqid; + /* We read DPDK queue from last classification rule present in +* FMC policy file. Hence, this check is required here. +* Also, the last classification rule in FMC policy file must +* have userspace queue so that it can be used by DPDK +* application. +*/ if (keys_params->key_params[j].cc_next_engine_params .next_engine != e_IOC_FM_PCD_DONE) { DPAA_PMD_WARN("FMC CC next engine not support"); -- 2.17.1
[dpdk-dev] [PATCH 09/11] raw/dpaa2_qdma: use correct params for config and queue setup
From: Nipun Gupta RAW configure and Queue setup APIs support size parameter for configure. This patch supports the same for DPAA2 QDMA PMD APIs Signed-off-by: Nipun Gupta --- drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 12 +--- drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h | 8 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c index c961e18d67..2048c2c514 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018-2020 NXP + * Copyright 2018-2021 NXP */ #include @@ -1146,8 +1146,11 @@ dpaa2_qdma_configure(const struct rte_rawdev *rawdev, DPAA2_QDMA_FUNC_TRACE(); - if (config_size != sizeof(*qdma_config)) + if (config_size != sizeof(*qdma_config)) { + DPAA2_QDMA_ERR("Config size mismatch. Expected %ld, Got: %ld", + sizeof(*qdma_config), config_size); return -EINVAL; + } /* In case QDMA device is not in stopped state, return -EBUSY */ if (qdma_dev->state == 1) { @@ -1247,8 +1250,11 @@ dpaa2_qdma_queue_setup(struct rte_rawdev *rawdev, DPAA2_QDMA_FUNC_TRACE(); - if (conf_size != sizeof(*q_config)) + if (conf_size != sizeof(*q_config)) { + DPAA2_QDMA_ERR("Config size mismatch. Expected %ld, Got: %ld", + sizeof(*q_config), conf_size); return -EINVAL; + } rte_spinlock_lock(&qdma_dev->lock); diff --git a/drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h b/drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h index cc1ac25451..1314474271 100644 --- a/drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h +++ b/drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018-2020 NXP + * Copyright 2018-2021 NXP */ #ifndef __RTE_PMD_DPAA2_QDMA_H__ @@ -177,13 +177,13 @@ struct rte_qdma_queue_config { #define rte_qdma_info rte_rawdev_info #define rte_qdma_start(id) rte_rawdev_start(id) #define rte_qdma_reset(id) rte_rawdev_reset(id) -#define rte_qdma_configure(id, cf) rte_rawdev_configure(id, cf) +#define rte_qdma_configure(id, cf, sz) rte_rawdev_configure(id, cf, sz) #define rte_qdma_dequeue_buffers(id, buf, num, ctxt) \ rte_rawdev_dequeue_buffers(id, buf, num, ctxt) #define rte_qdma_enqueue_buffers(id, buf, num, ctxt) \ rte_rawdev_enqueue_buffers(id, buf, num, ctxt) -#define rte_qdma_queue_setup(id, qid, cfg) \ - rte_rawdev_queue_setup(id, qid, cfg) +#define rte_qdma_queue_setup(id, qid, cfg, sz) \ + rte_rawdev_queue_setup(id, qid, cfg, sz) /*TODO introduce per queue stats API in rawdew */ /** -- 2.17.1
[dpdk-dev] [PATCH 10/11] raw/dpaa2_qdma: remove checks for lcore ID
From: Nipun Gupta There is no need for preventional check of rte_lcore_id() in data path. This patch removes the same. Signed-off-by: Nipun Gupta --- drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c index 2048c2c514..807a3694cd 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c @@ -1389,13 +1389,6 @@ dpaa2_qdma_enqueue(struct rte_rawdev *rawdev, &dpdmai_dev->qdma_dev->vqs[e_context->vq_id]; int ret; - /* Return error in case of wrong lcore_id */ - if (rte_lcore_id() != qdma_vq->lcore_id) { - DPAA2_QDMA_ERR("QDMA enqueue for vqid %d on wrong core", - e_context->vq_id); - return -EINVAL; - } - ret = qdma_vq->enqueue_job(qdma_vq, e_context->job, nb_jobs); if (ret < 0) { DPAA2_QDMA_ERR("DPDMAI device enqueue failed: %d", ret); @@ -1428,13 +1421,6 @@ dpaa2_qdma_dequeue(struct rte_rawdev *rawdev, return -EINVAL; } - /* Return error in case of wrong lcore_id */ - if (rte_lcore_id() != (unsigned int)(qdma_vq->lcore_id)) { - DPAA2_QDMA_WARN("QDMA dequeue for vqid %d on wrong core", - context->vq_id); - return -1; - } - /* Only dequeue when there are pending jobs on VQ */ if (qdma_vq->num_enqueues == qdma_vq->num_dequeues) return 0; -- 2.17.1
[dpdk-dev] [PATCH 11/11] common/dpaax: fix paddr to vaddr invalid conversion
From: Gagandeep Singh If some of the VA entries of table are somehow not populated and are NULL, it can add offset to NULL and return the invalid VA in PA to VA conversion. In this patch, adding a check if the VA entry has valid address only then add offset and return VA. Fixes: 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table") Cc: sta...@dpdk.org Signed-off-by: Gagandeep Singh Signed-off-by: Nipun Gupta --- drivers/common/dpaax/dpaax_iova_table.h | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/common/dpaax/dpaax_iova_table.h b/drivers/common/dpaax/dpaax_iova_table.h index 230fba8ba0..d7087ee7ca 100644 --- a/drivers/common/dpaax/dpaax_iova_table.h +++ b/drivers/common/dpaax/dpaax_iova_table.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2021 NXP */ #ifndef _DPAAX_IOVA_TABLE_H_ @@ -101,6 +101,12 @@ dpaax_iova_table_get_va(phys_addr_t paddr) { /* paddr > entry->start && paddr <= entry->(start+len) */ index = (paddr_align - entry[i].start)/DPAAX_MEM_SPLIT; + /* paddr is within range, but no vaddr entry ever written +* at index +*/ + if ((void *)entry[i].pages[index] == NULL) + return NULL; + vaddr = (void *)((uintptr_t)entry[i].pages[index] + offset); break; } while (1); -- 2.17.1
[dpdk-dev] [PATCH v1 00/11] NXP DPAAx Bus and PMD changes
From: Nipun Gupta This series adds new functionality related to flow redirection, multiple ordered tx enqueues, generating HW hash key etc. It also updates the MC firmware version and includes a fix in dpaxx library. Changes in v1: - Fix checkpatch errors Gagandeep Singh (1): common/dpaax: fix paddr to vaddr invalid conversion Hemant Agrawal (4): bus/fslmc: updated MC FW to 10.28 bus/fslmc: add qbman debug APIs support net/dpaa2: add debug print for MTU set for jumbo net/dpaa2: add function to generate HW hash key Jun Yang (2): net/dpaa2: support Tx flow redirection action net/dpaa2: support multiple Tx queues enqueue for ordered Nipun Gupta (2): raw/dpaa2_qdma: use correct params for config and queue setup raw/dpaa2_qdma: remove checks for lcore ID Rohit Raj (1): net/dpaa: add comments to explain driver behaviour Vanshika Shukla (1): net/dpaa2: update RSS to support additional distributions drivers/bus/fslmc/mc/dpdmai.c | 4 +- drivers/bus/fslmc/mc/fsl_dpdmai.h | 21 +- drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h | 15 +- drivers/bus/fslmc/mc/fsl_dpmng.h | 4 +- drivers/bus/fslmc/mc/fsl_dpopr.h | 7 +- .../bus/fslmc/qbman/include/fsl_qbman_debug.h | 201 +- drivers/bus/fslmc/qbman/qbman_debug.c | 621 ++ drivers/bus/fslmc/qbman/qbman_portal.c| 6 + drivers/common/dpaax/dpaax_iova_table.h | 8 +- drivers/event/dpaa2/dpaa2_eventdev.c | 12 +- drivers/net/dpaa/dpaa_fmc.c | 8 +- drivers/net/dpaa2/base/dpaa2_hw_dpni.c| 70 +- drivers/net/dpaa2/base/dpaa2_tlu_hash.c | 153 + drivers/net/dpaa2/dpaa2_ethdev.c | 9 +- drivers/net/dpaa2/dpaa2_ethdev.h | 12 +- drivers/net/dpaa2/dpaa2_flow.c| 116 +++- drivers/net/dpaa2/dpaa2_rxtx.c| 140 drivers/net/dpaa2/mc/dpdmux.c | 43 ++ drivers/net/dpaa2/mc/dpni.c | 48 +- drivers/net/dpaa2/mc/dprtc.c | 78 ++- drivers/net/dpaa2/mc/fsl_dpdmux.h | 6 + drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h | 9 + drivers/net/dpaa2/mc/fsl_dpkg.h | 6 +- drivers/net/dpaa2/mc/fsl_dpni.h | 147 - drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 55 +- drivers/net/dpaa2/mc/fsl_dprtc.h | 19 +- drivers/net/dpaa2/mc/fsl_dprtc_cmd.h | 25 +- drivers/net/dpaa2/meson.build | 1 + drivers/net/dpaa2/rte_pmd_dpaa2.h | 19 + drivers/net/dpaa2/version.map | 3 + drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 26 +- drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h | 8 +- 32 files changed, 1789 insertions(+), 111 deletions(-) create mode 100644 drivers/net/dpaa2/base/dpaa2_tlu_hash.c -- 2.17.1
[dpdk-dev] [PATCH v1 01/11] bus/fslmc: updated MC FW to 10.28
From: Hemant Agrawal Updating MC firmware support APIs to be latest. It supports improved DPDMUX (SRIOV equivalent) for traffic split between dpnis and additional PTP APIs. Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/mc/dpdmai.c | 4 +- drivers/bus/fslmc/mc/fsl_dpdmai.h | 21 - drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h | 15 ++-- drivers/bus/fslmc/mc/fsl_dpmng.h | 4 +- drivers/bus/fslmc/mc/fsl_dpopr.h | 7 +- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/mc/dpdmux.c | 43 + drivers/net/dpaa2/mc/dpni.c | 48 ++ drivers/net/dpaa2/mc/dprtc.c | 78 +++- drivers/net/dpaa2/mc/fsl_dpdmux.h | 6 ++ drivers/net/dpaa2/mc/fsl_dpdmux_cmd.h | 9 ++ drivers/net/dpaa2/mc/fsl_dpkg.h | 6 +- drivers/net/dpaa2/mc/fsl_dpni.h | 124 ++ drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 55 +--- drivers/net/dpaa2/mc/fsl_dprtc.h | 19 +++- drivers/net/dpaa2/mc/fsl_dprtc_cmd.h | 25 +- 16 files changed, 401 insertions(+), 65 deletions(-) diff --git a/drivers/bus/fslmc/mc/dpdmai.c b/drivers/bus/fslmc/mc/dpdmai.c index dcb9d516a1..9c2f3bf9d5 100644 --- a/drivers/bus/fslmc/mc/dpdmai.c +++ b/drivers/bus/fslmc/mc/dpdmai.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2021 NXP */ #include @@ -116,6 +116,7 @@ int dpdmai_create(struct fsl_mc_io *mc_io, cmd_params->num_queues = cfg->num_queues; cmd_params->priorities[0] = cfg->priorities[0]; cmd_params->priorities[1] = cfg->priorities[1]; + cmd_params->options = cpu_to_le32(cfg->adv.options); /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -299,6 +300,7 @@ int dpdmai_get_attributes(struct fsl_mc_io *mc_io, attr->id = le32_to_cpu(rsp_params->id); attr->num_of_priorities = rsp_params->num_of_priorities; attr->num_of_queues = rsp_params->num_of_queues; + attr->options = le32_to_cpu(rsp_params->options); return 0; } diff --git a/drivers/bus/fslmc/mc/fsl_dpdmai.h b/drivers/bus/fslmc/mc/fsl_dpdmai.h index 19328c00a0..5af8ed48c0 100644 --- a/drivers/bus/fslmc/mc/fsl_dpdmai.h +++ b/drivers/bus/fslmc/mc/fsl_dpdmai.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2021 NXP */ #ifndef __FSL_DPDMAI_H @@ -36,15 +36,32 @@ int dpdmai_close(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token); +/* DPDMAI options */ + +/** + * Enable individual Congestion Groups usage per each priority queue + * If this option is not enabled then only one CG is used for all priority + * queues + * If this option is enabled then a separate specific CG is used for each + * individual priority queue. + * In this case the priority queue must be specified via congestion notification + * API + */ +#define DPDMAI_OPT_CG_PER_PRIORITY 0x0001 + /** * struct dpdmai_cfg - Structure representing DPDMAI configuration * @priorities: Priorities for the DMA hardware processing; valid priorities are * configured with values 1-8; the entry following last valid entry * should be configured with 0 + * @options: dpdmai options */ struct dpdmai_cfg { uint8_t num_queues; uint8_t priorities[DPDMAI_PRIO_NUM]; + struct { + uint32_t options; + } adv; }; int dpdmai_create(struct fsl_mc_io *mc_io, @@ -81,11 +98,13 @@ int dpdmai_reset(struct fsl_mc_io *mc_io, * struct dpdmai_attr - Structure representing DPDMAI attributes * @id: DPDMAI object ID * @num_of_priorities: number of priorities + * @options: dpdmai options */ struct dpdmai_attr { int id; uint8_t num_of_priorities; uint8_t num_of_queues; + uint32_t options; }; __rte_internal diff --git a/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h b/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h index 7e122de4ef..c8f6b990f8 100644 --- a/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h +++ b/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h @@ -1,32 +1,33 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2017-2018, 2020-2021 NXP */ - #ifndef _FSL_DPDMAI_CMD_H #define _FSL_DPDMAI_CMD_H /* DPDMAI Version */ #define DPDMAI_VER_MAJOR 3 -#define DPDMAI_VER_MINOR 3 +#define DPDMAI_VER_MINOR 4 /* Command versioning */ #define DPDMAI_CMD_BASE_VERSION1 #define DPDMAI_CMD_VERSION_2 2 +#define DPDMAI_CMD_VERSION_3 3 #define DPDMAI_CMD_ID_OFFSET 4 #define DPDMAI_CMD(id) ((id << DPDMAI_CMD_ID_OFFSET) | DPDMAI_CMD_BASE_VERSION) #define DPDMAI_CMD_V2(id) ((id << DPDMAI_CMD_ID_OFFSET) | DPDMAI_CMD_VERSION_2) +#define DPDMAI_CMD_V3(id) ((id << DPDMAI_CMD_ID_OFFSET) | DPDMAI_CMD_VERSION_3) /* Command IDs */ #define DPDMAI_CMDID_CLOSE DPDMAI_CMD(0x8
[dpdk-dev] [PATCH v1 02/11] net/dpaa2: support Tx flow redirection action
From: Jun Yang TX redirection support by flow action RTE_FLOW_ACTION_TYPE_PHY_PORT and RTE_FLOW_ACTION_TYPE_PORT_ID This action is executed by HW to forward packets between ports. If the ingress packets match the rule, the packets are switched without software involved and perf is improved as well. Signed-off-by: Jun Yang --- drivers/net/dpaa2/dpaa2_ethdev.c | 5 ++ drivers/net/dpaa2/dpaa2_ethdev.h | 1 + drivers/net/dpaa2/dpaa2_flow.c | 116 +++ drivers/net/dpaa2/mc/fsl_dpni.h | 23 ++ 4 files changed, 132 insertions(+), 13 deletions(-) diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 560b79151b..9cf55c0f0b 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -2822,6 +2822,11 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) return ret; } +int dpaa2_dev_is_dpaa2(struct rte_eth_dev *dev) +{ + return dev->device->driver == &rte_dpaa2_pmd.driver; +} + static int rte_dpaa2_probe(struct rte_dpaa2_driver *dpaa2_drv, struct rte_dpaa2_device *dpaa2_dev) diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index b9c729f6cd..3f34d7ecff 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -240,6 +240,7 @@ uint16_t dummy_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts); void dpaa2_dev_free_eqresp_buf(uint16_t eqresp_ci); void dpaa2_flow_clean(struct rte_eth_dev *dev); uint16_t dpaa2_dev_tx_conf(void *queue) __rte_unused; +int dpaa2_dev_is_dpaa2(struct rte_eth_dev *dev); int dpaa2_timesync_enable(struct rte_eth_dev *dev); int dpaa2_timesync_disable(struct rte_eth_dev *dev); diff --git a/drivers/net/dpaa2/dpaa2_flow.c b/drivers/net/dpaa2/dpaa2_flow.c index bfe17c350a..5de886ec5e 100644 --- a/drivers/net/dpaa2/dpaa2_flow.c +++ b/drivers/net/dpaa2/dpaa2_flow.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018-2020 NXP + * Copyright 2018-2021 NXP */ #include @@ -30,10 +30,10 @@ int mc_l4_port_identification; static char *dpaa2_flow_control_log; -static int dpaa2_flow_miss_flow_id = +static uint16_t dpaa2_flow_miss_flow_id = DPNI_FS_MISS_DROP; -#define FIXED_ENTRY_SIZE 54 +#define FIXED_ENTRY_SIZE DPNI_MAX_KEY_SIZE enum flow_rule_ipaddr_type { FLOW_NONE_IPADDR, @@ -83,9 +83,18 @@ static const enum rte_flow_action_type dpaa2_supported_action_type[] = { RTE_FLOW_ACTION_TYPE_END, RTE_FLOW_ACTION_TYPE_QUEUE, + RTE_FLOW_ACTION_TYPE_PHY_PORT, + RTE_FLOW_ACTION_TYPE_PORT_ID, RTE_FLOW_ACTION_TYPE_RSS }; +static const +enum rte_flow_action_type dpaa2_supported_fs_action_type[] = { + RTE_FLOW_ACTION_TYPE_QUEUE, + RTE_FLOW_ACTION_TYPE_PHY_PORT, + RTE_FLOW_ACTION_TYPE_PORT_ID +}; + /* Max of enum rte_flow_item_type + 1, for both IPv4 and IPv6*/ #define DPAA2_FLOW_ITEM_TYPE_GENERIC_IP (RTE_FLOW_ITEM_TYPE_META + 1) @@ -2937,6 +2946,19 @@ dpaa2_configure_flow_raw(struct rte_flow *flow, return 0; } +static inline int dpaa2_fs_action_supported( + enum rte_flow_action_type action) +{ + int i; + + for (i = 0; i < (int)(sizeof(dpaa2_supported_fs_action_type) / + sizeof(enum rte_flow_action_type)); i++) { + if (action == dpaa2_supported_fs_action_type[i]) + return 1; + } + + return 0; +} /* The existing QoS/FS entry with IP address(es) * needs update after * new extract(s) are inserted before IP @@ -3115,7 +3137,7 @@ dpaa2_flow_entry_update( } } - if (curr->action != RTE_FLOW_ACTION_TYPE_QUEUE) { + if (!dpaa2_fs_action_supported(curr->action)) { curr = LIST_NEXT(curr, next); continue; } @@ -3253,6 +3275,43 @@ dpaa2_flow_verify_attr( return 0; } +static inline struct rte_eth_dev * +dpaa2_flow_redirect_dev(struct dpaa2_dev_priv *priv, + const struct rte_flow_action *action) +{ + const struct rte_flow_action_phy_port *phy_port; + const struct rte_flow_action_port_id *port_id; + int idx = -1; + struct rte_eth_dev *dest_dev; + + if (action->type == RTE_FLOW_ACTION_TYPE_PHY_PORT) { + phy_port = (const struct rte_flow_action_phy_port *) + action->conf; + if (!phy_port->original) + idx = phy_port->index; + } else if (action->type == RTE_FLOW_ACTION_TYPE_PORT_ID) { + port_id = (const struct rte_flow_action_port_id *) + action->conf; + if (!port_id->original) + idx = port_id->id; + } else { + return NULL; + } + + if (idx >= 0) { + if (!rte_eth_dev_is_valid_port(idx)) +
[dpdk-dev] [PATCH v1 03/11] bus/fslmc: add qbman debug APIs support
From: Hemant Agrawal Add support for debugging qbman FQs Signed-off-by: Youri Querry Signed-off-by: Hemant Agrawal Signed-off-by: Nipun Gupta --- .../bus/fslmc/qbman/include/fsl_qbman_debug.h | 201 +- drivers/bus/fslmc/qbman/qbman_debug.c | 621 ++ drivers/bus/fslmc/qbman/qbman_portal.c| 6 + 3 files changed, 824 insertions(+), 4 deletions(-) diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_debug.h b/drivers/bus/fslmc/qbman/include/fsl_qbman_debug.h index 54096e8774..14c40a74c5 100644 --- a/drivers/bus/fslmc/qbman/include/fsl_qbman_debug.h +++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_debug.h @@ -1,13 +1,118 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright (C) 2015 Freescale Semiconductor, Inc. - * Copyright 2020 NXP + * Copyright 2018-2020 NXP */ #ifndef _FSL_QBMAN_DEBUG_H #define _FSL_QBMAN_DEBUG_H -#include struct qbman_swp; +/* Buffer pool query commands */ +struct qbman_bp_query_rslt { + uint8_t verb; + uint8_t rslt; + uint8_t reserved[4]; + uint8_t bdi; + uint8_t state; + uint32_t fill; + uint32_t hdptr; + uint16_t swdet; + uint16_t swdxt; + uint16_t hwdet; + uint16_t hwdxt; + uint16_t swset; + uint16_t swsxt; + uint16_t vbpid; + uint16_t icid; + uint64_t bpscn_addr; + uint64_t bpscn_ctx; + uint16_t hw_targ; + uint8_t dbe; + uint8_t reserved2; + uint8_t sdcnt; + uint8_t hdcnt; + uint8_t sscnt; + uint8_t reserved3[9]; +}; + +int qbman_bp_query(struct qbman_swp *s, uint32_t bpid, + struct qbman_bp_query_rslt *r); +int qbman_bp_get_bdi(struct qbman_bp_query_rslt *r); +int qbman_bp_get_va(struct qbman_bp_query_rslt *r); +int qbman_bp_get_wae(struct qbman_bp_query_rslt *r); +uint16_t qbman_bp_get_swdet(struct qbman_bp_query_rslt *r); +uint16_t qbman_bp_get_swdxt(struct qbman_bp_query_rslt *r); +uint16_t qbman_bp_get_hwdet(struct qbman_bp_query_rslt *r); +uint16_t qbman_bp_get_hwdxt(struct qbman_bp_query_rslt *r); +uint16_t qbman_bp_get_swset(struct qbman_bp_query_rslt *r); +uint16_t qbman_bp_get_swsxt(struct qbman_bp_query_rslt *r); +uint16_t qbman_bp_get_vbpid(struct qbman_bp_query_rslt *r); +uint16_t qbman_bp_get_icid(struct qbman_bp_query_rslt *r); +int qbman_bp_get_pl(struct qbman_bp_query_rslt *r); +uint64_t qbman_bp_get_bpscn_addr(struct qbman_bp_query_rslt *r); +uint64_t qbman_bp_get_bpscn_ctx(struct qbman_bp_query_rslt *r); +uint16_t qbman_bp_get_hw_targ(struct qbman_bp_query_rslt *r); +int qbman_bp_has_free_bufs(struct qbman_bp_query_rslt *r); +uint32_t qbman_bp_num_free_bufs(struct qbman_bp_query_rslt *r); +int qbman_bp_is_depleted(struct qbman_bp_query_rslt *r); +int qbman_bp_is_surplus(struct qbman_bp_query_rslt *r); +uint32_t qbman_bp_get_hdptr(struct qbman_bp_query_rslt *r); +uint32_t qbman_bp_get_sdcnt(struct qbman_bp_query_rslt *r); +uint32_t qbman_bp_get_hdcnt(struct qbman_bp_query_rslt *r); +uint32_t qbman_bp_get_sscnt(struct qbman_bp_query_rslt *r); + +/* FQ query function for programmable fields */ +struct qbman_fq_query_rslt { + uint8_t verb; + uint8_t rslt; + uint8_t reserved[8]; + uint16_t cgid; + uint16_t dest_wq; + uint8_t reserved2; + uint8_t fq_ctrl; + uint16_t ics_cred; + uint16_t td_thresh; + uint16_t oal_oac; + uint8_t reserved3; + uint8_t mctl; + uint64_t fqd_ctx; + uint16_t icid; + uint16_t reserved4; + uint32_t vfqid; + uint32_t fqid_er; + uint16_t opridsz; + uint8_t reserved5[18]; +}; + +int qbman_fq_query(struct qbman_swp *s, uint32_t fqid, + struct qbman_fq_query_rslt *r); +uint8_t qbman_fq_attr_get_fqctrl(struct qbman_fq_query_rslt *r); +uint16_t qbman_fq_attr_get_cgrid(struct qbman_fq_query_rslt *r); +uint16_t qbman_fq_attr_get_destwq(struct qbman_fq_query_rslt *r); +uint16_t qbman_fq_attr_get_tdthresh(struct qbman_fq_query_rslt *r); +int qbman_fq_attr_get_oa_ics(struct qbman_fq_query_rslt *r); +int qbman_fq_attr_get_oa_cgr(struct qbman_fq_query_rslt *r); +uint16_t qbman_fq_attr_get_oal(struct qbman_fq_query_rslt *r); +int qbman_fq_attr_get_bdi(struct qbman_fq_query_rslt *r); +int qbman_fq_attr_get_ff(struct qbman_fq_query_rslt *r); +int qbman_fq_attr_get_va(struct qbman_fq_query_rslt *r); +int qbman_fq_attr_get_ps(struct qbman_fq_query_rslt *r); +int qbman_fq_attr_get_pps(struct qbman_fq_query_rslt *r); +uint16_t qbman_fq_attr_get_icid(struct qbman_fq_query_rslt *r); +int qbman_fq_attr_get_pl(struct qbman_fq_query_rslt *r); +uint32_t qbman_fq_attr_get_vfqid(struct qbman_fq_query_rslt *r); +uint32_t qbman_fq_attr_get_erfqid(struct qbman_fq_query_rslt *r); +uint16_t qbman_fq_attr_get_opridsz(struct qbman_fq_query_rslt *r); + +/* FQ query command for non-programmable fields*/ +enum qbman_fq_schedstate_e { + qbman_fq_schedstate_oos = 0, + qbman_fq_schedstate_retired
[dpdk-dev] [PATCH v1 05/11] net/dpaa2: add debug print for MTU set for jumbo
From: Hemant Agrawal This patch adds a debug print for MTU configured on the device when jumbo frames are enabled. Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 9cf55c0f0b..275656fbe4 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -573,6 +573,8 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev) dev->data->dev_conf.rxmode.max_rx_pkt_len - RTE_ETHER_HDR_LEN - RTE_ETHER_CRC_LEN - VLAN_TAG_SIZE; + DPAA2_PMD_INFO("MTU configured for the device: %d", + dev->data->mtu); } else { return -1; } -- 2.17.1
[dpdk-dev] [PATCH v1 04/11] net/dpaa2: support multiple Tx queues enqueue for ordered
From: Jun Yang Support the tx enqueue in order queue mode, where the queue id for each event may be different. Signed-off-by: Jun Yang --- drivers/event/dpaa2/dpaa2_eventdev.c | 12 ++- drivers/net/dpaa2/dpaa2_ethdev.h | 4 + drivers/net/dpaa2/dpaa2_rxtx.c | 140 +++ drivers/net/dpaa2/version.map| 1 + 4 files changed, 153 insertions(+), 4 deletions(-) diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index 5ccf22f77f..28f3bbca9a 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2017,2019 NXP + * Copyright 2017,2019-2021 NXP */ #include @@ -1002,16 +1002,20 @@ dpaa2_eventdev_txa_enqueue(void *port, struct rte_event ev[], uint16_t nb_events) { - struct rte_mbuf *m = (struct rte_mbuf *)ev[0].mbuf; + void *txq[32]; + struct rte_mbuf *m[32]; uint8_t qid, i; RTE_SET_USED(port); for (i = 0; i < nb_events; i++) { - qid = rte_event_eth_tx_adapter_txq_get(m); - rte_eth_tx_burst(m->port, qid, &m, 1); + m[i] = (struct rte_mbuf *)ev[i].mbuf; + qid = rte_event_eth_tx_adapter_txq_get(m[i]); + txq[i] = rte_eth_devices[m[i]->port].data->tx_queues[qid]; } + dpaa2_dev_tx_multi_txq_ordered(txq, m, nb_events); + return nb_events; } diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index 3f34d7ecff..5cdd2f6418 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -236,6 +236,10 @@ void dpaa2_dev_process_ordered_event(struct qbman_swp *swp, uint16_t dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts); uint16_t dpaa2_dev_tx_ordered(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts); +__rte_internal +uint16_t dpaa2_dev_tx_multi_txq_ordered(void **queue, + struct rte_mbuf **bufs, uint16_t nb_pkts); + uint16_t dummy_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts); void dpaa2_dev_free_eqresp_buf(uint16_t eqresp_ci); void dpaa2_flow_clean(struct rte_eth_dev *dev); diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index f40369e2c3..546888dc9c 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -1445,6 +1445,146 @@ dpaa2_set_enqueue_descriptor(struct dpaa2_queue *dpaa2_q, *dpaa2_seqn(m) = DPAA2_INVALID_MBUF_SEQN; } +uint16_t +dpaa2_dev_tx_multi_txq_ordered(void **queue, + struct rte_mbuf **bufs, uint16_t nb_pkts) +{ + /* Function to transmit the frames to multiple queues respectively.*/ + uint32_t loop, retry_count; + int32_t ret; + struct qbman_fd fd_arr[MAX_TX_RING_SLOTS]; + uint32_t frames_to_send; + struct rte_mempool *mp; + struct qbman_eq_desc eqdesc[MAX_TX_RING_SLOTS]; + struct dpaa2_queue *dpaa2_q[MAX_TX_RING_SLOTS]; + struct qbman_swp *swp; + uint16_t bpid; + struct rte_mbuf *mi; + struct rte_eth_dev_data *eth_data; + struct dpaa2_dev_priv *priv; + struct dpaa2_queue *order_sendq; + + if (unlikely(!DPAA2_PER_LCORE_DPIO)) { + ret = dpaa2_affine_qbman_swp(); + if (ret) { + DPAA2_PMD_ERR("Failed to allocate IO portal, tid: %d\n", + rte_gettid()); + return 0; + } + } + swp = DPAA2_PER_LCORE_PORTAL; + + for (loop = 0; loop < nb_pkts; loop++) { + dpaa2_q[loop] = (struct dpaa2_queue *)queue[loop]; + eth_data = dpaa2_q[loop]->eth_data; + priv = eth_data->dev_private; + qbman_eq_desc_clear(&eqdesc[loop]); + if (*dpaa2_seqn(*bufs) && priv->en_ordered) { + order_sendq = (struct dpaa2_queue *)priv->tx_vq[0]; + dpaa2_set_enqueue_descriptor(order_sendq, +(*bufs), +&eqdesc[loop]); + } else { + qbman_eq_desc_set_no_orp(&eqdesc[loop], +DPAA2_EQ_RESP_ERR_FQ); + qbman_eq_desc_set_fq(&eqdesc[loop], +dpaa2_q[loop]->fqid); + } + + retry_count = 0; + while (qbman_result_SCN_state(dpaa2_q[loop]->cscn)) { + retry_count++; + /* Retry for some time before giving up */ + if (retry_count > CONG_RETRY_COUNT) + goto send_frames; + } + + if (likely(RT
[dpdk-dev] [PATCH v1 06/11] net/dpaa2: add function to generate HW hash key
From: Hemant Agrawal This patch add support to generate the hash key in software equivalent to WRIOP key generation. Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/base/dpaa2_tlu_hash.c | 153 drivers/net/dpaa2/meson.build | 1 + drivers/net/dpaa2/rte_pmd_dpaa2.h | 19 +++ drivers/net/dpaa2/version.map | 2 + 4 files changed, 175 insertions(+) create mode 100644 drivers/net/dpaa2/base/dpaa2_tlu_hash.c diff --git a/drivers/net/dpaa2/base/dpaa2_tlu_hash.c b/drivers/net/dpaa2/base/dpaa2_tlu_hash.c new file mode 100644 index 00..9eb127c07c --- /dev/null +++ b/drivers/net/dpaa2/base/dpaa2_tlu_hash.c @@ -0,0 +1,153 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2021 NXP + */ +#include +#include +#include +#include + +static unsigned int sbox(unsigned int x) +{ + unsigned int a, b, c, d; + unsigned int oa, ob, oc, od; + + a = x & 0x1; + b = (x >> 1) & 0x1; + c = (x >> 2) & 0x1; + d = (x >> 3) & 0x1; + + oa = ((a & ~b & ~c & d) | (~a & b) | (~a & ~c & ~d) | (b & c)) & 0x1; + ob = ((a & ~b & d) | (~a & c & ~d) | (b & ~c)) & 0x1; + oc = ((a & ~b & c) | (a & ~b & ~d) | (~a & b & ~d) | (~a & c & ~d) | +(b & c & d)) & 0x1; + od = ((a & ~b & c) | (~a & b & ~c) | (a & b & ~d) | (~a & c & d)) & 0x1; + + return ((od << 3) | (oc << 2) | (ob << 1) | oa); +} + +static unsigned int sbox_tbl[16]; + +static int pbox_tbl[16] = {5, 9, 0, 13, + 7, 2, 11, 14, + 1, 4, 12, 8, + 3, 15, 6, 10 }; + +static unsigned int mix_tbl[8][16]; + +static unsigned int stage(unsigned int input) +{ + int sbox_out = 0; + int pbox_out = 0; + int i; + + /* mix */ + input ^= input >> 16; /* xor lower */ + input ^= input << 16; /* move original lower to upper */ + + for (i = 0; i < 32; i += 4) /* sbox stage */ + sbox_out |= (sbox_tbl[(input >> i) & 0xf]) << i; + + /* permutation */ + for (i = 0; i < 16; i++) + pbox_out |= ((sbox_out >> i) & 0x10001) << pbox_tbl[i]; + + return pbox_out; +} + +static unsigned int fast_stage(unsigned int input) +{ + int pbox_out = 0; + int i; + + /* mix */ + input ^= input >> 16; /* xor lower */ + input ^= input << 16; /* move original lower to upper */ + + for (i = 0; i < 32; i += 4) /* sbox stage */ + pbox_out |= mix_tbl[i >> 2][(input >> i) & 0xf]; + + return pbox_out; +} + +static unsigned int fast_hash32(unsigned int x) +{ + int i; + + for (i = 0; i < 4; i++) + x = fast_stage(x); + return x; +} + +static unsigned int +byte_crc32(unsigned char data /* new byte for the crc calculation */, + unsigned old_crc /* crc result of the last iteration */) +{ + int i; + unsigned int crc, polynom = 0xedb88320; + /* the polynomial is built on the reversed version of +* the CRC polynomial with out the x64 element. +*/ + + crc = old_crc; + for (i = 0; i < 8; i++, data >>= 1) + crc = (crc >> 1) ^ (((crc ^ data) & 0x1) ? polynom : 0); + /* xor with polynomial is lsb of crc^data is 1 */ + + return crc; +} + +static unsigned int crc32_table[256]; + +static void init_crc32_table(void) +{ + int i; + + for (i = 0; i < 256; i++) + crc32_table[i] = byte_crc32((unsigned char)i, 0LL); +} + +static unsigned int +crc32_string(unsigned char *data, +int size, unsigned int old_crc) +{ + unsigned int crc; + int i; + + crc = old_crc; + for (i = 0; i < size; i++) + crc = (crc >> 8) ^ crc32_table[(crc ^ data[i]) & 0xff]; + + return crc; +} + +static void hash_init(void) +{ + init_crc32_table(); + int i, j; + + for (i = 0; i < 16; i++) + sbox_tbl[i] = sbox(i); + + for (i = 0; i < 32; i += 4) + for (j = 0; j < 16; j++) { + /* (a,b) +* (b,a^b)=(X,Y) +* (X^Y,X) +*/ + unsigned int input = (0x ^ (8 << i)) | (j << i); + + input ^= input << 16; /* (X^Y,Y) */ + input ^= input >> 16; /* (X^Y,X) */ + mix_tbl[i >> 2][j] = stage(input); + } +} + +uint32_t rte_pmd_dpaa2_get_tlu_hash(uint8_t *data, int size) +{ + static int init; + + if (~init) + hash_init(); + init = 1; + return fast_hash32(crc32_string(data, size, 0x0)); +} diff --git a/drivers/net/dpaa2/meson.build b/drivers/net/dpaa2/meson.build index 20eaf0b8e4..4a6397d09e 100644 --- a/drivers/net/dpaa2/meson.build +++ b/drivers/net/dpaa2/meson.build @@ -20,6 +20,7 @@ sources = files( 'mc/dpkg.c', 'mc/dpdmux.c', 'mc/dpni.c', +
[dpdk-dev] [PATCH v1 07/11] net/dpaa2: update RSS to support additional distributions
From: Vanshika Shukla This patch updates the RSS support to support following additional distributions: - VLAN - ESP - AH - PPPOE Signed-off-by: Vanshika Shukla --- drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 70 +- drivers/net/dpaa2/dpaa2_ethdev.h | 7 ++- 2 files changed, 75 insertions(+), 2 deletions(-) diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c index 641e7027f1..08f49af768 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c @@ -210,6 +210,10 @@ dpaa2_distset_to_dpkg_profile_cfg( int l2_configured = 0, l3_configured = 0; int l4_configured = 0, sctp_configured = 0; int mpls_configured = 0; + int vlan_configured = 0; + int esp_configured = 0; + int ah_configured = 0; + int pppoe_configured = 0; memset(kg_cfg, 0, sizeof(struct dpkg_profile_cfg)); while (req_dist_set) { @@ -217,6 +221,7 @@ dpaa2_distset_to_dpkg_profile_cfg( dist_field = 1ULL << loop; switch (dist_field) { case ETH_RSS_L2_PAYLOAD: + case ETH_RSS_ETH: if (l2_configured) break; @@ -231,7 +236,70 @@ dpaa2_distset_to_dpkg_profile_cfg( kg_cfg->extracts[i].extract.from_hdr.type = DPKG_FULL_FIELD; i++; - break; + break; + + case ETH_RSS_PPPOE: + if (pppoe_configured) + break; + kg_cfg->extracts[i].extract.from_hdr.prot = + NET_PROT_PPPOE; + kg_cfg->extracts[i].extract.from_hdr.field = + NH_FLD_PPPOE_SID; + kg_cfg->extracts[i].type = + DPKG_EXTRACT_FROM_HDR; + kg_cfg->extracts[i].extract.from_hdr.type = + DPKG_FULL_FIELD; + i++; + break; + + case ETH_RSS_ESP: + if (esp_configured) + break; + esp_configured = 1; + + kg_cfg->extracts[i].extract.from_hdr.prot = + NET_PROT_IPSEC_ESP; + kg_cfg->extracts[i].extract.from_hdr.field = + NH_FLD_IPSEC_ESP_SPI; + kg_cfg->extracts[i].type = + DPKG_EXTRACT_FROM_HDR; + kg_cfg->extracts[i].extract.from_hdr.type = + DPKG_FULL_FIELD; + i++; + break; + + case ETH_RSS_AH: + if (ah_configured) + break; + ah_configured = 1; + + kg_cfg->extracts[i].extract.from_hdr.prot = + NET_PROT_IPSEC_AH; + kg_cfg->extracts[i].extract.from_hdr.field = + NH_FLD_IPSEC_AH_SPI; + kg_cfg->extracts[i].type = + DPKG_EXTRACT_FROM_HDR; + kg_cfg->extracts[i].extract.from_hdr.type = + DPKG_FULL_FIELD; + i++; + break; + + case ETH_RSS_C_VLAN: + case ETH_RSS_S_VLAN: + if (vlan_configured) + break; + vlan_configured = 1; + + kg_cfg->extracts[i].extract.from_hdr.prot = + NET_PROT_VLAN; + kg_cfg->extracts[i].extract.from_hdr.field = + NH_FLD_VLAN_TCI; + kg_cfg->extracts[i].type = + DPKG_EXTRACT_FROM_HDR; + kg_cfg->extracts[i].extract.from_hdr.type = + DPKG_FULL_FIELD; + i++; + break; case ETH_RSS_MPLS: diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index 5cdd2f6418..734ef17a9a 100644 --- a/drivers/net/dpaa2/dpaa2_e
[dpdk-dev] [PATCH v1 08/11] net/dpaa: add comments to explain driver behaviour
From: Rohit Raj This patch adds comment to explain how dpaa_port_fmc_ccnode_parse function is working to get the HW queue from FMC policy file Signed-off-by: Rohit Raj --- drivers/net/dpaa/dpaa_fmc.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/dpaa/dpaa_fmc.c b/drivers/net/dpaa/dpaa_fmc.c index 5195053361..f8c9360311 100644 --- a/drivers/net/dpaa/dpaa_fmc.c +++ b/drivers/net/dpaa/dpaa_fmc.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2017-2020 NXP + * Copyright 2017-2021 NXP */ /* System headers */ @@ -338,6 +338,12 @@ static int dpaa_port_fmc_ccnode_parse(struct fman_if *fif, fqid = keys_params->key_params[j].cc_next_engine_params .params.enqueue_params.new_fqid; + /* We read DPDK queue from last classification rule present in +* FMC policy file. Hence, this check is required here. +* Also, the last classification rule in FMC policy file must +* have userspace queue so that it can be used by DPDK +* application. +*/ if (keys_params->key_params[j].cc_next_engine_params .next_engine != e_IOC_FM_PCD_DONE) { DPAA_PMD_WARN("FMC CC next engine not support"); -- 2.17.1
[dpdk-dev] [PATCH v1 09/11] raw/dpaa2_qdma: use correct params for config and queue setup
From: Nipun Gupta RAW configure and Queue setup APIs support size parameter for configure. This patch supports the same for DPAA2 QDMA PMD APIs Signed-off-by: Nipun Gupta --- drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 12 +--- drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h | 8 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c index c961e18d67..6b7b51747e 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018-2020 NXP + * Copyright 2018-2021 NXP */ #include @@ -1146,8 +1146,11 @@ dpaa2_qdma_configure(const struct rte_rawdev *rawdev, DPAA2_QDMA_FUNC_TRACE(); - if (config_size != sizeof(*qdma_config)) + if (config_size != sizeof(*qdma_config)) { + DPAA2_QDMA_ERR("Config size mismatch. Expected %" PRIu64 + ", Got: %" PRIu64, sizeof(*qdma_config), config_size); return -EINVAL; + } /* In case QDMA device is not in stopped state, return -EBUSY */ if (qdma_dev->state == 1) { @@ -1247,8 +1250,11 @@ dpaa2_qdma_queue_setup(struct rte_rawdev *rawdev, DPAA2_QDMA_FUNC_TRACE(); - if (conf_size != sizeof(*q_config)) + if (conf_size != sizeof(*q_config)) { + DPAA2_QDMA_ERR("Config size mismatch. Expected %" PRIu64 + ", Got: %" PRIu64, sizeof(*q_config), conf_size); return -EINVAL; + } rte_spinlock_lock(&qdma_dev->lock); diff --git a/drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h b/drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h index cc1ac25451..1314474271 100644 --- a/drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h +++ b/drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018-2020 NXP + * Copyright 2018-2021 NXP */ #ifndef __RTE_PMD_DPAA2_QDMA_H__ @@ -177,13 +177,13 @@ struct rte_qdma_queue_config { #define rte_qdma_info rte_rawdev_info #define rte_qdma_start(id) rte_rawdev_start(id) #define rte_qdma_reset(id) rte_rawdev_reset(id) -#define rte_qdma_configure(id, cf) rte_rawdev_configure(id, cf) +#define rte_qdma_configure(id, cf, sz) rte_rawdev_configure(id, cf, sz) #define rte_qdma_dequeue_buffers(id, buf, num, ctxt) \ rte_rawdev_dequeue_buffers(id, buf, num, ctxt) #define rte_qdma_enqueue_buffers(id, buf, num, ctxt) \ rte_rawdev_enqueue_buffers(id, buf, num, ctxt) -#define rte_qdma_queue_setup(id, qid, cfg) \ - rte_rawdev_queue_setup(id, qid, cfg) +#define rte_qdma_queue_setup(id, qid, cfg, sz) \ + rte_rawdev_queue_setup(id, qid, cfg, sz) /*TODO introduce per queue stats API in rawdew */ /** -- 2.17.1
[dpdk-dev] [PATCH v1 10/11] raw/dpaa2_qdma: remove checks for lcore ID
From: Nipun Gupta There is no need for preventional check of rte_lcore_id() in data path. This patch removes the same. Signed-off-by: Nipun Gupta --- drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c index 6b7b51747e..d8a3583dd9 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c @@ -1389,13 +1389,6 @@ dpaa2_qdma_enqueue(struct rte_rawdev *rawdev, &dpdmai_dev->qdma_dev->vqs[e_context->vq_id]; int ret; - /* Return error in case of wrong lcore_id */ - if (rte_lcore_id() != qdma_vq->lcore_id) { - DPAA2_QDMA_ERR("QDMA enqueue for vqid %d on wrong core", - e_context->vq_id); - return -EINVAL; - } - ret = qdma_vq->enqueue_job(qdma_vq, e_context->job, nb_jobs); if (ret < 0) { DPAA2_QDMA_ERR("DPDMAI device enqueue failed: %d", ret); @@ -1428,13 +1421,6 @@ dpaa2_qdma_dequeue(struct rte_rawdev *rawdev, return -EINVAL; } - /* Return error in case of wrong lcore_id */ - if (rte_lcore_id() != (unsigned int)(qdma_vq->lcore_id)) { - DPAA2_QDMA_WARN("QDMA dequeue for vqid %d on wrong core", - context->vq_id); - return -1; - } - /* Only dequeue when there are pending jobs on VQ */ if (qdma_vq->num_enqueues == qdma_vq->num_dequeues) return 0; -- 2.17.1
[dpdk-dev] [PATCH v1 11/11] common/dpaax: fix paddr to vaddr invalid conversion
From: Gagandeep Singh If some of the VA entries of table are somehow not populated and are NULL, it can add offset to NULL and return the invalid VA in PA to VA conversion. In this patch, adding a check if the VA entry has valid address only then add offset and return VA. Fixes: 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table") Cc: sta...@dpdk.org Signed-off-by: Gagandeep Singh Signed-off-by: Nipun Gupta --- drivers/common/dpaax/dpaax_iova_table.h | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/common/dpaax/dpaax_iova_table.h b/drivers/common/dpaax/dpaax_iova_table.h index 230fba8ba0..d7087ee7ca 100644 --- a/drivers/common/dpaax/dpaax_iova_table.h +++ b/drivers/common/dpaax/dpaax_iova_table.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2021 NXP */ #ifndef _DPAAX_IOVA_TABLE_H_ @@ -101,6 +101,12 @@ dpaax_iova_table_get_va(phys_addr_t paddr) { /* paddr > entry->start && paddr <= entry->(start+len) */ index = (paddr_align - entry[i].start)/DPAAX_MEM_SPLIT; + /* paddr is within range, but no vaddr entry ever written +* at index +*/ + if ((void *)entry[i].pages[index] == NULL) + return NULL; + vaddr = (void *)((uintptr_t)entry[i].pages[index] + offset); break; } while (1); -- 2.17.1
[dpdk-dev] [PATCH v7 0/9] baseband: add NXP LA12xx driver
From: Nipun Gupta This series introduces the BBDEV LA12xx poll mode driver (PMD) to support an implementation for offloading High Phy processing functions like LDPC Encode / Decode 5GNR wireless acceleration function, using PCI based LA12xx Software defined radio. Please check the documentation patch for more info. The driver currently implements basic feature to offload only the 5G LDPC encode/decode. A new capability has been added to check if the driver can support the input data in network byte order. Two test vectors are also added as an example with input data in network byte. v2: add test case changes v3: fix 32 bit compilation v4: capability for network byte order, doc patch merged inline. v5: add llr_size and llr_decimals, removed LLR compression flag, update testbbdev to handle endianness, rebased on top of 20.08 v6: added BE as device info instead of capability, updated test to have 2 codeblocks v7: fixed checkpatch errors Hemant Agrawal (6): baseband: introduce NXP LA12xx driver baseband/la12xx: add devargs for max queues baseband/la12xx: add support for multiple modems baseband/la12xx: add queue and modem config support baseband/la12xx: add enqueue and dequeue support app/bbdev: enable la12xx for bbdev Nipun Gupta (3): bbdev: add big endian processing data processing info app/bbdev: handle endianness of test data app/bbdev: add test vectors for transport blocks MAINTAINERS | 10 + app/test-bbdev/meson.build|3 + app/test-bbdev/test_bbdev_perf.c | 62 + app/test-bbdev/test_vectors/ldpc_dec_tb.data | 265 app/test-bbdev/test_vectors/ldpc_enc_tb.data | 95 ++ doc/guides/bbdevs/features/la12xx.ini | 13 + doc/guides/bbdevs/index.rst |1 + doc/guides/bbdevs/la12xx.rst | 126 ++ doc/guides/rel_notes/release_21_11.rst|5 + drivers/baseband/la12xx/bbdev_la12xx.c| 1100 + drivers/baseband/la12xx/bbdev_la12xx.h| 51 + drivers/baseband/la12xx/bbdev_la12xx_ipc.h| 244 .../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 28 + drivers/baseband/la12xx/meson.build |6 + drivers/baseband/la12xx/version.map |3 + drivers/baseband/meson.build |1 + lib/bbdev/rte_bbdev.h |2 + 17 files changed, 2015 insertions(+) create mode 100644 app/test-bbdev/test_vectors/ldpc_dec_tb.data create mode 100644 app/test-bbdev/test_vectors/ldpc_enc_tb.data create mode 100644 doc/guides/bbdevs/features/la12xx.ini create mode 100644 doc/guides/bbdevs/la12xx.rst create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.c create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.h create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_ipc.h create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h create mode 100644 drivers/baseband/la12xx/meson.build create mode 100644 drivers/baseband/la12xx/version.map -- 2.17.1
[dpdk-dev] [PATCH v7 1/9] bbdev: add big endian processing data processing info
From: Nipun Gupta This patch intoduces a new info pertaining to bbdev device to process the data in big endian order. Signed-off-by: Nipun Gupta --- lib/bbdev/rte_bbdev.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h index 7017124414..3acc008d06 100644 --- a/lib/bbdev/rte_bbdev.h +++ b/lib/bbdev/rte_bbdev.h @@ -309,6 +309,8 @@ struct rte_bbdev_driver_info { uint16_t min_alignment; /** HARQ memory available in kB */ uint32_t harq_buffer_size; + /** Device support input, output and HARQ data as big-endian */ + uint8_t support_be_data; /** Default queue configuration used if none is supplied */ struct rte_bbdev_queue_conf default_queue_conf; /** Device operation capabilities */ -- 2.17.1
[dpdk-dev] [PATCH v7 2/9] baseband: introduce NXP LA12xx driver
From: Hemant Agrawal This patch introduce the baseband device drivers for NXP's LA1200 series software defined baseband modem. Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- MAINTAINERS | 9 ++ drivers/baseband/la12xx/bbdev_la12xx.c| 108 ++ .../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 28 + drivers/baseband/la12xx/meson.build | 6 + drivers/baseband/la12xx/version.map | 3 + drivers/baseband/meson.build | 1 + 6 files changed, 155 insertions(+) create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.c create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h create mode 100644 drivers/baseband/la12xx/meson.build create mode 100644 drivers/baseband/la12xx/version.map diff --git a/MAINTAINERS b/MAINTAINERS index 30bf77b79a..e3f0e8759f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1289,6 +1289,15 @@ F: drivers/event/opdl/ F: doc/guides/eventdevs/opdl.rst +Baseband Drivers + + +NXP LA12xx driver +M: Nipun Gupta +M: Hemant Agrawal +F: drivers/baseband/la12xx/ + + Rawdev Drivers -- diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c new file mode 100644 index 00..d3d7a4df37 --- /dev/null +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -0,0 +1,108 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020-2021 NXP + */ + +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include + +#define DRIVER_NAME baseband_la12xx + +/* private data structure */ +struct bbdev_la12xx_private { + unsigned int max_nb_queues; /**< Max number of queues */ +}; +/* Create device */ +static int +la12xx_bbdev_create(struct rte_vdev_device *vdev) +{ + struct rte_bbdev *bbdev; + const char *name = rte_vdev_device_name(vdev); + + PMD_INIT_FUNC_TRACE(); + + bbdev = rte_bbdev_allocate(name); + if (bbdev == NULL) + return -ENODEV; + + bbdev->data->dev_private = rte_zmalloc(name, + sizeof(struct bbdev_la12xx_private), + RTE_CACHE_LINE_SIZE); + if (bbdev->data->dev_private == NULL) { + rte_bbdev_release(bbdev); + return -ENOMEM; + } + + bbdev->dev_ops = NULL; + bbdev->device = &vdev->device; + bbdev->data->socket_id = 0; + bbdev->intr_handle = NULL; + + /* register rx/tx burst functions for data path */ + bbdev->dequeue_enc_ops = NULL; + bbdev->dequeue_dec_ops = NULL; + bbdev->enqueue_enc_ops = NULL; + bbdev->enqueue_dec_ops = NULL; + + return 0; +} + +/* Initialise device */ +static int +la12xx_bbdev_probe(struct rte_vdev_device *vdev) +{ + const char *name; + + PMD_INIT_FUNC_TRACE(); + + if (vdev == NULL) + return -EINVAL; + + name = rte_vdev_device_name(vdev); + if (name == NULL) + return -EINVAL; + + return la12xx_bbdev_create(vdev); +} + +/* Uninitialise device */ +static int +la12xx_bbdev_remove(struct rte_vdev_device *vdev) +{ + struct rte_bbdev *bbdev; + const char *name; + + PMD_INIT_FUNC_TRACE(); + + if (vdev == NULL) + return -EINVAL; + + name = rte_vdev_device_name(vdev); + if (name == NULL) + return -EINVAL; + + bbdev = rte_bbdev_get_named_dev(name); + if (bbdev == NULL) + return -EINVAL; + + rte_free(bbdev->data->dev_private); + + return rte_bbdev_release(bbdev); +} + +static struct rte_vdev_driver bbdev_la12xx_pmd_drv = { + .probe = la12xx_bbdev_probe, + .remove = la12xx_bbdev_remove +}; + +RTE_PMD_REGISTER_VDEV(DRIVER_NAME, bbdev_la12xx_pmd_drv); +RTE_LOG_REGISTER_DEFAULT(bbdev_la12xx_logtype, NOTICE); diff --git a/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h new file mode 100644 index 00..452435ccb9 --- /dev/null +++ b/drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020 NXP + */ + +#ifndef _BBDEV_LA12XX_PMD_LOGS_H_ +#define _BBDEV_LA12XX_PMD_LOGS_H_ + +extern int bbdev_la12xx_logtype; + +#define rte_bbdev_log(level, fmt, ...) \ + rte_log(RTE_LOG_ ## level, bbdev_la12xx_logtype, fmt "\n", \ + ##__VA_ARGS__) + +#ifdef RTE_LIBRTE_BBDEV_DEBUG +#define rte_bbdev_log_debug(fmt, ...) \ + rte_bbdev_log(DEBUG, "la12xx_pmd: " fmt, \ + ##__VA_ARGS__) +#else +#define rte_bbdev_log_debug(fmt, ...) +#endif + +#define PMD_INIT_FUNC_TRACE() rte_bbdev_log_debug(">>") + +/* DP Logs, toggled out at compile time if level lower than current level */ +#define rte_bbdev_dp_log(level, fmt, args...) \ + RTE_LOG_DP(l
[dpdk-dev] [PATCH v7 3/9] baseband/la12xx: add devargs for max queues
From: Hemant Agrawal This patch adds dev args to take max queues as input Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- drivers/baseband/la12xx/bbdev_la12xx.c | 73 +- 1 file changed, 71 insertions(+), 2 deletions(-) diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index d3d7a4df37..ee03e93870 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -17,13 +17,73 @@ #define DRIVER_NAME baseband_la12xx +/* Initialisation params structure that can be used by LA12xx BBDEV driver */ +struct bbdev_la12xx_params { + uint8_t queues_num; /*< LA12xx BBDEV queues number */ +}; + +#define LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" + +static const char * const bbdev_la12xx_valid_params[] = { + LA12XX_MAX_NB_QUEUES_ARG, +}; + /* private data structure */ struct bbdev_la12xx_private { unsigned int max_nb_queues; /**< Max number of queues */ }; +static inline int +parse_u16_arg(const char *key, const char *value, void *extra_args) +{ + uint16_t *u16 = extra_args; + + unsigned int long result; + if ((value == NULL) || (extra_args == NULL)) + return -EINVAL; + errno = 0; + result = strtoul(value, NULL, 0); + if ((result >= (1 << 16)) || (errno != 0)) { + rte_bbdev_log(ERR, "Invalid value %" PRIu64 " for %s", + result, key); + return -ERANGE; + } + *u16 = (uint16_t)result; + return 0; +} + +/* Parse parameters used to create device */ +static int +parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, + const char *input_args) +{ + struct rte_kvargs *kvlist = NULL; + int ret = 0; + + if (params == NULL) + return -EINVAL; + if (input_args) { + kvlist = rte_kvargs_parse(input_args, + bbdev_la12xx_valid_params); + if (kvlist == NULL) + return -EFAULT; + + ret = rte_kvargs_process(kvlist, bbdev_la12xx_valid_params[0], + &parse_u16_arg, ¶ms->queues_num); + if (ret < 0) + goto exit; + + } + +exit: + if (kvlist) + rte_kvargs_free(kvlist); + return ret; +} + /* Create device */ static int -la12xx_bbdev_create(struct rte_vdev_device *vdev) +la12xx_bbdev_create(struct rte_vdev_device *vdev, + struct bbdev_la12xx_params *init_params __rte_unused) { struct rte_bbdev *bbdev; const char *name = rte_vdev_device_name(vdev); @@ -60,7 +120,11 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev) static int la12xx_bbdev_probe(struct rte_vdev_device *vdev) { + struct bbdev_la12xx_params init_params = { + 8 + }; const char *name; + const char *input_args; PMD_INIT_FUNC_TRACE(); @@ -71,7 +135,10 @@ la12xx_bbdev_probe(struct rte_vdev_device *vdev) if (name == NULL) return -EINVAL; - return la12xx_bbdev_create(vdev); + input_args = rte_vdev_device_args(vdev); + parse_bbdev_la12xx_params(&init_params, input_args); + + return la12xx_bbdev_create(vdev, &init_params); } /* Uninitialise device */ @@ -105,4 +172,6 @@ static struct rte_vdev_driver bbdev_la12xx_pmd_drv = { }; RTE_PMD_REGISTER_VDEV(DRIVER_NAME, bbdev_la12xx_pmd_drv); +RTE_PMD_REGISTER_PARAM_STRING(DRIVER_NAME, + LA12XX_MAX_NB_QUEUES_ARG"="); RTE_LOG_REGISTER_DEFAULT(bbdev_la12xx_logtype, NOTICE); -- 2.17.1
[dpdk-dev] [PATCH v7 4/9] baseband/la12xx: add support for multiple modems
From: Hemant Agrawal This patch add support for multiple modems by assigning a modem id as dev args in vdev creation. Signed-off-by: Hemant Agrawal --- drivers/baseband/la12xx/bbdev_la12xx.c | 64 +++--- drivers/baseband/la12xx/bbdev_la12xx.h | 56 +++ drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 20 +++ 3 files changed, 133 insertions(+), 7 deletions(-) create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.h create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_ipc.h diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index ee03e93870..f9f32d665a 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -14,24 +14,26 @@ #include #include +#include +#include #define DRIVER_NAME baseband_la12xx /* Initialisation params structure that can be used by LA12xx BBDEV driver */ struct bbdev_la12xx_params { uint8_t queues_num; /*< LA12xx BBDEV queues number */ + int8_t modem_id; /*< LA12xx modem instance id */ }; #define LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" +#define LA12XX_VDEV_MODEM_ID_ARG "modem" +#define LA12XX_MAX_MODEM 4 static const char * const bbdev_la12xx_valid_params[] = { LA12XX_MAX_NB_QUEUES_ARG, + LA12XX_VDEV_MODEM_ID_ARG, }; -/* private data structure */ -struct bbdev_la12xx_private { - unsigned int max_nb_queues; /**< Max number of queues */ -}; static inline int parse_u16_arg(const char *key, const char *value, void *extra_args) { @@ -51,6 +53,28 @@ parse_u16_arg(const char *key, const char *value, void *extra_args) return 0; } +/* Parse integer from integer argument */ +static int +parse_integer_arg(const char *key __rte_unused, + const char *value, void *extra_args) +{ + int i; + char *end; + + errno = 0; + + i = strtol(value, &end, 10); + if (*end != 0 || errno != 0 || i < 0 || i > LA12XX_MAX_MODEM) { + rte_bbdev_log(ERR, "Supported Port IDS are 0 to %d", + LA12XX_MAX_MODEM - 1); + return -EINVAL; + } + + *((uint32_t *)extra_args) = i; + + return 0; +} + /* Parse parameters used to create device */ static int parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, @@ -72,6 +96,16 @@ parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, if (ret < 0) goto exit; + ret = rte_kvargs_process(kvlist, + bbdev_la12xx_valid_params[1], + &parse_integer_arg, + ¶ms->modem_id); + + if (params->modem_id >= LA12XX_MAX_MODEM) { + rte_bbdev_log(ERR, "Invalid modem id, must be < %u", + LA12XX_MAX_MODEM); + goto exit; + } } exit: @@ -83,10 +117,11 @@ parse_bbdev_la12xx_params(struct bbdev_la12xx_params *params, /* Create device */ static int la12xx_bbdev_create(struct rte_vdev_device *vdev, - struct bbdev_la12xx_params *init_params __rte_unused) + struct bbdev_la12xx_params *init_params) { struct rte_bbdev *bbdev; const char *name = rte_vdev_device_name(vdev); + struct bbdev_la12xx_private *priv; PMD_INIT_FUNC_TRACE(); @@ -102,6 +137,20 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev, return -ENOMEM; } + priv = bbdev->data->dev_private; + priv->modem_id = init_params->modem_id; + /* if modem id is not configured */ + if (priv->modem_id == -1) + priv->modem_id = bbdev->data->dev_id; + + /* Reset Global variables */ + priv->num_ldpc_enc_queues = 0; + priv->num_ldpc_dec_queues = 0; + priv->num_valid_queues = 0; + priv->max_nb_queues = init_params->queues_num; + + rte_bbdev_log(INFO, "Setting Up %s: DevId=%d, ModemId=%d", + name, bbdev->data->dev_id, priv->modem_id); bbdev->dev_ops = NULL; bbdev->device = &vdev->device; bbdev->data->socket_id = 0; @@ -121,7 +170,7 @@ static int la12xx_bbdev_probe(struct rte_vdev_device *vdev) { struct bbdev_la12xx_params init_params = { - 8 + 8, -1, }; const char *name; const char *input_args; @@ -173,5 +222,6 @@ static struct rte_vdev_driver bbdev_la12xx_pmd_drv = { RTE_PMD_REGISTER_VDEV(DRIVER_NAME, bbdev_la12xx_pmd_drv); RTE_PMD_REGISTER_PARAM_STRING(DRIVER_NAME, - LA12XX_MAX_NB_QUEUES_ARG"="); + LA12XX_MAX_NB_QUEUES_ARG"=" + LA12XX_VDEV_MODEM_ID_ARG "= "); RTE_LOG_REGISTER_DEFAULT(bbdev_la12xx_logtype, NOTICE); diff --git a/drivers/baseband/la12xx/bbdev_la12xx.h b/drivers/baseband/la12xx/bbdev_la12xx.h new file mode 100644 index 0
[dpdk-dev] [PATCH v7 7/9] app/bbdev: enable la12xx for bbdev
From: Hemant Agrawal this patch adds la12xx driver in test bbdev Signed-off-by: Hemant Agrawal --- app/test-bbdev/meson.build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/test-bbdev/meson.build b/app/test-bbdev/meson.build index edb9deef84..a726a5b3fa 100644 --- a/app/test-bbdev/meson.build +++ b/app/test-bbdev/meson.build @@ -23,3 +23,6 @@ endif if dpdk_conf.has('RTE_BASEBAND_ACC100') deps += ['baseband_acc100'] endif +if dpdk_conf.has('RTE_LIBRTE_PMD_BBDEV_LA12XX') + deps += ['baseband_la12xx'] +endif -- 2.17.1
[dpdk-dev] [PATCH v7 8/9] app/bbdev: handle endianness of test data
From: Nipun Gupta With data input, output and harq also supported in big endian format, this patch updates the testbbdev application to handle the endianness conversion as directed by the the driver being used. If the driver supports big endian data processing, conversion from little endian to big is handled by the testbbdev application. Signed-off-by: Nipun Gupta --- app/test-bbdev/test_bbdev_perf.c | 62 1 file changed, 62 insertions(+) diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c index 469597b8b3..a0f565ee3f 100644 --- a/app/test-bbdev/test_bbdev_perf.c +++ b/app/test-bbdev/test_bbdev_perf.c @@ -227,6 +227,64 @@ clear_soft_out_cap(uint32_t *op_flags) *op_flags &= ~RTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT; } +static inline void +reverse_op(struct op_data_entries *op) +{ + uint8_t nb_segs = op->nb_segments; + uint32_t *data, len; + int complete, rem, i, j; + uint8_t *rem_data, temp; + + /* Validate each mbuf segment length */ + for (i = 0; i < nb_segs; ++i) { + len = op->segments[i].length; + data = op->segments[i].addr; + + /* Swap complete u32 bytes */ + complete = len / 4; + for (j = 0; j < complete; j++) + data[j] = rte_bswap32(data[j]); + + /* Swap any remaining data for last seg */ + if (i == (nb_segs - 1)) { + rem = len % 4; + rem_data = (uint8_t *)&data[j]; + for (j = 0; j < rem/2; j++) { + temp = rem_data[j]; + rem_data[j] = rem_data[rem - j - 1]; + rem_data[rem - j - 1] = temp; + } + } + } +} + +static inline void +reverse_all_ops(void) +{ + unsigned int nb_inputs, nb_soft_outputs, nb_hard_outputs, + nb_harq_inputs, nb_harq_outputs; + + nb_inputs = test_vector.entries[DATA_INPUT].nb_segments; + if (nb_inputs) + reverse_op(&test_vector.entries[DATA_INPUT]); + + nb_soft_outputs = test_vector.entries[DATA_SOFT_OUTPUT].nb_segments; + if (nb_soft_outputs) + reverse_op(&test_vector.entries[DATA_SOFT_OUTPUT]); + + nb_hard_outputs = test_vector.entries[DATA_HARD_OUTPUT].nb_segments; + if (nb_hard_outputs) + reverse_op(&test_vector.entries[DATA_HARD_OUTPUT]); + + nb_harq_inputs = test_vector.entries[DATA_HARQ_INPUT].nb_segments; + if (nb_harq_inputs) + reverse_op(&test_vector.entries[DATA_HARQ_INPUT]); + + nb_harq_outputs = test_vector.entries[DATA_HARQ_OUTPUT].nb_segments; + if (nb_harq_outputs) + reverse_op(&test_vector.entries[DATA_HARQ_OUTPUT]); +} + static int check_dev_cap(const struct rte_bbdev_info *dev_info) { @@ -234,6 +292,7 @@ check_dev_cap(const struct rte_bbdev_info *dev_info) unsigned int nb_inputs, nb_soft_outputs, nb_hard_outputs, nb_harq_inputs, nb_harq_outputs; const struct rte_bbdev_op_cap *op_cap = dev_info->drv.capabilities; + uint8_t be_data = dev_info->drv.support_be_data; nb_inputs = test_vector.entries[DATA_INPUT].nb_segments; nb_soft_outputs = test_vector.entries[DATA_SOFT_OUTPUT].nb_segments; @@ -245,6 +304,9 @@ check_dev_cap(const struct rte_bbdev_info *dev_info) if (op_cap->type != test_vector.op_type) continue; + if (be_data) + reverse_all_ops(); + if (op_cap->type == RTE_BBDEV_OP_TURBO_DEC) { const struct rte_bbdev_op_cap_turbo_dec *cap = &op_cap->cap.turbo_dec; -- 2.17.1
[dpdk-dev] [PATCH v7 5/9] baseband/la12xx: add queue and modem config support
From: Hemant Agrawal This patch add support for connecting with modem and creating the ipc channel as queues with modem for the exchange of data. Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- MAINTAINERS| 1 + doc/guides/bbdevs/index.rst| 1 + doc/guides/bbdevs/la12xx.rst | 81 +++ doc/guides/rel_notes/release_21_11.rst | 5 + drivers/baseband/la12xx/bbdev_la12xx.c | 555 - drivers/baseband/la12xx/bbdev_la12xx.h | 17 +- drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 189 ++- 7 files changed, 836 insertions(+), 13 deletions(-) create mode 100644 doc/guides/bbdevs/la12xx.rst diff --git a/MAINTAINERS b/MAINTAINERS index e3f0e8759f..1bf39820d6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1296,6 +1296,7 @@ NXP LA12xx driver M: Nipun Gupta M: Hemant Agrawal F: drivers/baseband/la12xx/ +F: doc/guides/bbdevs/la12xx.rst Rawdev Drivers diff --git a/doc/guides/bbdevs/index.rst b/doc/guides/bbdevs/index.rst index 4445cbd1b0..cedd706fa6 100644 --- a/doc/guides/bbdevs/index.rst +++ b/doc/guides/bbdevs/index.rst @@ -14,3 +14,4 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 +la12xx diff --git a/doc/guides/bbdevs/la12xx.rst b/doc/guides/bbdevs/la12xx.rst new file mode 100644 index 00..3c9ac5c047 --- /dev/null +++ b/doc/guides/bbdevs/la12xx.rst @@ -0,0 +1,81 @@ +.. SPDX-License-Identifier: BSD-3-Clause +Copyright 2021 NXP + +NXP LA12xx Poll Mode Driver +=== + +The BBDEV LA12xx poll mode driver (PMD) supports an implementation for +offloading High Phy processing functions like LDPC Encode / Decode 5GNR wireless +acceleration function, using PCI based LA12xx Software defined radio. + +More information can be found at `NXP Official Website +<https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/layerscape-processors/layerscape-access-la1200-programmable-baseband-processor:LA1200>`_. + +Features + + +LA12xx PMD supports the following features: + +- Maximum of 8 UL queues +- Maximum of 8 DL queues +- PCIe Gen-3 x8 Interface +- MSI-X + +Installation + + +Section 3 of the DPDK manual provides instructions on installing and compiling DPDK. + +DPDK requires hugepages to be configured as detailed in section 2 of the DPDK manual. + +Initialization +-- + +The device can be listed on the host console with: + + +Use the following lspci command to get the multiple LA12xx processor ids. The +device ID of the LA12xx baseband processor is "1c30". + +.. code-block:: console + + sudo lspci -nn + +... +0001:01:00.0 Power PC [0b20]: Freescale Semiconductor Inc Device [1957:1c30] ( +rev 10) +... +0002:01:00.0 Power PC [0b20]: Freescale Semiconductor Inc Device [1957:1c30] ( +rev 10) + + +Prerequisites +- + +Currently supported by DPDK: + +- NXP LA1224 BSP **1.0+**. +- NXP LA1224 PCIe Modem card connected to ARM host. + +- Follow the DPDK :ref:`Getting Started Guide for Linux ` to setup the basic DPDK environment. + +* Use dev arg option ``modem=0`` to identify the modem instance for a given + device. This is required only if more than 1 modem cards are attached to host. + this is optional and the default value is 0. + e.g. ``--vdev=baseband_la12xx,modem=0`` + +* Use dev arg option ``max_nb_queues=x`` to specify the maximum number of queues + to be used for communication with offload device i.e. modem. default is 16. + e.g. ``--vdev=baseband_la12xx,max_nb_queues=4`` + +Enabling logs +- + +For enabling logs, use the following EAL parameter: + +.. code-block:: console + + ./your_bbdev_application --log-level=la12xx: + +Using ``bb.la12xx`` as log matching criteria, all Baseband PMD logs can be +enabled which are lower than logging ``level``. diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index ad7c1afec0..60b92c9a9f 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -91,6 +91,11 @@ New Features Added command-line options to specify total number of processes and current process ID. Each process owns subset of Rx and Tx queues. +* **Added NXP LA12xx baseband PMD.** + + * Added a new baseband PMD driver for NXP LA12xx Software defined radio. + * See the :doc:`../bbdevs/la12xx` for more details. + Removed Items - diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index f9f32d665a..46ee5b4d70 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -3,6 +3,11 @@ */ #include +#include +#include +#include +#include +#include #include #include @@ -29,11 +34,552 @@ struct bbdev_la12xx_params { #define LA12XX_VDEV_MODEM_ID_ARG "modem" #define LA12XX_MAX_MODEM 4 +#define LA12XX_
[dpdk-dev] [PATCH v7 6/9] baseband/la12xx: add enqueue and dequeue support
From: Hemant Agrawal Add support for enqueue and dequeue the LDPC enc/dec from the modem device. Signed-off-by: Nipun Gupta Signed-off-by: Hemant Agrawal --- doc/guides/bbdevs/features/la12xx.ini | 13 + doc/guides/bbdevs/la12xx.rst | 47 ++- drivers/baseband/la12xx/bbdev_la12xx.c | 328 - drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 37 +++ 4 files changed, 420 insertions(+), 5 deletions(-) create mode 100644 doc/guides/bbdevs/features/la12xx.ini diff --git a/doc/guides/bbdevs/features/la12xx.ini b/doc/guides/bbdevs/features/la12xx.ini new file mode 100644 index 00..0aec5eecb6 --- /dev/null +++ b/doc/guides/bbdevs/features/la12xx.ini @@ -0,0 +1,13 @@ +; +; Supported features of the 'la12xx' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Turbo Decoder (4G) = N +Turbo Encoder (4G) = N +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = N +HW Accelerated = Y +BBDEV API = Y diff --git a/doc/guides/bbdevs/la12xx.rst b/doc/guides/bbdevs/la12xx.rst index 3c9ac5c047..b111ec0dd6 100644 --- a/doc/guides/bbdevs/la12xx.rst +++ b/doc/guides/bbdevs/la12xx.rst @@ -16,10 +16,11 @@ Features LA12xx PMD supports the following features: +- LDPC Encode in the DL +- LDPC Decode in the UL - Maximum of 8 UL queues - Maximum of 8 DL queues - PCIe Gen-3 x8 Interface -- MSI-X Installation @@ -79,3 +80,47 @@ For enabling logs, use the following EAL parameter: Using ``bb.la12xx`` as log matching criteria, all Baseband PMD logs can be enabled which are lower than logging ``level``. + +Test Application + + +BBDEV provides a test application, ``test-bbdev.py`` and range of test data for testing +the functionality of LA12xx for FEC encode and decode, depending on the device +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). + "-s", "--snr": SNR in dB used when generating LLRs for bler tests. + "-s", "--iter_max" : Number of iterations for LDPC decoder. + "-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 decode or encode data, +type one of the following: + +.. code-block:: console + + ./test-bbdev.py -e="--vdev=baseband_la12xx,socket_id=0,max_nb_queues=8" -c validation -n 64 -b 1 -v ./ldpc_dec_default.data + ./test-bbdev.py -e="--vdev=baseband_la12xx,socket_id=0,max_nb_queues=8" -c validation -n 64 -b 1 -v ./ldpc_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. + + +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 LA12xx FEC capabilities which may cause some +testcases to be skipped, but no failure should be reported. diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index 46ee5b4d70..69ca83cee6 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -120,6 +120,10 @@ la12xx_queue_release(struct rte_bbdev *dev, uint16_t q_id) ((uint64_t) ((unsigned long) (A) \ - ((uint64_t)ipc_priv->hugepg_start.host_vaddr))) +#define MODEM_P2V(A) \ + ((uint64_t) ((unsigned long) (A) \ + + (unsigned long)(ipc_priv->peb_start.host_vaddr))) + static int ipc_queue_configure(uint32_t channel_id, ipc_t instance, struct bbdev_la12xx_q_priv *q_priv) { @@ -334,6 +338,318 @@ static const struct rte_bbdev_ops pmd_ops = { .queue_release = la12xx_queue_release, .start = la12xx_start }; + +static inline int +is_bd_ring_ful
[dpdk-dev] [PATCH v7 9/9] app/bbdev: add test vectors for transport blocks
From: Nipun Gupta This patch adds two test vectors for transport block in network byte order: - LDPC encode for Transport Block - LDPC decode for Transport block Signed-off-by: Nipun Gupta --- app/test-bbdev/test_vectors/ldpc_dec_tb.data | 265 +++ app/test-bbdev/test_vectors/ldpc_enc_tb.data | 95 +++ 2 files changed, 360 insertions(+) create mode 100644 app/test-bbdev/test_vectors/ldpc_dec_tb.data create mode 100644 app/test-bbdev/test_vectors/ldpc_enc_tb.data diff --git a/app/test-bbdev/test_vectors/ldpc_dec_tb.data b/app/test-bbdev/test_vectors/ldpc_dec_tb.data new file mode 100644 index 00..5882e8aafe --- /dev/null +++ b/app/test-bbdev/test_vectors/ldpc_dec_tb.data @@ -0,0 +1,265 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2021 NXP + +op_type = +RTE_BBDEV_OP_LDPC_DEC + +input0 = +0x7f818181, 0x7f7f817f, 0x7f817f81, 0x817f8181, 0x817f7f81, 0x817f7f81, 0x7f817f7f, 0x7f7f7f81, +0x7f7f7f7f, 0x817f7f7f, 0x7f7f8181, 0x817f7f7f, 0x7f7f817f, 0x8181817f, 0x817f7f81, 0x7f7f8181, +0x81817f81, 0x7f7f7f81, 0x81817f7f, 0x7f81817f, 0x817f7f81, 0x7f817f81, 0x8181817f, 0x7f7f7f81, +0x7f7f817f, 0x81817f7f, 0x7f81817f, 0x7f7f817f, 0x817f817f, 0x7f7f817f, 0x7f7f7f81, 0x7f7f7f81, +0x7f817f7f, 0x7f818181, 0x7f818181, 0x8181817f, 0x7f7f8181, 0x7f7f7f7f, 0x7f817f7f, 0x81818181, +0x7f7f817f, 0x7f7f7f7f, 0x817f8181, 0x7f7f7f81, 0x817f817f, 0x817f8181, 0x81817f7f, 0x7f7f7f7f, +0x81817f7f, 0x7f81817f, 0x817f7f7f, 0x817f7f81, 0x7f817f7f, 0x817f817f, 0x81817f81, 0x817f7f7f, +0x817f7f81, 0x817f817f, 0x8181817f, 0x81818181, 0x81818181, 0x817f7f7f, 0x7f817f81, 0x817f7f7f, +0x7f817f7f, 0x7f817f7f, 0x7f818181, 0x7f818181, 0x817f817f, 0x81817f81, 0x7f81817f, 0x817f817f, +0x7f81817f, 0x817f7f81, 0x7f7f817f, 0x817f8181, 0x817f7f81, 0x81817f7f, 0x8181817f, 0x7f7f7f7f, +0x817f7f81, 0x7f81817f, 0x7f7f7f7f, 0x7f817f81, 0x7f817f81, 0x817f7f7f, 0x81818181, 0x7f7f8181, +0x7f818181, 0x81817f7f, 0x7f817f81, 0x7f81817f, 0x7f7f8181, 0x7f7f817f, 0x7f7f817f, 0x81817f81, +0x7f818181, 0x8181817f, 0x7f817f81, 0x7f7f8181, 0x7f7f8181, 0x817f7f81, 0x7f7f7f7f, 0x7f817f7f, +0x7f7f8181, 0x7f817f7f, 0x7f818181, 0x81817f7f, 0x817f7f7f, 0x81817f81, 0x7f817f7f, 0x7f81817f, +0x7f81817f, 0x817f7f81, 0x7f817f7f, 0x817f817f, 0x7f7f817f, 0x817f7f81, 0x817f817f, 0x817f8181, +0x817f817f, 0x7f817f7f, 0x7f817f7f, 0x8181817f, 0x7f818181, 0x7f817f7f, 0x7f818181, 0x7f7f817f, +0x817f8181, 0x8181817f, 0x7f817f7f, 0x7f7f817f, 0x7f7f817f, 0x7f7f8181, 0x817f7f7f, 0x817f8181, +0x7f7f817f, 0x7f7f7f81, 0x817f7f81, 0x7f7f7f81, 0x7f7f7f7f, 0x817f8181, 0x81818181, 0x81817f81, +0x817f7f81, 0x7f7f817f, 0x7f817f7f, 0x7f7f8181, 0x7f7f7f81, 0x7f817f81, 0x817f8181, 0x81817f7f, +0x7f7f817f, 0x7f817f81, 0x7f817f81, 0x7f7f7f81, 0x81818181, 0x81817f7f, 0x7f7f817f, 0x7f817f81, +0x7f7f8181, 0x7f81817f, 0x817f8181, 0x7f7f8181, 0x7f7f7f81, 0x8181817f, 0x7f817f81, 0x81817f7f, +0x817f7f81, 0x817f8181, 0x817f7f7f, 0x7f7f817f, 0x817f7f7f, 0x81817f81, 0x7f7f7f7f, 0x817f7f7f, +0x817f7f81, 0x7f817f81, 0x8181817f, 0x81817f7f, 0x817f7f81, 0x7f818181, 0x7f7f817f, 0x7f818181, +0x7f7f7f7f, 0x7f7f8181, 0x7f7f817f, 0x7f817f81, 0x817f7f7f, 0x817f817f, 0x7f7f7f81, 0x7f7f7f81, +0x7f7f817f, 0x817f8181, 0x81817f81, 0x817f7f7f, 0x7f7f7f81, 0x817f7f7f, 0x7f7f7f7f, 0x7f7f817f, +0x81817f81, 0x7f7f7f81, 0x81817f7f, 0x81818181, 0x817f7f81, 0x817f817f, 0x817f7f7f, 0x7f7f7f7f, +0x7f81817f, 0x8181817f, 0x7f7f817f, 0x817f7f81, 0x7f81817f, 0x817f7f81, 0x7f7f817f, 0x7f818181, +0x817f7f7f, 0x817f7f81, 0x81817f81, 0x81817f81, 0x8181817f, 0x7f817f7f, 0x7f7f7f81, 0x8181817f, +0x7f817f81, 0x8181817f, 0x7f7f7f81, 0x817f8181, 0x817f7f81, 0x81817f81, 0x7f7f817f, 0x7f7f817f, +0x817f7f7f, 0x817f8181, 0x7f817f7f, 0x817f7f81, 0x7f7f7f81, 0x7f7f7f7f, 0x817f8181, 0x7f817f81, +0x81817f81, 0x7f7f7f81, 0x817f7f7f, 0x817f817f, 0x81817f7f, 0x817f7f81, 0x7f81817f, 0x817f817f, +0x81817f81, 0x8181817f, 0x7f818181, 0x7f81817f, 0x8181817f, 0x817f7f7f, 0x7f817f7f, 0x8181817f, +0x7f7f7f7f, 0x81817f7f, 0x7f7f7f81, 0x817f7f81, 0x7f7f7f81, 0x7f817f7f, 0x7f7f7f7f, 0x817f7f81, +0x7f818181, 0x817f7f7f, 0x7f7f7f81, 0x817f7f7f, 0x81818181, 0x81817f7f, 0x7f817f81, 0x7f7f7f81, +0x7f818181, 0x817f8181, 0x81817f81, 0x8181817f, 0x7f7f8181, 0x817f7f81, 0x7f81817f, 0x7f7f817f, +0x7f7f8181, 0x7f817f7f, 0x8181817f, 0x7f817f81, 0x7f817f7f, 0x7f7f8181, 0x7f818181, 0x7f7f8181, +0x817f7f81, 0x81817f81, 0x7f81817f, 0x81817f81, 0x817f7f7f, 0x7f818181, 0x8181817f, 0x817f8181, +0x7f7f7f81, 0x7f81817f, 0x81817f7f, 0x7f817f81, 0x7f7f817f, 0x7f7f8181, 0x7f81817f, 0x7f81817f, +0x7f818181, 0x817f7f7f, 0x817f8181, 0x7f7f8181, 0x8181817f, 0x7f817f81, 0x817f8181, 0x817f817f, +0x7f7f817f, 0x81817f81, 0x7f817f7f, 0x7f81817f, 0x817f817f, 0x81817f81, 0x7f7f7f7f, 0x8181817f, +0x7f817f81, 0x7f817f7f, 0x7f817f81, 0x7f817f7f, 0x7f7f7f81, 0x817f817f, 0x7f81817f, 0x817f7f81, +0x81818181, 0x7f817f81, 0x7f7f7f81, 0x7f81817f, 0x817f7f7f, 0x817f7f81, 0x817f7f7f, 0x81817f81, +0x7f7f817f, 0x817f8181, 0x81818181
[dpdk-dev] [PATCH] app/testpmd: support unequal number of RXQ and TXQ
From: Jun Yang The existing forwarding mode configures the total number of queues as the minimum of rxq and txq, so eventually the number of txq are same as rxq. However in some scenarios, specially for flow control the number of rxq and txq can be different. This patch makes the txq and function of rxq for all such scenario instead of keeping 1:1 relationship between the two. Signed-off-by: Jun Yang --- app/test-pmd/config.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index f5765b34f7..7e17f233ba 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -3000,8 +3000,6 @@ rss_fwd_config_setup(void) int end; nb_q = nb_rxq; - if (nb_q > nb_txq) - nb_q = nb_txq; cur_fwd_config.nb_fwd_lcores = (lcoreid_t) nb_fwd_lcores; cur_fwd_config.nb_fwd_ports = nb_fwd_ports; cur_fwd_config.nb_fwd_streams = @@ -3038,7 +3036,7 @@ rss_fwd_config_setup(void) fs->rx_port = fwd_ports_ids[rxp]; fs->rx_queue = rxq; fs->tx_port = fwd_ports_ids[txp]; - fs->tx_queue = rxq; + fs->tx_queue = (rxq % nb_txq); fs->peer_addr = fs->tx_port; fs->retry_enabled = retry_enabled; rxp++; @@ -3253,7 +3251,7 @@ fwd_config_setup(void) return; } - if ((nb_rxq > 1) && (nb_txq > 1)){ + if ((nb_rxq > 1) && (nb_txq > 1)) { if (dcb_config) { for (i = 0; i < nb_fwd_ports; i++) { pt_id = fwd_ports_ids[i]; -- 2.17.1
[dpdk-dev] [PATCH] app/testpmd: update raw flow to take hex input
From: Nipun Gupta This patch enables method to provide key and mask for raw rules to be provided as hexadecimal values. There is new parameter pattern_mask added to support this. Signed-off-by: Nipun Gupta --- app/test-pmd/cmdline_flow.c | 15 +++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 13 + 2 files changed, 28 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 6cd99bf37f..a95b147d92 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -158,6 +158,7 @@ enum index { ITEM_RAW_OFFSET, ITEM_RAW_LIMIT, ITEM_RAW_PATTERN, + ITEM_RAW_PATTERN_HEX, ITEM_ETH, ITEM_ETH_DST, ITEM_ETH_SRC, @@ -1046,6 +1047,7 @@ static const enum index item_raw[] = { ITEM_RAW_OFFSET, ITEM_RAW_LIMIT, ITEM_RAW_PATTERN, + ITEM_RAW_PATTERN_HEX, ITEM_NEXT, ZERO, }; @@ -2487,6 +2489,19 @@ static const struct token token_list[] = { ARGS_ENTRY_ARB(sizeof(struct rte_flow_item_raw), ITEM_RAW_PATTERN_SIZE)), }, + [ITEM_RAW_PATTERN_HEX] = { + .name = "pattern_hex", + .help = "hex string to look for", + .next = NEXT(item_raw, +NEXT_ENTRY(HEX), +NEXT_ENTRY(ITEM_PARAM_IS, + ITEM_PARAM_SPEC, + ITEM_PARAM_MASK)), + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_raw, pattern), +ARGS_ENTRY(struct rte_flow_item_raw, length), +ARGS_ENTRY_ARB(sizeof(struct rte_flow_item_raw), + ITEM_RAW_PATTERN_SIZE)), + }, [ITEM_ETH] = { .name = "eth", .help = "match Ethernet header", diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 4f8751be1c..3a69d37037 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -3637,6 +3637,7 @@ This section lists supported pattern items and their attributes, if any. - ``offset {integer}``: absolute or relative offset for pattern. - ``limit {unsigned}``: search area limit for start of pattern. - ``pattern {string}``: byte string to look for. + - ``pattern_hex {string}``: byte string (provided in hexadecimal) to look for. - ``eth``: match Ethernet header. @@ -5036,6 +5037,18 @@ The meter policy action list: ``green -> green, yellow -> yellow, red -> red``. testpmd> create port meter 0 1 13 1 yes 0x 0 0 testpmd> flow create 0 priority 0 ingress group 1 pattern eth / end actions meter mtr_id 1 / end +Sample RAW rule +~~~ + +A RAW rule can be creted as following using ``pattern_hex`` key and mask. + +:: + +testpmd> flow create 0 group 0 priority 1 ingress pattern raw relative is 0 search is 0 offset + is 0 limit is 0 pattern_hex spec 0a0a0a0a + pattern_hex mask / end actions + queue index 4 / end + BPF Functions -- -- 2.17.1
Re: [dpdk-dev] [PATCH] app/testpmd: update raw flow to take hex input
Please ignore this patch for now. Regards, Nipun > -Original Message- > From: nipun.gu...@nxp.com > Sent: Tuesday, September 28, 2021 4:39 PM > To: dev@dpdk.org > Cc: xiaoyun...@intel.com; or...@nvidia.com; tho...@monjalon.net; > ferruh.yi...@intel.com; Hemant Agrawal ; Nipun > Gupta > Subject: [PATCH] app/testpmd: update raw flow to take hex input > > From: Nipun Gupta > > This patch enables method to provide key and mask for raw rules > to be provided as hexadecimal values. There is new parameter > pattern_mask added to support this. > > Signed-off-by: Nipun Gupta > --- > app/test-pmd/cmdline_flow.c | 15 +++ > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 13 + > 2 files changed, 28 insertions(+) > > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > index 6cd99bf37f..a95b147d92 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -158,6 +158,7 @@ enum index { > ITEM_RAW_OFFSET, > ITEM_RAW_LIMIT, > ITEM_RAW_PATTERN, > + ITEM_RAW_PATTERN_HEX, > ITEM_ETH, > ITEM_ETH_DST, > ITEM_ETH_SRC, > @@ -1046,6 +1047,7 @@ static const enum index item_raw[] = { > ITEM_RAW_OFFSET, > ITEM_RAW_LIMIT, > ITEM_RAW_PATTERN, > + ITEM_RAW_PATTERN_HEX, > ITEM_NEXT, > ZERO, > }; > @@ -2487,6 +2489,19 @@ static const struct token token_list[] = { >ARGS_ENTRY_ARB(sizeof(struct rte_flow_item_raw), > ITEM_RAW_PATTERN_SIZE)), > }, > + [ITEM_RAW_PATTERN_HEX] = { > + .name = "pattern_hex", > + .help = "hex string to look for", > + .next = NEXT(item_raw, > + NEXT_ENTRY(HEX), > + NEXT_ENTRY(ITEM_PARAM_IS, > + ITEM_PARAM_SPEC, > + ITEM_PARAM_MASK)), > + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_raw, pattern), > + ARGS_ENTRY(struct rte_flow_item_raw, length), > + ARGS_ENTRY_ARB(sizeof(struct rte_flow_item_raw), > + ITEM_RAW_PATTERN_SIZE)), > + }, > [ITEM_ETH] = { > .name = "eth", > .help = "match Ethernet header", > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > index 4f8751be1c..3a69d37037 100644 > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -3637,6 +3637,7 @@ This section lists supported pattern items and their > attributes, if any. >- ``offset {integer}``: absolute or relative offset for pattern. >- ``limit {unsigned}``: search area limit for start of pattern. >- ``pattern {string}``: byte string to look for. > + - ``pattern_hex {string}``: byte string (provided in hexadecimal) to look > for. > > - ``eth``: match Ethernet header. > > @@ -5036,6 +5037,18 @@ The meter policy action list: ``green -> green, yellow > -> yellow, red -> red``. > testpmd> create port meter 0 1 13 1 yes 0x 0 0 > testpmd> flow create 0 priority 0 ingress group 1 pattern eth / end > actions > meter mtr_id 1 / end > > +Sample RAW rule > +~~~ > + > +A RAW rule can be creted as following using ``pattern_hex`` key and mask. > + > +:: > + > +testpmd> flow create 0 group 0 priority 1 ingress pattern raw relative > is 0 > search is 0 offset > + is 0 limit is 0 pattern_hex spec > 0a0a0a0a > + pattern_hex mask > / end > actions > + queue index 4 / end > + > BPF Functions > -- > > -- > 2.17.1
Re: [dpdk-dev] [PATCH v3] dmadev: introduce DMA device library
> +/** > + * A structure used to configure a virtual DMA channel. > + */ > +struct rte_dmadev_vchan_conf { > + uint8_t direction; > + /**< Set of supported transfer directions > + * @see RTE_DMA_MEM_TO_MEM > + * @see RTE_DMA_MEM_TO_DEV > + * @see RTE_DMA_DEV_TO_MEM > + * @see RTE_DMA_DEV_TO_DEV > + */ > + /** Number of descriptor for the virtual DMA channel */ > + uint16_t nb_desc; > + /** 1) Used to describes the port parameter in the device-to-memory > + * transfer scenario. > + * 2) Used to describes the source port parameter in the > + * device-to-device transfer scenario. > + * @see struct rte_dmadev_port_parameters > + */ There should also be a configuration to support no response (per Virtual Channel), And if that is enabled, user will not be required to call 'rte_dmadev_completed' API. This shall also be part of capability. > + struct rte_dmadev_port_parameters src_port; > + /** 1) Used to describes the port parameter in the memory-to-device-to > + * transfer scenario. > + * 2) Used to describes the destination port parameter in the > + * device-to-device transfer scenario. > + * @see struct rte_dmadev_port_parameters > + */ > + struct rte_dmadev_port_parameters dst_port; > +}; > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice. > + * > + * Enqueue a scatter list copy operation onto the virtual DMA channel. > + * > + * This queues up a scatter list copy operation to be performed by hardware, > + * but does not trigger hardware to begin that operation. This would need update with the submit flag. The statement should be true only when the flag is set? Similar comment I see on 'rte_dmadev_copy_sg' and 'rte_dma_fill' APIs > + * > + * @param dev_id > + * The identifier of the device. > + * @param vchan > + * The identifier of virtual DMA channel. > + * @param sg > + * The pointer of scatterlist. > + * @param flags > + * An flags for this operation. > + * @see RTE_DMA_OP_FLAG_* > + * > + * @return > + * - 0..UINT16_MAX: index of enqueued copy scatterlist job. > + * - <0: Error code returned by the driver copy scatterlist function. > + */ > +__rte_experimental > +static inline int > +rte_dmadev_copy_sg(uint16_t dev_id, uint16_t vchan, const struct rte_dma_sg > *sg, > +uint64_t flags) > +{ > + struct rte_dmadev *dev = &rte_dmadevices[dev_id]; > +#ifdef RTE_DMADEV_DEBUG > + if (!rte_dmadev_is_valid_dev(dev_id) || > + vchan >= dev->data->dev_conf.max_vchans || > + sg == NULL) > + return -EINVAL; > + RTE_FUNC_PTR_OR_ERR_RET(*dev->copy_sg, -ENOTSUP); > +#endif > + return (*dev->copy_sg)(dev, vchan, sg, flags); > +} > +