baseband: introduce NXP LA12xx driver
PATCH 1/6 baseband: introduce NXP LA12xx driver
This patch introduce the baseband device drivers for NXP's LA1200 series software defined baseband modem.
--- drivers/baseband/la12xx/bbdev_la12xx.c | 110 ++++++++++++++++++ .../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 38 ++++++ drivers/baseband/la12xx/meson.build | 6 + drivers/baseband/la12xx/version.map | 3 + drivers/baseband/meson.build | 2 +- 5 files changed, 158 insertions(+), 1 deletion(-) 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
drivers/baseband/la12xx/bbdev_la12xx.c new file +110 -0
@@ -0,0 +1,110 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2020-2021 NXP +*/ + +#include <string.h> + +#include <rte_common.h> +#include <rte_bus_vdev.h> +#include <rte_malloc.h> +#include <rte_ring.h> +#include <rte_kvargs.h> + +#include <rte_bbdev.h> +#include <rte_bbdev_pmd.h> + +#include <bbdev_la12xx_pmd_logs.h> + +#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); +RTE_PMD_REGISTER_ALIAS (DRIVER_NAME , bbdev_la12xx);
drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h new file +38 -0
@@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2020 NXP +*/ + +#ifndef _BBDEV_LA12XX_PMD_LOGS_H_ +#define _BBDEV_LA12XX_PMD_LOGS_H_ + +#define BBDEV_LA12XX_PMD_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, bbdev_la12xx_logtype, "bbdev_la12xx: " \ + fmt "\n", ##args) + +#define BBDEV_LA12XX_PMD_DEBUG(fmt, args...) \ + rte_log(RTE_LOG_DEBUG, bbdev_la12xx_logtype, "bbdev_la12xx: %s(): "\ + fmt "\n", __func__, ##args) + +#define PMD_INIT_FUNC_TRACE () BBDEV_LA12XX_PMD_DEBUG(">>") + +#define BBDEV_LA12XX_PMD_CRIT(fmt, args...) \ + BBDEV_LA12XX_PMD_LOG(CRIT, fmt, ## args) +#define BBDEV_LA12XX_PMD_INFO(fmt, args...) \ + BBDEV_LA12XX_PMD_LOG(INFO, fmt, ## args) +#define BBDEV_LA12XX_PMD_ERR(fmt, args...) \ + BBDEV_LA12XX_PMD_LOG(ERR, fmt, ## args) +#define BBDEV_LA12XX_PMD_WARN(fmt, args...) \ + BBDEV_LA12XX_PMD_LOG(WARNING, fmt, ## args) + +/* DP Logs, toggled out at compile time if level lower than current level */ +#define BBDEV_LA12XX_PMD_DP_LOG(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, fmt, ## args) + +#define BBDEV_LA12XX_PMD_DP_DEBUG(fmt, args...) \ + BBDEV_LA12XX_PMD_DP_LOG(DEBUG, fmt, ## args) +#define BBDEV_LA12XX_PMD_DP_INFO(fmt, args...) \ + BBDEV_LA12XX_PMD_DP_LOG(INFO, fmt, ## args) +#define BBDEV_LA12XX_PMD_DP_WARN(fmt, args...) \ + BBDEV_LA12XX_PMD_DP_LOG(WARNING, fmt, ## args) + +#endif /* _BBDEV_LA12XX_PMD_LOGS_H_ */
drivers/baseband/la12xx/meson.build new file +6 -0
@@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2020-2021 NXP + +deps += ['bbdev', 'bus_vdev', 'ring'] + +sources = files('bbdev_la12xx.c')
drivers/baseband/la12xx/version.map new file +3 -0
@@ -0,0 +1,3 @@ +DPDK_21 { + local: *; +};
drivers/baseband/meson.build +1 -1
@@ -5,4 +5,4 @@ if is_windows subdir_done() endif -drivers = ['null', 'turbo_sw', 'fpga_lte_fec', 'fpga_5gnr_fec', 'acc100'] +drivers = ['null', 'turbo_sw', 'fpga_lte_fec', 'fpga_5gnr_fec', 'acc100', 'la12xx']
Signature · 1 line
2.17.1
PATCH 2/6 baseband/la12xx: add devargs for max queues
This patch adds dev args to take max queues as input
--- drivers/baseband/la12xx/bbdev_la12xx.c | 72 +++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 2 deletions(-)
drivers/baseband/la12xx/bbdev_la12xx.c +70 -2
@@ -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 BBDEV_LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" + +static const char *const bbdev_la12xx_valid_params[] = { +BBDEV_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 )) { +BBDEV_LA12XX_PMD_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) {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 = { +RTE_BBDEV_DEFAULT_MAX_NB_QUEUES + };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,4 +173,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 , +BBDEV_LA12XX_MAX_NB_QUEUES_ARG "=<int>" );RTE_PMD_REGISTER_ALIAS (DRIVER_NAME , bbdev_la12xx);
Signature · 1 line
2.17.1
PATCH 3/6 baseband/la12xx: add support for multiple modems
In reply to Hemant AgrawalThis patch add support for multiple modems by assigning a modem id as dev args in vdev creation.
--- drivers/baseband/la12xx/bbdev_la12xx.c | 62 +++++++++++++++++++--- drivers/baseband/la12xx/bbdev_la12xx.h | 56 +++++++++++++++++++ drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 20 +++++++ 3 files changed, 132 insertions(+), 6 deletions(-) create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.h create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_ipc.h
drivers/baseband/la12xx/bbdev_la12xx.c +56 -6
@@ -14,6 +14,8 @@#include <rte_bbdev_pmd.h> #include <bbdev_la12xx_pmd_logs.h> +#include <bbdev_la12xx_ipc.h> +#include <bbdev_la12xx.h> #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 BBDEV_LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" +#define BBDEV_LA12XX_VDEV_MODEM_ID_ARG "modem" +#define LA12XX_MAX_MODEM 4static const char *const bbdev_la12xx_valid_params[] = {BBDEV_LA12XX_MAX_NB_QUEUES_ARG , +BBDEV_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 ) { +BBDEV_LA12XX_PMD_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 ) { +BBDEV_LA12XX_PMD_ERR ("Invalid modem id, must be < %u" , +LA12XX_MAX_MODEM ); + goto exit; + } } exit:
@@ -88,6 +122,7 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev, {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; + +BBDEV_LA12XX_PMD_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 = { -RTE_BBDEV_DEFAULT_MAX_NB_QUEUES +RTE_BBDEV_DEFAULT_MAX_NB_QUEUES ,-1 , };const char *name;const char *input_args;
@@ -174,5 +223,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 , -BBDEV_LA12XX_MAX_NB_QUEUES_ARG "=<int>" ); +BBDEV_LA12XX_MAX_NB_QUEUES_ARG "=<int>" +BBDEV_LA12XX_VDEV_MODEM_ID_ARG "=<int> " );RTE_PMD_REGISTER_ALIAS (DRIVER_NAME , bbdev_la12xx);
drivers/baseband/la12xx/bbdev_la12xx.h new file +56 -0
56 lines not on this page · raw message
drivers/baseband/la12xx/bbdev_la12xx_ipc.h new file +20 -0
@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2020-2021 NXP +*/ +#ifndef __BBDEV_LA12XX_IPC_H__ +#define __BBDEV_LA12XX_IPC_H__ + +/** No. of max channel per instance */ +#define IPC_MAX_DEPTH (16) + +/* This shared memory would be on the host side which have copy of some +* of the parameters which are also part of Shared BD ring. Read access +* of these parameters from the host side would not be over PCI. +*/ +typedef struct host_ipc_params { +volatile uint32_t pi; +volatile uint32_t ci; +volatile uint32_t modem_ptr[IPC_MAX_DEPTH ]; +} __rte_packed host_ipc_params_t; + +#endif
Signature · 1 line
2.17.1
PATCH 4/6 baseband/la12xx: add queue and modem config support
In reply to Hemant AgrawalThis patch add support for connecting with modem and creating the ipc channel as queues with modem for the exchange of data.
--- drivers/baseband/la12xx/bbdev_la12xx.c | 566 ++++++++++++++++++++- drivers/baseband/la12xx/bbdev_la12xx.h | 5 +- drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 180 +++++++ 3 files changed, 748 insertions(+), 3 deletions(-)
drivers/baseband/la12xx/bbdev_la12xx.c +565 -1
@@ -3,6 +3,11 @@*/ #include <string.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/ioctl.h> +#include <sys/mman.h> +#include <dirent.h> #include <rte_common.h> #include <rte_bus_vdev.h>
@@ -31,11 +36,563 @@ struct bbdev_la12xx_params {#define BBDEV_LA12XX_VDEV_MODEM_ID_ARG "modem"#define LA12XX_MAX_MODEM 4 +#define LA12XX_MAX_CORES 4 +#define BBDEV_LA12XX_LDPC_ENC_CORE 0 +#define BBDEV_LA12XX_LDPC_DEC_CORE 1 +static const char *const bbdev_la12xx_valid_params[] = {BBDEV_LA12XX_MAX_NB_QUEUES_ARG ,BBDEV_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_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 , + } + }, +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, +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->default_queue_conf = default_queue_conf; + dev_info->capabilities = bbdev_capabilities; + dev_info->cpu_flag_reqs =NULL ; + dev_info->min_alignment =64 ; + +BBDEV_LA12XX_PMD_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 (); + +/* TODO: Implement */ + +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 (); + +BBDEV_LA12XX_PMD_DEBUG ("%x %p" , ipc_instance->initialized, + ipc_priv->instance); + ch = &(ipc_instance->ch_list[channel_id]); + +BBDEV_LA12XX_PMD_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->queue_size; i++) { + vaddr =rte_malloc (NULL , msg_size,RTE_CACHE_LINE_SIZE ); +if (!vaddr) +return IPC_HOST_BUF_ALLOC_FAIL ; +/* Only offset now */ + ch->bd[i].modem_ptr = +rte_cpu_to_be_32 (HUGEPG_OFFSET (vaddr)); + ch->bd[i].host_virt_l =lower_32_bits (vaddr); + ch->bd[i].host_virt_h =upper_32_bits (vaddr); + q_priv->msg_ch_vaddr[i] = vaddr; +/* Not sure use of this len may be for CRC*/ + ch->bd[i].len =0 ; + } + ch->host_ipc_params = +rte_cpu_to_be_32 (HUGEPG_OFFSET (q_priv->host_params)); + ch->bl_initialized =1 ; + +BBDEV_LA12XX_PMD_DEBUG ("Channel configured" ); +return IPC_SUCCESS ; +} + +static int +la12xx_e200_queue_setup (struct rte_bbdev *dev, +struct bbdev_la12xx_q_priv *q_priv) +{ +struct bbdev_la12xx_private *priv = dev->data->dev_private; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +struct gul_hif *mhif; +ipc_metadata_t *ipc_md; +ipc_ch_t *ch; +int instance_id =0 , i; +int ret; + +PMD_INIT_FUNC_TRACE (); + +switch (q_priv->op_type) { +case RTE_BBDEV_OP_LDPC_ENC : + q_priv->la12xx_core_id =BBDEV_LA12XX_LDPC_ENC_CORE ; +break ; +case RTE_BBDEV_OP_LDPC_DEC : + q_priv->la12xx_core_id =BBDEV_LA12XX_LDPC_DEC_CORE ; +break ; +default : +BBDEV_LA12XX_PMD_ERR ("Unsupported op type\n" ); +return -1 ; + } + + mhif = (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; +/* offset is from start of PEB */ + ipc_md = (ipc_metadata_t *)((uint64_t )ipc_priv->peb_start.host_vaddr + + mhif->ipc_regs.ipc_mdata_offset); + ch = &ipc_md->instance_list[instance_id].ch_list[q_priv->q_id]; + +if (q_priv->q_id < priv->num_valid_queues) { +ipc_br_md_t *md, *host_md; +ipc_ch_t *host_rx_ch; + + host_rx_ch = + &ipc_md->instance_list[instance_id].ch_list[q_priv->q_id + +HOST_RX_QUEUEID_OFFSET ]; + md = &(ch->md); + host_md = &(host_rx_ch->md); + + q_priv->feca_blk_id =rte_cpu_to_be_32 (ch->feca_blk_id); + q_priv->feca_blk_id_be32 = ch->feca_blk_id; + q_priv->host_pi =rte_be_to_cpu_32 (host_md->pi); + q_priv->host_ci =rte_be_to_cpu_32 (md->ci); + q_priv->host_params = (host_ipc_params_t *) + (rte_be_to_cpu_32 (ch->host_ipc_params) + + ((uint64_t )ipc_priv->hugepg_start.host_vaddr)); + +for (i =0 ; i < q_priv->queue_size; i++) { +uint32_t h, l; + + h = host_rx_ch->bd[i].host_virt_h; + l = host_rx_ch->bd[i].host_virt_l; + q_priv->msg_ch_vaddr[i] = (void *)join_32_bits (h, l); + } + +BBDEV_LA12XX_PMD_WARN ( +"Queue [%d] already configured, not configuring again" , + q_priv->q_id); +return 0 ; + } + +BBDEV_LA12XX_PMD_DEBUG ("setting up queue %d" , q_priv->q_id); + + q_priv->host_params =rte_zmalloc (NULL ,sizeof (host_ipc_params_t), +RTE_CACHE_LINE_SIZE ); + ch->host_ipc_params = +rte_cpu_to_be_32 (HUGEPG_OFFSET (q_priv->host_params)); + +/* Call ipc_configure_channel */ + ret =ipc_queue_configure ((q_priv->q_id +HOST_RX_QUEUEID_OFFSET ), + ipc_priv, q_priv); +if (ret) { +BBDEV_LA12XX_PMD_ERR ("Unable to setup queue (%d) (err=%d)" , + q_priv->q_id, ret); +return ret; + } + +/* Set queue properties for LA12xx device */ +switch (q_priv->op_type) { +case RTE_BBDEV_OP_LDPC_ENC : +if (priv->num_ldpc_enc_queues >=MAX_LDPC_ENC_FECA_QUEUES ) { +BBDEV_LA12XX_PMD_ERR ( +"num_ldpc_enc_queues reached max value" ); +return -1 ; + } + ch->la12xx_core_id = +rte_cpu_to_be_32 (BBDEV_LA12XX_LDPC_ENC_CORE ); + ch->feca_blk_id =rte_cpu_to_be_32 (priv->num_ldpc_enc_queues++); +break ; +case RTE_BBDEV_OP_LDPC_DEC : +if (priv->num_ldpc_dec_queues >=MAX_LDPC_DEC_FECA_QUEUES ) { +BBDEV_LA12XX_PMD_ERR ( +"num_ldpc_dec_queues reached max value" ); +return -1 ; + } + ch->la12xx_core_id = +rte_cpu_to_be_32 (BBDEV_LA12XX_LDPC_DEC_CORE ); + ch->feca_blk_id =rte_cpu_to_be_32 (priv->num_ldpc_dec_queues++); +break ; +default : +BBDEV_LA12XX_PMD_ERR ("Not supported op type\n" ); +return -1 ; + } + ch->op_type =rte_cpu_to_be_32 (q_priv->op_type); + ch->depth =rte_cpu_to_be_32 (q_priv->queue_size); + +/* Store queue config here */ + q_priv->feca_blk_id =rte_cpu_to_be_32 (ch->feca_blk_id); + q_priv->feca_blk_id_be32 = ch->feca_blk_id; + +return 0 ; +} + +/* Setup a queue */ +static int +la12xx_queue_setup (struct rte_bbdev *dev,uint16_t q_id, +const struct rte_bbdev_queue_conf *queue_conf) +{ +struct bbdev_la12xx_private *priv = dev->data->dev_private; +struct rte_bbdev_queue_data *q_data; +struct bbdev_la12xx_q_priv *q_priv; +int ret; + +PMD_INIT_FUNC_TRACE (); + +/* Move to setup_queues callback */ + q_data = &dev->data->queues[q_id]; + q_data->queue_private =rte_zmalloc (NULL , +sizeof (struct bbdev_la12xx_q_priv ),0 ); +if (!q_data->queue_private) { +BBDEV_LA12XX_PMD_ERR ("Memory allocation failed for qpriv" ); +return -ENOMEM ; + } + q_priv = q_data->queue_private; + q_priv->q_id = q_id; + q_priv->bbdev_priv = dev->data->dev_private; + q_priv->queue_size = queue_conf->queue_size; + q_priv->op_type = queue_conf->op_type; + + ret =la12xx_e200_queue_setup (dev, q_priv); +if (ret) { +BBDEV_LA12XX_PMD_ERR ("e200_queue_setup failed for qid: %d" , + q_id); +return ret; + } + +/* Store queue config here */ + priv->num_valid_queues++; + +return 0 ; +} + +static int +la12xx_start (struct rte_bbdev *dev) +{ +struct bbdev_la12xx_private *priv = dev->data->dev_private; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +int ready =0 ; +struct gul_hif *hif_start; + +PMD_INIT_FUNC_TRACE (); + + hif_start = (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; + +/* Set Host Read bit */ +SET_HIF_HOST_RDY (hif_start,HIF_HOST_READY_IPC_APP ); + +/* Now wait for modem ready bit */ +while (!ready) + ready =CHK_HIF_MOD_RDY (hif_start,HIF_MOD_READY_IPC_APP ); + +return 0 ; +} + +static const struct rte_bbdev_ops pmd_ops = { + .info_get = la12xx_info_get, + .queue_setup = la12xx_queue_setup, + .queue_release = la12xx_queue_release, + .start = la12xx_start +}; +static struct hugepage_info * +get_hugepage_info (void ) +{ +struct hugepage_info *hp_info; +struct rte_memseg *mseg; + +PMD_INIT_FUNC_TRACE (); + +/* TODO - find a better way */ + hp_info =rte_malloc (NULL ,sizeof (struct hugepage_info ),0 ); +if (!hp_info) { +BBDEV_LA12XX_PMD_ERR ("Unable to allocate on local heap" ); +return NULL ; + } + + mseg =rte_mem_virt2memseg (hp_info,NULL ); + hp_info->vaddr = mseg->addr; + hp_info->paddr =rte_mem_virt2phy (mseg->addr); + hp_info->len = mseg->len; + +return hp_info; +} + +static int open_ipc_dev (int modem_id) +{ +char dev_initials[16 ], dev_path[PATH_MAX ]; +struct dirent *entry; +int dev_ipc =0 ; +DIR *dir; + + dir =opendir ("/dev/" ); +if (!dir) { +BBDEV_LA12XX_PMD_ERR ("Unable to open /dev/" ); +return -1 ; + } + +sprintf (dev_initials,"gulipcgul%d" , modem_id); + +while ((entry =readdir (dir)) !=NULL ) { +if (!strncmp (dev_initials, entry->d_name, +sizeof (dev_initials) -1 )) +break ; + } + +if (!entry) { +BBDEV_LA12XX_PMD_ERR ("Error: No gulipcgul%d device" , modem_id); +return -1 ; + } + +sprintf (dev_path,"/dev/%s" , entry->d_name); + dev_ipc =open (dev_path,O_RDWR ); +if (dev_ipc <0 ) { +BBDEV_LA12XX_PMD_ERR ("Error: Cannot open %s" , dev_path); +return -errno; + } + +return dev_ipc; +} + +static int +setup_la12xx_dev (struct rte_bbdev *dev) +{ +struct bbdev_la12xx_private *priv = dev->data->dev_private; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +struct hugepage_info *hp =NULL ; +ipc_channel_us_t *ipc_priv_ch =NULL ; +int dev_ipc =0 , dev_mem =0 , i; +ipc_metadata_t *ipc_md; +struct gul_hif *mhif; +uint32_t phy_align =0 ; +int ret; + +PMD_INIT_FUNC_TRACE (); + +if (!ipc_priv) { +/* TODO - get a better way */ +/* Get the hugepage info against it */ + hp =get_hugepage_info (); +if (!hp) { +BBDEV_LA12XX_PMD_ERR ("Unable to get hugepage info" ); + ret = -ENOMEM ; + goto err; + } + +BBDEV_LA12XX_PMD_DEBUG ("%lx %p %lx" , + hp->paddr, hp->vaddr, hp->len); + + ipc_priv =rte_zmalloc (0 ,sizeof (ipc_userspace_t),0 ); +if (ipc_priv ==NULL ) { +BBDEV_LA12XX_PMD_ERR ( +"Unable to allocate memory for ipc priv" ); + ret = -ENOMEM ; + goto err; + } + +for (i =0 ; i <IPC_MAX_CHANNEL_COUNT ; i++) { + ipc_priv_ch =rte_zmalloc (0 , +sizeof (ipc_channel_us_t),0 ); +if (ipc_priv_ch ==NULL ) { +BBDEV_LA12XX_PMD_ERR ( +"Unable to allocate memory for channels" ); + ret = -ENOMEM ; + } + ipc_priv->channels[i] = ipc_priv_ch; + } + + dev_mem =open ("/dev/mem" ,O_RDWR ); +if (dev_mem <0 ) { +BBDEV_LA12XX_PMD_ERR ("Error: Cannot open /dev/mem" ); + ret = -errno; + goto err; + } + + ipc_priv->instance_id =0 ; + ipc_priv->dev_mem = dev_mem; + +BBDEV_LA12XX_PMD_DEBUG ("hugepg input %lx %p %lx" , + hp->paddr, hp->vaddr, hp->len); + + ipc_priv->sys_map.hugepg_start.host_phys = hp->paddr; + ipc_priv->sys_map.hugepg_start.size = hp->len; + + ipc_priv->hugepg_start.host_phys = hp->paddr; + ipc_priv->hugepg_start.host_vaddr = hp->vaddr; + ipc_priv->hugepg_start.size = hp->len; + +rte_free (hp); + } + + dev_ipc =open_ipc_dev (priv->modem_id); +if (dev_ipc <0 ) { +BBDEV_LA12XX_PMD_ERR ("Error: open_ipc_dev failed" ); + goto err; + } + ipc_priv->dev_ipc = dev_ipc; + +/* Send IOCTL to get system map */ +/* Send IOCTL to put hugepg_start map */ + ret =ioctl (ipc_priv->dev_ipc,IOCTL_GUL_IPC_GET_SYS_MAP , + &ipc_priv->sys_map); +if (ret) { +BBDEV_LA12XX_PMD_ERR ( +"IOCTL_GUL_IPC_GET_SYS_MAP ioctl failed" ); + goto err; + } + + phy_align = (ipc_priv->sys_map.mhif_start.host_phys %0x1000 ); + ipc_priv->mhif_start.host_vaddr = +mmap (0 , ipc_priv->sys_map.mhif_start.size + phy_align, + (PROT_READ |PROT_WRITE ),MAP_SHARED , ipc_priv->dev_mem, + (ipc_priv->sys_map.mhif_start.host_phys - phy_align)); +if (ipc_priv->mhif_start.host_vaddr ==MAP_FAILED ) { +BBDEV_LA12XX_PMD_ERR ("MAP failed:" ); + ret = -errno; + goto err; + } + + ipc_priv->mhif_start.host_vaddr = (void *) ((uint64_t ) + (ipc_priv->mhif_start.host_vaddr) + phy_align); + + phy_align = (ipc_priv->sys_map.peb_start.host_phys %0x1000 ); + ipc_priv->peb_start.host_vaddr = +mmap (0 , ipc_priv->sys_map.peb_start.size + phy_align, + (PROT_READ |PROT_WRITE ),MAP_SHARED , ipc_priv->dev_mem, + (ipc_priv->sys_map.peb_start.host_phys - phy_align)); +if (ipc_priv->peb_start.host_vaddr ==MAP_FAILED ) { +BBDEV_LA12XX_PMD_ERR ("MAP failed:" ); + ret = -errno; + goto err; + } + + ipc_priv->peb_start.host_vaddr = (void *)((uint64_t ) + (ipc_priv->peb_start.host_vaddr) + phy_align); + + phy_align = (ipc_priv->sys_map.modem_ccsrbar.host_phys %0x1000 ); + ipc_priv->modem_ccsrbar.host_vaddr = +mmap (0 , ipc_priv->sys_map.modem_ccsrbar.size + phy_align, + (PROT_READ |PROT_WRITE ),MAP_SHARED , ipc_priv->dev_mem, + (ipc_priv->sys_map.modem_ccsrbar.host_phys - phy_align)); +if (ipc_priv->modem_ccsrbar.host_vaddr ==MAP_FAILED ) { +BBDEV_LA12XX_PMD_ERR ("MAP failed:" ); + ret = -errno; + goto err; + } + + ipc_priv->modem_ccsrbar.host_vaddr = (void *)((uint64_t ) + (ipc_priv->modem_ccsrbar.host_vaddr) + phy_align); + + ipc_priv->hugepg_start.modem_phys = + ipc_priv->sys_map.hugepg_start.modem_phys; + + ipc_priv->mhif_start.host_phys = + ipc_priv->sys_map.mhif_start.host_phys; + ipc_priv->mhif_start.size = ipc_priv->sys_map.mhif_start.size; + ipc_priv->peb_start.host_phys = ipc_priv->sys_map.peb_start.host_phys; + ipc_priv->peb_start.size = ipc_priv->sys_map.peb_start.size; + +BBDEV_LA12XX_PMD_INFO ("peb %lx %p %x" , + ipc_priv->peb_start.host_phys, + ipc_priv->peb_start.host_vaddr, + ipc_priv->peb_start.size); +BBDEV_LA12XX_PMD_INFO ("hugepg %lx %p %x" , + ipc_priv->hugepg_start.host_phys, + ipc_priv->hugepg_start.host_vaddr, + ipc_priv->hugepg_start.size); +BBDEV_LA12XX_PMD_INFO ("mhif %lx %p %x" , + ipc_priv->mhif_start.host_phys, + ipc_priv->mhif_start.host_vaddr, + ipc_priv->mhif_start.size); + mhif = (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; + +/* offset is from start of PEB */ + ipc_md = (ipc_metadata_t *)((uint64_t )ipc_priv->peb_start.host_vaddr + + mhif->ipc_regs.ipc_mdata_offset); + +if (sizeof (ipc_metadata_t) != mhif->ipc_regs.ipc_mdata_size) { +BBDEV_LA12XX_PMD_ERR ( +"\n ipc_metadata_t =%lx, mhif->ipc_regs.ipc_mdata_size=%x" , +sizeof (ipc_metadata_t), mhif->ipc_regs.ipc_mdata_size); +BBDEV_LA12XX_PMD_ERR ( +"--> mhif->ipc_regs.ipc_mdata_offset= %x" , + mhif->ipc_regs.ipc_mdata_offset); +BBDEV_LA12XX_PMD_ERR ( +"gul_hif size=%lx" ,sizeof (struct gul_hif )); +return IPC_MD_SZ_MISS_MATCH ; + } + + ipc_priv->instance = (ipc_instance_t *) + (&ipc_md->instance_list[ipc_priv->instance_id]); + +BBDEV_LA12XX_PMD_DEBUG ("finish host init" ); + + priv->ipc_priv = ipc_priv; + +return 0 ; + +err: +rte_free (hp); +rte_free (ipc_priv); +rte_free (ipc_priv_ch); +if (dev_mem) +close (dev_mem); +if (dev_ipc) +close (dev_ipc); + +return ret; +} +static inline int parse_u16_arg (const char *key,const char *value,void *extra_args) {
@@ -123,6 +680,7 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev,struct rte_bbdev *bbdev;const char *name =rte_vdev_device_name (vdev);struct bbdev_la12xx_private *priv; +int ret;PMD_INIT_FUNC_TRACE ();
@@ -152,7 +710,13 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev,BBDEV_LA12XX_PMD_INFO ("Setting Up %s: DevId=%d, ModemId=%d" , name, bbdev->data->dev_id, priv->modem_id); - bbdev->dev_ops =NULL ; + ret =setup_la12xx_dev (bbdev); +if (ret) { +BBDEV_LA12XX_PMD_ERR ("IPC Setup failed for %s" , name); +rte_free (bbdev->data->dev_private); +return ret; + } + bbdev->dev_ops = &pmd_ops; bbdev->device = &vdev->device; bbdev->data->socket_id =0 ; bbdev->intr_handle =NULL ;
drivers/baseband/la12xx/bbdev_la12xx.h +3 -2
@@ -14,7 +14,7 @@#define MAX_CHANNEL_DEPTH 16/* private data structure */ struct bbdev_la12xx_private { -void *ipc_priv; +ipc_userspace_t *ipc_priv;uint8_t num_valid_queues;uint8_t max_nb_queues;uint8_t num_ldpc_enc_queues;
@@ -52,5 +52,6 @@ struct bbdev_la12xx_q_priv {#define lower_32_bits (x) ((uint32_t)((uint64_t)x))#define upper_32_bits (x) ((uint32_t)(((uint64_t)(x) >> 16) >> 16)) - +#define join_32_bits (upper, lower) \ + ((uint64_t)(((uint64_t)(upper) << 32) | (uint32_t)(lower)))#endif
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +180 -0
193 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 5/6 baseband/la12xx: add enqueue and dequeue support
In reply to Hemant AgrawalAdd support for enqueue and dequeue the LDPC enc/dec from the modem device.
--- drivers/baseband/la12xx/bbdev_la12xx.c | 393 ++++++++++++++++++++- drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 37 ++ 2 files changed, 426 insertions(+), 4 deletions(-)
drivers/baseband/la12xx/bbdev_la12xx.c +389 -4
@@ -117,6 +117,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) {
@@ -345,6 +349,387 @@ static const struct rte_bbdev_ops pmd_ops = { .queue_release = la12xx_queue_release, .start = la12xx_start }; + +static int +fill_feca_desc_enc (struct bbdev_la12xx_q_priv *q_priv, +struct bbdev_ipc_dequeue_op *bbdev_ipc_op, +struct rte_bbdev_enc_op *bbdev_enc_op, +struct rte_bbdev_op_data *in_op_data) +{ +RTE_SET_USED (q_priv); +RTE_SET_USED (bbdev_ipc_op); +RTE_SET_USED (bbdev_enc_op); +RTE_SET_USED (in_op_data); + +return 0 ; +} + +static int +fill_feca_desc_dec (struct bbdev_la12xx_q_priv *q_priv, +struct bbdev_ipc_dequeue_op *bbdev_ipc_op, +struct rte_bbdev_dec_op *bbdev_dec_op, +struct rte_bbdev_op_data *out_op_data) +{ +RTE_SET_USED (q_priv); +RTE_SET_USED (bbdev_ipc_op); +RTE_SET_USED (bbdev_dec_op); +RTE_SET_USED (out_op_data); + +return 0 ; +} + +static inline int +is_bd_ring_full (uint32_t ci,uint32_t ci_flag, +uint32_t pi,uint32_t pi_flag) +{ +if (pi == ci) { +if (pi_flag != ci_flag) +return 1 ;/* Ring is Full */ + } +return 0 ; +} + +static inline int +prepare_ldpc_enc_op (struct rte_bbdev_enc_op *bbdev_enc_op, +struct bbdev_ipc_dequeue_op *bbdev_ipc_op, +struct bbdev_la12xx_q_priv *q_priv, +struct rte_bbdev_op_data *in_op_data, +struct rte_bbdev_op_data *out_op_data) +{ +struct rte_bbdev_op_ldpc_enc *ldpc_enc = &bbdev_enc_op->ldpc_enc; +uint32_t total_out_bits; +int ret; + + total_out_bits = (ldpc_enc->tb_params.cab * + ldpc_enc->tb_params.ea) + (ldpc_enc->tb_params.c - + ldpc_enc->tb_params.cab) * ldpc_enc->tb_params.eb; + + ldpc_enc->output.length = (total_out_bits +7 )/8 ; + + ret =fill_feca_desc_enc (q_priv, bbdev_ipc_op, + bbdev_enc_op, in_op_data); +if (ret) { +BBDEV_LA12XX_PMD_ERR ( +"fill_feca_desc_enc failed, ret: %d" , ret); +return ret; + } + +rte_pktmbuf_append (out_op_data->data, ldpc_enc->output.length); + +return 0 ; +} + +static inline int +prepare_ldpc_dec_op (struct rte_bbdev_dec_op *bbdev_dec_op, +struct bbdev_ipc_dequeue_op *bbdev_ipc_op, +struct bbdev_la12xx_q_priv *q_priv, +struct rte_bbdev_op_data *out_op_data) +{ +struct rte_bbdev_op_ldpc_dec *ldpc_dec = &bbdev_dec_op->ldpc_dec; +uint32_t total_out_bits; +uint32_t num_code_blocks =0 ; +uint16_t sys_cols; +int ret; + + sys_cols = (ldpc_dec->basegraph ==1 ) ?22 :10 ; +if (ldpc_dec->tb_params.c ==1 ) { + total_out_bits = ((sys_cols * ldpc_dec->z_c) - + ldpc_dec->n_filler); +/* 5G-NR protocol uses 16 bit CRC when output packet +* size <= 3824 (bits). Otherwise 24 bit CRC is used. +* Adjust the output bits accordingly +*/ +if (total_out_bits -16 <=3824 ) + total_out_bits -=16 ; +else + total_out_bits -=24 ; + ldpc_dec->hard_output.length = (total_out_bits /8 ); + }else { + total_out_bits = (((sys_cols * ldpc_dec->z_c) - + ldpc_dec->n_filler -24 ) * + ldpc_dec->tb_params.c); + ldpc_dec->hard_output.length = (total_out_bits /8 ) -3 ; + } + + num_code_blocks = ldpc_dec->tb_params.c; + + bbdev_ipc_op->num_code_blocks =rte_cpu_to_be_32 (num_code_blocks); + + ret =fill_feca_desc_dec (q_priv, bbdev_ipc_op, + bbdev_dec_op, out_op_data); +if (ret) { +BBDEV_LA12XX_PMD_ERR ("fill_feca_desc_dec failed, ret: %d" , ret); +return ret; + } + +return 0 ; +} + +static int +enqueue_single_op (struct bbdev_la12xx_q_priv *q_priv,void *bbdev_op) +{ +struct bbdev_la12xx_private *priv = q_priv->bbdev_priv; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +ipc_instance_t *ipc_instance = ipc_priv->instance; +struct bbdev_ipc_dequeue_op *bbdev_ipc_op; +struct rte_bbdev_op_ldpc_enc *ldpc_enc; +struct rte_bbdev_op_ldpc_dec *ldpc_dec; +uint32_t q_id = q_priv->q_id; +uint32_t ci, ci_flag, pi, pi_flag; +ipc_ch_t *ch = &(ipc_instance->ch_list[q_id]); +ipc_br_md_t *md = &(ch->md); +uint64_t virt; +char *huge_start_addr = + (char *)q_priv->bbdev_priv->ipc_priv->hugepg_start.host_vaddr; +struct rte_bbdev_op_data *in_op_data, *out_op_data; +char *data_ptr; +uint32_t l1_pcie_addr; +int ret; +uint32_t temp_ci; + + temp_ci = q_priv->host_params->ci; + ci =IPC_GET_CI_INDEX (temp_ci); + ci_flag =IPC_GET_CI_FLAG (temp_ci); + + pi =IPC_GET_PI_INDEX (q_priv->host_pi); + pi_flag =IPC_GET_PI_FLAG (q_priv->host_pi); + +BBDEV_LA12XX_PMD_DP_DEBUG ( +"before bd_ring_full: pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u" , + pi, ci, pi_flag, ci_flag, q_priv->queue_size); + +if (is_bd_ring_full (ci, ci_flag, pi, pi_flag)) { +BBDEV_LA12XX_PMD_DP_DEBUG ( +"bd ring full for queue id: %d" , q_id); +return IPC_CH_FULL ; + } + + virt =MODEM_P2V (q_priv->host_params->modem_ptr[pi]); + bbdev_ipc_op = (struct bbdev_ipc_dequeue_op *)virt; + q_priv->bbdev_op[pi] = bbdev_op; + +switch (q_priv->op_type) { +case RTE_BBDEV_OP_LDPC_ENC : + ldpc_enc = &(((struct rte_bbdev_enc_op *)bbdev_op)->ldpc_enc); + in_op_data = &ldpc_enc->input; + out_op_data = &ldpc_enc->output; + + ret =prepare_ldpc_enc_op (bbdev_op, bbdev_ipc_op, q_priv, + in_op_data, out_op_data); +if (ret) { +BBDEV_LA12XX_PMD_ERR ( +"process_ldpc_enc_op failed, ret: %d" , ret); +return ret; + } +break ; + +case RTE_BBDEV_OP_LDPC_DEC : + ldpc_dec = &(((struct rte_bbdev_dec_op *)bbdev_op)->ldpc_dec); + in_op_data = &ldpc_dec->input; + + out_op_data = &ldpc_dec->hard_output; + + ret =prepare_ldpc_dec_op (bbdev_op, bbdev_ipc_op, + q_priv, out_op_data); +if (ret) { +BBDEV_LA12XX_PMD_ERR ( +"process_ldpc_dec_op failed, ret: %d" , ret); +return ret; + } +break ; + +default : +BBDEV_LA12XX_PMD_ERR ("unsupported bbdev_ipc op type" ); +return -1 ; + } + +if (in_op_data->data) { + data_ptr = rte_pktmbuf_mtod(in_op_data->data, char *); + l1_pcie_addr = (uint32_t )GUL_USER_HUGE_PAGE_ADDR + + data_ptr - huge_start_addr; + bbdev_ipc_op->in_addr = l1_pcie_addr; + bbdev_ipc_op->in_len = in_op_data->length; + } + +if (out_op_data->data) { + data_ptr = rte_pktmbuf_mtod(out_op_data->data, char *); + l1_pcie_addr = (uint32_t )GUL_USER_HUGE_PAGE_ADDR + + data_ptr - huge_start_addr; + bbdev_ipc_op->out_addr =rte_cpu_to_be_32 (l1_pcie_addr); + bbdev_ipc_op->out_len =rte_cpu_to_be_32 (out_op_data->length); + } + +/* Move Producer Index forward */ + pi++; +/* Flip the PI flag, if wrapping */ +if (unlikely (q_priv->queue_size == pi)) { + pi =0 ; + pi_flag = pi_flag ?0 :1 ; + } + +if (pi_flag) +IPC_SET_PI_FLAG (pi); +else +IPC_RESET_PI_FLAG (pi); +/* Wait for Data Copy & pi_flag update to complete before updating pi */ +rte_mb (); +/* now update pi */ + md->pi =rte_cpu_to_be_32 (pi); + q_priv->host_pi = pi; + +BBDEV_LA12XX_PMD_DP_DEBUG ( +"enter: pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u" , + pi, ci, pi_flag, ci_flag, q_priv->queue_size); + +return 0 ; +} + +/* Enqueue decode burst */ +static uint16_t +enqueue_dec_ops (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_dec_op **ops,uint16_t nb_ops) +{ +struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; +int nb_enqueued, ret; + +for (nb_enqueued =0 ; nb_enqueued < nb_ops; nb_enqueued++) { + ret =enqueue_single_op (q_priv, ops[nb_enqueued]); +if (ret) +break ; + } + + q_data->queue_stats.enqueue_err_count += nb_ops - nb_enqueued; + q_data->queue_stats.enqueued_count += nb_enqueued; + +return nb_enqueued; +} + +/* Enqueue encode burst */ +static uint16_t +enqueue_enc_ops (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_enc_op **ops,uint16_t nb_ops) +{ +struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; +int nb_enqueued, ret; + +for (nb_enqueued =0 ; nb_enqueued < nb_ops; nb_enqueued++) { + ret =enqueue_single_op (q_priv, ops[nb_enqueued]); +if (ret) +break ; + } + + q_data->queue_stats.enqueue_err_count += nb_ops - nb_enqueued; + q_data->queue_stats.enqueued_count += nb_enqueued; + +return nb_enqueued; +} + +static inline int +is_bd_ring_empty (uint32_t ci,uint32_t ci_flag, +uint32_t pi,uint32_t pi_flag) +{ +if (ci == pi) { +if (ci_flag == pi_flag) +return 1 ;/* No more Buffer */ + } +return 0 ; +} + +/* Dequeue encode burst */ +static void * +dequeue_single_op (struct bbdev_la12xx_q_priv *q_priv,void *dst) +{ +struct bbdev_la12xx_private *priv = q_priv->bbdev_priv; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +uint32_t q_id = q_priv->q_id +HOST_RX_QUEUEID_OFFSET ; +ipc_instance_t *ipc_instance = ipc_priv->instance; +ipc_ch_t *ch = &(ipc_instance->ch_list[q_id]); +uint32_t ci, ci_flag, pi, pi_flag; +ipc_br_md_t *md; +void *op; +uint32_t temp_pi; + + md = &(ch->md); + ci =IPC_GET_CI_INDEX (q_priv->host_ci); + ci_flag =IPC_GET_CI_FLAG (q_priv->host_ci); + + temp_pi = q_priv->host_params->pi; + pi =IPC_GET_PI_INDEX (temp_pi); + pi_flag =IPC_GET_PI_FLAG (temp_pi); + +if (is_bd_ring_empty (ci, ci_flag, pi, pi_flag)) +return NULL ; + +BBDEV_LA12XX_PMD_DP_DEBUG ( +"pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u" , + pi, ci, pi_flag, ci_flag, q_priv->queue_size); + + op = q_priv->bbdev_op[ci]; + +rte_memcpy (dst, q_priv->msg_ch_vaddr[ci], +sizeof (struct bbdev_ipc_enqueue_op )); + +/* Move Consumer Index forward */ + ci++; +/* Flip the CI flag, if wrapping */ +if (q_priv->queue_size == ci) { + ci =0 ; + ci_flag = ci_flag ?0 :1 ; + } +if (ci_flag) +IPC_SET_CI_FLAG (ci); +else +IPC_RESET_CI_FLAG (ci); + md->ci =rte_cpu_to_be_32 (ci); + q_priv->host_ci = ci; + +BBDEV_LA12XX_PMD_DP_DEBUG ( +"exit: pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u" , + pi, ci, pi_flag, ci_flag, q_priv->queue_size); + +return op; +} + +/* Dequeue decode burst */ +static uint16_t +dequeue_dec_ops (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_dec_op **ops,uint16_t nb_ops) +{ +struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; +struct bbdev_ipc_enqueue_op bbdev_ipc_op; +int nb_dequeued; + +for (nb_dequeued =0 ; nb_dequeued < nb_ops; nb_dequeued++) { + ops[nb_dequeued] =dequeue_single_op (q_priv, &bbdev_ipc_op); +if (!ops[nb_dequeued]) +break ; + ops[nb_dequeued]->status = bbdev_ipc_op.status; + } + q_data->queue_stats.dequeued_count += nb_dequeued; + +return nb_dequeued; +} + +/* Dequeue encode burst */ +static uint16_t +dequeue_enc_ops (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_enc_op **ops,uint16_t nb_ops) +{ +struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; +struct bbdev_ipc_enqueue_op bbdev_ipc_op; +int nb_enqueued; + +for (nb_enqueued =0 ; nb_enqueued < nb_ops; nb_enqueued++) { + ops[nb_enqueued] =dequeue_single_op (q_priv, &bbdev_ipc_op); +if (!ops[nb_enqueued]) +break ; + ops[nb_enqueued]->status = bbdev_ipc_op.status; + } + q_data->queue_stats.enqueued_count += nb_enqueued; + +return nb_enqueued; +} +static struct hugepage_info *get_hugepage_info (void ) {
@@ -722,10 +1107,10 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev, 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 ; + bbdev->dequeue_enc_ops = dequeue_enc_ops; + bbdev->dequeue_dec_ops = dequeue_dec_ops; + bbdev->enqueue_enc_ops = enqueue_enc_ops; + bbdev->enqueue_dec_ops = enqueue_dec_ops;return 0 ; }
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +37 -0
@@ -76,6 +76,25 @@ typedef struct { _IOWR(GUL_IPC_MAGIC, 5, struct ipc_msg *) #define IOCTL_GUL_IPC_CHANNEL_RAISE_INTERRUPT _IOW(GUL_IPC_MAGIC, 6, int *) +#define GUL_USER_HUGE_PAGE_OFFSET (0) +#define GUL_PCI1_ADDR_BASE (0x00000000ULL) + +#define GUL_USER_HUGE_PAGE_ADDR (GUL_PCI1_ADDR_BASE + GUL_USER_HUGE_PAGE_OFFSET) + +/* IPC PI/CI index & flag manipulation helpers */ +#define IPC_PI_CI_FLAG_MASK 0x80000000 /* (1<<31) */ +#define IPC_PI_CI_INDEX_MASK 0x7FFFFFFF /* ~(1<<31) */ + +#define IPC_SET_PI_FLAG(x) (x |= IPC_PI_CI_FLAG_MASK) +#define IPC_RESET_PI_FLAG (x) (x &= IPC_PI_CI_INDEX_MASK) +#define IPC_GET_PI_FLAG (x) (x >> 31) +#define IPC_GET_PI_INDEX (x) (x & IPC_PI_CI_INDEX_MASK) + +#define IPC_SET_CI_FLAG (x) (x |= IPC_PI_CI_FLAG_MASK) +#define IPC_RESET_CI_FLAG (x) (x &= IPC_PI_CI_INDEX_MASK) +#define IPC_GET_CI_FLAG (x) (x >> 31) +#define IPC_GET_CI_INDEX (x) (x & IPC_PI_CI_INDEX_MASK) +/** buffer ring common metadata */ typedef struct ipc_bd_ring_md { volatile uint32_t pi; /**< Producer index and flag (MSB)
@@ -173,6 +192,24 @@ struct bbdev_ipc_enqueue_op {uint32_t rsvd; }; +/** Structure specifying dequeue operation (dequeue at LA1224) */ +struct bbdev_ipc_dequeue_op { +/** Input buffer memory address */ +uint32_t in_addr; +/** Input buffer memory length */ +uint32_t in_len; +/** Output buffer memory address */ +uint32_t out_addr; +/** Output buffer memory length */ +uint32_t out_len; +/* Number of code blocks. Only set when HARQ is used */ +uint32_t num_code_blocks; +/** Dequeue Operation flags */ +uint32_t op_flags; +/** Shared metadata between L1 and L2 */ +uint32_t shared_metadata; +}; +/* This shared memory would be on the host side which have copy of some * of the parameters which are also part of Shared BD ring. Read access * of these parameters from the host side would not be over PCI.
Signature · 1 line
2.17.1
PATCH 6/6 baseband/la12xx: add documentation support
In reply to Hemant AgrawalThis patch add documentation for LA12xx PMD.
--- MAINTAINERS | 9 ++ doc/guides/bbdevs/features/la12xx.ini | 14 +++ doc/guides/bbdevs/index.rst | 1 + doc/guides/bbdevs/la12xx.rst | 139 +++++++++++++++++++++++++ doc/guides/rel_notes/release_21_05.rst | 5 + 5 files changed, 168 insertions(+) create mode 100644 doc/guides/bbdevs/features/la12xx.ini create mode 100644 doc/guides/bbdevs/la12xx.rst
MAINTAINERS +9 -0
@@ -1289,6 +1289,15 @@ F: doc/guides/rawdevs/ntb.rst F: examples/ntb/ F: doc/guides/sample_app_ug/ntb.rst +Baseband Drivers +------------------- + +NXP LA12xx +M: Hemant Agrawal <[email protected]> +M: Nipun Gupta <[email protected]> +F: drivers/baseband/la12xx/ +F: doc/guides/bbdevs/la12xx.rst +F: doc/guides/bbdevs/features/la12xx.ini Packet processing -----------------
doc/guides/bbdevs/features/la12xx.ini new file +14 -0
@@ -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 +External DDR Access = Y +HW Accelerated = Y +BBDEV API = Y
doc/guides/bbdevs/index.rst +1 -0
@@ -14,3 +14,4 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 + la12xx
doc/guides/bbdevs/la12xx.rst new file +139 -0
139 lines not on this page · raw message
doc/guides/rel_notes/release_21_05.rst +5 -0
@@ -55,6 +55,11 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **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 -------------
Signature · 1 line
2.17.1
Quoted 3 lines · Hemant Agrawal
This patch introduce the baseband device drivers for NXP's LA1200 series software defined baseband modem.
Such a series deserves a cover letter.
You should copy bbdev maintainer and cryptodev subtree maintainer.
Quickly looked at the series, I see no change on the bbdev unit test code. Are those tests running fine with no modification (I sure hope so, but I want a confirmation).
Quoted 15 lines
Signed-off-by Nipun Gupta <[email protected]>Signed-off-by Hemant Agrawal <[email protected]>--- drivers/baseband/la12xx/bbdev_la12xx.c | 110 ++++++++++++++++++ .../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 38 ++++++ drivers/baseband/la12xx/meson.build | 6 + drivers/baseband/la12xx/version.map | 3 + drivers/baseband/meson.build | 2 +- 5 files changed, 158 insertions(+), 1 deletion(-) 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
[snip]
drivers/baseband/la12xx/bbdev_la12xx.c line 110
Quoted 4 lines
drivers/baseband/la12xx/bbdev_la12xx.c new file +4
-0+}; + +RTE_PMD_REGISTER_VDEV (DRIVER_NAME , bbdev_la12xx_pmd_drv); +RTE_PMD_REGISTER_ALIAS (DRIVER_NAME , bbdev_la12xx);
Quick glance at this patch, no need for an alias.
Alias are for maintaining compatibility when drivers are renamed but this is a new driver.
Signature · 1 line
David Marchand
Quoted 4 lines · David Marchand
Quoted 2 lines · Hemant Agrawal
This patch introduce the baseband device drivers for NXP's LA1200 series software defined baseband modem.
Such a series deserves a cover letter.
Ok. I will do that in v2.
Quoted 1 line
You should copy bbdev maintainer and cryptodev subtree maintainer.
Yes, changing the Akhil's id. He moved on.
Quoted 5 lines
Quickly looked at the series, I see no change on the bbdev unit test code. Are those tests running fine with no modification (I sure hope so, but I want a confirmation).
Good catch! Yes, we have made the changes and we are in the process of cleaning them up.
We will be posting them to mailing list soon.
Quoted 16 lines
Quoted 14 lines
Signed-off-by Nipun Gupta <[email protected]>Signed-off-by Hemant Agrawal <[email protected]>--- drivers/baseband/la12xx/bbdev_la12xx.c | 110 ++++++++++++++++++ .../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 38 ++++++ drivers/baseband/la12xx/meson.build | 6 + drivers/baseband/la12xx/version.map | 3 + drivers/baseband/meson.build | 2 +- 5 files changed, 158 insertions(+), 1 deletion(-)create mode 100644
drivers/baseband/la12xx/bbdev_la12xx.ccreate mode 100644drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.hcreate mode 100644drivers/baseband/la12xx/meson.buildcreate mode 100644drivers/baseband/la12xx/version.map[snip]
Quoted 7 lines
drivers/baseband/la12xx/bbdev_la12xx.c line 110
Quoted 4 lines
drivers/baseband/la12xx/bbdev_la12xx.c new file +4
-0+}; + +RTE_PMD_REGISTER_VDEV (DRIVER_NAME , bbdev_la12xx_pmd_drv); +RTE_PMD_REGISTER_ALIAS (DRIVER_NAME , bbdev_la12xx);Quick glance at this patch, no need for an alias.
Alias are for maintaining compatibility when drivers are renamed but this is a new driver.
Ok.
Quoted 2 lines
Hi Hemant/Nipun,
Could you please send a new version soon?
If review is completed, I would like to take it in RC1, i.e. 15th March.
Regards,
Akhil
Quoted 48 lines · David Marchand
Quoted 1 line
On Thu, Mar 18, 2021 at 7:38 AM Hemant Agrawal
Quoted 3 lines · <[email protected]> wrote:
Quoted 2 lines
This patch introduce the baseband device drivers for NXP's LA1200 series software defined baseband modem.
Such a series deserves a cover letter.
Ok. I will do that in v2.
Quoted 1 line
You should copy bbdev maintainer and cryptodev subtree maintainer.
Yes, changing the Akhil's id. He moved on.
Quoted 5 lines
Quickly looked at the series, I see no change on the bbdev unit test code. Are those tests running fine with no modification (I sure hope so, but I want a confirmation).
Good catch! Yes, we have made the changes and we are in the process of cleaning them up.
We will be posting them to mailing list soon.
Quoted 4 lines
Quoted 4 lines
Signed-off-by Nipun Gupta <[email protected]>Signed-off-by Hemant Agrawal <[email protected]>--- drivers/baseband/la12xx/bbdev_la12xx.c | 110++++++++++++++++++
Quoted 7 lines
Quoted 7 lines
.../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 38 ++++++ drivers/baseband/la12xx/meson.build | 6 + drivers/baseband/la12xx/version.map | 3 + drivers/baseband/meson.build | 2 +- 5 files changed, 158 insertions(+), 1 deletion(-)create mode 100644
drivers/baseband/la12xx/bbdev_la12xx.ccreate mode 100644
drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.hQuoted 5 lines
Quoted 3 lines
create mode 100644
drivers/baseband/la12xx/meson.buildcreate mode 100644drivers/baseband/la12xx/version.map[snip]
Quoted 7 lines
drivers/baseband/la12xx/bbdev_la12xx.c line 110
Quoted 4 lines
drivers/baseband/la12xx/bbdev_la12xx.c new file +4
-0+}; + +RTE_PMD_REGISTER_VDEV (DRIVER_NAME , bbdev_la12xx_pmd_drv); +RTE_PMD_REGISTER_ALIAS (DRIVER_NAME , bbdev_la12xx);Quick glance at this patch, no need for an alias.
Alias are for maintaining compatibility when drivers are renamed but this is a new driver.Ok.
Quoted 2 lines
Quoted 4 lines · Akhil Goyal
Hi Hemant/Nipun,
Could you please send a new version soon?
If review is completed, I would like to take it in RC1, i.e. 15th March.
yes, we are working on fixing few things. We will send it by weekend.
Regards,
Hemant
Quoted 47 lines
Regards,
AkhilQuoted 45 lines · David Marchand
Quoted 1 line
On Thu, Mar 18, 2021 at 7:38 AM Hemant Agrawal
Quoted 3 lines · <[email protected]> wrote:
Quoted 2 lines
This patch introduce the baseband device drivers for NXP's LA1200 series software defined baseband modem.
Such a series deserves a cover letter.
Ok. I will do that in v2.
Quoted 1 line
You should copy bbdev maintainer and cryptodev subtree maintainer.
Yes, changing the Akhil's id. He moved on.
Quoted 4 lines
Quickly looked at the series, I see no change on the bbdev unit test code. Are those tests running fine with no modification (I sure hope so, but I want a confirmation).
Good catch! Yes, we have made the changes and we are in the process of cleaning them up.
We will be posting them to mailing list soon.
Quoted 4 lines
Quoted 4 lines
Signed-off-by Nipun Gupta <[email protected]>Signed-off-by Hemant Agrawal <[email protected]>--- drivers/baseband/la12xx/bbdev_la12xx.c | 110++++++++++++++++++
Quoted 7 lines
Quoted 7 lines
.../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 38 ++++++ drivers/baseband/la12xx/meson.build | 6 + drivers/baseband/la12xx/version.map | 3 + drivers/baseband/meson.build | 2 +- 5 files changed, 158 insertions(+), 1 deletion(-)create mode 100644
drivers/baseband/la12xx/bbdev_la12xx.ccreate mode 100644
drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.hQuoted 5 lines
Quoted 3 lines
create mode 100644
drivers/baseband/la12xx/meson.buildcreate mode 100644drivers/baseband/la12xx/version.map[snip]
Quoted 7 lines
drivers/baseband/la12xx/bbdev_la12xx.c line 110
Quoted 4 lines
drivers/baseband/la12xx/bbdev_la12xx.c new file +4
-0+}; + +RTE_PMD_REGISTER_VDEV (DRIVER_NAME , bbdev_la12xx_pmd_drv); +RTE_PMD_REGISTER_ALIAS (DRIVER_NAME , bbdev_la12xx);Quick glance at this patch, no need for an alias.
Alias are for maintaining compatibility when drivers are renamed but this is a new driver.Ok.
Quoted 1 line
Note that I did not review this serie yet as v2 was pending (+ did not receive the initial serie). Planning to send comments once that v2 is formally shared.
Quoted 65 lines
-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Thursday, April 8, 2021 1:56 AM
To: [email protected]; David Marchand <[email protected]>
Cc: dev <[email protected]>; Nipun Gupta <[email protected]>; Chautru, Nicolas <[email protected]>
Subject: RE: [EXT] Re: [dpdk-dev] [PATCH 1/6] baseband: introduce NXP LA12xx driverHi Hemant/Nipun,
Could you please send a new version soon?
If review is completed, I would like to take it in RC1, i.e. 15th March.Regards,
AkhilQuoted 48 lines · David Marchand
Quoted 1 line
On Thu, Mar 18, 2021 at 7:38 AM Hemant Agrawal
Quoted 3 lines · <[email protected]> wrote:
Quoted 2 lines
This patch introduce the baseband device drivers for NXP's LA1200 series software defined baseband modem.
Such a series deserves a cover letter.
Ok. I will do that in v2.
Quoted 1 line
You should copy bbdev maintainer and cryptodev subtree maintainer.
Yes, changing the Akhil's id. He moved on.
Quoted 5 lines
Quickly looked at the series, I see no change on the bbdev unit test code. Are those tests running fine with no modification (I sure hope so, but I want a confirmation).
Good catch! Yes, we have made the changes and we are in the process of cleaning them up.
We will be posting them to mailing list soon.
Quoted 4 lines
Quoted 4 lines
Signed-off-by Nipun Gupta <[email protected]>Signed-off-by Hemant Agrawal <[email protected]>--- drivers/baseband/la12xx/bbdev_la12xx.c | 110++++++++++++++++++
Quoted 7 lines
Quoted 7 lines
.../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 38 ++++++ drivers/baseband/la12xx/meson.build | 6 + drivers/baseband/la12xx/version.map | 3 + drivers/baseband/meson.build | 2 +- 5 files changed, 158 insertions(+), 1 deletion(-)create mode 100644
drivers/baseband/la12xx/bbdev_la12xx.ccreate mode 100644
drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.hQuoted 5 lines
Quoted 3 lines
create mode 100644
drivers/baseband/la12xx/meson.buildcreate mode 100644drivers/baseband/la12xx/version.map[snip]
Quoted 7 lines
drivers/baseband/la12xx/bbdev_la12xx.c line 110
Quoted 4 lines
drivers/baseband/la12xx/bbdev_la12xx.c new file +4
-0+}; + +RTE_PMD_REGISTER_VDEV (DRIVER_NAME , bbdev_la12xx_pmd_drv); +RTE_PMD_REGISTER_ALIAS (DRIVER_NAME , bbdev_la12xx);Quick glance at this patch, no need for an alias.
Alias are for maintaining compatibility when drivers are renamed but this is a new driver.Ok.
Quoted 2 lines
v2 cover baseband: add NXP LA12xx driver
In reply to Hemant AgrawalThis 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.
Modifications has been done in test vectors to optionally support input in network byte order.
Two test vectors are also added as an example with data in network byte order.
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 baseband/la12xx: add documentation support
Nipun Gupta (2):
app/bbdev: add parameter to take input in network order app/bbdev: add test vectors for transport blocks
MAINTAINERS | 9 + app/test-bbdev/test_bbdev_vector.c | 18 +- app/test-bbdev/test_bbdev_vector.h | 2 + app/test-bbdev/test_vectors/ldpc_dec_tb.data | 362 +++++ app/test-bbdev/test_vectors/ldpc_enc_tb.data | 482 +++++++ doc/guides/bbdevs/features/la12xx.ini | 14 + doc/guides/bbdevs/index.rst | 1 + doc/guides/bbdevs/la12xx.rst | 139 ++ doc/guides/rel_notes/release_21_05.rst | 5 + drivers/baseband/la12xx/bbdev_la12xx.c | 1180 +++++++++++++++++ drivers/baseband/la12xx/bbdev_la12xx.h | 57 + drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 237 ++++ .../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 38 + drivers/baseband/la12xx/meson.build | 6 + drivers/baseband/la12xx/version.map | 3 + drivers/baseband/meson.build | 2 +- 16 files changed, 2552 insertions(+), 3 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
Signature · 1 line
2.17.1
PATCH v2 1/8 baseband: introduce NXP LA12xx driver
This patch introduce the baseband device drivers for NXP's LA1200 series software defined baseband modem.
--- drivers/baseband/la12xx/bbdev_la12xx.c | 109 ++++++++++++++++++ .../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 38 ++++++ drivers/baseband/la12xx/meson.build | 6 + drivers/baseband/la12xx/version.map | 3 + drivers/baseband/meson.build | 2 +- 5 files changed, 157 insertions(+), 1 deletion(-) 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
drivers/baseband/la12xx/bbdev_la12xx.c new file +109 -0
@@ -0,0 +1,109 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2020-2021 NXP +*/ + +#include <string.h> + +#include <rte_common.h> +#include <rte_bus_vdev.h> +#include <rte_malloc.h> +#include <rte_ring.h> +#include <rte_kvargs.h> + +#include <rte_bbdev.h> +#include <rte_bbdev_pmd.h> + +#include <bbdev_la12xx_pmd_logs.h> + +#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);
drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h new file +38 -0
@@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2020 NXP +*/ + +#ifndef _BBDEV_LA12XX_PMD_LOGS_H_ +#define _BBDEV_LA12XX_PMD_LOGS_H_ + +#define BBDEV_LA12XX_PMD_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, bbdev_la12xx_logtype, "bbdev_la12xx: " \ + fmt "\n", ##args) + +#define BBDEV_LA12XX_PMD_DEBUG(fmt, args...) \ + rte_log(RTE_LOG_DEBUG, bbdev_la12xx_logtype, "bbdev_la12xx: %s(): "\ + fmt "\n", __func__, ##args) + +#define PMD_INIT_FUNC_TRACE () BBDEV_LA12XX_PMD_DEBUG(">>") + +#define BBDEV_LA12XX_PMD_CRIT(fmt, args...) \ + BBDEV_LA12XX_PMD_LOG(CRIT, fmt, ## args) +#define BBDEV_LA12XX_PMD_INFO(fmt, args...) \ + BBDEV_LA12XX_PMD_LOG(INFO, fmt, ## args) +#define BBDEV_LA12XX_PMD_ERR(fmt, args...) \ + BBDEV_LA12XX_PMD_LOG(ERR, fmt, ## args) +#define BBDEV_LA12XX_PMD_WARN(fmt, args...) \ + BBDEV_LA12XX_PMD_LOG(WARNING, fmt, ## args) + +/* DP Logs, toggled out at compile time if level lower than current level */ +#define BBDEV_LA12XX_PMD_DP_LOG(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, fmt, ## args) + +#define BBDEV_LA12XX_PMD_DP_DEBUG(fmt, args...) \ + BBDEV_LA12XX_PMD_DP_LOG(DEBUG, fmt, ## args) +#define BBDEV_LA12XX_PMD_DP_INFO(fmt, args...) \ + BBDEV_LA12XX_PMD_DP_LOG(INFO, fmt, ## args) +#define BBDEV_LA12XX_PMD_DP_WARN(fmt, args...) \ + BBDEV_LA12XX_PMD_DP_LOG(WARNING, fmt, ## args) + +#endif /* _BBDEV_LA12XX_PMD_LOGS_H_ */
drivers/baseband/la12xx/meson.build new file +6 -0
@@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2020-2021 NXP + +deps += ['bbdev', 'bus_vdev', 'ring'] + +sources = files('bbdev_la12xx.c')
drivers/baseband/la12xx/version.map new file +3 -0
@@ -0,0 +1,3 @@ +DPDK_21 { + local: *; +};
drivers/baseband/meson.build +1 -1
@@ -5,4 +5,4 @@ if is_windows subdir_done() endif -drivers = ['null', 'turbo_sw', 'fpga_lte_fec', 'fpga_5gnr_fec', 'acc100'] +drivers = ['null', 'turbo_sw', 'fpga_lte_fec', 'fpga_5gnr_fec', 'acc100', 'la12xx']
Signature · 1 line
2.17.1
PATCH v2 2/8 baseband/la12xx: add devargs for max queues
In reply to Hemant AgrawalThis patch adds dev args to take max queues as input
--- drivers/baseband/la12xx/bbdev_la12xx.c | 72 +++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 2 deletions(-)
drivers/baseband/la12xx/bbdev_la12xx.c +70 -2
@@ -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 BBDEV_LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" + +static const char *const bbdev_la12xx_valid_params[] = { +BBDEV_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 )) { +BBDEV_LA12XX_PMD_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) {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 = { +RTE_BBDEV_DEFAULT_MAX_NB_QUEUES + };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 , +BBDEV_LA12XX_MAX_NB_QUEUES_ARG "=<int>" );
Signature · 1 line
2.17.1
PATCH v2 3/8 baseband/la12xx: add support for multiple modems
In reply to Hemant AgrawalThis patch add support for multiple modems by assigning a modem id as dev args in vdev creation.
--- drivers/baseband/la12xx/bbdev_la12xx.c | 62 +++++++++++++++++++--- drivers/baseband/la12xx/bbdev_la12xx.h | 56 +++++++++++++++++++ drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 20 +++++++ 3 files changed, 132 insertions(+), 6 deletions(-) create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.h create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_ipc.h
drivers/baseband/la12xx/bbdev_la12xx.c +56 -6
@@ -14,6 +14,8 @@#include <rte_bbdev_pmd.h> #include <bbdev_la12xx_pmd_logs.h> +#include <bbdev_la12xx_ipc.h> +#include <bbdev_la12xx.h> #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 BBDEV_LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" +#define BBDEV_LA12XX_VDEV_MODEM_ID_ARG "modem" +#define LA12XX_MAX_MODEM 4static const char *const bbdev_la12xx_valid_params[] = {BBDEV_LA12XX_MAX_NB_QUEUES_ARG , +BBDEV_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 ) { +BBDEV_LA12XX_PMD_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 ) { +BBDEV_LA12XX_PMD_ERR ("Invalid modem id, must be < %u" , +LA12XX_MAX_MODEM ); + goto exit; + } } exit:
@@ -88,6 +122,7 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev, {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; + +BBDEV_LA12XX_PMD_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 = { -RTE_BBDEV_DEFAULT_MAX_NB_QUEUES +RTE_BBDEV_DEFAULT_MAX_NB_QUEUES ,-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 , -BBDEV_LA12XX_MAX_NB_QUEUES_ARG "=<int>" ); +BBDEV_LA12XX_MAX_NB_QUEUES_ARG "=<int>" +BBDEV_LA12XX_VDEV_MODEM_ID_ARG "=<int> " );
drivers/baseband/la12xx/bbdev_la12xx.h new file +56 -0
56 lines not on this page · raw message
drivers/baseband/la12xx/bbdev_la12xx_ipc.h new file +20 -0
@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2020-2021 NXP +*/ +#ifndef __BBDEV_LA12XX_IPC_H__ +#define __BBDEV_LA12XX_IPC_H__ + +/** No. of max channel per instance */ +#define IPC_MAX_DEPTH (16) + +/* This shared memory would be on the host side which have copy of some +* of the parameters which are also part of Shared BD ring. Read access +* of these parameters from the host side would not be over PCI. +*/ +typedef struct host_ipc_params { +volatile uint32_t pi; +volatile uint32_t ci; +volatile uint32_t modem_ptr[IPC_MAX_DEPTH ]; +} __rte_packed host_ipc_params_t; + +#endif
Signature · 1 line
2.17.1
PATCH v2 4/8 baseband/la12xx: add queue and modem config support
In reply to Hemant AgrawalThis patch add support for connecting with modem and creating the ipc channel as queues with modem for the exchange of data.
--- drivers/baseband/la12xx/bbdev_la12xx.c | 566 ++++++++++++++++++++- drivers/baseband/la12xx/bbdev_la12xx.h | 5 +- drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 180 +++++++ 3 files changed, 748 insertions(+), 3 deletions(-)
drivers/baseband/la12xx/bbdev_la12xx.c +565 -1
@@ -3,6 +3,11 @@*/ #include <string.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/ioctl.h> +#include <sys/mman.h> +#include <dirent.h> #include <rte_common.h> #include <rte_bus_vdev.h>
@@ -31,11 +36,563 @@ struct bbdev_la12xx_params {#define BBDEV_LA12XX_VDEV_MODEM_ID_ARG "modem"#define LA12XX_MAX_MODEM 4 +#define LA12XX_MAX_CORES 4 +#define BBDEV_LA12XX_LDPC_ENC_CORE 0 +#define BBDEV_LA12XX_LDPC_DEC_CORE 1 +static const char *const bbdev_la12xx_valid_params[] = {BBDEV_LA12XX_MAX_NB_QUEUES_ARG ,BBDEV_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_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 , + } + }, +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, +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->default_queue_conf = default_queue_conf; + dev_info->capabilities = bbdev_capabilities; + dev_info->cpu_flag_reqs =NULL ; + dev_info->min_alignment =64 ; + +BBDEV_LA12XX_PMD_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 (); + +/* TODO: Implement */ + +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 (); + +BBDEV_LA12XX_PMD_DEBUG ("%x %p" , ipc_instance->initialized, + ipc_priv->instance); + ch = &(ipc_instance->ch_list[channel_id]); + +BBDEV_LA12XX_PMD_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->queue_size; i++) { + vaddr =rte_malloc (NULL , msg_size,RTE_CACHE_LINE_SIZE ); +if (!vaddr) +return IPC_HOST_BUF_ALLOC_FAIL ; +/* Only offset now */ + ch->bd[i].modem_ptr = +rte_cpu_to_be_32 (HUGEPG_OFFSET (vaddr)); + ch->bd[i].host_virt_l =lower_32_bits (vaddr); + ch->bd[i].host_virt_h =upper_32_bits (vaddr); + q_priv->msg_ch_vaddr[i] = vaddr; +/* Not sure use of this len may be for CRC*/ + ch->bd[i].len =0 ; + } + ch->host_ipc_params = +rte_cpu_to_be_32 (HUGEPG_OFFSET (q_priv->host_params)); + ch->bl_initialized =1 ; + +BBDEV_LA12XX_PMD_DEBUG ("Channel configured" ); +return IPC_SUCCESS ; +} + +static int +la12xx_e200_queue_setup (struct rte_bbdev *dev, +struct bbdev_la12xx_q_priv *q_priv) +{ +struct bbdev_la12xx_private *priv = dev->data->dev_private; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +struct gul_hif *mhif; +ipc_metadata_t *ipc_md; +ipc_ch_t *ch; +int instance_id =0 , i; +int ret; + +PMD_INIT_FUNC_TRACE (); + +switch (q_priv->op_type) { +case RTE_BBDEV_OP_LDPC_ENC : + q_priv->la12xx_core_id =BBDEV_LA12XX_LDPC_ENC_CORE ; +break ; +case RTE_BBDEV_OP_LDPC_DEC : + q_priv->la12xx_core_id =BBDEV_LA12XX_LDPC_DEC_CORE ; +break ; +default : +BBDEV_LA12XX_PMD_ERR ("Unsupported op type\n" ); +return -1 ; + } + + mhif = (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; +/* offset is from start of PEB */ + ipc_md = (ipc_metadata_t *)((uint64_t )ipc_priv->peb_start.host_vaddr + + mhif->ipc_regs.ipc_mdata_offset); + ch = &ipc_md->instance_list[instance_id].ch_list[q_priv->q_id]; + +if (q_priv->q_id < priv->num_valid_queues) { +ipc_br_md_t *md, *host_md; +ipc_ch_t *host_rx_ch; + + host_rx_ch = + &ipc_md->instance_list[instance_id].ch_list[q_priv->q_id + +HOST_RX_QUEUEID_OFFSET ]; + md = &(ch->md); + host_md = &(host_rx_ch->md); + + q_priv->feca_blk_id =rte_cpu_to_be_32 (ch->feca_blk_id); + q_priv->feca_blk_id_be32 = ch->feca_blk_id; + q_priv->host_pi =rte_be_to_cpu_32 (host_md->pi); + q_priv->host_ci =rte_be_to_cpu_32 (md->ci); + q_priv->host_params = (host_ipc_params_t *) + (rte_be_to_cpu_32 (ch->host_ipc_params) + + ((uint64_t )ipc_priv->hugepg_start.host_vaddr)); + +for (i =0 ; i < q_priv->queue_size; i++) { +uint32_t h, l; + + h = host_rx_ch->bd[i].host_virt_h; + l = host_rx_ch->bd[i].host_virt_l; + q_priv->msg_ch_vaddr[i] = (void *)join_32_bits (h, l); + } + +BBDEV_LA12XX_PMD_WARN ( +"Queue [%d] already configured, not configuring again" , + q_priv->q_id); +return 0 ; + } + +BBDEV_LA12XX_PMD_DEBUG ("setting up queue %d" , q_priv->q_id); + + q_priv->host_params =rte_zmalloc (NULL ,sizeof (host_ipc_params_t), +RTE_CACHE_LINE_SIZE ); + ch->host_ipc_params = +rte_cpu_to_be_32 (HUGEPG_OFFSET (q_priv->host_params)); + +/* Call ipc_configure_channel */ + ret =ipc_queue_configure ((q_priv->q_id +HOST_RX_QUEUEID_OFFSET ), + ipc_priv, q_priv); +if (ret) { +BBDEV_LA12XX_PMD_ERR ("Unable to setup queue (%d) (err=%d)" , + q_priv->q_id, ret); +return ret; + } + +/* Set queue properties for LA12xx device */ +switch (q_priv->op_type) { +case RTE_BBDEV_OP_LDPC_ENC : +if (priv->num_ldpc_enc_queues >=MAX_LDPC_ENC_FECA_QUEUES ) { +BBDEV_LA12XX_PMD_ERR ( +"num_ldpc_enc_queues reached max value" ); +return -1 ; + } + ch->la12xx_core_id = +rte_cpu_to_be_32 (BBDEV_LA12XX_LDPC_ENC_CORE ); + ch->feca_blk_id =rte_cpu_to_be_32 (priv->num_ldpc_enc_queues++); +break ; +case RTE_BBDEV_OP_LDPC_DEC : +if (priv->num_ldpc_dec_queues >=MAX_LDPC_DEC_FECA_QUEUES ) { +BBDEV_LA12XX_PMD_ERR ( +"num_ldpc_dec_queues reached max value" ); +return -1 ; + } + ch->la12xx_core_id = +rte_cpu_to_be_32 (BBDEV_LA12XX_LDPC_DEC_CORE ); + ch->feca_blk_id =rte_cpu_to_be_32 (priv->num_ldpc_dec_queues++); +break ; +default : +BBDEV_LA12XX_PMD_ERR ("Not supported op type\n" ); +return -1 ; + } + ch->op_type =rte_cpu_to_be_32 (q_priv->op_type); + ch->depth =rte_cpu_to_be_32 (q_priv->queue_size); + +/* Store queue config here */ + q_priv->feca_blk_id =rte_cpu_to_be_32 (ch->feca_blk_id); + q_priv->feca_blk_id_be32 = ch->feca_blk_id; + +return 0 ; +} + +/* Setup a queue */ +static int +la12xx_queue_setup (struct rte_bbdev *dev,uint16_t q_id, +const struct rte_bbdev_queue_conf *queue_conf) +{ +struct bbdev_la12xx_private *priv = dev->data->dev_private; +struct rte_bbdev_queue_data *q_data; +struct bbdev_la12xx_q_priv *q_priv; +int ret; + +PMD_INIT_FUNC_TRACE (); + +/* Move to setup_queues callback */ + q_data = &dev->data->queues[q_id]; + q_data->queue_private =rte_zmalloc (NULL , +sizeof (struct bbdev_la12xx_q_priv ),0 ); +if (!q_data->queue_private) { +BBDEV_LA12XX_PMD_ERR ("Memory allocation failed for qpriv" ); +return -ENOMEM ; + } + q_priv = q_data->queue_private; + q_priv->q_id = q_id; + q_priv->bbdev_priv = dev->data->dev_private; + q_priv->queue_size = queue_conf->queue_size; + q_priv->op_type = queue_conf->op_type; + + ret =la12xx_e200_queue_setup (dev, q_priv); +if (ret) { +BBDEV_LA12XX_PMD_ERR ("e200_queue_setup failed for qid: %d" , + q_id); +return ret; + } + +/* Store queue config here */ + priv->num_valid_queues++; + +return 0 ; +} + +static int +la12xx_start (struct rte_bbdev *dev) +{ +struct bbdev_la12xx_private *priv = dev->data->dev_private; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +int ready =0 ; +struct gul_hif *hif_start; + +PMD_INIT_FUNC_TRACE (); + + hif_start = (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; + +/* Set Host Read bit */ +SET_HIF_HOST_RDY (hif_start,HIF_HOST_READY_IPC_APP ); + +/* Now wait for modem ready bit */ +while (!ready) + ready =CHK_HIF_MOD_RDY (hif_start,HIF_MOD_READY_IPC_APP ); + +return 0 ; +} + +static const struct rte_bbdev_ops pmd_ops = { + .info_get = la12xx_info_get, + .queue_setup = la12xx_queue_setup, + .queue_release = la12xx_queue_release, + .start = la12xx_start +}; +static struct hugepage_info * +get_hugepage_info (void ) +{ +struct hugepage_info *hp_info; +struct rte_memseg *mseg; + +PMD_INIT_FUNC_TRACE (); + +/* TODO - find a better way */ + hp_info =rte_malloc (NULL ,sizeof (struct hugepage_info ),0 ); +if (!hp_info) { +BBDEV_LA12XX_PMD_ERR ("Unable to allocate on local heap" ); +return NULL ; + } + + mseg =rte_mem_virt2memseg (hp_info,NULL ); + hp_info->vaddr = mseg->addr; + hp_info->paddr =rte_mem_virt2phy (mseg->addr); + hp_info->len = mseg->len; + +return hp_info; +} + +static int open_ipc_dev (int modem_id) +{ +char dev_initials[16 ], dev_path[PATH_MAX ]; +struct dirent *entry; +int dev_ipc =0 ; +DIR *dir; + + dir =opendir ("/dev/" ); +if (!dir) { +BBDEV_LA12XX_PMD_ERR ("Unable to open /dev/" ); +return -1 ; + } + +sprintf (dev_initials,"gulipcgul%d" , modem_id); + +while ((entry =readdir (dir)) !=NULL ) { +if (!strncmp (dev_initials, entry->d_name, +sizeof (dev_initials) -1 )) +break ; + } + +if (!entry) { +BBDEV_LA12XX_PMD_ERR ("Error: No gulipcgul%d device" , modem_id); +return -1 ; + } + +sprintf (dev_path,"/dev/%s" , entry->d_name); + dev_ipc =open (dev_path,O_RDWR ); +if (dev_ipc <0 ) { +BBDEV_LA12XX_PMD_ERR ("Error: Cannot open %s" , dev_path); +return -errno; + } + +return dev_ipc; +} + +static int +setup_la12xx_dev (struct rte_bbdev *dev) +{ +struct bbdev_la12xx_private *priv = dev->data->dev_private; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +struct hugepage_info *hp =NULL ; +ipc_channel_us_t *ipc_priv_ch =NULL ; +int dev_ipc =0 , dev_mem =0 , i; +ipc_metadata_t *ipc_md; +struct gul_hif *mhif; +uint32_t phy_align =0 ; +int ret; + +PMD_INIT_FUNC_TRACE (); + +if (!ipc_priv) { +/* TODO - get a better way */ +/* Get the hugepage info against it */ + hp =get_hugepage_info (); +if (!hp) { +BBDEV_LA12XX_PMD_ERR ("Unable to get hugepage info" ); + ret = -ENOMEM ; + goto err; + } + +BBDEV_LA12XX_PMD_DEBUG ("%lx %p %lx" , + hp->paddr, hp->vaddr, hp->len); + + ipc_priv =rte_zmalloc (0 ,sizeof (ipc_userspace_t),0 ); +if (ipc_priv ==NULL ) { +BBDEV_LA12XX_PMD_ERR ( +"Unable to allocate memory for ipc priv" ); + ret = -ENOMEM ; + goto err; + } + +for (i =0 ; i <IPC_MAX_CHANNEL_COUNT ; i++) { + ipc_priv_ch =rte_zmalloc (0 , +sizeof (ipc_channel_us_t),0 ); +if (ipc_priv_ch ==NULL ) { +BBDEV_LA12XX_PMD_ERR ( +"Unable to allocate memory for channels" ); + ret = -ENOMEM ; + } + ipc_priv->channels[i] = ipc_priv_ch; + } + + dev_mem =open ("/dev/mem" ,O_RDWR ); +if (dev_mem <0 ) { +BBDEV_LA12XX_PMD_ERR ("Error: Cannot open /dev/mem" ); + ret = -errno; + goto err; + } + + ipc_priv->instance_id =0 ; + ipc_priv->dev_mem = dev_mem; + +BBDEV_LA12XX_PMD_DEBUG ("hugepg input %lx %p %lx" , + hp->paddr, hp->vaddr, hp->len); + + ipc_priv->sys_map.hugepg_start.host_phys = hp->paddr; + ipc_priv->sys_map.hugepg_start.size = hp->len; + + ipc_priv->hugepg_start.host_phys = hp->paddr; + ipc_priv->hugepg_start.host_vaddr = hp->vaddr; + ipc_priv->hugepg_start.size = hp->len; + +rte_free (hp); + } + + dev_ipc =open_ipc_dev (priv->modem_id); +if (dev_ipc <0 ) { +BBDEV_LA12XX_PMD_ERR ("Error: open_ipc_dev failed" ); + goto err; + } + ipc_priv->dev_ipc = dev_ipc; + +/* Send IOCTL to get system map */ +/* Send IOCTL to put hugepg_start map */ + ret =ioctl (ipc_priv->dev_ipc,IOCTL_GUL_IPC_GET_SYS_MAP , + &ipc_priv->sys_map); +if (ret) { +BBDEV_LA12XX_PMD_ERR ( +"IOCTL_GUL_IPC_GET_SYS_MAP ioctl failed" ); + goto err; + } + + phy_align = (ipc_priv->sys_map.mhif_start.host_phys %0x1000 ); + ipc_priv->mhif_start.host_vaddr = +mmap (0 , ipc_priv->sys_map.mhif_start.size + phy_align, + (PROT_READ |PROT_WRITE ),MAP_SHARED , ipc_priv->dev_mem, + (ipc_priv->sys_map.mhif_start.host_phys - phy_align)); +if (ipc_priv->mhif_start.host_vaddr ==MAP_FAILED ) { +BBDEV_LA12XX_PMD_ERR ("MAP failed:" ); + ret = -errno; + goto err; + } + + ipc_priv->mhif_start.host_vaddr = (void *) ((uint64_t ) + (ipc_priv->mhif_start.host_vaddr) + phy_align); + + phy_align = (ipc_priv->sys_map.peb_start.host_phys %0x1000 ); + ipc_priv->peb_start.host_vaddr = +mmap (0 , ipc_priv->sys_map.peb_start.size + phy_align, + (PROT_READ |PROT_WRITE ),MAP_SHARED , ipc_priv->dev_mem, + (ipc_priv->sys_map.peb_start.host_phys - phy_align)); +if (ipc_priv->peb_start.host_vaddr ==MAP_FAILED ) { +BBDEV_LA12XX_PMD_ERR ("MAP failed:" ); + ret = -errno; + goto err; + } + + ipc_priv->peb_start.host_vaddr = (void *)((uint64_t ) + (ipc_priv->peb_start.host_vaddr) + phy_align); + + phy_align = (ipc_priv->sys_map.modem_ccsrbar.host_phys %0x1000 ); + ipc_priv->modem_ccsrbar.host_vaddr = +mmap (0 , ipc_priv->sys_map.modem_ccsrbar.size + phy_align, + (PROT_READ |PROT_WRITE ),MAP_SHARED , ipc_priv->dev_mem, + (ipc_priv->sys_map.modem_ccsrbar.host_phys - phy_align)); +if (ipc_priv->modem_ccsrbar.host_vaddr ==MAP_FAILED ) { +BBDEV_LA12XX_PMD_ERR ("MAP failed:" ); + ret = -errno; + goto err; + } + + ipc_priv->modem_ccsrbar.host_vaddr = (void *)((uint64_t ) + (ipc_priv->modem_ccsrbar.host_vaddr) + phy_align); + + ipc_priv->hugepg_start.modem_phys = + ipc_priv->sys_map.hugepg_start.modem_phys; + + ipc_priv->mhif_start.host_phys = + ipc_priv->sys_map.mhif_start.host_phys; + ipc_priv->mhif_start.size = ipc_priv->sys_map.mhif_start.size; + ipc_priv->peb_start.host_phys = ipc_priv->sys_map.peb_start.host_phys; + ipc_priv->peb_start.size = ipc_priv->sys_map.peb_start.size; + +BBDEV_LA12XX_PMD_INFO ("peb %lx %p %x" , + ipc_priv->peb_start.host_phys, + ipc_priv->peb_start.host_vaddr, + ipc_priv->peb_start.size); +BBDEV_LA12XX_PMD_INFO ("hugepg %lx %p %x" , + ipc_priv->hugepg_start.host_phys, + ipc_priv->hugepg_start.host_vaddr, + ipc_priv->hugepg_start.size); +BBDEV_LA12XX_PMD_INFO ("mhif %lx %p %x" , + ipc_priv->mhif_start.host_phys, + ipc_priv->mhif_start.host_vaddr, + ipc_priv->mhif_start.size); + mhif = (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; + +/* offset is from start of PEB */ + ipc_md = (ipc_metadata_t *)((uint64_t )ipc_priv->peb_start.host_vaddr + + mhif->ipc_regs.ipc_mdata_offset); + +if (sizeof (ipc_metadata_t) != mhif->ipc_regs.ipc_mdata_size) { +BBDEV_LA12XX_PMD_ERR ( +"\n ipc_metadata_t =%lx, mhif->ipc_regs.ipc_mdata_size=%x" , +sizeof (ipc_metadata_t), mhif->ipc_regs.ipc_mdata_size); +BBDEV_LA12XX_PMD_ERR ( +"--> mhif->ipc_regs.ipc_mdata_offset= %x" , + mhif->ipc_regs.ipc_mdata_offset); +BBDEV_LA12XX_PMD_ERR ( +"gul_hif size=%lx" ,sizeof (struct gul_hif )); +return IPC_MD_SZ_MISS_MATCH ; + } + + ipc_priv->instance = (ipc_instance_t *) + (&ipc_md->instance_list[ipc_priv->instance_id]); + +BBDEV_LA12XX_PMD_DEBUG ("finish host init" ); + + priv->ipc_priv = ipc_priv; + +return 0 ; + +err: +rte_free (hp); +rte_free (ipc_priv); +rte_free (ipc_priv_ch); +if (dev_mem) +close (dev_mem); +if (dev_ipc) +close (dev_ipc); + +return ret; +} +static inline int parse_u16_arg (const char *key,const char *value,void *extra_args) {
@@ -123,6 +680,7 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev,struct rte_bbdev *bbdev;const char *name =rte_vdev_device_name (vdev);struct bbdev_la12xx_private *priv; +int ret;PMD_INIT_FUNC_TRACE ();
@@ -152,7 +710,13 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev,BBDEV_LA12XX_PMD_INFO ("Setting Up %s: DevId=%d, ModemId=%d" , name, bbdev->data->dev_id, priv->modem_id); - bbdev->dev_ops =NULL ; + ret =setup_la12xx_dev (bbdev); +if (ret) { +BBDEV_LA12XX_PMD_ERR ("IPC Setup failed for %s" , name); +rte_free (bbdev->data->dev_private); +return ret; + } + bbdev->dev_ops = &pmd_ops; bbdev->device = &vdev->device; bbdev->data->socket_id =0 ; bbdev->intr_handle =NULL ;
drivers/baseband/la12xx/bbdev_la12xx.h +3 -2
@@ -14,7 +14,7 @@#define MAX_CHANNEL_DEPTH 16/* private data structure */ struct bbdev_la12xx_private { -void *ipc_priv; +ipc_userspace_t *ipc_priv;uint8_t num_valid_queues;uint8_t max_nb_queues;uint8_t num_ldpc_enc_queues;
@@ -52,5 +52,6 @@ struct bbdev_la12xx_q_priv {#define lower_32_bits (x) ((uint32_t)((uint64_t)x))#define upper_32_bits (x) ((uint32_t)(((uint64_t)(x) >> 16) >> 16)) - +#define join_32_bits (upper, lower) \ + ((uint64_t)(((uint64_t)(upper) << 32) | (uint32_t)(lower)))#endif
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +180 -0
193 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 5/8 baseband/la12xx: add enqueue and dequeue support
In reply to Hemant AgrawalAdd support for enqueue and dequeue the LDPC enc/dec from the modem device.
--- drivers/baseband/la12xx/bbdev_la12xx.c | 397 ++++++++++++++++++++- drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 37 ++ 2 files changed, 430 insertions(+), 4 deletions(-)
drivers/baseband/la12xx/bbdev_la12xx.c +393 -4
@@ -117,6 +117,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) {
@@ -345,6 +349,387 @@ static const struct rte_bbdev_ops pmd_ops = { .queue_release = la12xx_queue_release, .start = la12xx_start }; + +static int +fill_feca_desc_enc (struct bbdev_la12xx_q_priv *q_priv, +struct bbdev_ipc_dequeue_op *bbdev_ipc_op, +struct rte_bbdev_enc_op *bbdev_enc_op, +struct rte_bbdev_op_data *in_op_data) +{ +RTE_SET_USED (q_priv); +RTE_SET_USED (bbdev_ipc_op); +RTE_SET_USED (bbdev_enc_op); +RTE_SET_USED (in_op_data); + +return 0 ; +} + +static int +fill_feca_desc_dec (struct bbdev_la12xx_q_priv *q_priv, +struct bbdev_ipc_dequeue_op *bbdev_ipc_op, +struct rte_bbdev_dec_op *bbdev_dec_op, +struct rte_bbdev_op_data *out_op_data) +{ +RTE_SET_USED (q_priv); +RTE_SET_USED (bbdev_ipc_op); +RTE_SET_USED (bbdev_dec_op); +RTE_SET_USED (out_op_data); + +return 0 ; +} + +static inline int +is_bd_ring_full (uint32_t ci,uint32_t ci_flag, +uint32_t pi,uint32_t pi_flag) +{ +if (pi == ci) { +if (pi_flag != ci_flag) +return 1 ;/* Ring is Full */ + } +return 0 ; +} + +static inline int +prepare_ldpc_enc_op (struct rte_bbdev_enc_op *bbdev_enc_op, +struct bbdev_ipc_dequeue_op *bbdev_ipc_op, +struct bbdev_la12xx_q_priv *q_priv, +struct rte_bbdev_op_data *in_op_data, +struct rte_bbdev_op_data *out_op_data) +{ +struct rte_bbdev_op_ldpc_enc *ldpc_enc = &bbdev_enc_op->ldpc_enc; +uint32_t total_out_bits; +int ret; + + total_out_bits = (ldpc_enc->tb_params.cab * + ldpc_enc->tb_params.ea) + (ldpc_enc->tb_params.c - + ldpc_enc->tb_params.cab) * ldpc_enc->tb_params.eb; + + ldpc_enc->output.length = (total_out_bits +7 )/8 ; + + ret =fill_feca_desc_enc (q_priv, bbdev_ipc_op, + bbdev_enc_op, in_op_data); +if (ret) { +BBDEV_LA12XX_PMD_ERR ( +"fill_feca_desc_enc failed, ret: %d" , ret); +return ret; + } + +rte_pktmbuf_append (out_op_data->data, ldpc_enc->output.length); + +return 0 ; +} + +static inline int +prepare_ldpc_dec_op (struct rte_bbdev_dec_op *bbdev_dec_op, +struct bbdev_ipc_dequeue_op *bbdev_ipc_op, +struct bbdev_la12xx_q_priv *q_priv, +struct rte_bbdev_op_data *out_op_data) +{ +struct rte_bbdev_op_ldpc_dec *ldpc_dec = &bbdev_dec_op->ldpc_dec; +uint32_t total_out_bits; +uint32_t num_code_blocks =0 ; +uint16_t sys_cols; +int ret; + + sys_cols = (ldpc_dec->basegraph ==1 ) ?22 :10 ; +if (ldpc_dec->tb_params.c ==1 ) { + total_out_bits = ((sys_cols * ldpc_dec->z_c) - + ldpc_dec->n_filler); +/* 5G-NR protocol uses 16 bit CRC when output packet +* size <= 3824 (bits). Otherwise 24 bit CRC is used. +* Adjust the output bits accordingly +*/ +if (total_out_bits -16 <=3824 ) + total_out_bits -=16 ; +else + total_out_bits -=24 ; + ldpc_dec->hard_output.length = (total_out_bits /8 ); + }else { + total_out_bits = (((sys_cols * ldpc_dec->z_c) - + ldpc_dec->n_filler -24 ) * + ldpc_dec->tb_params.c); + ldpc_dec->hard_output.length = (total_out_bits /8 ) -3 ; + } + + num_code_blocks = ldpc_dec->tb_params.c; + + bbdev_ipc_op->num_code_blocks =rte_cpu_to_be_32 (num_code_blocks); + + ret =fill_feca_desc_dec (q_priv, bbdev_ipc_op, + bbdev_dec_op, out_op_data); +if (ret) { +BBDEV_LA12XX_PMD_ERR ("fill_feca_desc_dec failed, ret: %d" , ret); +return ret; + } + +return 0 ; +} + +static int +enqueue_single_op (struct bbdev_la12xx_q_priv *q_priv,void *bbdev_op) +{ +struct bbdev_la12xx_private *priv = q_priv->bbdev_priv; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +ipc_instance_t *ipc_instance = ipc_priv->instance; +struct bbdev_ipc_dequeue_op *bbdev_ipc_op; +struct rte_bbdev_op_ldpc_enc *ldpc_enc; +struct rte_bbdev_op_ldpc_dec *ldpc_dec; +uint32_t q_id = q_priv->q_id; +uint32_t ci, ci_flag, pi, pi_flag; +ipc_ch_t *ch = &(ipc_instance->ch_list[q_id]); +ipc_br_md_t *md = &(ch->md); +uint64_t virt; +char *huge_start_addr = + (char *)q_priv->bbdev_priv->ipc_priv->hugepg_start.host_vaddr; +struct rte_bbdev_op_data *in_op_data, *out_op_data; +char *data_ptr; +uint32_t l1_pcie_addr; +int ret; +uint32_t temp_ci; + + temp_ci = q_priv->host_params->ci; + ci =IPC_GET_CI_INDEX (temp_ci); + ci_flag =IPC_GET_CI_FLAG (temp_ci); + + pi =IPC_GET_PI_INDEX (q_priv->host_pi); + pi_flag =IPC_GET_PI_FLAG (q_priv->host_pi); + +BBDEV_LA12XX_PMD_DP_DEBUG ( +"before bd_ring_full: pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u" , + pi, ci, pi_flag, ci_flag, q_priv->queue_size); + +if (is_bd_ring_full (ci, ci_flag, pi, pi_flag)) { +BBDEV_LA12XX_PMD_DP_DEBUG ( +"bd ring full for queue id: %d" , q_id); +return IPC_CH_FULL ; + } + + virt =MODEM_P2V (q_priv->host_params->modem_ptr[pi]); + bbdev_ipc_op = (struct bbdev_ipc_dequeue_op *)virt; + q_priv->bbdev_op[pi] = bbdev_op; + +switch (q_priv->op_type) { +case RTE_BBDEV_OP_LDPC_ENC : + ldpc_enc = &(((struct rte_bbdev_enc_op *)bbdev_op)->ldpc_enc); + in_op_data = &ldpc_enc->input; + out_op_data = &ldpc_enc->output; + + ret =prepare_ldpc_enc_op (bbdev_op, bbdev_ipc_op, q_priv, + in_op_data, out_op_data); +if (ret) { +BBDEV_LA12XX_PMD_ERR ( +"process_ldpc_enc_op failed, ret: %d" , ret); +return ret; + } +break ; + +case RTE_BBDEV_OP_LDPC_DEC : + ldpc_dec = &(((struct rte_bbdev_dec_op *)bbdev_op)->ldpc_dec); + in_op_data = &ldpc_dec->input; + + out_op_data = &ldpc_dec->hard_output; + + ret =prepare_ldpc_dec_op (bbdev_op, bbdev_ipc_op, + q_priv, out_op_data); +if (ret) { +BBDEV_LA12XX_PMD_ERR ( +"process_ldpc_dec_op failed, ret: %d" , ret); +return ret; + } +break ; + +default : +BBDEV_LA12XX_PMD_ERR ("unsupported bbdev_ipc op type" ); +return -1 ; + } + +if (in_op_data->data) { + data_ptr = rte_pktmbuf_mtod(in_op_data->data, char *); + l1_pcie_addr = (uint32_t )GUL_USER_HUGE_PAGE_ADDR + + data_ptr - huge_start_addr; + bbdev_ipc_op->in_addr = l1_pcie_addr; + bbdev_ipc_op->in_len = in_op_data->length; + } + +if (out_op_data->data) { + data_ptr = rte_pktmbuf_mtod(out_op_data->data, char *); + l1_pcie_addr = (uint32_t )GUL_USER_HUGE_PAGE_ADDR + + data_ptr - huge_start_addr; + bbdev_ipc_op->out_addr =rte_cpu_to_be_32 (l1_pcie_addr); + bbdev_ipc_op->out_len =rte_cpu_to_be_32 (out_op_data->length); + } + +/* Move Producer Index forward */ + pi++; +/* Flip the PI flag, if wrapping */ +if (unlikely (q_priv->queue_size == pi)) { + pi =0 ; + pi_flag = pi_flag ?0 :1 ; + } + +if (pi_flag) +IPC_SET_PI_FLAG (pi); +else +IPC_RESET_PI_FLAG (pi); +/* Wait for Data Copy & pi_flag update to complete before updating pi */ +rte_mb (); +/* now update pi */ + md->pi =rte_cpu_to_be_32 (pi); + q_priv->host_pi = pi; + +BBDEV_LA12XX_PMD_DP_DEBUG ( +"enter: pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u" , + pi, ci, pi_flag, ci_flag, q_priv->queue_size); + +return 0 ; +} + +/* Enqueue decode burst */ +static uint16_t +enqueue_dec_ops (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_dec_op **ops,uint16_t nb_ops) +{ +struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; +int nb_enqueued, ret; + +for (nb_enqueued =0 ; nb_enqueued < nb_ops; nb_enqueued++) { + ret =enqueue_single_op (q_priv, ops[nb_enqueued]); +if (ret) +break ; + } + + q_data->queue_stats.enqueue_err_count += nb_ops - nb_enqueued; + q_data->queue_stats.enqueued_count += nb_enqueued; + +return nb_enqueued; +} + +/* Enqueue encode burst */ +static uint16_t +enqueue_enc_ops (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_enc_op **ops,uint16_t nb_ops) +{ +struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; +int nb_enqueued, ret; + +for (nb_enqueued =0 ; nb_enqueued < nb_ops; nb_enqueued++) { + ret =enqueue_single_op (q_priv, ops[nb_enqueued]); +if (ret) +break ; + } + + q_data->queue_stats.enqueue_err_count += nb_ops - nb_enqueued; + q_data->queue_stats.enqueued_count += nb_enqueued; + +return nb_enqueued; +} + +static inline int +is_bd_ring_empty (uint32_t ci,uint32_t ci_flag, +uint32_t pi,uint32_t pi_flag) +{ +if (ci == pi) { +if (ci_flag == pi_flag) +return 1 ;/* No more Buffer */ + } +return 0 ; +} + +/* Dequeue encode burst */ +static void * +dequeue_single_op (struct bbdev_la12xx_q_priv *q_priv,void *dst) +{ +struct bbdev_la12xx_private *priv = q_priv->bbdev_priv; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +uint32_t q_id = q_priv->q_id +HOST_RX_QUEUEID_OFFSET ; +ipc_instance_t *ipc_instance = ipc_priv->instance; +ipc_ch_t *ch = &(ipc_instance->ch_list[q_id]); +uint32_t ci, ci_flag, pi, pi_flag; +ipc_br_md_t *md; +void *op; +uint32_t temp_pi; + + md = &(ch->md); + ci =IPC_GET_CI_INDEX (q_priv->host_ci); + ci_flag =IPC_GET_CI_FLAG (q_priv->host_ci); + + temp_pi = q_priv->host_params->pi; + pi =IPC_GET_PI_INDEX (temp_pi); + pi_flag =IPC_GET_PI_FLAG (temp_pi); + +if (is_bd_ring_empty (ci, ci_flag, pi, pi_flag)) +return NULL ; + +BBDEV_LA12XX_PMD_DP_DEBUG ( +"pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u" , + pi, ci, pi_flag, ci_flag, q_priv->queue_size); + + op = q_priv->bbdev_op[ci]; + +rte_memcpy (dst, q_priv->msg_ch_vaddr[ci], +sizeof (struct bbdev_ipc_enqueue_op )); + +/* Move Consumer Index forward */ + ci++; +/* Flip the CI flag, if wrapping */ +if (q_priv->queue_size == ci) { + ci =0 ; + ci_flag = ci_flag ?0 :1 ; + } +if (ci_flag) +IPC_SET_CI_FLAG (ci); +else +IPC_RESET_CI_FLAG (ci); + md->ci =rte_cpu_to_be_32 (ci); + q_priv->host_ci = ci; + +BBDEV_LA12XX_PMD_DP_DEBUG ( +"exit: pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u" , + pi, ci, pi_flag, ci_flag, q_priv->queue_size); + +return op; +} + +/* Dequeue decode burst */ +static uint16_t +dequeue_dec_ops (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_dec_op **ops,uint16_t nb_ops) +{ +struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; +struct bbdev_ipc_enqueue_op bbdev_ipc_op; +int nb_dequeued; + +for (nb_dequeued =0 ; nb_dequeued < nb_ops; nb_dequeued++) { + ops[nb_dequeued] =dequeue_single_op (q_priv, &bbdev_ipc_op); +if (!ops[nb_dequeued]) +break ; + ops[nb_dequeued]->status = bbdev_ipc_op.status; + } + q_data->queue_stats.dequeued_count += nb_dequeued; + +return nb_dequeued; +} + +/* Dequeue encode burst */ +static uint16_t +dequeue_enc_ops (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_enc_op **ops,uint16_t nb_ops) +{ +struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; +struct bbdev_ipc_enqueue_op bbdev_ipc_op; +int nb_enqueued; + +for (nb_enqueued =0 ; nb_enqueued < nb_ops; nb_enqueued++) { + ops[nb_enqueued] =dequeue_single_op (q_priv, &bbdev_ipc_op); +if (!ops[nb_enqueued]) +break ; + ops[nb_enqueued]->status = bbdev_ipc_op.status; + } + q_data->queue_stats.enqueued_count += nb_enqueued; + +return nb_enqueued; +} +static struct hugepage_info *get_hugepage_info (void ) {
@@ -722,10 +1107,14 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev, 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 ; + bbdev->dequeue_enc_ops = dequeue_enc_ops; + bbdev->dequeue_dec_ops = dequeue_dec_ops; + bbdev->enqueue_enc_ops = enqueue_enc_ops; + bbdev->enqueue_dec_ops = enqueue_dec_ops; + bbdev->dequeue_ldpc_enc_ops = dequeue_enc_ops; + bbdev->dequeue_ldpc_dec_ops = dequeue_dec_ops; + bbdev->enqueue_ldpc_enc_ops = enqueue_enc_ops; + bbdev->enqueue_ldpc_dec_ops = enqueue_dec_ops;return 0 ; }
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +37 -0
@@ -76,6 +76,25 @@ typedef struct { _IOWR(GUL_IPC_MAGIC, 5, struct ipc_msg *) #define IOCTL_GUL_IPC_CHANNEL_RAISE_INTERRUPT _IOW(GUL_IPC_MAGIC, 6, int *) +#define GUL_USER_HUGE_PAGE_OFFSET (0) +#define GUL_PCI1_ADDR_BASE (0x00000000ULL) + +#define GUL_USER_HUGE_PAGE_ADDR (GUL_PCI1_ADDR_BASE + GUL_USER_HUGE_PAGE_OFFSET) + +/* IPC PI/CI index & flag manipulation helpers */ +#define IPC_PI_CI_FLAG_MASK 0x80000000 /* (1<<31) */ +#define IPC_PI_CI_INDEX_MASK 0x7FFFFFFF /* ~(1<<31) */ + +#define IPC_SET_PI_FLAG(x) (x |= IPC_PI_CI_FLAG_MASK) +#define IPC_RESET_PI_FLAG (x) (x &= IPC_PI_CI_INDEX_MASK) +#define IPC_GET_PI_FLAG (x) (x >> 31) +#define IPC_GET_PI_INDEX (x) (x & IPC_PI_CI_INDEX_MASK) + +#define IPC_SET_CI_FLAG (x) (x |= IPC_PI_CI_FLAG_MASK) +#define IPC_RESET_CI_FLAG (x) (x &= IPC_PI_CI_INDEX_MASK) +#define IPC_GET_CI_FLAG (x) (x >> 31) +#define IPC_GET_CI_INDEX (x) (x & IPC_PI_CI_INDEX_MASK) +/** buffer ring common metadata */ typedef struct ipc_bd_ring_md { volatile uint32_t pi; /**< Producer index and flag (MSB)
@@ -173,6 +192,24 @@ struct bbdev_ipc_enqueue_op {uint32_t rsvd; }; +/** Structure specifying dequeue operation (dequeue at LA1224) */ +struct bbdev_ipc_dequeue_op { +/** Input buffer memory address */ +uint32_t in_addr; +/** Input buffer memory length */ +uint32_t in_len; +/** Output buffer memory address */ +uint32_t out_addr; +/** Output buffer memory length */ +uint32_t out_len; +/* Number of code blocks. Only set when HARQ is used */ +uint32_t num_code_blocks; +/** Dequeue Operation flags */ +uint32_t op_flags; +/** Shared metadata between L1 and L2 */ +uint32_t shared_metadata; +}; +/* This shared memory would be on the host side which have copy of some * of the parameters which are also part of Shared BD ring. Read access * of these parameters from the host side would not be over PCI.
Signature · 1 line
2.17.1
PATCH v2 6/8 baseband/la12xx: add documentation support
In reply to Hemant AgrawalThis patch add documentation for LA12xx PMD.
--- MAINTAINERS | 9 ++ doc/guides/bbdevs/features/la12xx.ini | 14 +++ doc/guides/bbdevs/index.rst | 1 + doc/guides/bbdevs/la12xx.rst | 139 +++++++++++++++++++++++++ doc/guides/rel_notes/release_21_05.rst | 5 + 5 files changed, 168 insertions(+) create mode 100644 doc/guides/bbdevs/features/la12xx.ini create mode 100644 doc/guides/bbdevs/la12xx.rst
MAINTAINERS +9 -0
@@ -1289,6 +1289,15 @@ F: doc/guides/rawdevs/ntb.rst F: examples/ntb/ F: doc/guides/sample_app_ug/ntb.rst +Baseband Drivers +------------------- + +NXP LA12xx +M: Hemant Agrawal <[email protected]> +M: Nipun Gupta <[email protected]> +F: drivers/baseband/la12xx/ +F: doc/guides/bbdevs/la12xx.rst +F: doc/guides/bbdevs/features/la12xx.ini Packet processing -----------------
doc/guides/bbdevs/features/la12xx.ini new file +14 -0
@@ -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 +External DDR Access = Y +HW Accelerated = Y +BBDEV API = Y
doc/guides/bbdevs/index.rst +1 -0
@@ -14,3 +14,4 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 + la12xx
doc/guides/bbdevs/la12xx.rst new file +139 -0
139 lines not on this page · raw message
doc/guides/rel_notes/release_21_05.rst +5 -0
@@ -130,6 +130,11 @@ New Features * Added command to display Rx queue used descriptor count. ``show port (port_id) rxq (queue_id) desc used count`` +* **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 -------------
Signature · 1 line
2.17.1
PATCH v2 7/8 app/bbdev: add parameter to take input in network order
In reply to Hemant AgrawalFrom: Nipun Gupta <[email protected]>
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
--- app/test-bbdev/test_bbdev_vector.c | 18 ++++++++++++++++-- app/test-bbdev/test_bbdev_vector.h | 2 ++ 2 files changed, 18 insertions(+), 2 deletions(-)
app/test-bbdev/test_bbdev_vector.c +16 -2
@@ -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 ;
app/test-bbdev/test_bbdev_vector.h +2 -0
@@ -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;
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v2 7/8] app/bbdev: add parameter to take input in network order
Quoted 7 lines · Hemant Agrawal
From: Nipun Gupta <[email protected]>
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
I did not look at the bbdev API, but something feels odd here. Why should the test know about endianness?
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH v2 7/8] app/bbdev: add parameter to take input in network order
Quoted 10 lines · David Marchand
Quoted 6 lines · Hemant Agrawal
From: Nipun Gupta <[email protected]>
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
I did not look at the bbdev API, but something feels odd here. Why should the test know about endianness?
This is baseband data, which need to be processed by the offload device. It is important for know the endianness of this data else the offload device will not be able to process it correctly.
The existing files only have data in little-endian format. In the real world, the network data can come in big-endian format, so the drivers (running on Little-endian machine) shall be able to pass the big-endian data for processing to offload device.
PATCH v2 8/8 app/bbdev: add test vectors for transport blocks
In reply to Hemant AgrawalFrom: Nipun Gupta <[email protected]>
This patch adds two test vectors for transport block in network byte order:
- LDPC encode for Transport Block
- LDPC decode for Transport block
--- 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
app/test-bbdev/test_vectors/ldpc_dec_tb.data new file +362 -0
@@ -0,0 +1,362 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2020 NXP + +op_type = +RTE_BBDEV_OP_LDPC_DEC + +network_order = +1 + +input0 = +0x817f7f81, 0x81817f7f, 0x7f7f8181, 0x81817f81, 0x8181817f, 0x7f817f81, 0x7f817f81, 0x7f817f7f, +0x7f818181, 0x7f817f7f, 0x81817f81, 0x817f7f7f, 0x81817f81, 0x81818181, 0x7f818181, 0x81818181, +0x7f7f7f7f, 0x81818181, 0x7f81817f, 0x817f7f7f, 0x81817f7f, 0x817f817f, 0x81817f81, 0x7f817f81, +0x7f7f7f7f, 0x7f7f8181, 0x7f818181, 0x81817f81, 0x7f818181, 0x817f8181, 0x817f8181, 0x7f7f7f7f, +0x7f7f817f, 0x817f8181, 0x8181817f, 0x817f7f81, 0x7f818181, 0x81817f7f, 0x7f81817f, 0x7f7f7f7f, +0x7f817f7f, 0x81818181, 0x7f81817f, 0x7f7f817f, 0x8181817f, 0x8181817f, 0x817f8181, 0x7f817f81, +0x7f7f8181, 0x7f7f7f7f, 0x81817f81, 0x7f7f7f81, 0x7f81817f, 0x81817f7f, 0x81817f7f, 0x7f7f8181, +0x817f817f, 0x7f817f7f, 0x7f7f7f7f, 0x817f8181, 0x81818181, 0x7f7f7f7f, 0x7f7f8181, 0x7f7f7f7f, +0x7f817f81, 0x7f81817f, 0x7f818181, 0x817f817f, 0x81817f7f, 0x7f7f7f81, 0x7f7f7f81, 0x7f817f81, +0x817f7f7f, 0x7f817f7f, 0x817f7f81, 0x7f7f7f7f, 0x7f817f81, 0x81817f7f, 0x7f817f7f, 0x7f7f7f81, +0x7f817f7f, 0x7f7f7f81, 0x7f817f7f, 0x7f81817f, 0x817f7f81, 0x7f7f7f7f, 0x81818181, 0x7f7f8181, +0x817f7f7f, 0x817f7f81, 0x81817f81, 0x7f817f81, 0x7f818181, 0x817f7f81, 0x7f817f7f, 0x7f818181, +0x7f7f8181, 0x81817f81, 0x7f7f8181, 0x8181817f, 0x8181817f, 0x817f7f81, 0x8181817f, 0x7f7f817f, +0x7f817f81, 0x817f7f7f, 0x81818181, 0x817f7f7f, 0x81817f81, 0x7f7f7f7f, 0x8181817f, 0x7f81817f, +0x8181817f, 0x7f818181, 0x7f817f7f, 0x817f7f7f, 0x7f817f7f, 0x817f8181, 0x7f7f8181, 0x7f81817f, +0x7f7f7f7f, 0x7f7f817f, 0x81818181, 0x7f818181, 0x81818181, 0x7f7f817f, 0x817f817f, 0x817f817f, +0x7f7f7f81, 0x7f7f817f, 0x7f7f7f7f, 0x7f7f8181, 0x7f817f81, 0x7f7f7f81, 0x81817f7f, 0x7f817f81, +0x817f817f, 0x7f7f7f7f, 0x81817f81, 0x817f8181, 0x7f817f7f, 0x7f81817f, 0x7f818181, 0x817f8181, +0x7f81817f, 0x7f818181, 0x817f817f, 0x8181817f, 0x817f817f, 0x81817f7f, 0x817f817f, 0x7f81817f, +0x8181817f, 0x7f817f81, 0x7f817f7f, 0x81817f81, 0x7f81817f, 0x817f8181, 0x7f818181, 0x7f7f7f7f, +0x817f8181, 0x7f817f7f, 0x7f7f8181, 0x817f8181, 0x7f7f7f81, 0x817f8181, 0x81817f7f, 0x817f7f7f, +0x81817f81, 0x81818181, 0x7f818181, 0x7f818181, 0x8181817f, 0x7f7f8181, 0x7f7f817f, 0x7f7f8181, +0x81817f7f, 0x7f817f7f, 0x7f7f817f, 0x81818181, 0x7f817f81, 0x817f8181, 0x7f81817f, 0x7f7f7f7f, +0x7f7f8181, 0x817f7f81, 0x7f7f8181, 0x817f817f, 0x7f818181, 0x7f7f8181, 0x7f7f7f7f, 0x8181817f, +0x817f7f81, 0x7f7f7f81, 0x817f7f81, 0x8181817f, 0x817f8181, 0x7f817f7f, 0x7f7f7f81, 0x817f817f, +0x81817f7f, 0x817f8181, 0x7f7f7f81, 0x7f81817f, 0x7f7f8181, 0x7f817f7f, 0x817f8181, 0x7f7f7f81, +0x8181817f, 0x817f8181, 0x7f817f7f, 0x817f7f81, 0x7f818181, 0x7f7f7f81, 0x81817f7f, 0x817f8181, +0x7f7f817f, 0x7f81817f, 0x817f7f81, 0x7f7f7f81, 0x7f81817f, 0x817f8181, 0x81818181, 0x817f817f, +0x7f81817f, 0x817f8181, 0x7f817f81, 0x7f817f7f, 0x7f81817f, 0x7f7f817f, 0x7f81817f, 0x81817f81, +0x817f817f, 0x81818181, 0x7f817f7f, 0x817f8181, 0x817f7f7f, 0x7f7f7f81, 0x817f8181, 0x7f818181, +0x7f7f7f7f, 0x817f8181, 0x817f7f7f, 0x7f817f7f, 0x81817f7f, 0x81818181, 0x7f7f817f, 0x8181817f, +0x8181817f, 0x8181817f, 0x81817f7f, 0x7f817f81, 0x817f8181, 0x8181817f, 0x7f81817f, 0x7f817f7f, +0x7f817f81, 0x81818181, 0x8181817f, 0x7f81817f, 0x81818181, 0x7f7f7f81, 0x7f818181, 0x7f7f7f81, +0x7f7f7f7f, 0x7f7f7f7f, 0x817f7f7f, 0x8181817f, 0x8181817f, 0x817f7f7f, 0x7f817f7f, 0x817f8181, +0x817f7f7f, 0x817f8181, 0x7f7f817f, 0x817f817f, 0x817f8181, 0x81817f81, 0x81817f81, 0x81817f7f, +0x7f81817f, 0x7f7f7f7f, 0x81817f81, 0x7f7f8181, 0x7f817f7f, 0x81818181, 0x7f7f817f, 0x81817f7f, +0x817f817f, 0x7f817f7f, 0x7f7f817f, 0x7f7f7f81, 0x817f7f81, 0x7f7f7f7f, 0x817f8181, 0x7f818181, +0x817f8181, 0x7f817f81, 0x7f7f7f7f, 0x8181817f, 0x81818181, 0x81817f7f, 0x817f7f7f, 0x817f8181, +0x817f8181, 0x7f818181, 0x81818181, 0x7f818181, 0x7f817f7f, 0x81817f81, 0x817f7f7f, 0x817f7f81, +0x817f7f81, 0x81817f81, 0x8181817f, 0x81817f81, 0x81817f81, 0x817f8181, 0x81818181, 0x81818181, +0x81818181, 0x817f817f, 0x8181817f, 0x8181817f, 0x81817f81, 0x817f7f81, 0x817f7f81, 0x817f7f7f, +0x7f7f8181, 0x7f7f817f, 0x7f7f8181, 0x7f817f7f, 0x7f818181, 0x81817f81, 0x7f817f81, 0x817f7f81, +0x7f817f81, 0x817f817f, 0x8181817f, 0x81817f81, 0x7f7f817f, 0x817f8181, 0x7f81817f, 0x7f817f81, +0x81817f7f, 0x7f7f8181, 0x7f7f817f, 0x7f7f8181, 0x7f7f7f7f, 0x7f7f7f81, 0x7f817f7f, 0x7f7f817f, +0x7f7f8181, 0x7f7f817f, 0x7f7f817f, 0x8181817f, 0x81817f7f, 0x7f7f817f, 0x7f817f81, 0x7f7f817f, +0x8181817f, 0x7f7f8181, 0x81817f7f, 0x817f817f, 0x8181817f, 0x817f7f81, 0x8181817f, 0x7f81817f, +0x7f81817f, 0x817f817f, 0x7f7f7f81, 0x7f7f8181, 0x81817f7f, 0x7f7f7f81, 0x7f818181, 0x7f818181, +0x7f7f7f81, 0x7f7f7f7f, 0x7f818181, 0x8181817f, 0x8181817f, 0x8181817f, 0x7f81817f, 0x81818181, +0x7f818181, 0x7f7f817f, 0x7f817f7f, 0x7f818181, 0x817f8181, 0x7f7f817f, 0x7f818181, 0x7f818181, +0x81817f81, 0x7f7f817f, 0x7f81817f, 0x7f7f7f7f, 0x7f7f7f7f, 0x7f817f81, 0x81817f81, 0x7f7f817f, +0x7f817f7f, 0x817f817f, 0x7f818181, 0x81817f81, 0x7f81817f, 0x7f817f7f, 0x7f817f7f, 0x7f7f7f81, +0x7f818181, 0x7f818181, 0x817f817f, 0x81818181, 0x817f817f, 0x81818181, 0x7f818181, 0x7f818181, +0x7f7f817f, 0x817f7f7f, 0x7f817f7f, 0x7f7f817f, 0x7f7f7f7f, 0x7f7f8181, 0x817f7f81, 0x7f81817f, +0x81817f81, 0x817f7f81, 0x8181817f, 0x817f817f, 0x7f817f7f, 0x7f817f81, 0x7f81817f, 0x7f818181, +0x817f8181, 0x81817f7f, 0x817f7f7f, 0x817f8181, 0x7f818181, 0x817f7f7f, 0x817f7f7f, 0x7f7f817f, +0x817f817f, 0x81817f81, 0x81818181, 0x7f7f7f81, 0x817f7f81, 0x817f7f81, 0x7f7f8181, 0x81818181, +0x7f7f7f7f, 0x7f7f8181, 0x81817f81, 0x7f817f7f, 0x817f817f, 0x817f8181, 0x81817f81, 0x7f7f817f, +0x7f817f7f, 0x7f818181, 0x81818181, 0x7f81817f, 0x7f7f7f81, 0x7f81817f, 0x7f7f817f, 0x8181817f, +0x817f7f81, 0x817f817f, 0x7f7f8181, 0x817f7f81, 0x7f7f8181, 0x817f7f81, 0x7f7f8181, 0x81817f81, +0x7f7f817f, 0x81818181, 0x8181817f, 0x7f818181, 0x817f817f, 0x7f817f81, 0x7f817f7f, 0x7f81817f, +0x7f7f7f81, 0x817f7f81, 0x817f7f7f, 0x7f7f7f81, 0x817f7f81, 0x817f8181, 0x817f8181, 0x7f818181, +0x7f7f8181, 0x7f817f7f, 0x81818181, 0x8181817f, 0x7f7f817f, 0x81817f7f, 0x817f817f, 0x81817f81, +0x7f817f81, 0x7f7f7f7f, 0x8181817f, 0x817f7f81, 0x81817f81, 0x7f818181, 0x81818181, 0x7f7f8181, +0x817f7f7f, 0x7f817f7f, 0x7f7f817f, 0x817f817f, 0x7f817f7f, 0x817f7f81, 0x7f7f8181, 0x7f7f7f81, +0x81818181, 0x7f7f8181, 0x81818181, 0x817f7f81, 0x81818181, 0x817f7f81, 0x81817f7f, 0x7f7f817f, +0x817f7f7f, 0x8181817f, 0x817f7f81, 0x81818181, 0x81817f81, 0x81818181, 0x7f81817f, 0x7f817f81, +0x7f81817f, 0x7f817f7f, 0x7f81817f, 0x7f818181, 0x81817f7f, 0x7f81817f, 0x81817f7f, 0x817f7f7f, +0x817f8181, 0x7f7f8181, 0x8181817f, 0x8181817f, 0x81817f7f, 0x817f817f, 0x7f81817f, 0x8181817f, +0x7f818181, 0x817f7f7f, 0x7f818181, 0x817f8181, 0x81818181, 0x7f7f7f81, 0x7f7f8181, 0x7f817f7f, +0x817f8181, 0x7f817f7f, 0x7f818181, 0x7f7f7f7f, 0x7f7f817f, 0x817f817f, 0x817f8181, 0x7f81817f, +0x7f817f7f, 0x7f7f7f7f, 0x7f7f8181, 0x7f818181, 0x7f817f7f, 0x7f7f8181, 0x7f817f81, 0x7f7f817f, +0x817f8181, 0x81817f81, 0x7f7f8181, 0x81817f81, 0x81817f7f, 0x817f7f7f, 0x817f8181, 0x7f818181, +0x81818181, 0x7f817f7f, 0x81817f81, 0x817f7f7f, 0x817f7f81, 0x81817f7f, 0x817f817f, 0x7f817f81, +0x7f7f8181, 0x81817f7f, 0x7f818181, 0x7f7f7f7f, 0x7f7f7f81, 0x7f817f81, 0x7f7f7f81, 0x7f7f8181, +0x81817f81, 0x817f817f, 0x817f7f81, 0x7f7f817f, 0x81817f7f, 0x81817f81, 0x817f7f81, 0x7f818181, +0x817f817f, 0x7f81817f, 0x8181817f, 0x8181817f, 0x7f818181, 0x817f7f81, 0x81818181, 0x817f7f81, +0x817f7f7f, 0x8181817f, 0x8181817f, 0x7f817f7f, 0x81818181, 0x7f7f7f81, 0x7f7f7f7f, 0x7f818181, +0x817f7f7f, 0x7f7f817f, 0x7f7f7f81, 0x7f7f7f81, 0x7f817f81, 0x7f817f7f, 0x7f817f81, 0x817f7f81, +0x81817f81, 0x8181817f, 0x7f81817f, 0x81818181, 0x7f7f7f7f, 0x817f7f81, 0x7f7f817f, 0x81818181, +0x817f817f, 0x7f818181, 0x817f7f81, 0x817f817f, 0x817f8181, 0x7f7f7f7f, 0x81817f81, 0x7f7f8181, +0x8181817f, 0x81817f7f, 0x7f818181, 0x81817f7f, 0x81817f81, 0x7f81817f, 0x7f81817f, 0x817f7f7f, +0x7f817f81, 0x8181817f, 0x81817f81, 0x7f818181, 0x8181817f, 0x81817f81, 0x81817f81, 0x7f7f8181, +0x7f818181, 0x817f8181, 0x81817f81, 0x7f818181, 0x7f818181, 0x81818181, 0x7f7f8181, 0x81817f7f, +0x7f7f8181, 0x7f818181, 0x7f818181, 0x8181817f, 0x7f817f81, 0x8181817f, 0x7f817f7f, 0x817f817f, +0x7f817f81, 0x81818181, 0x817f7f81, 0x8181817f, 0x7f7f817f, 0x7f7f7f81, 0x817f7f81, 0x7f7f8181, +0x7f817f81, 0x81817f81, 0x81818181, 0x7f7f7f81, 0x817f8181, 0x81817f7f, 0x817f7f7f, 0x7f7f817f, +0x8181817f, 0x7f817f81, 0x817f8181, 0x817f7f7f, 0x81817f81, 0x817f8181, 0x7f817f81, 0x8181817f, +0x81817f81, 0x817f817f, 0x817f8181, 0x81817f81, 0x7f817f81, 0x7f818181, 0x7f7f7f81, 0x7f7f8181, +0x7f7f817f, 0x8181817f, 0x7f817f7f, 0x817f8181, 0x817f8181, 0x817f817f, 0x7f7f817f, 0x81817f7f, +0x817f7f81, 0x7f818181, 0x7f7f7f7f, 0x7f818181, 0x81818181, 0x7f818181, 0x7f818181, 0x8181817f, +0x81817f81, 0x7f7f7f81, 0x817f7f81, 0x817f8181, 0x81817f7f, 0x7f81817f, 0x7f7f817f, 0x817f8181, +0x81817f81, 0x817f7f7f, 0x817f817f, 0x7f81817f, 0x817f817f, 0x817f7f7f, 0x81817f7f, 0x817f7f81, +0x817f817f, 0x7f7f7f7f, 0x8181817f, 0x7f817f81, 0x7f817f81, 0x81817f81, 0x7f817f7f, 0x7f817f7f, +0x7f817f7f, 0x7f7f7f7f, 0x7f7f7f7f, 0x81817f81, 0x817f7f81, 0x7f7f7f81, 0x81817f81, 0x7f7f817f, +0x817f8181, 0x7f817f81, 0x8181817f, 0x7f7f8181, 0x817f8181, 0x7f81817f, 0x8181817f, 0x7f7f8181, +0x81817f81, 0x7f818181, 0x7f817f81, 0x7f7f7f7f, 0x7f7f8181, 0x7f818181, 0x8181817f, 0x7f7f7f7f, +0x817f817f, 0x81817f7f, 0x7f81817f, 0x7f7f7f7f, 0x7f81817f, 0x7f81817f, 0x817f817f, 0x817f7f81, +0x7f817f81, 0x7f817f7f, 0x81817f7f, 0x817f7f7f, 0x817f7f7f, 0x7f817f81, 0x7f7f817f, 0x7f81817f, +0x81818181, 0x817f7f81, 0x7f7f8181, 0x7f7f7f7f, 0x7f7f8181, 0x7f7f817f, 0x817f7f7f, 0x7f817f81, +0x7f817f7f, 0x7f7f817f, 0x81817f81, 0x7f817f81, 0x8181817f, 0x7f7f8181, 0x7f7f8181, 0x8181817f, +0x7f7f7f81, 0x8181817f, 0x8181817f, 0x81817f81, 0x7f81817f, 0x7f7f817f, 0x7f7f817f, 0x7f7f817f, +0x7f81817f, 0x7f818181, 0x7f817f7f, 0x81817f7f, 0x7f7f7f81, 0x81817f81, 0x817f8181, 0x817f7f81, +0x817f817f, 0x7f818181, 0x7f817f7f, 0x817f7f81, 0x7f7f7f7f, 0x81817f7f, 0x7f81817f, 0x7f817f81, +0x7f7f8181, 0x7f817f7f, 0x7f81817f, 0x7f81817f, 0x81817f81, 0x7f817f81, 0x817f817f, 0x817f817f, +0x8181817f, 0x7f7f817f, 0x817f7f81, 0x81817f7f, 0x7f817f7f, 0x7f81817f, 0x7f7f8181, 0x8181817f, +0x7f817f7f, 0x817f817f, 0x81817f7f, 0x817f7f7f, 0x817f7f81, 0x81818181, 0x7f7f7f81, 0x81817f7f, +0x817f817f, 0x817f8181, 0x7f81817f, 0x7f7f8181, 0x817f7f81, 0x7f7f8181, 0x81817f7f, 0x81817f81, +0x7f818181, 0x817f817f, 0x7f7f817f, 0x817f817f, 0x817f7f81, 0x7f7f8181, 0x7f7f8181, 0x7f7f7f7f, +0x817f8181, 0x7f7f7f81, 0x817f7f7f, 0x7f7f8181, 0x7f7f7f7f, 0x7f817f7f, 0x7f817f7f, 0x7f7f817f, +0x817f817f, 0x81818181, 0x7f81817f, 0x7f7f817f, 0x7f818181, 0x817f7f7f, 0x7f817f81, 0x81817f81, +0x817f7f7f, 0x81817f7f, 0x81817f81, 0x7f7f8181, 0x7f7f817f, 0x7f7f7f81, 0x8181817f, 0x81817f7f, +0x81817f81, 0x7f7f7f81, 0x7f817f7f, 0x817f7f7f, 0x817f7f7f, 0x81817f7f, 0x81817f81, 0x7f7f7f7f, +0x7f817f81, 0x817f7f81, 0x7f817f81, 0x7f7f7f81, 0x81818181, 0x7f7f8181, 0x81817f7f, 0x81818181, +0x7f7f8181, 0x7f7f817f, 0x817f7f7f, 0x7f818181, 0x817f8181, 0x81817f7f, 0x8181817f, 0x81817f7f, +0x8181817f, 0x7f817f81, 0x81818181, 0x817f7f7f, 0x81818181, 0x7f818181, 0x7f7f8181, 0x7f7f817f, +0x817f8181, 0x7f7f8181, 0x817f7f7f, 0x817f7f81, 0x7f81817f, 0x817f7f7f, 0x8181817f, 0x81817f81, +0x817f7f81, 0x817f7f7f, 0x7f7f7f7f, 0x81817f7f, 0x817f7f7f, 0x7f818181, 0x7f81817f, 0x7f817f7f, +0x817f8181, 0x7f7f7f81, 0x7f817f81, 0x817f8181, 0x817f7f7f, 0x7f818181, 0x7f7f7f81, 0x81817f7f, +0x817f7f7f, 0x7f817f7f, 0x7f817f7f, 0x7f7f817f, 0x817f8181, 0x817f7f7f, 0x7f7f817f, 0x8181817f, +0x817f7f7f, 0x8181817f, 0x7f7f8181, 0x7f817f7f, 0x7f817f81, 0x81818181, 0x7f7f817f, 0x81818181, +0x817f7f7f, 0x7f7f7f81, 0x81817f7f, 0x817f8181, 0x7f7f7f81, 0x817f8181, 0x7f7f8181, 0x817f7f81, +0x817f7f81, 0x7f817f7f, 0x7f7f817f, 0x7f7f8181, 0x7f7f7f81, 0x7f7f7f81, 0x7f81817f, 0x817f817f, +0x7f817f7f, 0x81817f7f, 0x7f7f817f, 0x7f7f7f81, 0x817f8181, 0x7f7f8181, 0x7f7f7f81, 0x7f7f7f81, +0x81818181, 0x7f7f7f7f, 0x817f8181, 0x7f7f8181, 0x7f817f7f, 0x7f817f7f, 0x817f7f7f, 0x8181817f, +0x81818181, 0x7f817f81, 0x7f7f7f7f, 0x817f7f81, 0x817f7f81, 0x7f818181, 0x7f81817f, 0x7f818181, +0x7f7f7f81, 0x7f81817f, 0x7f7f8181, 0x7f7f8181, 0x817f7f81, 0x7f817f81, 0x7f817f7f, 0x7f818181, +0x7f7f817f, 0x7f818181, 0x7f817f7f, 0x81817f7f, 0x7f7f7f81, 0x7f818181, 0x817f7f7f, 0x817f817f, +0x7f81817f, 0x817f7f81, 0x7f818181, 0x817f7f81, 0x7f7f7f81, 0x8181817f, 0x8181817f, 0x7f81817f, +0x817f817f, 0x7f7f7f81, 0x81817f81, 0x7f7f8181, 0x7f7f7f81, 0x7f7f8181, 0x817f8181, 0x817f7f7f, +0x7f817f81, 0x8181817f, 0x7f7f817f, 0x7f817f7f, 0x7f7f8181, 0x7f7f7f81, 0x8181817f, 0x7f7f8181, +0x7f818181, 0x81817f7f, 0x8181817f, 0x817f7f81, 0x7f7f7f81, 0x817f7f7f, 0x7f817f81, 0x7f818181, +0x81818181, 0x7f7f7f7f, 0x817f7f81, 0x7f817f7f, 0x7f817f7f, 0x7f81817f, 0x81818181, 0x817f7f81, +0x817f7f81, 0x7f817f81, 0x7f7f8181, 0x7f818181, 0x7f818181, 0x7f818181, 0x7f7f7f81, 0x7f81817f, +0x7f81817f, 0x7f818181, 0x7f7f7f81, 0x81817f81, 0x81818181, 0x817f7f7f, 0x817f7f7f, 0x817f817f, +0x8181817f, 0x7f7f8181, 0x7f7f7f7f, 0x81818181, 0x817f8181, 0x7f7f8181, 0x81817f81, 0x7f817f81, +0x7f818181, 0x7f7f817f, 0x817f7f81, 0x7f7f7f81, 0x7f7f7f81, 0x81817f81, 0x81817f81, 0x7f7f7f7f, +0x817f7f81, 0x7f817f7f, 0x81817f81, 0x7f817f81, 0x817f817f, 0x7f7f8181, 0x81817f7f, 0x817f7f81, +0x7f817f81, 0x7f7f7f81, 0x817f8181, 0x7f7f7f81, 0x817f7f7f, 0x7f7f7f81, 0x817f817f, 0x7f7f7f81, +0x7f817f7f, 0x7f817f7f, 0x8181817f, 0x8181817f, 0x7f7f7f81, 0x7f7f7f81, 0x7f817f81, 0x81817f81, +0x81817f7f, 0x7f7f7f7f, 0x81817f7f, 0x81818181, 0x817f817f, 0x81817f81, 0x81818181, 0x817f7f81, +0x817f8181, 0x817f7f7f, 0x81817f7f, 0x81817f7f, 0x81818181, 0x7f7f7f7f, 0x7f817f7f, 0x7f81817f, +0x7f7f817f, 0x8181817f, 0x817f8181, 0x817f8181, 0x8181817f, 0x7f7f7f81, 0x817f7f7f, 0x817f7f7f, +0x817f8181, 0x7f817f81, 0x7f7f7f7f, 0x81817f7f, 0x81818181, 0x7f817f7f, 0x7f7f8181, 0x817f8181, +0x817f7f7f, 0x817f7f81, 0x817f7f81, 0x81817f7f, 0x7f817f7f, 0x817f7f7f, 0x7f7f8181, 0x7f817f81, +0x7f7f7f7f, 0x8181817f, 0x7f7f7f81, 0x81818181, 0x7f7f817f, 0x81817f81, 0x817f7f7f, 0x7f817f81, +0x817f817f, 0x7f817f81, 0x817f7f7f, 0x7f7f8181, 0x7f81817f, 0x7f7f8181, 0x7f7f7f7f, 0x7f818181, +0x81817f81, 0x7f7f817f, 0x7f7f817f, 0x7f7f817f, 0x817f7f7f, 0x81818181, 0x81817f7f, 0x7f817f81, +0x7f7f817f, 0x7f7f7f7f, 0x81818181, 0x7f7f817f, 0x7f7f817f, 0x7f817f7f, 0x817f7f81, 0x7f817f7f, +0x7f7f7f81, 0x7f7f817f, 0x817f817f, 0x81817f7f, 0x81818181, 0x817f8181, 0x7f817f7f, 0x817f8181, +0x7f818181, 0x7f81817f, 0x817f7f81, 0x817f7f7f, 0x7f7f817f, 0x817f7f7f, 0x7f7f7f81, 0x81817f7f, +0x7f7f817f, 0x817f7f81, 0x7f818181, 0x817f8181, 0x817f8181, 0x7f7f7f7f, 0x817f817f, 0x7f7f7f7f, +0x7f7f7f7f, 0x7f7f7f7f, 0x817f8181, 0x81817f81, 0x817f7f7f, 0x7f818181, 0x7f81817f, 0x7f81817f, +0x81818181, 0x817f8181, 0x817f7f81, 0x8181817f, 0x817f7f7f, 0x7f7f7f7f, 0x81817f81, 0x817f817f, +0x817f817f, 0x817f7f81, 0x7f818181, 0x7f817f81, 0x81817f81, 0x7f81817f, 0x7f81817f, 0x7f817f7f, +0x7f817f81, 0x7f7f7f81, 0x81817f81, 0x81817f81, 0x7f7f817f, 0x7f817f7f, 0x7f818181, 0x7f81817f, +0x817f7f81, 0x817f7f81, 0x81817f81, 0x7f818181, 0x817f8181, 0x7f81817f, 0x7f7f7f7f, 0x817f7f7f, +0x7f817f7f, 0x81817f7f, 0x7f7f8181, 0x7f7f8181, 0x7f7f8181, 0x817f8181, 0x7f81817f, 0x817f7f81, +0x817f7f81, 0x7f7f817f, 0x7f817f81, 0x81817f7f, 0x7f7f7f7f, 0x7f7f7f7f, 0x7f7f8181, 0x817f7f81, +0x8181817f, 0x8181817f, 0x7f7f8181, 0x7f7f817f, 0x817f7f81, 0x817f8181, 0x7f818181, 0x81818181, +0x817f7f81, 0x7f7f817f, 0x7f7f817f, 0x7f7f8181, 0x7f7f7f7f, 0x817f7f81, 0x8181817f, 0x81818181, +0x817f817f, 0x7f818181, 0x817f7f81, 0x81817f7f, 0x7f817f7f, 0x7f817f7f, 0x81818181, 0x817f817f, +0x817f7f81, 0x7f7f8181, 0x7f7f8181, 0x8181817f, 0x7f817f7f, 0x7f81817f, 0x7f7f7f81, 0x7f7f7f81, +0x8181817f, 0x7f817f7f, 0x817f7f81, 0x7f817f81, 0x7f817f81, 0x817f817f, 0x81818181, 0x817f817f, +0x817f8181, 0x7f7f8181, 0x7f817f7f, 0x817f817f, 0x817f7f81, 0x8181817f, 0x7f7f7f81, 0x81817f81, +0x817f7f81, 0x81818181, 0x7f818181, 0x7f7f7f81, 0x7f818181, 0x7f817f7f, 0x7f7f7f81, 0x7f7f7f81, +0x817f817f, 0x81818181, 0x7f7f817f, 0x81818181, 0x8181817f, 0x7f7f817f, 0x7f7f7f7f, 0x7f818181, +0x817f817f, 0x7f7f8181, 0x7f817f81, 0x817f8181, 0x7f817f81, 0x7f7f7f81, 0x7f818181, 0x8181817f, +0x7f7f7f7f, 0x7f7f7f81, 0x7f7f7f81, 0x7f7f7f7f, 0x81817f7f, 0x7f7f8181, 0x817f817f, 0x817f8181, +0x817f7f7f, 0x81817f81, 0x7f81817f, 0x7f7f8181, 0x7f7f8181, 0x7f7f7f7f, 0x817f817f, 0x81818181, +0x7f7f8181, 0x7f818181, 0x7f81817f, 0x817f7f7f, 0x81817f7f, 0x81817f81, 0x7f81817f, 0x8181817f, +0x81818181, 0x81817f7f, 0x7f818181, 0x7f817f81, 0x817f7f7f, 0x817f817f, 0x7f7f817f, 0x81818181, +0x7f81817f, 0x7f7f7f81, 0x7f7f7f81, 0x81817f81, 0x81817f7f, 0x817f7f81, 0x7f817f81, 0x817f817f, +0x817f817f, 0x7f7f7f7f, 0x7f817f7f, 0x7f7f7f81, 0x81817f7f, 0x817f7f81, 0x7f7f8181, 0x817f7f81, +0x7f81817f, 0x817f7f81, 0x817f817f, 0x817f8181, 0x7f818181, 0x7f7f7f81, 0x7f7f8181, 0x817f7f7f, +0x7f7f7f7f, 0x81817f7f, 0x81817f7f, 0x81817f7f, 0x7f817f81, 0x81818181, 0x817f817f, 0x81817f7f, +0x7f7f7f7f, 0x7f7f7f7f, 0x7f818181, 0x7f7f7f81, 0x817f7f81, 0x7f817f7f, 0x7f817f81, 0x7f7f7f81, +0x81817f7f, 0x81817f81, 0x81817f81, 0x81818181, 0x817f7f7f, 0x7f818181, 0x81818181, 0x7f7f7f7f, +0x7f818181, 0x7f7f817f, 0x7f7f8181, 0x817f7f7f, 0x7f817f81, 0x817f7f7f, 0x81818181, 0x7f7f817f, +0x817f7f81, 0x817f7f81, 0x7f81817f, 0x81817f81, 0x7f7f8181, 0x7f81817f, 0x7f7f8181, 0x817f7f7f, +0x7f817f7f, 0x8181817f, 0x8181817f, 0x8181817f, 0x7f7f8181, 0x8181817f, 0x7f7f8181, 0x817f817f, +0x7f817f7f, 0x7f7f8181, 0x7f7f7f81, 0x7f818181, 0x81817f7f, 0x7f818181, 0x817f7f81, 0x7f7f817f, +0x7f7f7f7f, 0x7f817f81, 0x7f817f81, 0x7f7f8181, 0x7f7f817f, 0x7f817f7f, 0x81817f81, 0x7f7f8181, +0x81818181, 0x7f7f817f, 0x7f817f81, 0x817f8181, 0x817f8181, 0x81817f81, 0x817f817f, 0x7f81817f, +0x817f7f7f, 0x7f7f7f7f, 0x7f7f7f81, 0x817f8181, 0x7f7f7f81, 0x817f8181, 0x81818181, 0x7f817f81, +0x81818181, 0x7f81817f, 0x7f7f7f7f, 0x81817f81, 0x7f818181, 0x7f7f7f7f, 0x7f81817f, 0x7f81817f, +0x8181817f, 0x7f81817f, 0x81817f81, 0x7f7f7f7f, 0x817f7f81, 0x7f7f7f81, 0x7f817f81, 0x7f7f7f81, +0x81818181, 0x81817f7f, 0x81817f81, 0x7f7f817f, 0x7f818181, 0x81817f81, 0x81817f7f, 0x81817f81, +0x7f7f7f81, 0x81817f7f, 0x7f7f8181, 0x7f7f817f, 0x81817f7f, 0x817f7f81, 0x7f818181, 0x7f817f7f, +0x7f817f81, 0x7f7f817f, 0x7f7f817f, 0x817f817f, 0x7f7f7f7f, 0x817f7f81, 0x7f7f7f81, 0x817f817f, +0x7f7f8181, 0x7f818181, 0x817f817f, 0x7f817f81, 0x817f7f7f, 0x7f818181, 0x81818181, 0x81818181, +0x81817f7f, 0x7f81817f, 0x7f817f7f, 0x7f7f817f, 0x7f7f8181, 0x817f817f, 0x817f8181, 0x7f7f817f, +0x817f7f81, 0x81817f81, 0x817f7f81, 0x7f81817f, 0x817f7f81, 0x81817f7f, 0x7f817f7f, 0x7f817f81, +0x817f7f7f, 0x7f7f817f, 0x7f817f81, 0x7f7f7f81, 0x81818181, 0x7f817f7f, 0x817f817f, 0x81818181, +0x7f7f7f7f, 0x7f817f81, 0x7f817f81, 0x7f817f7f, 0x817f8181, 0x817f8181, 0x7f817f81, 0x81818181, +0x7f818181, 0x81818181, 0x7f81817f, 0x7f818181, 0x7f7f817f, 0x7f7f817f, 0x7f7f7f81, 0x81817f7f, +0x7f818181, 0x817f8181, 0x7f7f7f81, 0x7f7f817f, 0x7f7f817f, 0x7f817f81, 0x7f817f7f, 0x7f7f7f7f, +0x81817f81, 0x81817f81, 0x7f7f7f81, 0x81818181, 0x7f817f7f, 0x81818181, 0x81817f7f, 0x7f7f8181, +0x817f7f7f, 0x7f7f817f, 0x817f817f, 0x817f8181, 0x81818181, 0x7f817f81, 0x817f817f, 0x817f8181, +0x817f8181, 0x817f817f, 0x81817f7f, 0x7f817f7f, 0x817f8181, 0x81817f7f, 0x81818181, 0x817f8181, +0x7f817f7f, 0x7f817f7f, 0x7f7f8181, 0x817f817f, 0x7f7f817f, 0x7f817f81, 0x7f7f817f, 0x7f7f7f81, +0x817f817f, 0x7f7f8181, 0x81817f7f, 0x7f7f7f7f, 0x7f818181, 0x7f818181, 0x7f817f81, 0x7f81817f, +0x7f7f8181, 0x7f7f7f7f, 0x81817f81, 0x817f7f7f, 0x81817f7f, 0x817f7f7f, 0x8181817f, 0x7f818181, +0x817f817f, 0x817f7f81, 0x81817f7f, 0x817f7f81, 0x7f817f81, 0x817f7f81, 0x817f817f, 0x7f7f7f7f, +0x7f817f7f, 0x8181817f, 0x7f818181, 0x81817f81, 0x7f7f7f7f, 0x7f818181, 0x817f817f, 0x7f818181, +0x7f818181, 0x817f7f7f, 0x81817f7f, 0x81817f81, 0x7f7f7f81, 0x7f7f817f, 0x81817f81, 0x7f81817f, +0x817f8181, 0x7f81817f, 0x7f7f7f81, 0x7f818181, 0x81817f7f, 0x7f818181, 0x817f817f, 0x817f7f7f, +0x817f7f7f, 0x817f817f, 0x817f7f7f, 0x7f81817f, 0x7f817f81, 0x7f7f8181, 0x817f817f, 0x817f817f, +0x7f81817f, 0x7f817f7f, 0x7f7f817f, 0x81817f81, 0x817f8181, 0x81818181, 0x7f7f817f, 0x81818181, +0x81817f7f, 0x7f818181, 0x7f7f8181, 0x7f7f8181, 0x81818181, 0x7f817f7f, 0x8181817f, 0x8181817f, +0x817f7f7f, 0x817f7f7f, 0x81818181, 0x7f818181, 0x7f817f7f, 0x81817f81, 0x8181817f, 0x817f7f7f, +0x7f7f7f7f, 0x7f7f7f81, 0x7f817f81, 0x7f7f817f, 0x81817f81, 0x7f7f817f, 0x7f818181, 0x7f817f7f, +0x7f81817f, 0x7f7f817f, 0x81818181, 0x7f7f817f, 0x7f7f8181, 0x7f7f7f81, 0x81817f81, 0x817f817f, +0x7f817f81, 0x7f817f7f, 0x8181817f, 0x7f7f7f81, 0x81818181, 0x817f7f7f, 0x81817f7f, 0x7f817f7f, +0x817f7f7f, 0x817f817f, 0x7f817f7f, 0x817f8181, 0x81818181, 0x7f817f7f, 0x81817f81, 0x817f7f7f, +0x817f8181, 0x7f81817f, 0x7f7f8181, 0x7f817f81, 0x81817f7f, 0x7f7f817f, 0x817f7f81, 0x817f817f, +0x7f817f81, 0x817f8181, 0x81817f7f, 0x817f8181, 0x8181817f, 0x7f81817f, 0x81817f7f, 0x7f7f817f, +0x7f81817f, 0x81817f7f, 0x7f818181, 0x817f7f81, 0x8181817f, 0x7f818181, 0x7f7f817f, 0x7f817f7f, +0x7f817f7f, 0x8181817f, 0x7f81817f, 0x81817f81, 0x7f7f7f7f, 0x7f81817f, 0x817f7f7f, 0x817f7f7f, +0x817f817f, 0x7f81817f, 0x7f818181, 0x7f7f7f81, 0x817f7f7f, 0x7f7f7f81, 0x7f7f8181, 0x7f7f817f, +0x7f7f7f81, 0x817f7f81, 0x81817f81, 0x7f7f817f, 0x817f8181, 0x7f7f7f81, 0x7f7f817f, 0x817f817f, +0x817f7f81, 0x817f817f, 0x7f817f7f, 0x7f7f817f, 0x81818181, 0x81817f81, 0x817f8181, 0x7f7f8181, +0x7f7f8181, 0x817f8181, 0x7f7f7f7f, 0x8181817f, 0x7f7f7f7f, 0x7f81817f, 0x81817f81, 0x81817f7f, +0x7f7f8181, 0x8181817f, 0x7f818181, 0x7f817f7f, 0x7f7f817f, 0x7f81817f, 0x7f817f81, 0x7f817f7f, +0x7f7f8181, 0x81818181, 0x7f7f8181, 0x7f7f7f81, 0x817f7f7f, 0x7f7f8181, 0x81818181, 0x7f817f81, +0x81818181, 0x7f818181, 0x7f818181, 0x817f8181, 0x81818181, 0x7f81817f, 0x7f7f8181, 0x7f7f8181, +0x817f7f7f, 0x7f7f7f7f, 0x7f817f81, 0x7f81817f, 0x7f817f7f, 0x817f817f, 0x7f7f7f81, 0x817f7f81, +0x7f818181, 0x8181817f, 0x817f7f81, 0x817f817f, 0x817f8181, 0x7f7f7f81, 0x7f817f7f, 0x81817f81, +0x817f8181, 0x817f8181, 0x7f817f7f, 0x81817f7f, 0x817f7f81, 0x7f817f81, 0x817f7f7f, 0x817f8181, +0x7f817f7f, 0x81817f7f, 0x81817f81, 0x7f817f81, 0x7f81817f, 0x7f7f7f81, 0x7f817f7f, 0x7f7f8181, +0x8181817f, 0x7f7f7f7f, 0x7f7f8181, 0x7f817f7f, 0x817f8181, 0x817f7f81, 0x7f7f7f7f, 0x7f81817f, +0x7f7f8181, 0x817f817f, 0x7f7f7f81, 0x81817f7f, 0x81818181, 0x817f7f81, 0x7f817f7f, 0x7f81817f, +0x8181817f, 0x7f7f817f, 0x817f7f81, 0x81817f81, 0x8181817f, 0x7f7f8181, 0x817f7f81, 0x81817f81, +0x817f8181, 0x817f8181, 0x817f817f, 0x817f8181, 0x817f7f81, 0x7f7f7f7f, 0x7f7f8181, 0x817f817f, +0x7f817f7f, 0x817f7f81, 0x7f81817f, 0x81818181, 0x7f7f7f81, 0x7f818181, 0x7f7f8181, 0x81817f7f, +0x817f7f81, 0x8181817f, 0x7f817f81, 0x7f7f7f7f, 0x7f817f7f, 0x7f818181, 0x8181817f, 0x817f7f81, +0x817f7f7f, 0x7f817f81, 0x7f7f8181, 0x817f7f81, 0x817f7f7f, 0x817f8181, 0x7f817f81, 0x81817f7f, +0x817f817f, 0x81817f81, 0x81817f7f, 0x8181817f, 0x817f8181, 0x817f7f7f, 0x81817f7f, 0x81817f81, +0x817f7f81, 0x81818181, 0x81817f81, 0x7f817f7f, 0x7f817f7f, 0x8181817f, 0x7f818181, 0x7f7f7f7f, +0x7f817f81, 0x81817f81, 0x7f7f817f, 0x817f7f81, 0x7f7f7f81, 0x7f818181, 0x7f7f7f7f, 0x7f817f7f, +0x7f7f817f, 0x817f7f7f, 0x7f7f817f, 0x8181817f, 0x7f818181, 0x7f7f7f7f, 0x81817f7f, 0x7f81817f, +0x817f7f7f, 0x7f7f7f7f, 0x7f81817f, 0x817f7f7f, 0x817f817f, 0x7f7f7f81, 0x81817f81, 0x817f7f7f, +0x817f7f81, 0x81817f7f, 0x7f7f7f7f, 0x81818181, 0x81817f7f, 0x7f7f7f81, 0x81817f7f, 0x7f7f7f81, +0x7f817f81, 0x817f7f7f, 0x7f817f7f, 0x7f81817f, 0x7f817f7f, 0x817f817f, 0x817f817f, 0x8181817f, +0x817f8181, 0x81818181, 0x817f817f, 0x7f7f8181, 0x7f817f7f, 0x7f817f81, 0x817f7f7f, 0x7f7f8181, +0x7f817f81, 0x81817f81, 0x817f817f, 0x7f818181, 0x7f7f7f81, 0x7f7f8181, 0x7f81817f, 0x8181817f, +0x7f7f7f7f, 0x817f8181, 0x7f7f7f7f, 0x81817f81, 0x8181817f, 0x7f7f817f, 0x8181817f, 0x7f7f7f7f, +0x7f817f7f, 0x7f81817f, 0x817f7f7f, 0x81817f7f, 0x7f7f7f7f, 0x81817f81, 0x81817f81, 0x7f81817f, +0x7f7f7f81, 0x81817f81, 0x817f817f, 0x7f7f7f7f, 0x8181817f, 0x7f817f7f, 0x7f7f7f81, 0x7f817f7f, +0x817f8181, 0x7f7f7f81, 0x7f81817f, 0x817f8181, 0x7f7f8181, 0x7f817f81, 0x8181817f, 0x81818181, +0x7f7f8181, 0x817f817f, 0x817f7f81, 0x7f817f7f, 0x7f818181, 0x81818181, 0x7f817f81, 0x817f7f81, +0x817f817f, 0x81817f7f, 0x81817f81, 0x817f7f7f, 0x7f7f7f81, 0x7f81817f, 0x7f7f8181, 0x7f7f817f, +0x7f7f7f7f, 0x7f817f7f, 0x7f817f7f, 0x817f8181, 0x7f7f7f81, 0x8181817f, 0x817f8181, 0x7f7f7f7f, +0x81817f81, 0x817f817f, 0x81818181, 0x7f817f7f, 0x817f817f, 0x817f817f, 0x81817f7f, 0x7f7f7f81, +0x7f7f7f81, 0x81817f7f, 0x7f817f7f, 0x817f8181, 0x81817f7f, 0x81817f7f, 0x817f8181, 0x8181817f, +0x7f81817f, 0x7f81817f, 0x817f7f81, 0x817f817f, 0x7f7f8181, 0x8181817f, 0x7f817f81, 0x817f817f, +0x7f818181, 0x81818181, 0x7f7f7f7f, 0x817f8181, 0x7f817f7f, 0x7f7f817f, 0x7f7f7f81, 0x7f7f7f81, +0x817f817f, 0x817f817f, 0x81818181, 0x81818181, 0x817f7f81, 0x7f81817f, 0x817f8181, 0x7f7f817f, +0x817f8181, 0x7f7f7f81, 0x7f818181, 0x817f7f7f, 0x817f7f81, 0x817f8181, 0x817f817f, 0x817f817f, +0x7f817f81, 0x817f7f7f, 0x81817f7f, 0x7f818181, 0x7f7f817f, 0x817f7f81, 0x817f7f81, 0x817f8181, +0x7f7f817f, 0x8181817f, 0x8181817f, 0x7f7f817f, 0x81817f81, 0x7f7f7f7f, 0x7f81817f, 0x8181817f, +0x7f7f817f, 0x7f7f8181, 0x8181817f, 0x817f817f, 0x7f817f81, 0x7f7f8181, 0x7f7f7f7f, 0x7f7f7f81, +0x81817f81, 0x81818181, 0x7f7f7f81, 0x7f817f81, 0x817f7f7f, 0x7f81817f, 0x81817f7f, 0x7f817f81, +0x7f818181, 0x7f7f7f81, 0x8181817f, 0x817f8181, 0x817f817f, 0x817f817f, 0x7f7f7f7f, 0x8181817f, +0x7f81817f, 0x81818181, 0x7f7f8181, 0x817f7f7f, 0x81817f81, 0x817f817f, 0x817f7f81, 0x81818181 + +output0 = +0xfb26769b, 0xc79ba708, 0xf8635f11, 0xd7e4cfa4, 0xe3c5e7d7, 0xc02d1876, 0xe718a692, 0x09395387, +0x9b38d4ad, 0x2cb9b3e9, 0xa975b0e1, 0x330bcede, 0x7b7550e4, 0x1f120789, 0x719ec767, 0x84e65e6f, +0x8067338a, 0x2f38b6a5, 0xe1100cdc, 0x4129350a, 0xf42f39a8, 0x41ae51c4, 0xa916952f, 0xab6d7503, +0xd0359b04, 0x97be8694, 0xee8effbe, 0x79b093ec, 0x57122f74, 0x73037ee7, 0x395a2f52, 0x73caae6b, +0xc3eff955, 0xf9f1d126, 0x02432290, 0x7295881a, 0xdd24b3a4, 0x7b3473eb, 0x9d1dcbef, 0x3c990bfb, +0xf280623b, 0x20c84e3b, 0x144c6d3a, 0x8ec60a92, 0x09737fc3, 0xeb399fd3, 0xfe46efae, 0x8bca3001, +0x78ade416, 0xb84aea12, 0x43ca2a9e, 0x15fe0d33, 0xd7c16a39, 0xc42a34e8, 0x58df1eaa, 0xa4c437b8, +0x155c3a34, 0xb76ffb85, 0x83762da1, 0x7a114abf, 0xa28f5f9a, 0xc5ea01a2, 0x2701d947, 0xf16083f2, +0x3800ccfd, 0x9c7a9a6f, 0xf65e474d, 0xb143759a, 0xdaaac55c, 0x29950c88, 0xa47976ba, 0xe8335a4f, +0x6a858152, 0x25a3a9f9, 0xc42def6b, 0x07a3ffe4, 0xeb949edb, 0x767e93a2, 0xe58b7e91, 0x02b0ceec, +0x4a519ff0, 0x33091006, 0xa5300a4a, 0x2bcd45f6, 0xb83b264d, 0x22336f72, 0xa555c8d1, 0xeb4aa02c, +0x700dd4a9, 0x6b8fc1e6, 0xd44ce0f3, 0xbb66e520, 0xbdb17016, 0xbebb013c, 0xe2a05d9a, 0x516f5605, +0xac27f407, 0xbd05f488, 0x2ef5e8c2, 0x23a62cf8, 0x50f2f8a9, 0x45d6bda3, 0x9b6efd5a, 0x77cdc34b, +0xb466da5a, 0x98b948f0, 0xb345dd43, 0x52ee8fdf, 0xc0596488, 0x73fab111, 0xf88a77d7, 0x36952151, +0xe5c88df4, 0x05e4e05a, 0xfd68dff8, 0x33ce03ce, 0x181d38da, 0x1bd14663, 0xf3b0e86a, 0xb1d7900d, +0x52165396, 0xa54e79ef, 0xbf1cda0d, 0xad1f7a2a, 0xebf4db32, 0xf049cd5d, 0xdcbe865f, 0xa1c31f6d, +0xeba00e1d, 0xde8e2a87, 0x5e9c15de, 0x02ec68bd, 0xaad1a964, 0x95d3bd1c, 0xf7e7048d, 0x4e2c6243, +0x7e675787, 0xd9811021, 0xec5c7341, 0x98d304da, 0xe68ea509, 0x6318d315, 0xe3570ce2, 0x594c4fad, +0x840f01f5, 0xa9a2e403, 0x8e651529, 0x72c70e44, 0x9402e2f4, 0x9e1cd395, 0x890701ca, 0xe804887a, +0xd209cae4, 0x0c344a3d, 0x8926ca86, 0x0f6debfa, 0x83323654, 0xd0d12b75, 0x7d73888c, 0xf95ce546, +0x0b4fe312, 0x2582b52d, 0xcf10f7ff, 0x7bf385f5, 0x57dcaf9f, 0xcbb60aef, 0x64711e8f, 0x923571ec, +0xfd90c78e, 0x85099f54, 0x63ae3fdf, 0xc683a0b3, 0x591e8102, 0xb6180e2d, 0x35ae7560, 0x94a4a536, +0x97defd69, 0x92afc0b4, 0xebce8cf4, 0x4d2fc035, 0x9057a972, 0x30e204a6, 0xc5af64e8, 0x6c7fa059, +0x40f043e6, 0xdcd8bc3f, 0x5bb3962b, 0xf0f1a38d, 0x99b2893e, 0xf77257c4, 0x60c59a02, 0xaedcaff2, +0xe5a852c1, 0xea67ccb9, 0x150acbb7, 0xea2cb0bc, 0xfa64f623, 0x0d37fe47, 0x81643457, 0x3dcf1a62, +0x5c6c4066, 0x66bdc50d, 0x20e45b88, 0x9746424f + +basegraph= +1 + +z_c= +320 + +n_cb= +16000 + +q_m= +8 + +n_filler= +488 + +ea = +8448 + +eb = +8448 + +iter_max= +8 + +expected_iter_count= +2 + +c = +1 + +r = +0 + +cab = +1 + +rv_index = +0 + +en_scramble = +1 + +q = +0 + +n_id = +323 + +n_rnti = +2300 + +code_block_mode = +0 + +op_flags = +RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP + +expected_status = +OK
app/test-bbdev/test_vectors/ldpc_enc_tb.data new file +482 -0
482 lines not on this page · raw message
Signature · 1 line
2.17.1
v3 cover baseband: add NXP LA12xx driver
In reply to Hemant AgrawalThis 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.
Modifications has been done in test vectors to optionally support input 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
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 baseband/la12xx: add documentation support
Nipun Gupta (2):
app/bbdev: add parameter to take input in network order app/bbdev: add test vectors for transport blocks
MAINTAINERS | 9 + app/test-bbdev/test_bbdev_vector.c | 18 +- app/test-bbdev/test_bbdev_vector.h | 2 + app/test-bbdev/test_vectors/ldpc_dec_tb.data | 362 +++++ app/test-bbdev/test_vectors/ldpc_enc_tb.data | 482 +++++++ doc/guides/bbdevs/features/la12xx.ini | 14 + doc/guides/bbdevs/index.rst | 1 + doc/guides/bbdevs/la12xx.rst | 139 ++ doc/guides/rel_notes/release_21_05.rst | 5 + drivers/baseband/la12xx/bbdev_la12xx.c | 1178 +++++++++++++++++ drivers/baseband/la12xx/bbdev_la12xx.h | 57 + drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 237 ++++ .../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 38 + drivers/baseband/la12xx/meson.build | 6 + drivers/baseband/la12xx/version.map | 3 + drivers/baseband/meson.build | 2 +- 16 files changed, 2550 insertions(+), 3 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
Signature · 1 line
2.17.1
PATCH v3 1/8 baseband: introduce NXP LA12xx driver
This patch introduce the baseband device drivers for NXP's LA1200 series software defined baseband modem.
--- drivers/baseband/la12xx/bbdev_la12xx.c | 109 ++++++++++++++++++ .../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 38 ++++++ drivers/baseband/la12xx/meson.build | 6 + drivers/baseband/la12xx/version.map | 3 + drivers/baseband/meson.build | 2 +- 5 files changed, 157 insertions(+), 1 deletion(-) 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
drivers/baseband/la12xx/bbdev_la12xx.c new file +109 -0
@@ -0,0 +1,109 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2020-2021 NXP +*/ + +#include <string.h> + +#include <rte_common.h> +#include <rte_bus_vdev.h> +#include <rte_malloc.h> +#include <rte_ring.h> +#include <rte_kvargs.h> + +#include <rte_bbdev.h> +#include <rte_bbdev_pmd.h> + +#include <bbdev_la12xx_pmd_logs.h> + +#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);
drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h new file +38 -0
@@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2020 NXP +*/ + +#ifndef _BBDEV_LA12XX_PMD_LOGS_H_ +#define _BBDEV_LA12XX_PMD_LOGS_H_ + +#define BBDEV_LA12XX_PMD_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, bbdev_la12xx_logtype, "bbdev_la12xx: " \ + fmt "\n", ##args) + +#define BBDEV_LA12XX_PMD_DEBUG(fmt, args...) \ + rte_log(RTE_LOG_DEBUG, bbdev_la12xx_logtype, "bbdev_la12xx: %s(): "\ + fmt "\n", __func__, ##args) + +#define PMD_INIT_FUNC_TRACE () BBDEV_LA12XX_PMD_DEBUG(">>") + +#define BBDEV_LA12XX_PMD_CRIT(fmt, args...) \ + BBDEV_LA12XX_PMD_LOG(CRIT, fmt, ## args) +#define BBDEV_LA12XX_PMD_INFO(fmt, args...) \ + BBDEV_LA12XX_PMD_LOG(INFO, fmt, ## args) +#define BBDEV_LA12XX_PMD_ERR(fmt, args...) \ + BBDEV_LA12XX_PMD_LOG(ERR, fmt, ## args) +#define BBDEV_LA12XX_PMD_WARN(fmt, args...) \ + BBDEV_LA12XX_PMD_LOG(WARNING, fmt, ## args) + +/* DP Logs, toggled out at compile time if level lower than current level */ +#define BBDEV_LA12XX_PMD_DP_LOG(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, fmt, ## args) + +#define BBDEV_LA12XX_PMD_DP_DEBUG(fmt, args...) \ + BBDEV_LA12XX_PMD_DP_LOG(DEBUG, fmt, ## args) +#define BBDEV_LA12XX_PMD_DP_INFO(fmt, args...) \ + BBDEV_LA12XX_PMD_DP_LOG(INFO, fmt, ## args) +#define BBDEV_LA12XX_PMD_DP_WARN(fmt, args...) \ + BBDEV_LA12XX_PMD_DP_LOG(WARNING, fmt, ## args) + +#endif /* _BBDEV_LA12XX_PMD_LOGS_H_ */
drivers/baseband/la12xx/meson.build new file +6 -0
@@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2020-2021 NXP + +deps += ['bbdev', 'bus_vdev', 'ring'] + +sources = files('bbdev_la12xx.c')
drivers/baseband/la12xx/version.map new file +3 -0
@@ -0,0 +1,3 @@ +DPDK_21 { + local: *; +};
drivers/baseband/meson.build +1 -1
@@ -5,4 +5,4 @@ if is_windows subdir_done() endif -drivers = ['null', 'turbo_sw', 'fpga_lte_fec', 'fpga_5gnr_fec', 'acc100'] +drivers = ['null', 'turbo_sw', 'fpga_lte_fec', 'fpga_5gnr_fec', 'acc100', 'la12xx']
Signature · 1 line
2.17.1
v4 cover 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.
Hemant Agrawal (7):
bbdev: add network order data capability
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 (1):
app/bbdev: add test vectors for transport blocks
app/test-bbdev/meson.build | 3 + 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_05.rst | 5 + drivers/baseband/la12xx/bbdev_la12xx.c | 1099 +++++++++++++++++ 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 | 8 +- 17 files changed, 1775 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
Signature · 1 line
2.17.1
PATCH v4 1/8 bbdev: add network order data capability
This patch intoduces a new capability of the bbdev device to process the LDPC data in network byte order.
--- doc/guides/bbdevs/features/default.ini | 1 + doc/guides/prog_guide/bbdev.rst | 6 ++++++ lib/bbdev/rte_bbdev_op.h | 8 ++++++-- 3 files changed, 13 insertions(+), 2 deletions(-)
doc/guides/bbdevs/features/default.ini +1 -0
@@ -14,3 +14,4 @@ LLR/HARQ Compression = External DDR Access = HW Accelerated = BBDEV API = +Network Order Data =
doc/guides/prog_guide/bbdev.rst +6 -0
@@ -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_NETWORK_ORDER | +| Set if a device supports network order 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_NETWORK_ORDER | +| Set if a device supports network order 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.
lib/bbdev/rte_bbdev_op.h +6 -2
@@ -186,7 +186,9 @@ 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 network order data processing */ + RTE_BBDEV_LDPC_DEC_NETWORK_ORDER = (1ULL << 19) };/** Flags for LDPC encoder operation and capability structure */
@@ -206,7 +208,9 @@ 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 network order data processing */ + RTE_BBDEV_LDPC_ENC_NETWORK_ORDER = (1ULL << 8) };/** Flags for the Code Block/Transport block mode */
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v4 1/8] bbdev: add network order data capability
+ Thomas, Akhil
In case this is for release 21.05 isn't it a bit late for introducing a new API change?
Quoted 34 lines
-----Original Message-----
From: Hemant Agrawal <[email protected]>
Sent: Saturday, April 24, 2021 3:37 AM
To: [email protected]; [email protected]; Chautru, Nicolas <[email protected]>
Cc: [email protected]; Hemant Agrawal <[email protected]>
Subject: [PATCH v4 1/8] bbdev: add network order data capabilityThis patch intoduces a new capability of the bbdev device to process the LDPC data in network byte order.
Signed-off-by Hemant Agrawal <[email protected]>--- doc/guides/bbdevs/features/default.ini | 1 + doc/guides/prog_guide/bbdev.rst | 6 ++++++ lib/bbdev/rte_bbdev_op.h | 8 ++++++-- 3 files changed, 13 insertions(+), 2 deletions(-)doc/guides/bbdevs/features/default.ini +1
-0@@ -14,3 +14,4 @@ LLR/HARQ Compression = External DDR Access = HW Accelerated = BBDEV API = +Network Order Data =(quoted diff) +0
-0
b/doc/guides/prog_guide/bbdev.rstindex6b2bd54e1a..89a86d10fb100644
doc/guides/prog_guide/bbdev.rst given below. · line 751
Quoted 6 lines
doc/guides/prog_guide/bbdev.rst +3
-1@@ -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_NETWORK_ORDER | +| Set if a device supports network order data processing | ++--------------------------------------------------------------------+
I don't believe this is an extra capability extension per se here, but actually a different assumption. Tell me if I misinterpret the intent of your serie.
From looking at the PMD I assume that you may mean " Set when a device requires network order data processing"
Basically the distinction I am trying to highlight is that it depends whether we want to expose this as an incremental dynamic operation flag that you can set at run time (enqueue ...), or whether this is more of distinct assumption that may be different for each PMD (either one of the other).
I assume this is the later, please confirm. Ie I assume that your PMD would not be able to process the data in case this is presented with other endianness (ie you don't check ever that flag in the op_flag in your driver), in that case your driver would fail many existing unit test if considered as an additional capability on top of default one. You probably see such failures if you have tried to run the regression which would confirm the issue. In that case we may want discuss whether this is not actually more something to be capture under struct rte_bbdev_driver_info as a bool endianness. Both arguably may work but later arguably closer to the suggested intent and less convoluted. Worth discussing further/
But basically if as this under that structure that would be exposed the same way as different LLR numerical assumption and that can be handled gracefulyl in the application/bbdev-test.
+ Tom Rix, Dave Burley
Quoted 44 lines
doc/guides/prog_guide/bbdev.rst +0
-0The structure passed for each LDPC encode operation is given below, withthe operation flags forming a bitmask in the ``op_flags`` field.
doc/guides/prog_guide/bbdev.rst +3
-0@@ -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_NETWORK_ORDER | +| Set if a device supports network order data processing | ++--------------------------------------------------------------------+ The structure passed for each LDPC decode operation is given below, withthe operation flags forming a bitmask in the ``op_flags`` field.
lib/bbdev/rte_bbdev_op.h index renamed from lib/bbdev/rte_bbdev_op.h +0
-0
f946842727..8fab617768100644lib/bbdev/rte_bbdev_op.h +3
-1@@ -186,7 +186,9 @@ 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 network order data processing */ +RTE_BBDEV_LDPC_DEC_NETWORK_ORDER = (1ULL <<19 ) };/** Flags for LDPC encoder operation and capability structure */ @@ -206,7
+208,9 @@ enumrte_bbdev_op_ldpcenc_flag_bitmasks{lib/bbdev/rte_bbdev_op.h +0
-0/** 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 */
lib/bbdev/rte_bbdev_op.h +3
-2-RTE_BBDEV_LDPC_ENC_CONCATENATION = (1ULL <<7 ) +RTE_BBDEV_LDPC_ENC_CONCATENATION = (1ULL <<7 ), +/** Set if a device supports network order data processing */ + RTE_BBDEV_LDPC_ENC_NETWORK_ORDER = (1ULL << 8) };/** Flags for the Code Block/Transport block mode */ --2.17.1
Re: [dpdk-dev] [PATCH v4 1/8] bbdev: add network order data capability
Sam 24 avr 2021, à 23:59, Chautru, Nicolas a écrit :
Quoted 4 lines
+ Thomas, Akhil
In case this is for release 21.05 isn't it a bit late for introducing a new API change?
Yes API change should be in -rc1.
Of course there is a bit of flexibility if you are sure an exception can be done without hurting other drivers, testing, etc.
Re: [dpdk-dev] [PATCH v4 1/8] bbdev: add network order data capability
In reply to Hemant AgrawalHi Hemant
Can I ask what the usage case is for RTE_BBDEV_LDPC_ENC_NETWORK_ORDER/RTE_BBDEV_LDPC_DEC_NETWORK_ORDER ?
Thanks
Dave
________________________________
From: dev <[email protected]> on behalf of Hemant Agrawal <[email protected]>
Sent: 24 April 2021 11:36
To: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; Hemant Agrawal <[email protected]>
Subject: [dpdk-dev] [PATCH v4 1/8] bbdev: add network order data capability
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
This patch intoduces a new capability of the bbdev device to process the LDPC data in network byte order.
--- doc/guides/bbdevs/features/default.ini | 1 + doc/guides/prog_guide/bbdev.rst | 6 ++++++ lib/bbdev/rte_bbdev_op.h | 8 ++++++-- 3 files changed, 13 insertions(+), 2 deletions(-)
doc/guides/bbdevs/features/default.ini +1 -0
@@ -14,3 +14,4 @@ LLR/HARQ Compression = External DDR Access = HW Accelerated = BBDEV API = +Network Order Data =
doc/guides/prog_guide/bbdev.rst +6 -0
@@ -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_NETWORK_ORDER | +| Set if a device supports network order 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_NETWORK_ORDER | +| Set if a device supports network order 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.
lib/bbdev/rte_bbdev_op.h +6 -2
@@ -186,7 +186,9 @@ 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 network order data processing */ + RTE_BBDEV_LDPC_DEC_NETWORK_ORDER = (1ULL << 19) };/** Flags for LDPC encoder operation and capability structure */
@@ -206,7 +208,9 @@ 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 network order data processing */ + RTE_BBDEV_LDPC_ENC_NETWORK_ORDER = (1ULL << 8) };/** Flags for the Code Block/Transport block mode */
--
2.17.1
Re: [dpdk-dev] [PATCH v4 1/8] bbdev: add network order data capability
Hi Dave,
If we go back to the data providing source i.e. FAPI interface, it is implementation specific. As per SCF222:
Our customers do use BE data in network and at FAPI interface.
In LA12xx, at present, we use u8 Big-endian data for processing to FECA engine. We do see that other drivers in DPDK are using Little Endian *(with u32 data)* but standards is open for both.
Regards,
Hemant
Quoted 91 lines · Dave Burley
Hi Hemant
Can I ask what the usage case is for RTE_BBDEV_LDPC_ENC_NETWORK_ORDER/RTE_BBDEV_LDPC_DEC_NETWORK_ORDER ?
Thanks
Dave
________________________________
From: dev <[email protected]> on behalf of Hemant Agrawal <[email protected]>
Sent: 24 April 2021 11:36
To: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; Hemant Agrawal <[email protected]>
Subject: [dpdk-dev] [PATCH v4 1/8] bbdev: add network order data capabilityCAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
This patch intoduces a new capability of the bbdev device to process the LDPC data in network byte order.
Signed-off-by Hemant Agrawal <[email protected]>--- doc/guides/bbdevs/features/default.ini | 1 + doc/guides/prog_guide/bbdev.rst | 6 ++++++ lib/bbdev/rte_bbdev_op.h | 8 ++++++-- 3 files changed, 13 insertions(+), 2 deletions(-)doc/guides/bbdevs/features/default.ini +1
-0@@ -14,3 +14,4 @@ LLR/HARQ Compression = External DDR Access = HW Accelerated = BBDEV API = +Network Order Data =doc/guides/prog_guide/bbdev.rst +6
-0@@ -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_NETWORK_ORDER | +| Set if a device supports network order 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_NETWORK_ORDER | +| Set if a device supports network order 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.lib/bbdev/rte_bbdev_op.h +6
-3@@ -186,7 +186,9 @@ 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 network order data processing */ + RTE_BBDEV_LDPC_DEC_NETWORK_ORDER = (1ULL << 19) };/** Flags for LDPC encoder operation and capability structure */ @@ -206,7 +208,9 @@ 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 network order data processing */ + RTE_BBDEV_LDPC_ENC_NETWORK_ORDER = (1ULL << 8) };/** Flags for the Code Block/Transport block mode */ --2.17.1
Re: [dpdk-dev] [PATCH v4 1/8] bbdev: add network order data capability
In reply to Dave BurleyHi,
My mail with photo snippets were rejected by dpdk mailing list. So, just sending the summary of it.
My understanding is that in ORAN, typically network order is used between CU-DU or DU-RU communication. In FAPI interface as well, both LE and BE are allowed types, however few places do explicitly state BE type.
Our customers/partners are typically using BE and LA12xx is configured to process BE data.
Regards,
Hemant
Quoted 91 lines · Dave Burley
Hi Hemant
Can I ask what the usage case is for RTE_BBDEV_LDPC_ENC_NETWORK_ORDER/RTE_BBDEV_LDPC_DEC_NETWORK_ORDER ?
Thanks
Dave
________________________________
From: dev <[email protected]> on behalf of Hemant Agrawal <[email protected]>
Sent: 24 April 2021 11:36
To: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; Hemant Agrawal <[email protected]>
Subject: [dpdk-dev] [PATCH v4 1/8] bbdev: add network order data capabilityCAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
This patch intoduces a new capability of the bbdev device to process the LDPC data in network byte order.
Signed-off-by Hemant Agrawal <[email protected]>--- doc/guides/bbdevs/features/default.ini | 1 + doc/guides/prog_guide/bbdev.rst | 6 ++++++ lib/bbdev/rte_bbdev_op.h | 8 ++++++-- 3 files changed, 13 insertions(+), 2 deletions(-)doc/guides/bbdevs/features/default.ini +1
-0@@ -14,3 +14,4 @@ LLR/HARQ Compression = External DDR Access = HW Accelerated = BBDEV API = +Network Order Data =doc/guides/prog_guide/bbdev.rst +6
-0@@ -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_NETWORK_ORDER | +| Set if a device supports network order 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_NETWORK_ORDER | +| Set if a device supports network order 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.lib/bbdev/rte_bbdev_op.h +6
-3@@ -186,7 +186,9 @@ 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 network order data processing */ + RTE_BBDEV_LDPC_DEC_NETWORK_ORDER = (1ULL << 19) };/** Flags for LDPC encoder operation and capability structure */ @@ -206,7 +208,9 @@ 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 network order data processing */ + RTE_BBDEV_LDPC_ENC_NETWORK_ORDER = (1ULL << 8) };/** Flags for the Code Block/Transport block mode */ --2.17.1
Re: [dpdk-dev] [PATCH v4 1/8] bbdev: add network order data capability
Hi Hemant,
As mentioned earlier I have no problem adding such an option in the API, but that would still be a late API change (arguably too tight for 21.05 so that everyone has time to comment back).
Based on description below this should not be an operation specific flag (again see my previous comment, not dynamic nor tied to operation type).
This can be done by adding a bool big_endianess to the struct rte_bbdev_driver_info as suggested earlier. This would be set in each PMD accordingly to their expectation/design. This can be used then in bbdev-test and application to ensure the data is present with the correct assumption. Any concern with that approach? Please check that you can run successfully the existing unit-test with such a set of changes for your device.
Nic
Quoted 135 lines
-----Original Message-----
From: Hemant Agrawal <[email protected]>
Sent: Wednesday, April 28, 2021 6:35 AM
To: Dave Burley <[email protected]>; Hemant Agrawal <[email protected]>; [email protected]; [email protected]; Chautru, Nicolas <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v4 1/8] bbdev: add network order data capabilityHi,
My mail with photo snippets were rejected by dpdk mailing list. So, just
sending the summary of it.My understanding is that in ORAN, typically network order is used
between CU-DU or DU-RU communication. In FAPI interface as well, both LE and BE are allowed types, however few places do explicitly state BE type.Our customers/partners are typically using BE and LA12xx is configured to
process BE data.Regards,
Hemant
Quoted 3 lines · Dave Burley
Hi Hemant
Can I ask what the usage case is for
RTE_BBDEV_LDPC_ENC_NETWORK_ORDER/RTE_BBDEV_LDPC_DEC_NETWO
RK_ORDER?Quoted 7 lines
Thanks
Dave
Quoted 8 lines
________________________________
From: dev <[email protected]> on behalf of Hemant Agrawal <[email protected]>
Sent: 24 April 2021 11:36
To: [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Cc: [email protected] <[email protected]>;Hemant
Quoted 5 lines
Agrawal <[email protected]>
Subject: [dpdk-dev] [PATCH v4 1/8] bbdev: add network order data capabilityCAUTION: This email originated from outside of the organization. Do not
click links or open attachments unless you recognize the sender and know the content is safe.
Quoted 22 lines
This patch intoduces a new capability of the bbdev device to process the LDPC data in network byte order.
Signed-off-by Hemant Agrawal <[email protected]>--- doc/guides/bbdevs/features/default.ini | 1 + doc/guides/prog_guide/bbdev.rst | 6 ++++++ lib/bbdev/rte_bbdev_op.h | 8 ++++++-- 3 files changed, 13 insertions(+), 2 deletions(-)doc/guides/bbdevs/features/default.ini +1
-0@@ -14,3 +14,4 @@ LLR/HARQ Compression = External DDR Access = HW Accelerated = BBDEV API = +Network Order Data =(quoted diff) +0
-0Quoted 1 line
b/doc/guides/prog_guide/bbdev.rstindex6b2bd54e1a..89a86d10fb100644
Quoted 29 lines
doc/guides/prog_guide/bbdev.rst +8
-0@@ -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_NETWORK_ORDER | +| Set if a device supports network order 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_NETWORK_ORDER | +| Set if a device supports network order 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.lib/bbdev/rte_bbdev_op.h index renamed from lib/bbdev/rte_bbdev_op.h +0
-0
f946842727..8fab617768100644lib/bbdev/rte_bbdev_op.h enum rte_bbdev_op_ldpcdec_flag_bitmasks { · line 189
Quoted 5 lines
lib/bbdev/rte_bbdev_op.h +1
-1@@ -186,7 +186,9 @@ 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),
lib/bbdev/rte_bbdev_op.h enum rte_bbdev_op_ldpcdec_flag_bitmasks {
Quoted 9 lines
lib/bbdev/rte_bbdev_op.h +2
-1+/** Set if a device supports network order data processing */ +RTE_BBDEV_LDPC_DEC_NETWORK_ORDER = (1ULL <<19 ) }; /** Flags for LDPC encoder operation and capability structure */ @@ -206,7 +208,9 @@ 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 */
Quoted 10 lines
lib/bbdev/rte_bbdev_op.h +3
-2-RTE_BBDEV_LDPC_ENC_CONCATENATION = (1ULL <<7 ) +RTE_BBDEV_LDPC_ENC_CONCATENATION = (1ULL <<7 ), +/** Set if a device supports network order data processing */ + RTE_BBDEV_LDPC_ENC_NETWORK_ORDER = (1ULL << 8) };/** Flags for the Code Block/Transport block mode */ --2.17.1
PATCH v4 2/8 baseband: introduce NXP LA12xx driver
In reply to Hemant AgrawalThis patch introduce the baseband device drivers for NXP's LA1200 series software defined baseband modem.
--- 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 + 5 files changed, 145 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
drivers/baseband/la12xx/bbdev_la12xx.c new file +109 -0
@@ -0,0 +1,109 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2020-2021 NXP +*/ + +#include <string.h> + +#include <rte_common.h> +#include <rte_bus_vdev.h> +#include <rte_malloc.h> +#include <rte_ring.h> +#include <rte_kvargs.h> + +#include <rte_bbdev.h> +#include <rte_bbdev_pmd.h> + +#include <bbdev_la12xx_pmd_logs.h> + +#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);
drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h new file +26 -0
@@ -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, ## args) + +#endif /* _BBDEV_LA12XX_PMD_LOGS_H_ */
drivers/baseband/la12xx/meson.build new file +6 -0
@@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2020-2021 NXP + +deps += ['bbdev', 'bus_vdev', 'ring'] + +sources = files('bbdev_la12xx.c')
drivers/baseband/la12xx/version.map new file +3 -0
@@ -0,0 +1,3 @@ +DPDK_21 { + local: *; +};
drivers/baseband/meson.build +1 -0
@@ -11,4 +11,5 @@ drivers = [ 'fpga_lte_fec', 'null', 'turbo_sw', + 'la12xx', ]
Signature · 1 line
2.17.1
PATCH v4 3/8 baseband/la12xx: add devargs for max queues
In reply to Hemant AgrawalThis patch adds dev args to take max queues as input
--- drivers/baseband/la12xx/bbdev_la12xx.c | 72 +++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 2 deletions(-)
drivers/baseband/la12xx/bbdev_la12xx.c +70 -2
@@ -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 "=<int>" );
Signature · 1 line
2.17.1
PATCH v4 4/8 baseband/la12xx: add support for multiple modems
In reply to Hemant AgrawalThis patch add support for multiple modems by assigning a modem id as dev args in vdev creation.
--- 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
drivers/baseband/la12xx/bbdev_la12xx.c +57 -7
@@ -14,6 +14,8 @@#include <rte_bbdev_pmd.h> #include <bbdev_la12xx_pmd_logs.h> +#include <bbdev_la12xx_ipc.h> +#include <bbdev_la12xx.h> #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 4static 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 "=<int>" ); +LA12XX_MAX_NB_QUEUES_ARG "=<int>" +LA12XX_VDEV_MODEM_ID_ARG "=<int> " );
drivers/baseband/la12xx/bbdev_la12xx.h new file +56 -0
56 lines not on this page · raw message
drivers/baseband/la12xx/bbdev_la12xx_ipc.h new file +20 -0
@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2020-2021 NXP +*/ +#ifndef __BBDEV_LA12XX_IPC_H__ +#define __BBDEV_LA12XX_IPC_H__ + +/** No. of max channel per instance */ +#define IPC_MAX_DEPTH (16) + +/* This shared memory would be on the host side which have copy of some +* of the parameters which are also part of Shared BD ring. Read access +* of these parameters from the host side would not be over PCI. +*/ +typedef struct host_ipc_params { +volatile uint32_t pi; +volatile uint32_t ci; +volatile uint32_t modem_ptr[IPC_MAX_DEPTH ]; +} __rte_packed host_ipc_params_t; + +#endif
Signature · 1 line
2.17.1
PATCH v4 5/8 baseband/la12xx: add queue and modem config support
In reply to Hemant AgrawalThis patch add support for connecting with modem
and creating the ipc channel as queues with modem
for the exchange of data.
--- doc/guides/bbdevs/index.rst | 1 + doc/guides/bbdevs/la12xx.rst | 81 +++ doc/guides/rel_notes/release_21_05.rst | 5 + drivers/baseband/la12xx/bbdev_la12xx.c | 552 ++++++++++++++++++++- drivers/baseband/la12xx/bbdev_la12xx.h | 11 +- drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 189 ++++++- 6 files changed, 829 insertions(+), 10 deletions(-) create mode 100644 doc/guides/bbdevs/la12xx.rst
doc/guides/bbdevs/index.rst +1 -0
@@ -14,3 +14,4 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 + la12xx
doc/guides/bbdevs/la12xx.rst new file +81 -0
81 lines not on this page · raw message
doc/guides/rel_notes/release_21_05.rst +5 -0
@@ -236,6 +236,11 @@ New Features the hash function used in NICs to spread the traffic among the queues. It can be used to get predictable mapping of the flows. +* **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. + * **Updated testpmd.** * Added a command line option to configure forced speed for Ethernet port.
drivers/baseband/la12xx/bbdev_la12xx.c +551 -1
581 lines not on this page · raw message
drivers/baseband/la12xx/bbdev_la12xx.h +3 -8
@@ -5,16 +5,10 @@ #ifndef __BBDEV_LA12XX_H__ #define __BBDEV_LA12XX_H__ -#define BBDEV_IPC_ENC_OP_TYPE 1 -#define BBDEV_IPC_DEC_OP_TYPE 2 - -#define MAX_LDPC_ENC_FECA_QUEUES 4 -#define MAX_LDPC_DEC_FECA_QUEUES 4 - #define MAX_CHANNEL_DEPTH 16 /* private data structure */ struct bbdev_la12xx_private { - void *ipc_priv; + ipc_userspace_t *ipc_priv; uint8_t num_valid_queues; uint8_t max_nb_queues; uint8_t num_ldpc_enc_queues;
@@ -52,5 +46,6 @@ struct bbdev_la12xx_q_priv {#define lower_32_bits (x) ((uint32_t)((uint64_t)x))#define upper_32_bits (x) ((uint32_t)(((uint64_t)(x) >> 16) >> 16)) - +#define join_32_bits (upper, lower) \ + ((size_t)(((uint64_t)(upper) << 32) | (uint32_t)(lower)))#endif
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +188 -1
204 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v4 5/8] baseband/la12xx: add queue and modem config support
Quoted 195 lines
-----Original Message-----
From: Hemant Agrawal <[email protected]>
Sent: Saturday, April 24, 2021 3:37 AM
Subject: [PATCH v4 5/8] baseband/la12xx: add queue and modem config supportThis 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 <[email protected]>Signed-off-by Hemant Agrawal <[email protected]>--- doc/guides/bbdevs/index.rst | 1 + doc/guides/bbdevs/la12xx.rst | 81 +++ doc/guides/rel_notes/release_21_05.rst | 5 + drivers/baseband/la12xx/bbdev_la12xx.c | 552 ++++++++++++++++++++- drivers/baseband/la12xx/bbdev_la12xx.h | 11 +- drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 189 ++++++- 6 files changed, 829 insertions(+), 10 deletions(-) create mode 100644
doc/guides/bbdevs/la12xx.rstdoc/guides/bbdevs/index.rst +1
-0@@ -14,3 +14,4 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 + la12xxdoc/guides/bbdevs/la12xx.rst new file +9
-0@@ -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 definedradio.
doc/guides/bbdevs/la12xx.rst new file +3
-0+ +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>`_.
doc/guides/bbdevs/la12xx.rst new file +15
-0+ +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 andcompiling DPDK.
doc/guides/bbdevs/la12xx.rst new file +2
-0+ +DPDK requires hugepages to be configured as detailed in section 2 of theDPDK manual.
doc/guides/bbdevs/la12xx.rst new file +30
-0+ +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 <linux_gsg>` tosetup the basic DPDK environment.
doc/guides/bbdevs/la12xx.rst new file +4
-0+ +* 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 tohost.
doc/guides/bbdevs/la12xx.rst new file +4
-0+ 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 maximumnumber
doc/guides/bbdevs/la12xx.rst new file +2
-0+of queues + to be used for communication with offload device i.e. modem. default is16.
doc/guides/bbdevs/la12xx.rst new file +13
-0+ 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 <EAL args> --log-level=la12xx:<level> + +Using ``bb.la12xx`` as log matching criteria, all Baseband PMD logs can +be enabled which are lower than logging ``level``.doc/guides/rel_notes/release_21_05.rst +3
-0@@ -236,6 +236,11 @@ New Features the hash function used in NICs to spread the traffic among the queues. It can be used to get predictable mapping of the flows. +* **Added NXP LA12xx baseband PMD.** + + * Added a new baseband PMD driver for NXP LA12xx Software definedradio.
doc/guides/rel_notes/release_21_05.rst +2
-0+ * See the :doc:`../bbdevs/la12xx` for more details. + * **Updated testpmd.** * Added a command line option to configure forced speed for Ethernetport.
drivers/baseband/la12xx/bbdev_la12xx.c +18
-0@@ -3,6 +3,11 @@*/ #include <string.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/ioctl.h> +#include <sys/mman.h> +#include <dirent.h> #include <rte_common.h> #include <rte_bus_vdev.h> @@ -31,11 +36,549 @@ 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_CRC_24A_ATTACH |
+RTE_BBDEV_LDPC_CRC_24B_ATTACH,drivers/baseband/la12xx/bbdev_la12xx.c +2
-0+ .num_buffers_src = +
RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,drivers/baseband/la12xx/bbdev_la12xx.c +2
-0+ .num_buffers_dst = +
RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,
drivers/baseband/la12xx/bbdev_la12xx.c struct bbdev_la12xx_params { · line 69
Quoted 8 lines
drivers/baseband/la12xx/bbdev_la12xx.c +8
-0+ } + }, + { + .type = RTE_BBDEV_OP_LDPC_DEC, + .cap.ldpc_dec = { + .capability_flags = +RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK | + RTE_BBDEV_LDPC_LLR_COMPRESSION |
Are you sure you support the 6bits LLR compression option? I don't see it being used in the PMD below. Nor in doc. Let me know if you are unclear what that flag really mean.
Quoted 38 lines
+
RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK | + RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP,drivers/baseband/la12xx/bbdev_la12xx.c +2
-0+ .num_buffers_src = +
RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,drivers/baseband/la12xx/bbdev_la12xx.c +2
-0+ .num_buffers_hard_out = +
RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,drivers/baseband/la12xx/bbdev_la12xx.c +27
-0+ } + }, +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->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-Quoted 1 line
dev_id); }
drivers/baseband/la12xx/bbdev_la12xx.c struct bbdev_la12xx_params { · line 115
Quoted 10 lines
drivers/baseband/la12xx/bbdev_la12xx.c +10
-0+ +/* 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 (); + +/* TODO: Implement */
There is still a TODO here? You mentioned it previous patch you would add now, right?
Quoted 229 lines
drivers/baseband/la12xx/bbdev_la12xx.c +46
-0+ +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->queue_size; i++) { + vaddr =rte_malloc (NULL , msg_size,RTE_CACHE_LINE_SIZE ); +if (!vaddr) +return IPC_HOST_BUF_ALLOC_FAIL ; +/* Only offset now */ + ch->bd_h[i].modem_ptr = +rte_cpu_to_be_32 (HUGEPG_OFFSET (vaddr)); + ch->bd_h[i].host_virt_l =lower_32_bits (vaddr); + ch->bd_h[i].host_virt_h =upper_32_bits (vaddr); + q_priv->msg_ch_vaddr[i] = vaddr; +/* Not sure use of this len may be for CRC*/ + ch->bd_h[i].len =0 ; + } + ch->host_ipc_params = + rte_cpu_to_be_32(HUGEPG_OFFSET(q_priv-Quoted 1 line
host_params));drivers/baseband/la12xx/bbdev_la12xx.c +34
-0+ +rte_bbdev_log_debug ("Channel configured" ); +return IPC_SUCCESS ; +} + +static int +la12xx_e200_queue_setup (struct rte_bbdev *dev, +struct bbdev_la12xx_q_priv *q_priv) +{ +struct bbdev_la12xx_private *priv = dev->data->dev_private; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +struct gul_hif *mhif; +ipc_metadata_t *ipc_md; +ipc_ch_t *ch; +int instance_id =0 , i; +int ret; + +PMD_INIT_FUNC_TRACE (); + +switch (q_priv->op_type) { +case RTE_BBDEV_OP_LDPC_ENC : + q_priv->la12xx_core_id =LA12XX_LDPC_ENC_CORE ; +break ; +case RTE_BBDEV_OP_LDPC_DEC : + q_priv->la12xx_core_id =LA12XX_LDPC_DEC_CORE ; +break ; +default : +rte_bbdev_log (ERR ,"Unsupported op type\n" ); +return -1 ; + } + + mhif = (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; +/* offset is from start of PEB */ + ipc_md = (ipc_metadata_t *)((uint64_t)ipc_priv-Quoted 1 line
peb_start.host_vaddr +
drivers/baseband/la12xx/bbdev_la12xx.c +24
-0+ mhif->ipc_regs.ipc_mdata_offset); + ch = &ipc_md->instance_list[instance_id].ch_list[q_priv->q_id]; + +if (q_priv->q_id < priv->num_valid_queues) { +ipc_br_md_t *md = &(ch->md); + + q_priv->feca_blk_id =rte_cpu_to_be_32 (ch->feca_blk_id); + q_priv->feca_blk_id_be32 = ch->feca_blk_id; + q_priv->host_pi =rte_be_to_cpu_32 (md->pi); + q_priv->host_ci =rte_be_to_cpu_32 (md->ci); + q_priv->host_params = (host_ipc_params_t *) + (rte_be_to_cpu_32 (ch->host_ipc_params) + + ((uint64_t )ipc_priv->hugepg_start.host_vaddr)); + +for (i =0 ; i < q_priv->queue_size; i++) { +uint32_t h, l; + + h = ch->bd_h[i].host_virt_h; + l = ch->bd_h[i].host_virt_l; + q_priv->msg_ch_vaddr[i] = (void *)join_32_bits (h, l); + } + + rte_bbdev_log(WARNING, + "Queue [%d] already configured, not configuringagain",
drivers/baseband/la12xx/bbdev_la12xx.c +18
-0+ q_priv->q_id); +return 0 ; + } + +rte_bbdev_log_debug ("setting up queue %d" , q_priv->q_id); + +/* Call ipc_configure_channel */ + ret =ipc_queue_configure (q_priv->q_id, ipc_priv, q_priv); +if (ret) { +rte_bbdev_log (ERR ,"Unable to setup queue (%d) (err=%d)" , + q_priv->q_id, ret); +return ret; + } + +/* Set queue properties for LA12xx device */ +switch (q_priv->op_type) { +case RTE_BBDEV_OP_LDPC_ENC : + if (priv->num_ldpc_enc_queues >=
LA12XX_MAX_LDPC_ENC_QUEUES) {drivers/baseband/la12xx/bbdev_la12xx.c +2
-0+ rte_bbdev_log(ERR, + "num_ldpc_enc_queues reached maxvalue");
drivers/baseband/la12xx/bbdev_la12xx.c +5
-0+return -1 ; + } + ch->la12xx_core_id = +rte_cpu_to_be_32 (LA12XX_LDPC_ENC_CORE ); + ch->feca_blk_id = rte_cpu_to_be_32(priv-Quoted 1 line
num_ldpc_enc_queues++);
drivers/baseband/la12xx/bbdev_la12xx.c +3
-0+break ; +case RTE_BBDEV_OP_LDPC_DEC : + if (priv->num_ldpc_dec_queues >=
LA12XX_MAX_LDPC_DEC_QUEUES) {drivers/baseband/la12xx/bbdev_la12xx.c +2
-0+ rte_bbdev_log(ERR, + "num_ldpc_dec_queues reached maxvalue");
drivers/baseband/la12xx/bbdev_la12xx.c +5
-0+return -1 ; + } + ch->la12xx_core_id = +rte_cpu_to_be_32 (LA12XX_LDPC_DEC_CORE ); + ch->feca_blk_id = rte_cpu_to_be_32(priv-Quoted 1 line
num_ldpc_dec_queues++);
drivers/baseband/la12xx/bbdev_la12xx.c +71
-0+break ; +default : +rte_bbdev_log (ERR ,"Not supported op type\n" ); +return -1 ; + } + ch->op_type =rte_cpu_to_be_32 (q_priv->op_type); + ch->depth =rte_cpu_to_be_32 (q_priv->queue_size); + +/* Store queue config here */ + q_priv->feca_blk_id =rte_cpu_to_be_32 (ch->feca_blk_id); + q_priv->feca_blk_id_be32 = ch->feca_blk_id; + +return 0 ; +} + +/* Setup a queue */ +static int +la12xx_queue_setup (struct rte_bbdev *dev,uint16_t q_id, +const struct rte_bbdev_queue_conf *queue_conf) { +struct bbdev_la12xx_private *priv = dev->data->dev_private; +struct rte_bbdev_queue_data *q_data; +struct bbdev_la12xx_q_priv *q_priv; +int ret; + +PMD_INIT_FUNC_TRACE (); + +/* Move to setup_queues callback */ + q_data = &dev->data->queues[q_id]; + q_data->queue_private =rte_zmalloc (NULL , +sizeof (struct bbdev_la12xx_q_priv ),0 ); +if (!q_data->queue_private) { +rte_bbdev_log (ERR ,"Memory allocation failed for qpriv" ); +return -ENOMEM ; + } + q_priv = q_data->queue_private; + q_priv->q_id = q_id; + q_priv->bbdev_priv = dev->data->dev_private; + q_priv->queue_size = queue_conf->queue_size; + q_priv->op_type = queue_conf->op_type; + + ret =la12xx_e200_queue_setup (dev, q_priv); +if (ret) { +rte_bbdev_log (ERR ,"e200_queue_setup failed for qid: %d" , + q_id); +return ret; + } + +/* Store queue config here */ + priv->num_valid_queues++; + +return 0 ; +} + +static int +la12xx_start (struct rte_bbdev *dev) +{ +struct bbdev_la12xx_private *priv = dev->data->dev_private; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +int ready =0 ; +struct gul_hif *hif_start; + +PMD_INIT_FUNC_TRACE (); + + hif_start = (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; + +/* Set Host Read bit */ +SET_HIF_HOST_RDY (hif_start,HIF_HOST_READY_IPC_APP ); + +/* Now wait for modem ready bit */ +while (!ready) + ready = CHK_HIF_MOD_RDY(hif_start,
HIF_MOD_READY_IPC_APP);drivers/baseband/la12xx/bbdev_la12xx.c +9
-0+ +return 0 ; +} + +static const struct rte_bbdev_ops pmd_ops = { + .info_get = la12xx_info_get, + .queue_setup = la12xx_queue_setup, + .queue_release = la12xx_queue_release, + .start = la12xx_start
drivers/baseband/la12xx/bbdev_la12xx.c struct bbdev_la12xx_params { · line 346
Quoted 10 lines
drivers/baseband/la12xx/bbdev_la12xx.c +10
-0+}; +static struct hugepage_info * +get_hugepage_info (void ) +{ +struct hugepage_info *hp_info; +struct rte_memseg *mseg; + +PMD_INIT_FUNC_TRACE (); + +/* TODO - find a better way */
See previous comment
Quoted 533 lines
drivers/baseband/la12xx/bbdev_la12xx.c +37
-0+ hp_info =rte_malloc (NULL ,sizeof (struct hugepage_info ),0 ); +if (!hp_info) { +rte_bbdev_log (ERR ,"Unable to allocate on local heap" ); +return NULL ; + } + + mseg =rte_mem_virt2memseg (hp_info,NULL ); + hp_info->vaddr = mseg->addr; + hp_info->paddr =rte_mem_virt2phy (mseg->addr); + hp_info->len = mseg->len; + +return hp_info; +} + +static int open_ipc_dev (int modem_id) +{ +char dev_initials[16 ], dev_path[PATH_MAX ]; +struct dirent *entry; +int dev_ipc =0 ; +DIR *dir; + + dir =opendir ("/dev/" ); +if (!dir) { +rte_bbdev_log (ERR ,"Unable to open /dev/" ); +return -1 ; + } + +sprintf (dev_initials,"gulipcgul%d" , modem_id); + +while ((entry =readdir (dir)) !=NULL ) { +if (!strncmp (dev_initials, entry->d_name, +sizeof (dev_initials) -1 )) +break ; + } + +if (!entry) { + rte_bbdev_log(ERR, "Error: No gulipcgul%d device",
modem_id);drivers/baseband/la12xx/bbdev_la12xx.c +54
-0+return -1 ; + } + +sprintf (dev_path,"/dev/%s" , entry->d_name); + dev_ipc =open (dev_path,O_RDWR ); +if (dev_ipc <0 ) { +rte_bbdev_log (ERR ,"Error: Cannot open %s" , dev_path); +return -errno; + } + +return dev_ipc; +} + +static int +setup_la12xx_dev (struct rte_bbdev *dev) { +struct bbdev_la12xx_private *priv = dev->data->dev_private; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +struct hugepage_info *hp =NULL ; +ipc_channel_us_t *ipc_priv_ch =NULL ; +int dev_ipc =0 , dev_mem =0 , i; +ipc_metadata_t *ipc_md; +struct gul_hif *mhif; +uint32_t phy_align =0 ; +int ret; + +PMD_INIT_FUNC_TRACE (); + +if (!ipc_priv) { +/* TODO - get a better way */ +/* Get the hugepage info against it */ + hp =get_hugepage_info (); +if (!hp) { +rte_bbdev_log (ERR ,"Unable to get hugepage info" ); + ret = -ENOMEM ; + goto err; + } + +rte_bbdev_log_debug ("%lx %p %lx" , + hp->paddr, hp->vaddr, hp->len); + + ipc_priv =rte_zmalloc (0 ,sizeof (ipc_userspace_t),0 ); +if (ipc_priv ==NULL ) { +rte_bbdev_log (ERR , +"Unable to allocate memory for ipc priv" ); + ret = -ENOMEM ; + goto err; + } + +for (i =0 ; i <IPC_MAX_CHANNEL_COUNT ; i++) { + ipc_priv_ch =rte_zmalloc (0 , +sizeof (ipc_channel_us_t),0 ); +if (ipc_priv_ch ==NULL ) { + rte_bbdev_log(ERR, + "Unable to allocate memory forchannels");
drivers/baseband/la12xx/bbdev_la12xx.c +8
-0+ ret = -ENOMEM ; + } + ipc_priv->channels[i] = ipc_priv_ch; + } + + dev_mem =open ("/dev/mem" ,O_RDWR ); +if (dev_mem <0 ) { + rte_bbdev_log(ERR, "Error: Cannot open
/dev/mem");drivers/baseband/la12xx/bbdev_la12xx.c +39
-0+ ret = -errno; + goto err; + } + + ipc_priv->instance_id =0 ; + ipc_priv->dev_mem = dev_mem; + +rte_bbdev_log_debug ("hugepg input %lx %p %lx" , + hp->paddr, hp->vaddr, hp->len); + + ipc_priv->sys_map.hugepg_start.host_phys = hp->paddr; + ipc_priv->sys_map.hugepg_start.size = hp->len; + + ipc_priv->hugepg_start.host_phys = hp->paddr; + ipc_priv->hugepg_start.host_vaddr = hp->vaddr; + ipc_priv->hugepg_start.size = hp->len; + +rte_free (hp); + } + + dev_ipc =open_ipc_dev (priv->modem_id); +if (dev_ipc <0 ) { +rte_bbdev_log (ERR ,"Error: open_ipc_dev failed" ); + goto err; + } + ipc_priv->dev_ipc = dev_ipc; + + ret =ioctl (ipc_priv->dev_ipc,IOCTL_GUL_IPC_GET_SYS_MAP , + &ipc_priv->sys_map); +if (ret) { +rte_bbdev_log (ERR , +"IOCTL_GUL_IPC_GET_SYS_MAP ioctl failed" ); + goto err; + } + + phy_align = (ipc_priv->sys_map.mhif_start.host_phys %0x1000 ); + ipc_priv->mhif_start.host_vaddr = + mmap(0, ipc_priv->sys_map.mhif_start.size + phy_align, + (PROT_READ | PROT_WRITE), MAP_SHARED, ipc_priv-Quoted 1 line
dev_mem,drivers/baseband/la12xx/bbdev_la12xx.c +14
-0+ (ipc_priv->sys_map.mhif_start.host_phys - phy_align)); +if (ipc_priv->mhif_start.host_vaddr ==MAP_FAILED ) { +rte_bbdev_log (ERR ,"MAP failed:" ); + ret = -errno; + goto err; + } + + ipc_priv->mhif_start.host_vaddr = (void *) ((uint64_t ) + (ipc_priv->mhif_start.host_vaddr) + phy_align); + + phy_align = (ipc_priv->sys_map.peb_start.host_phys %0x1000 ); + ipc_priv->peb_start.host_vaddr = + mmap(0, ipc_priv->sys_map.peb_start.size + phy_align, + (PROT_READ | PROT_WRITE), MAP_SHARED, ipc_priv-Quoted 1 line
dev_mem,drivers/baseband/la12xx/bbdev_la12xx.c +11
-0+ (ipc_priv->sys_map.peb_start.host_phys - phy_align)); +if (ipc_priv->peb_start.host_vaddr ==MAP_FAILED ) { +rte_bbdev_log (ERR ,"MAP failed:" ); + ret = -errno; + goto err; + } + + ipc_priv->peb_start.host_vaddr = (void *)((uint64_t ) + (ipc_priv->peb_start.host_vaddr) + phy_align); + + phy_align = (ipc_priv->sys_map.modem_ccsrbar.host_phys %
0x1000);drivers/baseband/la12xx/bbdev_la12xx.c +2
-0+ ipc_priv->modem_ccsrbar.host_vaddr = + mmap(0, ipc_priv->sys_map.modem_ccsrbar.size +
phy_align,drivers/baseband/la12xx/bbdev_la12xx.c +1
-0+ (PROT_READ | PROT_WRITE), MAP_SHARED, ipc_priv-Quoted 1 line
dev_mem,drivers/baseband/la12xx/bbdev_la12xx.c +1
-0+ (ipc_priv->sys_map.modem_ccsrbar.host_phys -
phy_align));drivers/baseband/la12xx/bbdev_la12xx.c +16
-0+if (ipc_priv->modem_ccsrbar.host_vaddr ==MAP_FAILED ) { +rte_bbdev_log (ERR ,"MAP failed:" ); + ret = -errno; + goto err; + } + + ipc_priv->modem_ccsrbar.host_vaddr = (void *)((uint64_t ) + (ipc_priv->modem_ccsrbar.host_vaddr) + phy_align); + + ipc_priv->hugepg_start.modem_phys = + ipc_priv->sys_map.hugepg_start.modem_phys; + + ipc_priv->mhif_start.host_phys = + ipc_priv->sys_map.mhif_start.host_phys; + ipc_priv->mhif_start.size = ipc_priv->sys_map.mhif_start.size; + ipc_priv->peb_start.host_phys = ipc_priv-Quoted 1 line
sys_map.peb_start.host_phys;
drivers/baseband/la12xx/bbdev_la12xx.c +18
-0+ ipc_priv->peb_start.size = ipc_priv->sys_map.peb_start.size; + +rte_bbdev_log (INFO ,"peb %lx %p %x" , + ipc_priv->peb_start.host_phys, + ipc_priv->peb_start.host_vaddr, + ipc_priv->peb_start.size); +rte_bbdev_log (INFO ,"hugepg %lx %p %x" , + ipc_priv->hugepg_start.host_phys, + ipc_priv->hugepg_start.host_vaddr, + ipc_priv->hugepg_start.size); +rte_bbdev_log (INFO ,"mhif %lx %p %x" , + ipc_priv->mhif_start.host_phys, + ipc_priv->mhif_start.host_vaddr, + ipc_priv->mhif_start.size); + mhif = (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; + +/* offset is from start of PEB */ + ipc_md = (ipc_metadata_t *)((uint64_t)ipc_priv-Quoted 1 line
peb_start.host_vaddr +
drivers/baseband/la12xx/bbdev_la12xx.c +5
-0+ mhif->ipc_regs.ipc_mdata_offset); + +if (sizeof (ipc_metadata_t) != mhif->ipc_regs.ipc_mdata_size) { + rte_bbdev_log(ERR, + "ipc_metadata_t =%lx, mhif-Quoted 1 line
ipc_regs.ipc_mdata_size=%x",
drivers/baseband/la12xx/bbdev_la12xx.c +1
-0+ sizeof(ipc_metadata_t), mhif-Quoted 1 line
ipc_regs.ipc_mdata_size);
drivers/baseband/la12xx/bbdev_la12xx.c +1
-0+ rte_bbdev_log(ERR, "--> mhif->ipc_regs.ipc_mdata_offset=%x",
drivers/baseband/la12xx/bbdev_la12xx.c +2
-0+ mhif->ipc_regs.ipc_mdata_offset); + rte_bbdev_log(ERR, "gul_hif size=%lx", sizeof(struct
gul_hif));drivers/baseband/la12xx/bbdev_la12xx.c +24
-0+return IPC_MD_SZ_MISS_MATCH ; + } + + ipc_priv->instance = (ipc_instance_t *) + (&ipc_md->instance_list[ipc_priv->instance_id]); + +rte_bbdev_log_debug ("finish host init" ); + + priv->ipc_priv = ipc_priv; + +return 0 ; + +err: +rte_free (hp); +rte_free (ipc_priv); +rte_free (ipc_priv_ch); +if (dev_mem) +close (dev_mem); +if (dev_ipc) +close (dev_ipc); + +return ret; +} +static inline int parse_u16_arg(const char *key, const char *value, void *extra_args) { @@ -123,6 +666,7 @@ la12xx_bbdev_create(struct
rte_vdev_device*vdev,drivers/baseband/la12xx/bbdev_la12xx.c +8
-1struct rte_bbdev *bbdev;const char *name =rte_vdev_device_name (vdev);struct bbdev_la12xx_private *priv; +int ret;PMD_INIT_FUNC_TRACE ();@@ -152,7 +696,13 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev,rte_bbdev_log (INFO ,"Setting Up %s: DevId=%d, ModemId=%d" , name, bbdev->data->dev_id, priv- >modem_id); - bbdev->dev_ops =NULL ; + ret =setup_la12xx_dev (bbdev); +if (ret) { +rte_bbdev_log (ERR ,"IPC Setup failed for %s" , name); +rte_free (bbdev->data->dev_private); +return ret; + } + bbdev->dev_ops = &pmd_ops; bbdev->device = &vdev->device;drivers/baseband/la12xx/bbdev_la12xx.c +0
-0bbdev->data->socket_id =0 ; bbdev->intr_handle =NULL ;drivers/baseband/la12xx/bbdev_la12xx.h +3
-8@@ -5,16 +5,10 @@ #ifndef __BBDEV_LA12XX_H__ #define __BBDEV_LA12XX_H__ -#define BBDEV_IPC_ENC_OP_TYPE 1 -#define BBDEV_IPC_DEC_OP_TYPE 2 - -#define MAX_LDPC_ENC_FECA_QUEUES 4 -#define MAX_LDPC_DEC_FECA_QUEUES 4 - #define MAX_CHANNEL_DEPTH 16 /* private data structure */ struct bbdev_la12xx_private { - void *ipc_priv; + ipc_userspace_t *ipc_priv; uint8_t num_valid_queues; uint8_t max_nb_queues; uint8_t num_ldpc_enc_queues;@@ -52,5 +46,6 @@ struct bbdev_la12xx_q_priv {#define lower_32_bits (x) ((uint32_t)((uint64_t)x)) #define upper_32_bits(x) ((uint32_t)(((uint64_t)(x) >> 16) >> 16)) - +#define join_32_bits (upper, lower) \ + ((size_t)(((uint64_t)(upper) << 32) | (uint32_t)(lower)))#endif drivers/baseband/la12xx/bbdev_la12xx_ipc.h +21
-0@@ -4,9 +4,182 @@#ifndef __BBDEV_LA12XX_IPC_H__#define __BBDEV_LA12XX_IPC_H__ +#define LA12XX_MAX_QUEUES 20 +#define HOST_RX_QUEUEID_OFFSET LA12XX_MAX_QUEUES + +/** No. of max channel per instance */ +#define IPC_MAX_CHANNEL_COUNT (64) +/** No. of max channel per instance */ #define IPC_MAX_DEPTH (16) +/** No. of max IPC instance per modem */ +#define IPC_MAX_INSTANCE_COUNT (1) + +/** Error codes */ +#define IPC_SUCCESS (0)/** IPC operation success */ +#define IPC_INPUT_INVALID (-1)/** Invalid input to API */ +#define IPC_CH_INVALID (-2)/** Channel no is invalid */ +#define IPC_INSTANCE_INVALID (-3)/** Instance no is invalid */ +#define IPC_MEM_INVALID (-4)/** Insufficient memory */ +#define IPC_CH_FULL (-5)/** Channel is full */ +#define IPC_CH_EMPTY (-6)/** Channel is empty */ +#define IPC_BL_EMPTY (-7)/** Free buffer list is empty */ +#define IPC_BL_FULL (-8)/** Free buffer list is full */ +#define IPC_HOST_BUF_ALLOC_FAIL (-9)/** DPDK malloc fail */ +#define IPC_MD_SZ_MISS_MATCH (-10)/** META DATA size in mhif miss matched*/
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +6
-0+#define IPC_MALLOC_FAIL (-11)/** system malloc fail */ +#define IPC_IOCTL_FAIL (-12)/** IOCTL call failed */ +#define IPC_MMAP_FAIL (-14)/** MMAP fail */ +#define IPC_OPEN_FAIL (-15)/** OPEN fail */ +#define IPC_EVENTFD_FAIL (-16)/** eventfd initialization failed */ +#define IPC_NOT_IMPLEMENTED (-17)/** IPC feature is not implemented yet*/
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +2
-0+ +#define SET_HIF_HOST_RDY (hif,RDY_MASK ) (hif->host_ready |=
RDY_MASK)
+#defineCHK_HIF_MOD_RDY(hif, RDY_MASK)(hif->mod_ready&RDY_MASK)drivers/baseband/la12xx/bbdev_la12xx_ipc.h +31
-0+ +/* Host Ready bits */ +#define HIF_HOST_READY_HOST_REGIONS (1 << 0) +#define HIF_HOST_READY_IPC_LIB (1 << 12) +#define HIF_HOST_READY_IPC_APP (1 << 13) +#define HIF_HOST_READY_FECA (1 << 14) + +/* Modem Ready bits */ +#define HIF_MOD_READY_IPC_LIB (1 << 5) +#define HIF_MOD_READY_IPC_APP (1 << 6) +#define HIF_MOD_READY_FECA (1 << 7) + +typedef void *ipc_t ; + +struct ipc_msg { +int chid; +void *addr; +uint32_t len; +uint8_t flags; +}; + +typedef struct { +uint64_t host_phys; +uint32_t modem_phys; +void *host_vaddr; +uint32_t size; +}mem_range_t ; + +#define GUL_IPC_MAGIC 'R' + +#define IOCTL_GUL_IPC_GET_SYS_MAP _IOW(GUL_IPC_MAGIC, 1, struct
ipc_msg
+*) #defineIOCTL_GUL_IPC_CHANNEL_REGISTER_IOWR(GUL_IPC_MAGIC, 4,drivers/baseband/la12xx/bbdev_la12xx_ipc.h +3
-0+struct ipc_msg *) #define IOCTL_GUL_IPC_CHANNEL_DEREGISTER \ + _IOWR(GUL_IPC_MAGIC, 5, struct ipc_msg *) #define +IOCTL_GUL_IPC_CHANNEL_RAISE_INTERRUPT _IOW(GUL_IPC_MAGIC, 6,int *)
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +30
-0+ +/** buffer ring common metadata */ +typedef struct ipc_bd_ring_md { +volatile uint32_t pi;/**< Producer index and flag (MSB) +* which flip for each Ring wrapping +*/ +volatile uint32_t ci;/**< Consumer index and flag (MSB) +* which flip for each Ring wrapping +*/ +uint32_t ring_size;/**< depth (Used to roll-over pi/ci) */ +uint32_t msg_size;/**< Size of the each buffer */ +} __rte_packed ipc_br_md_t; + +/** IPC buffer descriptor */ +typedef struct ipc_buffer_desc { +union { +uint64_t host_virt;/**< msg's host virtual address */ +struct { +uint32_t host_virt_l; +uint32_t host_virt_h; + }; + }; +uint32_t modem_ptr;/**< msg's modem physical address */ +uint32_t len;/**< msg len */ +} __rte_packed ipc_bd_t; + +typedef struct ipc_channel { + uint32_t ch_id; /**< Channel id */ + ipc_br_md_t md; /**< Metadata for BD ring */ + ipc_bd_t bd_h[IPC_MAX_DEPTH]; /**< Buffer Descriptor onHost */
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +1
-0+ipc_bd_t bd_m[IPC_MAX_DEPTH ];/**< Buffer Descriptor on Modem */
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +5
-0+uint32_t op_type;/**< Type of the BBDEV operation +* supported on this channel +*/ +uint32_t depth;/**< Channel depth */ +uint32_t feca_blk_id;/**< FECA Transport Block ID for processing */
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +7
-0+uint32_t la12xx_core_id;/**< LA12xx core ID on which this will be +* scheduled +*/ +uint32_t feca_input_circ_size;/**< FECA transport block input +* circular buffer size +*/ +uint32_t host_ipc_params;/**< Address for host IPC parameters */
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +13
-0+}__rte_packed ipc_ch_t; + +typedef struct ipc_instance { +uint32_t instance_id;/**< instance id, use to init this +* instance by ipc_init API +*/ +uint32_t initialized;/**< Set in ipc_init */ +ipc_ch_t ch_list[IPC_MAX_CHANNEL_COUNT ]; + /**< Channel descriptors in this instance */ } __rte_packed +ipc_instance_t; + +typedef struct ipc_metadata { + uint32_t ipc_host_signature; /**< IPC host signature, Set by host/L2*/
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +1
-0+uint32_t ipc_geul_signature;/**< IPC geul signature, Set by modem */
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +66
-2+ipc_instance_t instance_list[IPC_MAX_INSTANCE_COUNT ]; +}__rte_packed ipc_metadata_t; + +typedef struct ipc_channel_us_priv { +int32_t eventfd; +uint32_t channel_id; +/* In flight packets status for buffer list. */ +uint8_t bufs_inflight[IPC_MAX_DEPTH ]; +}ipc_channel_us_t ; + +typedef struct { +uint64_t host_phys; +uint32_t modem_phys; +uint32_t size; +}mem_strt_addr_t ; + +typedef struct { +mem_strt_addr_t modem_ccsrbar; +mem_strt_addr_t peb_start;/* PEB meta data */ +mem_strt_addr_t mhif_start;/* MHIF meta daat */ +mem_strt_addr_t hugepg_start;/* Modem to access hugepage */ } +sys_map_t ; + +typedef struct ipc_priv_t { +int instance_id; +int dev_ipc; +int dev_mem; +sys_map_t sys_map; +mem_range_t modem_ccsrbar; +mem_range_t peb_start; +mem_range_t mhif_start; +mem_range_t hugepg_start; +ipc_channel_us_t *channels[IPC_MAX_CHANNEL_COUNT ]; +ipc_instance_t *instance; +ipc_instance_t *instance_bk; +}ipc_userspace_t ; + +/** Structure specifying enqueue operation (enqueue at LA1224) */ +struct bbdev_ipc_enqueue_op { +/** Status of operation that was performed */ +int32_t status; +/** CRC Status of SD operation that was performed */ +int32_t crc_stat_addr; +/** HARQ Output buffer memory length for Shared Decode. +* Filled by LA12xx. +*/ +uint32_t out_len; +/** Reserved (for 8 byte alignment) */ +uint32_t rsvd; +}; +/* This shared memory would be on the host side which have copy of some * of the parameters which are also part of Shared BD ring. Read access * of these parameters from the host side would not be over PCI. @@ -14,7 +187,21 @@typedef struct host_ipc_params {volatile uint32_t pi;volatile uint32_t ci; -volatile uint32_t modem_ptr[IPC_MAX_DEPTH ]; +volatile uint32_t bd_m_modem_ptr[IPC_MAX_DEPTH ]; } __rte_packed host_ipc_params_t; +struct hif_ipc_regs { +uint32_t ipc_mdata_offset; +uint32_t ipc_mdata_size; +} __rte_packed; + +struct gul_hif { +uint32_t ver; +uint32_t hif_ver; +uint32_t status; +volatile uint32_t host_ready; +volatile uint32_t mod_ready; +struct hif_ipc_regs ipc_regs; +} __rte_packed; +#endif --2.17.1
Re: [dpdk-dev] [PATCH v4 5/8] baseband/la12xx: add queue and modem config support
Quoted 11 lines
drivers/baseband/la12xx/bbdev_la12xx.c struct bbdev_la12xx_params { · line 69
Quoted 7 lines
drivers/baseband/la12xx/bbdev_la12xx.c +5
-0+ .type = RTE_BBDEV_OP_LDPC_DEC, + .cap.ldpc_dec = { + .capability_flags = +RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK | + RTE_BBDEV_LDPC_LLR_COMPRESSION |Are you sure you support the 6bits LLR compression option? I don't see it being used in the PMD below. Nor in doc.
Let me know if you are unclear what that flag really mean.
We support LLR compression in the Hardware by default. We do not need to call ' ldpc_input_llr_scaling' API in testbbdev.
Regards,
Nipun
Re: [dpdk-dev] [PATCH v4 5/8] baseband/la12xx: add queue and modem config support
Hi Nipun,
Quoted 21 lines
-----Original Message-----
From: Nipun Gupta <[email protected]>
Sent: Thursday, May 13, 2021 4:02 AM
To: Chautru, Nicolas <[email protected]>; Hemant Agrawal <[email protected]>; [email protected]; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v4 5/8] baseband/la12xx: add queue and modem config supportQuoted 9 lines
drivers/baseband/la12xx/bbdev_la12xx.c struct bbdev_la12xx_params { · line 69
Quoted 5 lines
drivers/baseband/la12xx/bbdev_la12xx.c +5
-0+ .type = RTE_BBDEV_OP_LDPC_DEC, + .cap.ldpc_dec = { + .capability_flags = +RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK | + RTE_BBDEV_LDPC_LLR_COMPRESSION |Are you sure you support the 6bits LLR compression option? I don't see it being used in the PMD below. Nor in doc.
Let me know if you are unclear what that flag really mean.
Quoted 3 lines
We support LLR compression in the Hardware by default. We do not need to call '
ldpc_input_llr_scaling' API in testbbdev.
So you always assume to pack up the input data as 6 bits back-to-back? You understand what that feature mean? My concern is that you would not support current API and many unit test would fail then for you PMD. Are you able to run the bbdev-test and see failures (all tests should be either skipped : missing capability) or passing
Quoted 2 lines
Regards,
Nipun
Re: [dpdk-dev] [PATCH v4 5/8] baseband/la12xx: add queue and modem config support
Hi,
Quoted 36 lines
-----Original Message-----
From: Chautru, Nicolas <[email protected]>
Sent: Thursday, May 13, 2021 8:21 PM
To: Nipun Gupta <[email protected]>; Hemant Agrawal <[email protected]>; [email protected]; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v4 5/8] baseband/la12xx: add queue and modem config supportHi Nipun,
Quoted 21 lines
-----Original Message-----
From: Nipun Gupta <[email protected]>
Sent: Thursday, May 13, 2021 4:02 AM
To: Chautru, Nicolas <[email protected]>; Hemant Agrawal <[email protected]>; [email protected]; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v4 5/8] baseband/la12xx: add queue and modem config supportQuoted 9 lines
drivers/baseband/la12xx/bbdev_la12xx.c struct bbdev_la12xx_params { · line 69
Quoted 5 lines
drivers/baseband/la12xx/bbdev_la12xx.c +5
-0+ .type = RTE_BBDEV_OP_LDPC_DEC, + .cap.ldpc_dec = { + .capability_flags = +RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK | + RTE_BBDEV_LDPC_LLR_COMPRESSION |Are you sure you support the 6bits LLR compression option? I don't see it being used in the PMD below. Nor in doc.
Let me know if you are unclear what that flag really mean.Quoted 3 lines
We support LLR compression in the Hardware by default. We do not need to call '
ldpc_input_llr_scaling' API in testbbdev.
Quoted 6 lines
So you always assume to pack up the input data as 6 bits back-to-back? You understand what that feature mean?
My concern is that you would not support current API and many unit test would fail then for you PMD.
Are you able to run the bbdev-test and see failures (all tests should be either skipped : missing capability) or passing
Our test vectors pass with our driver (Performance, validation, Latency and offload cost tests), provided we do not call 'ldpc_input_llr_scaling' API.
I am not sure why this API is being called in testbbdev. Can you provide more insight on why this API is doing and why does it modifies the input data?
Quoted 4 lines
Quoted 4 lines
Regards,
Nipun
Re: [dpdk-dev] [PATCH v4 5/8] baseband/la12xx: add queue and modem config support
Quoted 53 lines
-----Original Message-----
From: Nipun Gupta <[email protected]>
Sent: Monday, May 17, 2021 10:00 AMHi,
Quoted 22 lines
-----Original Message-----
From: Chautru, Nicolas <[email protected]>
Sent: Thursday, May 13, 2021 8:21 PM
To: Nipun Gupta <[email protected]>; Hemant Agrawal <[email protected]>; [email protected]; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v4 5/8] baseband/la12xx: add queue and modem config supportHi Nipun,
Quoted 11 lines
-----Original Message-----
From: Nipun Gupta <[email protected]>
Sent: Thursday, May 13, 2021 4:02 AM
To: Chautru, Nicolas <[email protected]>; Hemant Agrawal <[email protected]>; [email protected]; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v4 5/8] baseband/la12xx: add queue and modem config supportQuoted 4 lines
Quoted 4 lines
Quoted 4 lines
drivers/baseband/la12xx/bbdev_la12xx.c struct bbdev_la12xx_params { · line 80
Quoted 4 lines
drivers/baseband/la12xx/bbdev_la12xx.c +4
-0+ .type = RTE_BBDEV_OP_LDPC_DEC, + .cap.ldpc_dec = { + .capability_flags = +RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK |Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
+
RTE_BBDEV_LDPC_LLR_COMPRESSION|Quoted 9 lines
Quoted 8 lines
Quoted 4 lines
Are you sure you support the 6bits LLR compression option? I don't see it being used in the PMD below. Nor in doc.
Let me know if you are unclear what that flag really mean.We support LLR compression in the Hardware by default. We do not need to call '
ldpc_input_llr_scaling' API in testbbdev.Quoted 6 lines
So you always assume to pack up the input data as 6 bits back-to-back? You understand what that feature mean?
My concern is that you would not support current API and many unit test would fail then for you PMD.
Are you able to run the bbdev-test and see failures (all tests should be either skipped : missing capability) or passing
Quoted 4 lines
Our test vectors pass with our driver (Performance, validation, Latency and offload cost tests), provided we do not call '
ldpc_input_llr_scaling' API. I am not sure why this API is being called in testbbdev. Can you provide more insight on why this API is doing and why does it modifies the input data?
What LLR numerical representation are you doing for your PMD/HW.
Ie how many integer bits, how many decimals bits.
This is to be able to support seamless different decoder implementation which have different assumptions or implementation.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Regards,
Nipun
Re: [dpdk-dev] [PATCH v4 5/8] baseband/la12xx: add queue and modem config support
Quoted 69 lines
-----Original Message-----
From: Chautru, Nicolas <[email protected]>
Sent: Monday, May 17, 2021 11:23 PM
To: Nipun Gupta <[email protected]>; Hemant Agrawal <[email protected]>; [email protected]; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v4 5/8] baseband/la12xx: add queue and modem config supportQuoted 51 lines
-----Original Message-----
From: Nipun Gupta <[email protected]>
Sent: Monday, May 17, 2021 10:00 AMHi,
Quoted 22 lines
-----Original Message-----
From: Chautru, Nicolas <[email protected]>
Sent: Thursday, May 13, 2021 8:21 PM
To: Nipun Gupta <[email protected]>; Hemant Agrawal <[email protected]>; [email protected]; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v4 5/8] baseband/la12xx: add queue and modem config supportHi Nipun,
Quoted 11 lines
-----Original Message-----
From: Nipun Gupta <[email protected]>
Sent: Thursday, May 13, 2021 4:02 AM
To: Chautru, Nicolas <[email protected]>; Hemant Agrawal <[email protected]>; [email protected]; [email protected]
Cc: [email protected]
Subject: RE: [PATCH v4 5/8] baseband/la12xx: add queue and modem config supportQuoted 4 lines
Quoted 4 lines
Quoted 4 lines
drivers/baseband/la12xx/bbdev_la12xx.c struct bbdev_la12xx_params { · line 80
Quoted 4 lines
drivers/baseband/la12xx/bbdev_la12xx.c +4
-0+ .type = RTE_BBDEV_OP_LDPC_DEC, + .cap.ldpc_dec = { + .capability_flags = +RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK |Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
+
RTE_BBDEV_LDPC_LLR_COMPRESSION|Quoted 9 lines
Quoted 8 lines
Quoted 4 lines
Are you sure you support the 6bits LLR compression option? I don't see it being used in the PMD below. Nor in doc.
Let me know if you are unclear what that flag really mean.We support LLR compression in the Hardware by default. We do not need to call '
ldpc_input_llr_scaling' API in testbbdev.Quoted 6 lines
So you always assume to pack up the input data as 6 bits back-to-back? You understand what that feature mean?
My concern is that you would not support current API and many unit test would fail then for you PMD.
Are you able to run the bbdev-test and see failures (all tests should be either skipped : missing capability) or passingQuoted 4 lines
Our test vectors pass with our driver (Performance, validation, Latency and offload cost tests), provided we do not call '
ldpc_input_llr_scaling' API. I am not sure why this API is being called in testbbdev. Can you provide more insight on why this API is doing and why does it modifies the input data?
Quoted 4 lines
What LLR numerical representation are you doing for your PMD/HW. Ie how many integer bits, how many decimals bits.
This is to be able to support seamless different decoder implementation which have different assumptions or implementation.
It is 8 integer bits and 1 decimal bit for our hardware. Will fix our code.
Thanks,
Nipun
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Regards,
Nipun
PATCH v4 6/8 baseband/la12xx: add enqueue and dequeue support
In reply to Hemant AgrawalAdd support for enqueue and dequeue the LDPC enc/dec from the modem device.
--- 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
doc/guides/bbdevs/features/la12xx.ini new file +14 -0
@@ -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 +Network Order Data = Y
doc/guides/bbdevs/la12xx.rst +46 -0
55 lines not on this page · raw message
drivers/baseband/la12xx/bbdev_la12xx.c +328 -6
364 lines not on this page · raw message
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +37 -0
@@ -73,6 +73,25 @@ typedef struct { _IOWR(GUL_IPC_MAGIC, 5, struct ipc_msg *) #define IOCTL_GUL_IPC_CHANNEL_RAISE_INTERRUPT _IOW(GUL_IPC_MAGIC, 6, int *) +#define GUL_USER_HUGE_PAGE_OFFSET (0) +#define GUL_PCI1_ADDR_BASE (0x00000000ULL) + +#define GUL_USER_HUGE_PAGE_ADDR (GUL_PCI1_ADDR_BASE + GUL_USER_HUGE_PAGE_OFFSET) + +/* IPC PI/CI index & flag manipulation helpers */ +#define IPC_PI_CI_FLAG_MASK 0x80000000 /* (1<<31) */ +#define IPC_PI_CI_INDEX_MASK 0x7FFFFFFF /* ~(1<<31) */ + +#define IPC_SET_PI_FLAG(x) (x |= IPC_PI_CI_FLAG_MASK) +#define IPC_RESET_PI_FLAG (x) (x &= IPC_PI_CI_INDEX_MASK) +#define IPC_GET_PI_FLAG (x) (x >> 31) +#define IPC_GET_PI_INDEX (x) (x & IPC_PI_CI_INDEX_MASK) + +#define IPC_SET_CI_FLAG (x) (x |= IPC_PI_CI_FLAG_MASK) +#define IPC_RESET_CI_FLAG (x) (x &= IPC_PI_CI_INDEX_MASK) +#define IPC_GET_CI_FLAG (x) (x >> 31) +#define IPC_GET_CI_INDEX (x) (x & IPC_PI_CI_INDEX_MASK) +/** buffer ring common metadata */ typedef struct ipc_bd_ring_md { volatile uint32_t pi; /**< Producer index and flag (MSB)
@@ -180,6 +199,24 @@ struct bbdev_ipc_enqueue_op {uint32_t rsvd; }; +/** Structure specifying dequeue operation (dequeue at LA1224) */ +struct bbdev_ipc_dequeue_op { +/** Input buffer memory address */ +uint32_t in_addr; +/** Input buffer memory length */ +uint32_t in_len; +/** Output buffer memory address */ +uint32_t out_addr; +/** Output buffer memory length */ +uint32_t out_len; +/* Number of code blocks. Only set when HARQ is used */ +uint32_t num_code_blocks; +/** Dequeue Operation flags */ +uint32_t op_flags; +/** Shared metadata between L1 and L2 */ +uint32_t shared_metadata; +}; +/* This shared memory would be on the host side which have copy of some * of the parameters which are also part of Shared BD ring. Read access * of these parameters from the host side would not be over PCI.
Signature · 1 line
2.17.1
PATCH v4 7/8 app/bbdev: enable la12xx for bbdev
In reply to Hemant Agrawalthis patch adds la12xx driver in test bbdev
--- app/test-bbdev/meson.build | 3 +++ 1 file changed, 3 insertions(+)
app/test-bbdev/meson.build +3 -0
@@ -17,3 +17,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
Signature · 1 line
2.17.1
PATCH v4 8/8 app/bbdev: add test vectors for transport blocks
In reply to Hemant AgrawalFrom: Nipun Gupta <[email protected]>
This patch adds two test vectors for transport block in network byte order:
- LDPC encode for Transport Block
- LDPC decode for Transport block
--- 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
app/test-bbdev/test_vectors/ldpc_dec_tb.data new file +122 -0
@@ -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, 0x817f7f7f, 0x7f817f81, 0x817f8181, 0x7f81817f, +0x7f818181, 0x7f7f8181, 0x817f817f, 0x7f7f7f7f, 0x81818181, 0x7f817f81, 0x81817f81, 0x7f81817f, +0x81818181, 0x7f7f817f, 0x81818181, 0x7f7f7f81, 0x817f7f81, 0x8181817f, 0x7f818181, 0x7f7f7f7f, +0x7f7f7f7f, 0x8181817f, 0x81817f81, 0x81818181, 0x7f7f817f, 0x81817f7f, 0x7f817f81, 0x817f8181, +0x81817f7f, 0x7f817f7f, 0x817f7f7f, 0x7f81817f, 0x817f7f7f, 0x7f7f7f7f, 0x7f7f8181, 0x7f7f8181, +0x7f81817f, 0x7f7f8181, 0x7f7f8181, 0x817f7f81, 0x8181817f, 0x81817f7f, 0x817f8181, 0x817f817f, +0x8181817f, 0x7f7f8181, 0x7f81817f, 0x817f817f, 0x7f817f81, 0x7f817f7f, 0x7f7f8181, 0x81818181, +0x7f817f81, 0x7f7f8181, 0x81817f7f, 0x7f7f7f81, 0x7f7f7f81, 0x7f7f7f7f, 0x7f81817f, 0x7f7f8181, +0x7f7f817f, 0x817f817f, 0x7f7f7f7f, 0x817f8181, 0x7f818181, 0x7f7f817f, 0x8181817f, 0x8181817f, +0x817f7f81, 0x8181817f, 0x817f8181, 0x7f817f7f, 0x81817f7f, 0x81818181, 0x7f7f8181, 0x7f817f81, +0x817f8181, 0x7f817f7f, 0x81818181, 0x81817f81, 0x7f817f81, 0x81817f7f, 0x7f818181, 0x8181817f, +0x7f7f7f81, 0x7f81817f, 0x7f7f8181, 0x81818181, 0x81817f7f, 0x817f8181, 0x81817f7f, 0x7f7f817f, +0x81818181, 0x7f7f8181, 0x7f7f817f, 0x817f817f, 0x7f817f81, 0x7f7f7f7f, 0x7f817f81, 0x7f817f7f, +0x7f81817f, 0x7f7f8181, 0x7f7f817f, 0x81818181, 0x7f7f8181, 0x817f7f81, 0x81817f81, 0x81817f7f, +0x81817f81, 0x81818181, 0x7f817f81, 0x7f7f7f7f, 0x81817f7f, 0x7f817f7f, 0x7f7f817f, 0x81817f7f, +0x81817f7f, 0x7f7f7f7f, 0x817f7f7f, 0x7f817f81, 0x81818181, 0x81817f7f, 0x7f817f7f, 0x8181817f, +0x7f81817f, 0x817f7f81, 0x7f817f7f, 0x7f7f7f7f, 0x817f7f81, 0x7f817f81, 0x81818181, 0x81817f81, +0x7f817f81, 0x81818181, 0x81818181, 0x8181817f, 0x7f7f817f, 0x817f7f7f, 0x817f7f7f, 0x7f7f7f7f, +0x81818181, 0x7f817f7f, 0x817f7f81, 0x7f7f8181, 0x817f8181, 0x81817f7f, 0x81817f7f, 0x817f7f7f, +0x817f817f, 0x7f818181, 0x7f817f7f, 0x817f8181, 0x7f817f7f, 0x817f8181, 0x7f7f817f, 0x81817f7f, +0x8181817f, 0x7f817f81, 0x7f7f7f81, 0x81818181, 0x7f7f7f81, 0x81818181, 0x7f7f817f, 0x817f7f7f, +0x817f817f, 0x7f7f8181, 0x7f7f7f81, 0x7f817f7f, 0x817f8181, 0x817f817f, 0x81818181, 0x81817f7f, + +output0 = +0xea7bdad9, 0xabd8311a, 0x4e7ba2e2, 0x5c5c5c85, 0xc400ed50, 0x9bea8883, 0xb7f0 + +basegraph= +2 + +z_c= +28 + +n_cb= +1400 + +q_m= +2 + +n_filler= +56 + +ea = +2048 + +eb = +2048 + +iter_max= +8 + +expected_iter_count= +2 + +c = +1 + +r = +0 + +cab = +0 + +rv_index = +0 + +code_block_mode = +0 + +op_flags = +RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP, RTE_BBDEV_LDPC_LLR_COMPRESSION, RTE_BBDEV_LDPC_DEC_NETWORK_ORDER + +expected_status = +OK
app/test-bbdev/test_vectors/ldpc_enc_tb.data new file +60 -0
60 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v4 8/8] app/bbdev: add test vectors for transport blocks
Quoted 8 lines
-----Original Message-----
From: Hemant Agrawal <[email protected]>
Sent: Saturday, April 24, 2021 3:37 AMFrom: Nipun Gupta <[email protected]>
Quoted 7 lines
This patch adds two test vectors for transport block in network byte order:
- LDPC encode for Transport Block
- LDPC decode for Transport blockSigned-off-by Nipun Gupta <[email protected]>---
See related comment on patch 1.
Assuming this is a different PMD assumption (not an incremental one) then this should not require new vectors with the op_flag RTE_BBDEV_LDPC_ENC_NETWORK_ORDER.
These would artificially create non-compatible vectors for no reason.
But all existing vectors should be able to run on any PMD, the test framework will just change order endianness based on what is supported by the device so that all unit test can be run successfully on any PMD. See how it is done for LLR numerical assumptions which can differ between PMDs. Let me know if unclear
Quoted 156 lines
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.dataapp/test- renamed from app/test-bbdev/test_vectors/ldpc_dec_tb.data +0
-0bbdev/test_vectors/ldpc_dec_tb.data
new file mode 100644
index 0000000000..4ec5020d04app/test-bbdev/test_vectors/ldpc_dec_tb.data new file +95
-0@@ -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, 0x817f7f7f, 0x7f817f81, +0x817f8181, 0x7f81817f, 0x7f818181, 0x7f7f8181, 0x817f817f, 0x7f7f7f7f, +0x81818181, 0x7f817f81, 0x81817f81, 0x7f81817f, 0x81818181, 0x7f7f817f, +0x81818181, 0x7f7f7f81, 0x817f7f81, 0x8181817f, 0x7f818181, 0x7f7f7f7f, +0x7f7f7f7f, 0x8181817f, 0x81817f81, 0x81818181, 0x7f7f817f, 0x81817f7f, +0x7f817f81, 0x817f8181, 0x81817f7f, 0x7f817f7f, 0x817f7f7f, 0x7f81817f, +0x817f7f7f, 0x7f7f7f7f, 0x7f7f8181, 0x7f7f8181, 0x7f81817f, 0x7f7f8181, +0x7f7f8181, 0x817f7f81, 0x8181817f, 0x81817f7f, 0x817f8181, 0x817f817f, +0x8181817f, 0x7f7f8181, 0x7f81817f, 0x817f817f, 0x7f817f81, 0x7f817f7f, +0x7f7f8181, 0x81818181, 0x7f817f81, 0x7f7f8181, 0x81817f7f, 0x7f7f7f81, +0x7f7f7f81, 0x7f7f7f7f, 0x7f81817f, 0x7f7f8181, 0x7f7f817f, 0x817f817f, +0x7f7f7f7f, 0x817f8181, 0x7f818181, 0x7f7f817f, 0x8181817f, 0x8181817f, +0x817f7f81, 0x8181817f, 0x817f8181, 0x7f817f7f, 0x81817f7f, 0x81818181, +0x7f7f8181, 0x7f817f81, 0x817f8181, 0x7f817f7f, 0x81818181, 0x81817f81, +0x7f817f81, 0x81817f7f, 0x7f818181, 0x8181817f, 0x7f7f7f81, 0x7f81817f, +0x7f7f8181, 0x81818181, 0x81817f7f, 0x817f8181, 0x81817f7f, 0x7f7f817f, +0x81818181, 0x7f7f8181, 0x7f7f817f, 0x817f817f, 0x7f817f81, 0x7f7f7f7f, +0x7f817f81, 0x7f817f7f, 0x7f81817f, 0x7f7f8181, 0x7f7f817f, 0x81818181, +0x7f7f8181, 0x817f7f81, 0x81817f81, 0x81817f7f, 0x81817f81, 0x81818181, +0x7f817f81, 0x7f7f7f7f, 0x81817f7f, 0x7f817f7f, 0x7f7f817f, 0x81817f7f, +0x81817f7f, 0x7f7f7f7f, 0x817f7f7f, 0x7f817f81, 0x81818181, 0x81817f7f, +0x7f817f7f, 0x8181817f, 0x7f81817f, 0x817f7f81, 0x7f817f7f, 0x7f7f7f7f, +0x817f7f81, 0x7f817f81, 0x81818181, 0x81817f81, 0x7f817f81, 0x81818181, +0x81818181, 0x8181817f, 0x7f7f817f, 0x817f7f7f, 0x817f7f7f, 0x7f7f7f7f, +0x81818181, 0x7f817f7f, 0x817f7f81, 0x7f7f8181, 0x817f8181, 0x81817f7f, +0x81817f7f, 0x817f7f7f, 0x817f817f, 0x7f818181, 0x7f817f7f, 0x817f8181, +0x7f817f7f, 0x817f8181, 0x7f7f817f, 0x81817f7f, 0x8181817f, 0x7f817f81, +0x7f7f7f81, 0x81818181, 0x7f7f7f81, 0x81818181, 0x7f7f817f, 0x817f7f7f, +0x817f817f, 0x7f7f8181, 0x7f7f7f81, 0x7f817f7f, 0x817f8181, 0x817f817f, +0x81818181, 0x81817f7f, + +output0 = +0xea7bdad9, 0xabd8311a, 0x4e7ba2e2, 0x5c5c5c85, 0xc400ed50,
0x9bea8883,
+0xb7f0app/test-bbdev/test_vectors/ldpc_dec_tb.data new file +45
-0+ +basegraph= +2 + +z_c= +28 + +n_cb= +1400 + +q_m= +2 + +n_filler= +56 + +ea = +2048 + +eb = +2048 + +iter_max= +8 + +expected_iter_count= +2 + +c = +1 + +r = +0 + +cab = +0 + +rv_index = +0 + +code_block_mode = +0 + +op_flags = +RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP,
Quoted 1 line
RTE_BBDEV_LDPC_LLR_COMPRESSION,
Is there really LLR compression in that vector? It doesn't look like it from looking at the data. It looks like saturated S8 integer format.
Quoted 78 lines
app/test-bbdev/test_vectors/ldpc_dec_tb.data new file +4
-0+RTE_BBDEV_LDPC_DEC_NETWORK_ORDER + +expected_status = +OKapp/test- renamed from app/test-bbdev/test_vectors/ldpc_enc_tb.data +0
-0bbdev/test_vectors/ldpc_enc_tb.data
new file mode 100644
index 0000000000..f3e883584aapp/test-bbdev/test_vectors/ldpc_enc_tb.data new file +7
-0@@ -0,0 +1,60 @@ +# SPDX-License-Identifier: BSD-3-Clause # Copyright 2020 NXP + +op_type = +RTE_BBDEV_OP_LDPC_ENC + +input0 = +0xea7bdad9, 0xabd8311a, 0x4e7ba2e2, 0x5c5c5c85, 0xc400ed50,
0x9bea8883,
+0xb7f0app/test-bbdev/test_vectors/ldpc_enc_tb.data new file +52
-0+ +output0 = +0x109dd93b, 0x5bfc1299, 0x44a1bd2c, 0x05ce87c4, 0x006cafc4, 0x2aa04d17, +0xf803a60d, 0xb9b7032b, 0x5f8af3c9, 0xffa174d1, 0x9ca683dd, 0x0f78551c, +0xb62d51e0, 0xe4996866, 0x42698b36, 0xa4f727f3, 0x445dcd8a, 0x84531088, +0x2b1813e3, 0xcf5735a6, 0x342bf366, 0xe6ec7026, 0x9d062f0d, 0x1e8d0f99, +0x01dc0f9d, 0x5041de7a, 0xb1061c0e, 0x776f4313, 0xfb00f397, 0xbb02acb2, +0x7d1952fb, 0x0bf4af7c, 0x794ae785, 0x9c76d198, 0x8082533d, 0x4ceb5bb3, +0xc9ae8a54, 0x58e72404, 0x472422c3, 0x8eeb7f58, 0x6c47b68d, 0xc9d8f01d, +0x6b585a0f, 0x6d5f0a37, 0x07e91f2f, 0xb5c2fde0, 0x3308684c, 0xabce9336, +0xf345a63e, 0x36011c35, 0xee27b0a2, 0x53fc4be9, 0xe7c5df4b, 0x2cbcf361, +0x4505a23f, 0xcd93f236, 0xc24c05fd, 0xe4cf580c, 0xdf590496, 0x0882eff5, +0x8ccb394f, 0xc2b4b47a, 0x82f1f15e, 0xcfab413a + +basegraph= +2 + +z_c= +28 + +n_cb= +1400 + +q_m= +2 + +n_filler= +56 + +ea = +2048 + +eb = +2048 + +c = +1 + +r = +0 + +cab = +0 + +rv_index = +0 + +code_block_mode = +0 + +op_flags = +RTE_BBDEV_LDPC_CRC_24B_ATTACH,
RTE_BBDEV_LDPC_ENC_NETWORK_ORDERapp/test-bbdev/test_vectors/ldpc_enc_tb.data new file +3
-1+ +expected_status = +OK --2.17.1
Re: [dpdk-dev] [EXT] [PATCH v4 0/8] baseband: add NXP LA12xx driver
In reply to Hemant AgrawalQuoted 29 lines
Subject: [EXT] [PATCH v4 0/8] 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.Hemant Agrawal (7):
bbdev: add network order data capability
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
Quoted 3 lines
Nipun Gupta (1):
app/bbdev: add test vectors for transport blocks
This PMD is deferred for next release. Marked as deferred in patchworks.
Re: [dpdk-dev] [EXT] [PATCH v4 0/8] baseband: add NXP LA12xx driver
Quoted 30 lines
Quoted 5 lines
Subject: [EXT] [PATCH v4 0/8] 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
Quoted 24 lines
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.Hemant Agrawal (7):
bbdev: add network order data capability
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
Quoted 4 lines
Quoted 3 lines
Nipun Gupta (1):
app/bbdev: add test vectors for transport blocksThis PMD is deferred for next release. Marked as deferred in patchworks.
Hi Hemant,
Any update on this PMD? Is it still planned for 21.08?
Regards,
Akhil
Re: [dpdk-dev] [EXT] [PATCH v4 0/8] baseband: add NXP LA12xx driver
Hi Akhil,
Quoted 31 lines
Quoted 31 lines
Quoted 6 lines
Subject: [EXT] [PATCH v4 0/8] 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
Quoted 24 lines
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.Hemant Agrawal (7):
bbdev: add network order data capability
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
Quoted 7 lines
Quoted 4 lines
Quoted 3 lines
Nipun Gupta (1):
app/bbdev: add test vectors for transport blocksThis PMD is deferred for next release. Marked as deferred in patchworks.
Hi Hemant,
Any update on this PMD? Is it still planned for 21.08?
[Hemant]
Yes, we will be sending the update shortly
Quoted 3 lines
Regards,
Akhil
PATCH v3 2/8 baseband/la12xx: add devargs for max queues
In reply to Hemant AgrawalThis patch adds dev args to take max queues as input
--- drivers/baseband/la12xx/bbdev_la12xx.c | 72 +++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 2 deletions(-)
drivers/baseband/la12xx/bbdev_la12xx.c +70 -2
@@ -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 BBDEV_LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" + +static const char *const bbdev_la12xx_valid_params[] = { +BBDEV_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 )) { +BBDEV_LA12XX_PMD_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) {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 ,-1 , + };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 , +BBDEV_LA12XX_MAX_NB_QUEUES_ARG "=<int>" );
Signature · 1 line
2.17.1
PATCH v3 3/8 baseband/la12xx: add support for multiple modems
In reply to Hemant AgrawalThis patch add support for multiple modems by assigning a modem id as dev args in vdev creation.
--- drivers/baseband/la12xx/bbdev_la12xx.c | 60 ++++++++++++++++++++-- drivers/baseband/la12xx/bbdev_la12xx.h | 56 ++++++++++++++++++++ drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 20 ++++++++ 3 files changed, 131 insertions(+), 5 deletions(-) create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.h create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_ipc.h
drivers/baseband/la12xx/bbdev_la12xx.c +55 -5
@@ -14,6 +14,8 @@#include <rte_bbdev_pmd.h> #include <bbdev_la12xx_pmd_logs.h> +#include <bbdev_la12xx_ipc.h> +#include <bbdev_la12xx.h> #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 BBDEV_LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" +#define BBDEV_LA12XX_VDEV_MODEM_ID_ARG "modem" +#define LA12XX_MAX_MODEM 4static const char *const bbdev_la12xx_valid_params[] = {BBDEV_LA12XX_MAX_NB_QUEUES_ARG , +BBDEV_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 ) { +BBDEV_LA12XX_PMD_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 ) { +BBDEV_LA12XX_PMD_ERR ("Invalid modem id, must be < %u" , +LA12XX_MAX_MODEM ); + goto exit; + } } exit:
@@ -88,6 +122,7 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev, {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; + +BBDEV_LA12XX_PMD_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 ;
@@ -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 , -BBDEV_LA12XX_MAX_NB_QUEUES_ARG "=<int>" ); +BBDEV_LA12XX_MAX_NB_QUEUES_ARG "=<int>" +BBDEV_LA12XX_VDEV_MODEM_ID_ARG "=<int> " );
drivers/baseband/la12xx/bbdev_la12xx.h new file +56 -0
56 lines not on this page · raw message
drivers/baseband/la12xx/bbdev_la12xx_ipc.h new file +20 -0
@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2020-2021 NXP +*/ +#ifndef __BBDEV_LA12XX_IPC_H__ +#define __BBDEV_LA12XX_IPC_H__ + +/** No. of max channel per instance */ +#define IPC_MAX_DEPTH (16) + +/* This shared memory would be on the host side which have copy of some +* of the parameters which are also part of Shared BD ring. Read access +* of these parameters from the host side would not be over PCI. +*/ +typedef struct host_ipc_params { +volatile uint32_t pi; +volatile uint32_t ci; +volatile uint32_t modem_ptr[IPC_MAX_DEPTH ]; +} __rte_packed host_ipc_params_t; + +#endif
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v3 3/8] baseband/la12xx: add support for multiple modems
Quoted 31 lines
-----Original Message-----
From: Hemant Agrawal <[email protected]>
Sent: Monday, April 12, 2021 10:17 PMThis patch add support for multiple modems by assigning a modem id as dev args in vdev creation.
Signed-off-by Hemant Agrawal <[email protected]>--- drivers/baseband/la12xx/bbdev_la12xx.c | 60 ++++++++++++++++++++-- drivers/baseband/la12xx/bbdev_la12xx.h | 56 ++++++++++++++++++++ drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 20 ++++++++ 3 files changed, 131 insertions(+), 5 deletions(-) create mode 100644 drivers/baseband/la12xx/bbdev_la12xx.h create mode 100644 drivers/baseband/la12xx/bbdev_la12xx_ipc.hdrivers/baseband/la12xx/bbdev_la12xx.c +2
-0@@ -14,6 +14,8 @@#include <rte_bbdev_pmd.h> #include <bbdev_la12xx_pmd_logs.h> +#include <bbdev_la12xx_ipc.h> +#include <bbdev_la12xx.h> #define DRIVER_NAME baseband_la12xx
drivers/baseband/la12xx/bbdev_la12xx.c RTE_LOG_REGISTER(bbdev_la12xx_logtype, · line 33
Quoted 10 lines
drivers/baseband/la12xx/bbdev_la12xx.c +3
-0@@ -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 BBDEV_LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" +#define BBDEV_LA12XX_VDEV_MODEM_ID_ARG "modem" +#define LA12XX_MAX_MODEM 4
Minor : best to be consistent with prefix used throught the PMD. A bit of a mix and match.
Quoted 107 lines
drivers/baseband/la12xx/bbdev_la12xx.c +1
-4static const char *const bbdev_la12xx_valid_params[] = {BBDEV_LA12XX_MAX_NB_QUEUES_ARG , +BBDEV_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)drivers/baseband/la12xx/bbdev_la12xx.c +21
-0return 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 ) { +BBDEV_LA12XX_PMD_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 intparse_bbdev_la12xx_params(struct
bbdev_la12xx_params*params, @@ - 73,6 +97,16 @@ parse_bbdev_la12xx_params(structbbdev_la12xx_params*params,drivers/baseband/la12xx/bbdev_la12xx.c +7
-0if (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 ) { + BBDEV_LA12XX_PMD_ERR("Invalid modem id, mustbe < %u",
drivers/baseband/la12xx/bbdev_la12xx.c +18
-0+ LA12XX_MAX_MODEM); + goto exit; + } } exit:@@ -88,6 +122,7 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev, {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; + +BBDEV_LA12XX_PMD_INFO ("Setting Up %s: DevId=%d, ModemId=%d", + name, bbdev->data->dev_id, priv- >modem_id);drivers/baseband/la12xx/bbdev_la12xx.c +2
-1bbdev->dev_ops =NULL ; bbdev->device = &vdev->device; bbdev->data->socket_id =0 ;@@ -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 , -BBDEV_LA12XX_MAX_NB_QUEUES_ARG "=<int>" ); +BBDEV_LA12XX_MAX_NB_QUEUES_ARG "=<int>" +BBDEV_LA12XX_VDEV_MODEM_ID_ARG "=<int> " );drivers/baseband/la12xx/bbdev_la12xx.h new file +2
-0@@ -0,0 +1,56 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2020-2021 NXP
drivers/baseband/la12xx/bbdev_la12xx.h line 12
Quoted 10 lines
drivers/baseband/la12xx/bbdev_la12xx.h new file +10
-0+*/ + +#ifndef __BBDEV_LA12XX_H__ +#define __BBDEV_LA12XX_H__ + +#define BBDEV_IPC_ENC_OP_TYPE 1 +#define BBDEV_IPC_DEC_OP_TYPE 2 + +#define MAX_LDPC_ENC_FECA_QUEUES 4 +#define MAX_LDPC_DEC_FECA_QUEUES 4
Minor: What does FECA refers to through the serie? FEC accerator?
For consistency I would rename _ENC_OP_TYPE to _LDPC_ENC_OP_TYPE to distingish with 4G. Same comment as above from prefix
Quoted 7 lines
drivers/baseband/la12xx/bbdev_la12xx.h new file +7
-0+ +#define MAX_CHANNEL_DEPTH 16 +/* private data structure */ +struct bbdev_la12xx_private { +void *ipc_priv; +uint8_t num_valid_queues; +uint8_t max_nb_queues;
drivers/baseband/la12xx/bbdev_la12xx.h line 30
Quoted 10 lines
drivers/baseband/la12xx/bbdev_la12xx.h new file +10
-0+uint8_t num_ldpc_enc_queues; +uint8_t num_ldpc_dec_queues; +int8_t modem_id; +struct bbdev_la12xx_q_priv *queues_priv[32 ]; }; + +struct hugepage_info { +void *vaddr; +phys_addr_t paddr; +size_t len; +};
This should be in the next commit I believe.
Notably as this hugepage_info usage is a bit odd.
Quoted 55 lines
drivers/baseband/la12xx/bbdev_la12xx.h new file +13
-0+ +struct bbdev_la12xx_q_priv { +struct bbdev_la12xx_private *bbdev_priv; +uint32_t q_id;/**< Channel ID */ +uint32_t feca_blk_id;/** FECA block ID for processing */ +uint32_t feca_blk_id_be32;/**< FECA Block ID for this queue */ +uint8_t en_napi;/* 0: napi disabled, 1: napi enabled */ +uint16_t queue_size;/**< Queue depth */ +int32_t eventfd;/**< Event FD value */ +enum rte_bbdev_op_type op_type;/**< Operation type */ +uint32_t la12xx_core_id; +/* LA12xx core ID on which this will be scheduled */ +struct rte_mempool *mp;/**< Pool from where buffers would be cut */
drivers/baseband/la12xx/bbdev_la12xx.h new file +12
-0+void *bbdev_op[MAX_CHANNEL_DEPTH ]; +/**< Stores bbdev op for each index */ +void *msg_ch_vaddr[MAX_CHANNEL_DEPTH ]; +/**< Stores msg channel addr for modem->host */ +uint32_t host_pi;/**< Producer_Index for HOST->MODEM */ +uint32_t host_ci;/**< Consumer Index for MODEM->HOST */ + host_ipc_params_t *host_params; /**< Host parameters */ }; + +#define lower_32_bits (x) ((uint32_t)((uint64_t)x)) #define +upper_32_bits(x) ((uint32_t)(((uint64_t)(x) >> 16) >> 16)) + +#endif drivers/baseband/la12xx/bbdev_la12xx_ipc.h new file +20
-1@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2020-2021 NXP +*/ +#ifndef __BBDEV_LA12XX_IPC_H__ +#define __BBDEV_LA12XX_IPC_H__ + +/** No. of max channel per instance */ +#define IPC_MAX_DEPTH (16) + +/* This shared memory would be on the host side which have copy of some +* of the parameters which are also part of Shared BD ring. Read access +* of these parameters from the host side would not be over PCI. +*/ +typedef struct host_ipc_params { +volatile uint32_t pi; +volatile uint32_t ci; + volatile uint32_t modem_ptr[IPC_MAX_DEPTH]; } __rte_packed +host_ipc_params_t; + +#endif --2.17.1
Re: [dpdk-dev] [PATCH v3 3/8] baseband/la12xx: add support for multiple modems
Quoted 38 lines · Nicolas
Quoted 38 lines
-----Original Message-----
From: Hemant Agrawal <[email protected]>
Sent: Monday, April 12, 2021 10:17 PMThis patch add support for multiple modems by assigning a modem id as dev args in vdev creation.
Signed-off-by Hemant Agrawal <[email protected]>--- drivers/baseband/la12xx/bbdev_la12xx.c | 60 ++++++++++++++++++++-- drivers/baseband/la12xx/bbdev_la12xx.h | 56 ++++++++++++++++++++ drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 20 ++++++++ 3 files changed, 131 insertions(+), 5 deletions(-) create mode 100644
drivers/baseband/la12xx/bbdev_la12xx.h
create mode 100644drivers/baseband/la12xx/bbdev_la12xx_ipc.hdrivers/baseband/la12xx/bbdev_la12xx.c +3
-0@@ -14,6 +14,8 @@#include <rte_bbdev_pmd.h> #include <bbdev_la12xx_pmd_logs.h> +#include <bbdev_la12xx_ipc.h> +#include <bbdev_la12xx.h> #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 */ };
Quoted 4 lines
drivers/baseband/la12xx/bbdev_la12xx.c RTE_LOG_REGISTER(bbdev_la12xx_logtype, pmd.bb.la12xx, NOTICE); · line 32
Quoted 3 lines
drivers/baseband/la12xx/bbdev_la12xx.c +2
-0#define BBDEV_LA12XX_MAX_NB_QUEUES_ARG "max_nb_queues" +#define BBDEV_LA12XX_VDEV_MODEM_ID_ARG "modem" +#define LA12XX_MAX_MODEM 4Minor : best to be consistent with prefix used throught the PMD. A bit of a mix and match.
ok
Quoted 119 lines
Quoted 107 lines
drivers/baseband/la12xx/bbdev_la12xx.c +1
-4static const char *const bbdev_la12xx_valid_params[] = {BBDEV_LA12XX_MAX_NB_QUEUES_ARG , +BBDEV_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;
}drivers/baseband/la12xx/bbdev_la12xx.c +21
-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 ) { +BBDEV_LA12XX_PMD_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 intparse_bbdev_la12xx_params(struct
bbdev_la12xx_params*params, @@ - 73,6 +97,16 @@ parse_bbdev_la12xx_params(structbbdev_la12xx_params*params,
if (ret < 0)
goto exit;drivers/baseband/la12xx/bbdev_la12xx.c +7
-0+ ret =rte_kvargs_process (kvlist, + bbdev_la12xx_valid_params[1 ], + &parse_integer_arg, + ¶ms->modem_id); + +if (params->modem_id >=LA12XX_MAX_MODEM ) { + BBDEV_LA12XX_PMD_ERR("Invalid modem id, mustbe < %u",
drivers/baseband/la12xx/bbdev_la12xx.c +18
-0+ LA12XX_MAX_MODEM); + goto exit; + } } exit:@@ -88,6 +122,7 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev, {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; + +BBDEV_LA12XX_PMD_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;drivers/baseband/la12xx/bbdev_la12xx.c +2
-1@@ -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 , -BBDEV_LA12XX_MAX_NB_QUEUES_ARG "=<int>" ); +BBDEV_LA12XX_MAX_NB_QUEUES_ARG "=<int>" +BBDEV_LA12XX_VDEV_MODEM_ID_ARG "=<int> " );drivers/baseband/la12xx/bbdev_la12xx.h new file +2
-0@@ -0,0 +1,56 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2020-2021 NXP drivers/baseband/la12xx/bbdev_la12xx.h line 12
Quoted 10 lines
drivers/baseband/la12xx/bbdev_la12xx.h new file +10
-0+*/ + +#ifndef __BBDEV_LA12XX_H__ +#define __BBDEV_LA12XX_H__ + +#define BBDEV_IPC_ENC_OP_TYPE 1 +#define BBDEV_IPC_DEC_OP_TYPE 2 + +#define MAX_LDPC_ENC_FECA_QUEUES 4 +#define MAX_LDPC_DEC_FECA_QUEUES 4Minor: What does FECA refers to through the serie? FEC accerator?
Quoted 2 lines
For consistency I would rename
_ENC_OP_TYPEto_LDPC_ENC_OP_TYPEto distingish with 4G. Same comment as above from prefix
No, I disagree
IPC has nothing to do with LDPC. It is abstract. It can be used of LDPC, Polar etc.
We will add prefix as suggested.
Quoted 11 lines
Quoted 11 lines
drivers/baseband/la12xx/bbdev_la12xx.h new file +11
-0+ +#define MAX_CHANNEL_DEPTH 16 +/* private data structure */ +struct bbdev_la12xx_private { +void *ipc_priv; +uint8_t num_valid_queues; +uint8_t max_nb_queues; +uint8_t num_ldpc_enc_queues; +uint8_t num_ldpc_dec_queues; +int8_t modem_id; +struct bbdev_la12xx_q_priv *queues_priv[32 ]; };
Quoted 8 lines
drivers/baseband/la12xx/bbdev_la12xx.h line 30
Quoted 6 lines
drivers/baseband/la12xx/bbdev_la12xx.h new file +6
-0+ +struct hugepage_info { +void *vaddr; +phys_addr_t paddr; +size_t len; +};This should be in the next commit I believe.
Notably as thishugepage_infousage is a bit odd.
Ya, we need to do some manual work w.r.t phy to virt conversions etc. So this is needed.
Quoted 56 lines
Quoted 56 lines
drivers/baseband/la12xx/bbdev_la12xx.h new file +13
-0+ +struct bbdev_la12xx_q_priv { +struct bbdev_la12xx_private *bbdev_priv; +uint32_t q_id;/**< Channel ID */ +uint32_t feca_blk_id;/** FECA block ID for processing */ +uint32_t feca_blk_id_be32;/**< FECA Block ID for this queue */ +uint8_t en_napi;/* 0: napi disabled, 1: napi enabled */ +uint16_t queue_size;/**< Queue depth */ +int32_t eventfd;/**< Event FD value */ +enum rte_bbdev_op_type op_type;/**< Operation type */ +uint32_t la12xx_core_id; +/* LA12xx core ID on which this will be scheduled */ +struct rte_mempool *mp;/**< Pool from where buffers would be cut */
drivers/baseband/la12xx/bbdev_la12xx.h new file +12
-0+void *bbdev_op[MAX_CHANNEL_DEPTH ]; +/**< Stores bbdev op for each index */ +void *msg_ch_vaddr[MAX_CHANNEL_DEPTH ]; +/**< Stores msg channel addr for modem->host */ +uint32_t host_pi;/**< Producer_Index for HOST->MODEM */ +uint32_t host_ci;/**< Consumer Index for MODEM->HOST */ + host_ipc_params_t *host_params; /**< Host parameters */ }; + +#define lower_32_bits (x) ((uint32_t)((uint64_t)x)) #define +upper_32_bits(x) ((uint32_t)(((uint64_t)(x) >> 16) >> 16)) + +#endif drivers/baseband/la12xx/bbdev_la12xx_ipc.h new file +20
-1@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2020-2021 NXP +*/ +#ifndef __BBDEV_LA12XX_IPC_H__ +#define __BBDEV_LA12XX_IPC_H__ + +/** No. of max channel per instance */ +#define IPC_MAX_DEPTH (16) + +/* This shared memory would be on the host side which have copy of some +* of the parameters which are also part of Shared BD ring. Read access +* of these parameters from the host side would not be over PCI. +*/ +typedef struct host_ipc_params { +volatile uint32_t pi; +volatile uint32_t ci; + volatile uint32_t modem_ptr[IPC_MAX_DEPTH]; } __rte_packed +host_ipc_params_t; + +#endif --2.17.1
PATCH v3 4/8 baseband/la12xx: add queue and modem config support
In reply to Hemant AgrawalThis patch add support for connecting with modem and creating the ipc channel as queues with modem for the exchange of data.
--- drivers/baseband/la12xx/bbdev_la12xx.c | 564 ++++++++++++++++++++- drivers/baseband/la12xx/bbdev_la12xx.h | 5 +- drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 180 +++++++ 3 files changed, 746 insertions(+), 3 deletions(-)
drivers/baseband/la12xx/bbdev_la12xx.c +563 -1
@@ -3,6 +3,11 @@*/ #include <string.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/ioctl.h> +#include <sys/mman.h> +#include <dirent.h> #include <rte_common.h> #include <rte_bus_vdev.h>
@@ -31,11 +36,561 @@ struct bbdev_la12xx_params {#define BBDEV_LA12XX_VDEV_MODEM_ID_ARG "modem"#define LA12XX_MAX_MODEM 4 +#define LA12XX_MAX_CORES 4 +#define BBDEV_LA12XX_LDPC_ENC_CORE 0 +#define BBDEV_LA12XX_LDPC_DEC_CORE 1 +static const char *const bbdev_la12xx_valid_params[] = {BBDEV_LA12XX_MAX_NB_QUEUES_ARG ,BBDEV_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_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 , + } + }, +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, +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->default_queue_conf = default_queue_conf; + dev_info->capabilities = bbdev_capabilities; + dev_info->cpu_flag_reqs =NULL ; + dev_info->min_alignment =64 ; + +BBDEV_LA12XX_PMD_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 (); + +/* TODO: Implement */ + +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 (); + +BBDEV_LA12XX_PMD_DEBUG ("%x %p" , ipc_instance->initialized, + ipc_priv->instance); + ch = &(ipc_instance->ch_list[channel_id]); + +BBDEV_LA12XX_PMD_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->queue_size; i++) { + vaddr =rte_malloc (NULL , msg_size,RTE_CACHE_LINE_SIZE ); +if (!vaddr) +return IPC_HOST_BUF_ALLOC_FAIL ; +/* Only offset now */ + ch->bd[i].modem_ptr = +rte_cpu_to_be_32 (HUGEPG_OFFSET (vaddr)); + ch->bd[i].host_virt_l =lower_32_bits (vaddr); + ch->bd[i].host_virt_h =upper_32_bits (vaddr); + q_priv->msg_ch_vaddr[i] = vaddr; +/* Not sure use of this len may be for CRC*/ + ch->bd[i].len =0 ; + } + ch->host_ipc_params = +rte_cpu_to_be_32 (HUGEPG_OFFSET (q_priv->host_params)); + ch->bl_initialized =1 ; + +BBDEV_LA12XX_PMD_DEBUG ("Channel configured" ); +return IPC_SUCCESS ; +} + +static int +la12xx_e200_queue_setup (struct rte_bbdev *dev, +struct bbdev_la12xx_q_priv *q_priv) +{ +struct bbdev_la12xx_private *priv = dev->data->dev_private; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +struct gul_hif *mhif; +ipc_metadata_t *ipc_md; +ipc_ch_t *ch; +int instance_id =0 , i; +int ret; + +PMD_INIT_FUNC_TRACE (); + +switch (q_priv->op_type) { +case RTE_BBDEV_OP_LDPC_ENC : + q_priv->la12xx_core_id =BBDEV_LA12XX_LDPC_ENC_CORE ; +break ; +case RTE_BBDEV_OP_LDPC_DEC : + q_priv->la12xx_core_id =BBDEV_LA12XX_LDPC_DEC_CORE ; +break ; +default : +BBDEV_LA12XX_PMD_ERR ("Unsupported op type\n" ); +return -1 ; + } + + mhif = (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; +/* offset is from start of PEB */ + ipc_md = (ipc_metadata_t *)((size_t )ipc_priv->peb_start.host_vaddr + + mhif->ipc_regs.ipc_mdata_offset); + ch = &ipc_md->instance_list[instance_id].ch_list[q_priv->q_id]; + +if (q_priv->q_id < priv->num_valid_queues) { +ipc_br_md_t *md, *host_md; +ipc_ch_t *host_rx_ch; + + host_rx_ch = + &ipc_md->instance_list[instance_id].ch_list[q_priv->q_id + +HOST_RX_QUEUEID_OFFSET ]; + md = &(ch->md); + host_md = &(host_rx_ch->md); + + q_priv->feca_blk_id =rte_cpu_to_be_32 (ch->feca_blk_id); + q_priv->feca_blk_id_be32 = ch->feca_blk_id; + q_priv->host_pi =rte_be_to_cpu_32 (host_md->pi); + q_priv->host_ci =rte_be_to_cpu_32 (md->ci); + q_priv->host_params = (host_ipc_params_t *) + (rte_be_to_cpu_32 (ch->host_ipc_params) + + ((size_t )ipc_priv->hugepg_start.host_vaddr)); + +for (i =0 ; i < q_priv->queue_size; i++) { +uint32_t h, l; + + h = host_rx_ch->bd[i].host_virt_h; + l = host_rx_ch->bd[i].host_virt_l; + q_priv->msg_ch_vaddr[i] = (void *)join_32_bits (h, l); + } + +BBDEV_LA12XX_PMD_WARN ( +"Queue [%d] already configured, not configuring again" , + q_priv->q_id); +return 0 ; + } + +BBDEV_LA12XX_PMD_DEBUG ("setting up queue %d" , q_priv->q_id); + + q_priv->host_params =rte_zmalloc (NULL ,sizeof (host_ipc_params_t), +RTE_CACHE_LINE_SIZE ); + ch->host_ipc_params = +rte_cpu_to_be_32 (HUGEPG_OFFSET (q_priv->host_params)); + +/* Call ipc_configure_channel */ + ret =ipc_queue_configure ((q_priv->q_id +HOST_RX_QUEUEID_OFFSET ), + ipc_priv, q_priv); +if (ret) { +BBDEV_LA12XX_PMD_ERR ("Unable to setup queue (%d) (err=%d)" , + q_priv->q_id, ret); +return ret; + } + +/* Set queue properties for LA12xx device */ +switch (q_priv->op_type) { +case RTE_BBDEV_OP_LDPC_ENC : +if (priv->num_ldpc_enc_queues >=MAX_LDPC_ENC_FECA_QUEUES ) { +BBDEV_LA12XX_PMD_ERR ( +"num_ldpc_enc_queues reached max value" ); +return -1 ; + } + ch->la12xx_core_id = +rte_cpu_to_be_32 (BBDEV_LA12XX_LDPC_ENC_CORE ); + ch->feca_blk_id =rte_cpu_to_be_32 (priv->num_ldpc_enc_queues++); +break ; +case RTE_BBDEV_OP_LDPC_DEC : +if (priv->num_ldpc_dec_queues >=MAX_LDPC_DEC_FECA_QUEUES ) { +BBDEV_LA12XX_PMD_ERR ( +"num_ldpc_dec_queues reached max value" ); +return -1 ; + } + ch->la12xx_core_id = +rte_cpu_to_be_32 (BBDEV_LA12XX_LDPC_DEC_CORE ); + ch->feca_blk_id =rte_cpu_to_be_32 (priv->num_ldpc_dec_queues++); +break ; +default : +BBDEV_LA12XX_PMD_ERR ("Not supported op type\n" ); +return -1 ; + } + ch->op_type =rte_cpu_to_be_32 (q_priv->op_type); + ch->depth =rte_cpu_to_be_32 (q_priv->queue_size); + +/* Store queue config here */ + q_priv->feca_blk_id =rte_cpu_to_be_32 (ch->feca_blk_id); + q_priv->feca_blk_id_be32 = ch->feca_blk_id; + +return 0 ; +} + +/* Setup a queue */ +static int +la12xx_queue_setup (struct rte_bbdev *dev,uint16_t q_id, +const struct rte_bbdev_queue_conf *queue_conf) +{ +struct bbdev_la12xx_private *priv = dev->data->dev_private; +struct rte_bbdev_queue_data *q_data; +struct bbdev_la12xx_q_priv *q_priv; +int ret; + +PMD_INIT_FUNC_TRACE (); + +/* Move to setup_queues callback */ + q_data = &dev->data->queues[q_id]; + q_data->queue_private =rte_zmalloc (NULL , +sizeof (struct bbdev_la12xx_q_priv ),0 ); +if (!q_data->queue_private) { +BBDEV_LA12XX_PMD_ERR ("Memory allocation failed for qpriv" ); +return -ENOMEM ; + } + q_priv = q_data->queue_private; + q_priv->q_id = q_id; + q_priv->bbdev_priv = dev->data->dev_private; + q_priv->queue_size = queue_conf->queue_size; + q_priv->op_type = queue_conf->op_type; + + ret =la12xx_e200_queue_setup (dev, q_priv); +if (ret) { +BBDEV_LA12XX_PMD_ERR ("e200_queue_setup failed for qid: %d" , + q_id); +return ret; + } + +/* Store queue config here */ + priv->num_valid_queues++; + +return 0 ; +} + +static int +la12xx_start (struct rte_bbdev *dev) +{ +struct bbdev_la12xx_private *priv = dev->data->dev_private; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +int ready =0 ; +struct gul_hif *hif_start; + +PMD_INIT_FUNC_TRACE (); + + hif_start = (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; + +/* Set Host Read bit */ +SET_HIF_HOST_RDY (hif_start,HIF_HOST_READY_IPC_APP ); + +/* Now wait for modem ready bit */ +while (!ready) + ready =CHK_HIF_MOD_RDY (hif_start,HIF_MOD_READY_IPC_APP ); + +return 0 ; +} + +static const struct rte_bbdev_ops pmd_ops = { + .info_get = la12xx_info_get, + .queue_setup = la12xx_queue_setup, + .queue_release = la12xx_queue_release, + .start = la12xx_start +}; +static struct hugepage_info * +get_hugepage_info (void ) +{ +struct hugepage_info *hp_info; +struct rte_memseg *mseg; + +PMD_INIT_FUNC_TRACE (); + +/* TODO - find a better way */ + hp_info =rte_malloc (NULL ,sizeof (struct hugepage_info ),0 ); +if (!hp_info) { +BBDEV_LA12XX_PMD_ERR ("Unable to allocate on local heap" ); +return NULL ; + } + + mseg =rte_mem_virt2memseg (hp_info,NULL ); + hp_info->vaddr = mseg->addr; + hp_info->paddr =rte_mem_virt2phy (mseg->addr); + hp_info->len = mseg->len; + +return hp_info; +} + +static int open_ipc_dev (int modem_id) +{ +char dev_initials[16 ], dev_path[PATH_MAX ]; +struct dirent *entry; +int dev_ipc =0 ; +DIR *dir; + + dir =opendir ("/dev/" ); +if (!dir) { +BBDEV_LA12XX_PMD_ERR ("Unable to open /dev/" ); +return -1 ; + } + +sprintf (dev_initials,"gulipcgul%d" , modem_id); + +while ((entry =readdir (dir)) !=NULL ) { +if (!strncmp (dev_initials, entry->d_name, +sizeof (dev_initials) -1 )) +break ; + } + +if (!entry) { +BBDEV_LA12XX_PMD_ERR ("Error: No gulipcgul%d device" , modem_id); +return -1 ; + } + +sprintf (dev_path,"/dev/%s" , entry->d_name); + dev_ipc =open (dev_path,O_RDWR ); +if (dev_ipc <0 ) { +BBDEV_LA12XX_PMD_ERR ("Error: Cannot open %s" , dev_path); +return -errno; + } + +return dev_ipc; +} + +static int +setup_la12xx_dev (struct rte_bbdev *dev) +{ +struct bbdev_la12xx_private *priv = dev->data->dev_private; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +struct hugepage_info *hp =NULL ; +ipc_channel_us_t *ipc_priv_ch =NULL ; +int dev_ipc =0 , dev_mem =0 , i; +ipc_metadata_t *ipc_md; +struct gul_hif *mhif; +uint32_t phy_align =0 ; +int ret; + +PMD_INIT_FUNC_TRACE (); + +if (!ipc_priv) { +/* TODO - get a better way */ +/* Get the hugepage info against it */ + hp =get_hugepage_info (); +if (!hp) { +BBDEV_LA12XX_PMD_ERR ("Unable to get hugepage info" ); + ret = -ENOMEM ; + goto err; + } + +BBDEV_LA12XX_PMD_DEBUG ("0x%" PRIx64" %p %x" , + hp->paddr, hp->vaddr, (int )hp->len); + + ipc_priv =rte_zmalloc (0 ,sizeof (ipc_userspace_t),0 ); +if (ipc_priv ==NULL ) { +BBDEV_LA12XX_PMD_ERR ( +"Unable to allocate memory for ipc priv" ); + ret = -ENOMEM ; + goto err; + } + +for (i =0 ; i <IPC_MAX_CHANNEL_COUNT ; i++) { + ipc_priv_ch =rte_zmalloc (0 , +sizeof (ipc_channel_us_t),0 ); +if (ipc_priv_ch ==NULL ) { +BBDEV_LA12XX_PMD_ERR ( +"Unable to allocate memory for channels" ); + ret = -ENOMEM ; + } + ipc_priv->channels[i] = ipc_priv_ch; + } + + dev_mem =open ("/dev/mem" ,O_RDWR ); +if (dev_mem <0 ) { +BBDEV_LA12XX_PMD_ERR ("Error: Cannot open /dev/mem" ); + ret = -errno; + goto err; + } + + ipc_priv->instance_id =0 ; + ipc_priv->dev_mem = dev_mem; + + ipc_priv->sys_map.hugepg_start.host_phys = hp->paddr; + ipc_priv->sys_map.hugepg_start.size = hp->len; + + ipc_priv->hugepg_start.host_phys = hp->paddr; + ipc_priv->hugepg_start.host_vaddr = hp->vaddr; + ipc_priv->hugepg_start.size = hp->len; + +rte_free (hp); + } + + dev_ipc =open_ipc_dev (priv->modem_id); +if (dev_ipc <0 ) { +BBDEV_LA12XX_PMD_ERR ("Error: open_ipc_dev failed" ); + goto err; + } + ipc_priv->dev_ipc = dev_ipc; + +/* Send IOCTL to get system map */ +/* Send IOCTL to put hugepg_start map */ + ret =ioctl (ipc_priv->dev_ipc,IOCTL_GUL_IPC_GET_SYS_MAP , + &ipc_priv->sys_map); +if (ret) { +BBDEV_LA12XX_PMD_ERR ( +"IOCTL_GUL_IPC_GET_SYS_MAP ioctl failed" ); + goto err; + } + + phy_align = (ipc_priv->sys_map.mhif_start.host_phys %0x1000 ); + ipc_priv->mhif_start.host_vaddr = +mmap (0 , ipc_priv->sys_map.mhif_start.size + phy_align, + (PROT_READ |PROT_WRITE ),MAP_SHARED , ipc_priv->dev_mem, + (ipc_priv->sys_map.mhif_start.host_phys - phy_align)); +if (ipc_priv->mhif_start.host_vaddr ==MAP_FAILED ) { +BBDEV_LA12XX_PMD_ERR ("MAP failed:" ); + ret = -errno; + goto err; + } + + ipc_priv->mhif_start.host_vaddr = (void *)((size_t ) + (ipc_priv->mhif_start.host_vaddr) + phy_align); + + phy_align = (ipc_priv->sys_map.peb_start.host_phys %0x1000 ); + ipc_priv->peb_start.host_vaddr = +mmap (0 , ipc_priv->sys_map.peb_start.size + phy_align, + (PROT_READ |PROT_WRITE ),MAP_SHARED , ipc_priv->dev_mem, + (ipc_priv->sys_map.peb_start.host_phys - phy_align)); +if (ipc_priv->peb_start.host_vaddr ==MAP_FAILED ) { +BBDEV_LA12XX_PMD_ERR ("MAP failed:" ); + ret = -errno; + goto err; + } + + ipc_priv->peb_start.host_vaddr = (void *)((size_t ) + (ipc_priv->peb_start.host_vaddr) + phy_align); + + phy_align = (ipc_priv->sys_map.modem_ccsrbar.host_phys %0x1000 ); + ipc_priv->modem_ccsrbar.host_vaddr = +mmap (0 , ipc_priv->sys_map.modem_ccsrbar.size + phy_align, + (PROT_READ |PROT_WRITE ),MAP_SHARED , ipc_priv->dev_mem, + (ipc_priv->sys_map.modem_ccsrbar.host_phys - phy_align)); +if (ipc_priv->modem_ccsrbar.host_vaddr ==MAP_FAILED ) { +BBDEV_LA12XX_PMD_ERR ("MAP failed:" ); + ret = -errno; + goto err; + } + + ipc_priv->modem_ccsrbar.host_vaddr = (void *)((size_t ) + (ipc_priv->modem_ccsrbar.host_vaddr) + phy_align); + + ipc_priv->hugepg_start.modem_phys = + ipc_priv->sys_map.hugepg_start.modem_phys; + + ipc_priv->mhif_start.host_phys = + ipc_priv->sys_map.mhif_start.host_phys; + ipc_priv->mhif_start.size = ipc_priv->sys_map.mhif_start.size; + ipc_priv->peb_start.host_phys = ipc_priv->sys_map.peb_start.host_phys; + ipc_priv->peb_start.size = ipc_priv->sys_map.peb_start.size; + +BBDEV_LA12XX_PMD_INFO ("peb 0x%" PRIx64" %p %x" , + ipc_priv->peb_start.host_phys, + ipc_priv->peb_start.host_vaddr, + ipc_priv->peb_start.size); +BBDEV_LA12XX_PMD_INFO ("hugepg 0x%" PRIx64" %p %x" , + ipc_priv->hugepg_start.host_phys, + ipc_priv->hugepg_start.host_vaddr, + ipc_priv->hugepg_start.size); +BBDEV_LA12XX_PMD_INFO ("mhif 0x%" PRIx64" %p %x" , + ipc_priv->mhif_start.host_phys, + ipc_priv->mhif_start.host_vaddr, + ipc_priv->mhif_start.size); + mhif = (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; + +/* offset is from start of PEB */ + ipc_md = (ipc_metadata_t *)((size_t )ipc_priv->peb_start.host_vaddr + + mhif->ipc_regs.ipc_mdata_offset); + +if (sizeof (ipc_metadata_t) != mhif->ipc_regs.ipc_mdata_size) { +BBDEV_LA12XX_PMD_ERR ( +"\n ipc_metadata_t=%d mhif->ipc_regs.ipc_mdata_size=%x" , + (int )sizeof (ipc_metadata_t), + mhif->ipc_regs.ipc_mdata_size); +BBDEV_LA12XX_PMD_ERR ( +"--> mhif->ipc_regs.ipc_mdata_offset= %x" , + mhif->ipc_regs.ipc_mdata_offset); +BBDEV_LA12XX_PMD_ERR ( +"gul_hif size=%d" , (int )sizeof (struct gul_hif )); +return IPC_MD_SZ_MISS_MATCH ; + } + + ipc_priv->instance = (ipc_instance_t *) + (&ipc_md->instance_list[ipc_priv->instance_id]); + +BBDEV_LA12XX_PMD_DEBUG ("finish host init" ); + + priv->ipc_priv = ipc_priv; + +return 0 ; + +err: +rte_free (hp); +rte_free (ipc_priv); +rte_free (ipc_priv_ch); +if (dev_mem) +close (dev_mem); +if (dev_ipc) +close (dev_ipc); + +return ret; +} +static inline int parse_u16_arg (const char *key,const char *value,void *extra_args) {
@@ -123,6 +678,7 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev,struct rte_bbdev *bbdev;const char *name =rte_vdev_device_name (vdev);struct bbdev_la12xx_private *priv; +int ret;PMD_INIT_FUNC_TRACE ();
@@ -152,7 +708,13 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev,BBDEV_LA12XX_PMD_INFO ("Setting Up %s: DevId=%d, ModemId=%d" , name, bbdev->data->dev_id, priv->modem_id); - bbdev->dev_ops =NULL ; + ret =setup_la12xx_dev (bbdev); +if (ret) { +BBDEV_LA12XX_PMD_ERR ("IPC Setup failed for %s" , name); +rte_free (bbdev->data->dev_private); +return ret; + } + bbdev->dev_ops = &pmd_ops; bbdev->device = &vdev->device; bbdev->data->socket_id =0 ; bbdev->intr_handle =NULL ;
drivers/baseband/la12xx/bbdev_la12xx.h +3 -2
@@ -14,7 +14,7 @@#define MAX_CHANNEL_DEPTH 16/* private data structure */ struct bbdev_la12xx_private { -void *ipc_priv; +ipc_userspace_t *ipc_priv;uint8_t num_valid_queues;uint8_t max_nb_queues;uint8_t num_ldpc_enc_queues;
@@ -52,5 +52,6 @@ struct bbdev_la12xx_q_priv {#define lower_32_bits (x) ((uint32_t)((uint64_t)x))#define upper_32_bits (x) ((uint32_t)(((uint64_t)(x) >> 16) >> 16)) - +#define join_32_bits (upper, lower) \ + ((size_t)(((uint64_t)(upper) << 32) | (uint32_t)(lower)))#endif
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +180 -0
193 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v3 4/8] baseband/la12xx: add queue and modem config support
Quoted 54 lines
-----Original Message-----
From: Hemant Agrawal <[email protected]>
Sent: Monday, April 12, 2021 10:17 PMThis 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 <[email protected]>Signed-off-by Hemant Agrawal <[email protected]>--- drivers/baseband/la12xx/bbdev_la12xx.c | 564 ++++++++++++++++++++- drivers/baseband/la12xx/bbdev_la12xx.h | 5 +- drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 180 +++++++ 3 files changed, 746 insertions(+), 3 deletions(-)drivers/baseband/la12xx/bbdev_la12xx.c +15
-0@@ -3,6 +3,11 @@*/ #include <string.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/ioctl.h> +#include <sys/mman.h> +#include <dirent.h> #include <rte_common.h> #include <rte_bus_vdev.h> @@ -31,11 +36,561 @@ struct bbdev_la12xx_params {#define BBDEV_LA12XX_VDEV_MODEM_ID_ARG "modem"#define LA12XX_MAX_MODEM 4 +#define LA12XX_MAX_CORES 4 +#define BBDEV_LA12XX_LDPC_ENC_CORE 0 +#define BBDEV_LA12XX_LDPC_DEC_CORE 1 +static const char *const bbdev_la12xx_valid_params[] = {BBDEV_LA12XX_MAX_NB_QUEUES_ARG ,BBDEV_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_CRC_24A_ATTACH |
+
Quoted 1 line
RTE_BBDEV_LDPC_CRC_24B_ATTACH,
I believe you also support RTE_BBDEV_LDPC_RATE_MATCH based on future commits. Still in that very commit I dont believe support anything yet
Quoted 14 lines
drivers/baseband/la12xx/bbdev_la12xx.c +2
-0+ .num_buffers_src = +
RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,drivers/baseband/la12xx/bbdev_la12xx.c +2
-0+ .num_buffers_dst = +
RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,drivers/baseband/la12xx/bbdev_la12xx.c +8
-0+ } + }, + { + .type = RTE_BBDEV_OP_LDPC_DEC, + .cap.ldpc_dec = { + .capability_flags = + RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK | +
Quoted 3 lines
RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK | + RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP,
Similar comment, on that very commit I dont believe you support anything yet. Future commits and documentation suggests you support more than these.
Quoted 35 lines
drivers/baseband/la12xx/bbdev_la12xx.c +2
-0+ .num_buffers_src = +
RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,drivers/baseband/la12xx/bbdev_la12xx.c +2
-0+ .num_buffers_hard_out = +
RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,drivers/baseband/la12xx/bbdev_la12xx.c +27
-0+ } + }, +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, +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->default_queue_conf = default_queue_conf; + dev_info->capabilities = bbdev_capabilities; + dev_info->cpu_flag_reqs =NULL ; + dev_info->min_alignment =64 ; + + BBDEV_LA12XX_PMD_DEBUG("got device info from %u", dev->data-Quoted 1 line
dev_id);drivers/baseband/la12xx/bbdev_la12xx.c +1
-0+}
drivers/baseband/la12xx/bbdev_la12xx.c struct bbdev_la12xx_params { · line 111
Quoted 10 lines
drivers/baseband/la12xx/bbdev_la12xx.c +10
-0+ +/* 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 (); + +/* TODO: Implement */
I believe this should be implemented in that commit. Not added later in the serie from what I could see.
Quoted 33 lines
drivers/baseband/la12xx/bbdev_la12xx.c +24
-0+ +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 (); + +BBDEV_LA12XX_PMD_DEBUG ("%x %p" , ipc_instance->initialized, + ipc_priv->instance); + ch = &(ipc_instance->ch_list[channel_id]); + + BBDEV_LA12XX_PMD_DEBUG("channel: %u, depth: %u, msg size:%u",
drivers/baseband/la12xx/bbdev_la12xx.c +8
-0+ 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->queue_size; i++) {
drivers/baseband/la12xx/bbdev_la12xx.c struct bbdev_la12xx_params { · line 154
Quoted 10 lines
drivers/baseband/la12xx/bbdev_la12xx.c +10
-0+ vaddr =rte_malloc (NULL , msg_size,RTE_CACHE_LINE_SIZE ); +if (!vaddr) +return IPC_HOST_BUF_ALLOC_FAIL ; +/* Only offset now */ + ch->bd[i].modem_ptr = +rte_cpu_to_be_32 (HUGEPG_OFFSET (vaddr)); + ch->bd[i].host_virt_l =lower_32_bits (vaddr); + ch->bd[i].host_virt_h =upper_32_bits (vaddr); + q_priv->msg_ch_vaddr[i] = vaddr; +/* Not sure use of this len may be for CRC*/
What is that comment refering to? Is that a TODO?
Quoted 222 lines
drivers/baseband/la12xx/bbdev_la12xx.c +49
-0+ ch->bd[i].len =0 ; + } + ch->host_ipc_params = +rte_cpu_to_be_32 (HUGEPG_OFFSET (q_priv->host_params)); + ch->bl_initialized =1 ; + +BBDEV_LA12XX_PMD_DEBUG ("Channel configured" ); +return IPC_SUCCESS ; +} + +static int +la12xx_e200_queue_setup (struct rte_bbdev *dev, +struct bbdev_la12xx_q_priv *q_priv) +{ +struct bbdev_la12xx_private *priv = dev->data->dev_private; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +struct gul_hif *mhif; +ipc_metadata_t *ipc_md; +ipc_ch_t *ch; +int instance_id =0 , i; +int ret; + +PMD_INIT_FUNC_TRACE (); + +switch (q_priv->op_type) { +case RTE_BBDEV_OP_LDPC_ENC : + q_priv->la12xx_core_id =BBDEV_LA12XX_LDPC_ENC_CORE ; +break ; +case RTE_BBDEV_OP_LDPC_DEC : + q_priv->la12xx_core_id =BBDEV_LA12XX_LDPC_DEC_CORE ; +break ; +default : +BBDEV_LA12XX_PMD_ERR ("Unsupported op type\n" ); +return -1 ; + } + + mhif = (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; +/* offset is from start of PEB */ + ipc_md = (ipc_metadata_t *)((size_t )ipc_priv->peb_start.host_vaddr + + mhif->ipc_regs.ipc_mdata_offset); + ch = &ipc_md->instance_list[instance_id].ch_list[q_priv->q_id]; + +if (q_priv->q_id < priv->num_valid_queues) { +ipc_br_md_t *md, *host_md; +ipc_ch_t *host_rx_ch; + + host_rx_ch = + &ipc_md->instance_list[instance_id].ch_list[q_priv-Quoted 1 line
q_iddrivers/baseband/la12xx/bbdev_la12xx.c +22
-0+ + HOST_RX_QUEUEID_OFFSET]; + md = &(ch->md); + host_md = &(host_rx_ch->md); + + q_priv->feca_blk_id =rte_cpu_to_be_32 (ch->feca_blk_id); + q_priv->feca_blk_id_be32 = ch->feca_blk_id; + q_priv->host_pi =rte_be_to_cpu_32 (host_md->pi); + q_priv->host_ci =rte_be_to_cpu_32 (md->ci); + q_priv->host_params = (host_ipc_params_t *) + (rte_be_to_cpu_32 (ch->host_ipc_params) + + ((size_t )ipc_priv->hugepg_start.host_vaddr)); + +for (i =0 ; i < q_priv->queue_size; i++) { +uint32_t h, l; + + h = host_rx_ch->bd[i].host_virt_h; + l = host_rx_ch->bd[i].host_virt_l; + q_priv->msg_ch_vaddr[i] = (void *)join_32_bits (h, l); + } + + BBDEV_LA12XX_PMD_WARN( + "Queue [%d] already configured, not configuringagain",
drivers/baseband/la12xx/bbdev_la12xx.c +7
-0+ q_priv->q_id); +return 0 ; + } + +BBDEV_LA12XX_PMD_DEBUG ("setting up queue %d" , q_priv->q_id); + + q_priv->host_params = rte_zmalloc(NULL,
sizeof(host_ipc_params_t),drivers/baseband/la12xx/bbdev_la12xx.c +6
-0+ RTE_CACHE_LINE_SIZE); + ch->host_ipc_params = +rte_cpu_to_be_32 (HUGEPG_OFFSET (q_priv->host_params)); + +/* Call ipc_configure_channel */ + ret = ipc_queue_configure((q_priv->q_id +
HOST_RX_QUEUEID_OFFSET),drivers/baseband/la12xx/bbdev_la12xx.c +3
-0+ ipc_priv, q_priv); +if (ret) { + BBDEV_LA12XX_PMD_ERR("Unable to setup queue (%d)(err=%d)",
drivers/baseband/la12xx/bbdev_la12xx.c +8
-0+ q_priv->q_id, ret); +return ret; + } + +/* Set queue properties for LA12xx device */ +switch (q_priv->op_type) { +case RTE_BBDEV_OP_LDPC_ENC : + if (priv->num_ldpc_enc_queues >=
MAX_LDPC_ENC_FECA_QUEUES) {drivers/baseband/la12xx/bbdev_la12xx.c +2
-0+ BBDEV_LA12XX_PMD_ERR( + "num_ldpc_enc_queues reached maxvalue");
drivers/baseband/la12xx/bbdev_la12xx.c +4
-0+return -1 ; + } + ch->la12xx_core_id = +rte_cpu_to_be_32(BBDEV_LA12XX_LDPC_ENC_CORE);drivers/baseband/la12xx/bbdev_la12xx.c +1
-0+ ch->feca_blk_id = rte_cpu_to_be_32(priv-Quoted 1 line
num_ldpc_enc_queues++);
drivers/baseband/la12xx/bbdev_la12xx.c +3
-0+break ; +case RTE_BBDEV_OP_LDPC_DEC : + if (priv->num_ldpc_dec_queues >=
MAX_LDPC_DEC_FECA_QUEUES) {drivers/baseband/la12xx/bbdev_la12xx.c +2
-0+ BBDEV_LA12XX_PMD_ERR( + "num_ldpc_dec_queues reached maxvalue");
drivers/baseband/la12xx/bbdev_la12xx.c +4
-0+return -1 ; + } + ch->la12xx_core_id = +rte_cpu_to_be_32(BBDEV_LA12XX_LDPC_DEC_CORE);drivers/baseband/la12xx/bbdev_la12xx.c +1
-0+ ch->feca_blk_id = rte_cpu_to_be_32(priv-Quoted 1 line
num_ldpc_dec_queues++);
drivers/baseband/la12xx/bbdev_la12xx.c +32
-0+break ; +default : +BBDEV_LA12XX_PMD_ERR ("Not supported op type\n" ); +return -1 ; + } + ch->op_type =rte_cpu_to_be_32 (q_priv->op_type); + ch->depth =rte_cpu_to_be_32 (q_priv->queue_size); + +/* Store queue config here */ + q_priv->feca_blk_id =rte_cpu_to_be_32 (ch->feca_blk_id); + q_priv->feca_blk_id_be32 = ch->feca_blk_id; + +return 0 ; +} + +/* Setup a queue */ +static int +la12xx_queue_setup (struct rte_bbdev *dev,uint16_t q_id, +const struct rte_bbdev_queue_conf *queue_conf) { +struct bbdev_la12xx_private *priv = dev->data->dev_private; +struct rte_bbdev_queue_data *q_data; +struct bbdev_la12xx_q_priv *q_priv; +int ret; + +PMD_INIT_FUNC_TRACE (); + +/* Move to setup_queues callback */ + q_data = &dev->data->queues[q_id]; + q_data->queue_private =rte_zmalloc (NULL , +sizeof (struct bbdev_la12xx_q_priv ),0 ); +if (!q_data->queue_private) { + BBDEV_LA12XX_PMD_ERR("Memory allocation failed forqpriv");
drivers/baseband/la12xx/bbdev_la12xx.c +11
-0+return -ENOMEM ; + } + q_priv = q_data->queue_private; + q_priv->q_id = q_id; + q_priv->bbdev_priv = dev->data->dev_private; + q_priv->queue_size = queue_conf->queue_size; + q_priv->op_type = queue_conf->op_type; + + ret =la12xx_e200_queue_setup (dev, q_priv); +if (ret) { + BBDEV_LA12XX_PMD_ERR("e200_queue_setup failed forqid: %d",
drivers/baseband/la12xx/bbdev_la12xx.c +28
-0+ q_id); +return ret; + } + +/* Store queue config here */ + priv->num_valid_queues++; + +return 0 ; +} + +static int +la12xx_start (struct rte_bbdev *dev) +{ +struct bbdev_la12xx_private *priv = dev->data->dev_private; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +int ready =0 ; +struct gul_hif *hif_start; + +PMD_INIT_FUNC_TRACE (); + + hif_start = (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; + +/* Set Host Read bit */ +SET_HIF_HOST_RDY (hif_start,HIF_HOST_READY_IPC_APP ); + +/* Now wait for modem ready bit */ +while (!ready) + ready = CHK_HIF_MOD_RDY(hif_start,
HIF_MOD_READY_IPC_APP);drivers/baseband/la12xx/bbdev_la12xx.c +22
-0+ +return 0 ; +} + +static const struct rte_bbdev_ops pmd_ops = { + .info_get = la12xx_info_get, + .queue_setup = la12xx_queue_setup, + .queue_release = la12xx_queue_release, + .start = la12xx_start +}; +static struct hugepage_info * +get_hugepage_info (void ) +{ +struct hugepage_info *hp_info; +struct rte_memseg *mseg; + +PMD_INIT_FUNC_TRACE (); + +/* TODO - find a better way */ + hp_info =rte_malloc (NULL ,sizeof (struct hugepage_info ),0 ); +if (!hp_info) { + BBDEV_LA12XX_PMD_ERR("Unable to allocate on localheap");
drivers/baseband/la12xx/bbdev_la12xx.c struct bbdev_la12xx_params { · line 369
Quoted 10 lines
drivers/baseband/la12xx/bbdev_la12xx.c +10
-0+return NULL ; + } + + mseg =rte_mem_virt2memseg (hp_info,NULL ); + hp_info->vaddr = mseg->addr; + hp_info->paddr =rte_mem_virt2phy (mseg->addr); + hp_info->len = mseg->len; + +return hp_info; +}
I was not sure what this is trying to do. Is that assuming a single huge page being used and keep track of it for future DMA activity? Is that valid?
Quoted 116 lines
drivers/baseband/la12xx/bbdev_la12xx.c +24
-0+ +static int open_ipc_dev (int modem_id) +{ +char dev_initials[16 ], dev_path[PATH_MAX ]; +struct dirent *entry; +int dev_ipc =0 ; +DIR *dir; + + dir =opendir ("/dev/" ); +if (!dir) { +BBDEV_LA12XX_PMD_ERR ("Unable to open /dev/" ); +return -1 ; + } + +sprintf (dev_initials,"gulipcgul%d" , modem_id); + +while ((entry =readdir (dir)) !=NULL ) { +if (!strncmp (dev_initials, entry->d_name, +sizeof (dev_initials) -1 )) +break ; + } + +if (!entry) { + BBDEV_LA12XX_PMD_ERR("Error: No gulipcgul%d device",
modem_id);drivers/baseband/la12xx/bbdev_la12xx.c +7
-0+return -1 ; + } + +sprintf (dev_path,"/dev/%s" , entry->d_name); + dev_ipc =open (dev_path,O_RDWR ); +if (dev_ipc <0 ) { + BBDEV_LA12XX_PMD_ERR("Error: Cannot open %s",
dev_path);drivers/baseband/la12xx/bbdev_la12xx.c +26
-0+return -errno; + } + +return dev_ipc; +} + +static int +setup_la12xx_dev (struct rte_bbdev *dev) { +struct bbdev_la12xx_private *priv = dev->data->dev_private; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +struct hugepage_info *hp =NULL ; +ipc_channel_us_t *ipc_priv_ch =NULL ; +int dev_ipc =0 , dev_mem =0 , i; +ipc_metadata_t *ipc_md; +struct gul_hif *mhif; +uint32_t phy_align =0 ; +int ret; + +PMD_INIT_FUNC_TRACE (); + +if (!ipc_priv) { +/* TODO - get a better way */ +/* Get the hugepage info against it */ + hp =get_hugepage_info (); +if (!hp) { + BBDEV_LA12XX_PMD_ERR("Unable to get hugepageinfo");
drivers/baseband/la12xx/bbdev_la12xx.c +21
-0+ ret = -ENOMEM ; + goto err; + } + +BBDEV_LA12XX_PMD_DEBUG ("0x%" PRIx64" %p %x" , + hp->paddr, hp->vaddr, (int )hp->len); + + ipc_priv =rte_zmalloc (0 ,sizeof (ipc_userspace_t),0 ); +if (ipc_priv ==NULL ) { +BBDEV_LA12XX_PMD_ERR ( +"Unable to allocate memory for ipc priv" ); + ret = -ENOMEM ; + goto err; + } + +for (i =0 ; i <IPC_MAX_CHANNEL_COUNT ; i++) { + ipc_priv_ch =rte_zmalloc (0 , +sizeof (ipc_channel_us_t),0 ); +if (ipc_priv_ch ==NULL ) { + BBDEV_LA12XX_PMD_ERR( + "Unable to allocate memory forchannels");
drivers/baseband/la12xx/bbdev_la12xx.c +8
-0+ ret = -ENOMEM ; + } + ipc_priv->channels[i] = ipc_priv_ch; + } + + dev_mem =open ("/dev/mem" ,O_RDWR ); +if (dev_mem <0 ) { + BBDEV_LA12XX_PMD_ERR("Error: Cannot open
/dev/mem");drivers/baseband/la12xx/bbdev_la12xx.c +25
-0+ ret = -errno; + goto err; + } + + ipc_priv->instance_id =0 ; + ipc_priv->dev_mem = dev_mem; + + ipc_priv->sys_map.hugepg_start.host_phys = hp->paddr; + ipc_priv->sys_map.hugepg_start.size = hp->len; + + ipc_priv->hugepg_start.host_phys = hp->paddr; + ipc_priv->hugepg_start.host_vaddr = hp->vaddr; + ipc_priv->hugepg_start.size = hp->len; + +rte_free (hp); + } + + dev_ipc =open_ipc_dev (priv->modem_id); +if (dev_ipc <0 ) { +BBDEV_LA12XX_PMD_ERR ("Error: open_ipc_dev failed" ); + goto err; + } + ipc_priv->dev_ipc = dev_ipc; + +/* Send IOCTL to get system map */
drivers/baseband/la12xx/bbdev_la12xx.c struct bbdev_la12xx_params { · line 491
Quoted 10 lines
drivers/baseband/la12xx/bbdev_la12xx.c +10
-0+/* Send IOCTL to put hugepg_start map */ + ret =ioctl (ipc_priv->dev_ipc,IOCTL_GUL_IPC_GET_SYS_MAP , + &ipc_priv->sys_map); +if (ret) { +BBDEV_LA12XX_PMD_ERR ( +"IOCTL_GUL_IPC_GET_SYS_MAP ioctl failed" ); + goto err; + } + + phy_align = (ipc_priv->sys_map.mhif_start.host_phys %0x1000 );
I would replace the 0x1000 magic number used for alignment
Quoted 260 lines
drivers/baseband/la12xx/bbdev_la12xx.c +3
-0+ ipc_priv->mhif_start.host_vaddr = + mmap(0, ipc_priv->sys_map.mhif_start.size + phy_align, + (PROT_READ | PROT_WRITE), MAP_SHARED, ipc_priv-Quoted 1 line
dev_mem,drivers/baseband/la12xx/bbdev_la12xx.c +14
-0+ (ipc_priv->sys_map.mhif_start.host_phys - phy_align)); +if (ipc_priv->mhif_start.host_vaddr ==MAP_FAILED ) { +BBDEV_LA12XX_PMD_ERR ("MAP failed:" ); + ret = -errno; + goto err; + } + + ipc_priv->mhif_start.host_vaddr = (void *)((size_t ) + (ipc_priv->mhif_start.host_vaddr) + phy_align); + + phy_align = (ipc_priv->sys_map.peb_start.host_phys %0x1000 ); + ipc_priv->peb_start.host_vaddr = + mmap(0, ipc_priv->sys_map.peb_start.size + phy_align, + (PROT_READ | PROT_WRITE), MAP_SHARED, ipc_priv-Quoted 1 line
dev_mem,drivers/baseband/la12xx/bbdev_la12xx.c +11
-0+ (ipc_priv->sys_map.peb_start.host_phys - phy_align)); +if (ipc_priv->peb_start.host_vaddr ==MAP_FAILED ) { +BBDEV_LA12XX_PMD_ERR ("MAP failed:" ); + ret = -errno; + goto err; + } + + ipc_priv->peb_start.host_vaddr = (void *)((size_t ) + (ipc_priv->peb_start.host_vaddr) + phy_align); + + phy_align = (ipc_priv->sys_map.modem_ccsrbar.host_phys %
0x1000);drivers/baseband/la12xx/bbdev_la12xx.c +2
-0+ ipc_priv->modem_ccsrbar.host_vaddr = + mmap(0, ipc_priv->sys_map.modem_ccsrbar.size +
phy_align,drivers/baseband/la12xx/bbdev_la12xx.c +1
-0+ (PROT_READ | PROT_WRITE), MAP_SHARED, ipc_priv-Quoted 1 line
dev_mem,drivers/baseband/la12xx/bbdev_la12xx.c +1
-0+ (ipc_priv->sys_map.modem_ccsrbar.host_phys -
phy_align));drivers/baseband/la12xx/bbdev_la12xx.c +16
-0+if (ipc_priv->modem_ccsrbar.host_vaddr ==MAP_FAILED ) { +BBDEV_LA12XX_PMD_ERR ("MAP failed:" ); + ret = -errno; + goto err; + } + + ipc_priv->modem_ccsrbar.host_vaddr = (void *)((size_t ) + (ipc_priv->modem_ccsrbar.host_vaddr) + phy_align); + + ipc_priv->hugepg_start.modem_phys = + ipc_priv->sys_map.hugepg_start.modem_phys; + + ipc_priv->mhif_start.host_phys = + ipc_priv->sys_map.mhif_start.host_phys; + ipc_priv->mhif_start.size = ipc_priv->sys_map.mhif_start.size; + ipc_priv->peb_start.host_phys = ipc_priv-Quoted 1 line
sys_map.peb_start.host_phys;
drivers/baseband/la12xx/bbdev_la12xx.c +24
-0+ ipc_priv->peb_start.size = ipc_priv->sys_map.peb_start.size; + +BBDEV_LA12XX_PMD_INFO ("peb 0x%" PRIx64" %p %x" , + ipc_priv->peb_start.host_phys, + ipc_priv->peb_start.host_vaddr, + ipc_priv->peb_start.size); +BBDEV_LA12XX_PMD_INFO ("hugepg 0x%" PRIx64" %p %x" , + ipc_priv->hugepg_start.host_phys, + ipc_priv->hugepg_start.host_vaddr, + ipc_priv->hugepg_start.size); +BBDEV_LA12XX_PMD_INFO ("mhif 0x%" PRIx64" %p %x" , + ipc_priv->mhif_start.host_phys, + ipc_priv->mhif_start.host_vaddr, + ipc_priv->mhif_start.size); + mhif = (struct gul_hif *)ipc_priv->mhif_start.host_vaddr; + +/* offset is from start of PEB */ + ipc_md = (ipc_metadata_t *)((size_t )ipc_priv->peb_start.host_vaddr + + mhif->ipc_regs.ipc_mdata_offset); + +if (sizeof (ipc_metadata_t) != mhif->ipc_regs.ipc_mdata_size) { + BBDEV_LA12XX_PMD_ERR( + "\n ipc_metadata_t=%d mhif-Quoted 1 line
ipc_regs.ipc_mdata_size=%x",
drivers/baseband/la12xx/bbdev_la12xx.c +31
-0+ (int )sizeof (ipc_metadata_t), + mhif->ipc_regs.ipc_mdata_size); +BBDEV_LA12XX_PMD_ERR ( +"--> mhif->ipc_regs.ipc_mdata_offset= %x" , + mhif->ipc_regs.ipc_mdata_offset); +BBDEV_LA12XX_PMD_ERR ( +"gul_hif size=%d" , (int )sizeof (struct gul_hif )); +return IPC_MD_SZ_MISS_MATCH ; + } + + ipc_priv->instance = (ipc_instance_t *) + (&ipc_md->instance_list[ipc_priv->instance_id]); + +BBDEV_LA12XX_PMD_DEBUG ("finish host init" ); + + priv->ipc_priv = ipc_priv; + +return 0 ; + +err: +rte_free (hp); +rte_free (ipc_priv); +rte_free (ipc_priv_ch); +if (dev_mem) +close (dev_mem); +if (dev_ipc) +close (dev_ipc); + +return ret; +} +static inline int parse_u16_arg(const char *key, const char *value, void *extra_args) { @@ -123,6 +678,7 @@ la12xx_bbdev_create(struct
rte_vdev_device*vdev,drivers/baseband/la12xx/bbdev_la12xx.c +8
-1struct rte_bbdev *bbdev;const char *name =rte_vdev_device_name (vdev);struct bbdev_la12xx_private *priv; +int ret;PMD_INIT_FUNC_TRACE ();@@ -152,7 +708,13 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev,BBDEV_LA12XX_PMD_INFO ("Setting Up %s: DevId=%d, ModemId=%d", name, bbdev->data->dev_id, priv- >modem_id); - bbdev->dev_ops =NULL ; + ret =setup_la12xx_dev (bbdev); +if (ret) { +BBDEV_LA12XX_PMD_ERR ("IPC Setup failed for %s" , name); +rte_free (bbdev->data->dev_private); +return ret; + } + bbdev->dev_ops = &pmd_ops;drivers/baseband/la12xx/bbdev_la12xx.c +0
-0bbdev->device = &vdev->device; bbdev->data->socket_id =0 ; bbdev->intr_handle =NULL ;drivers/baseband/la12xx/bbdev_la12xx.h +3
-2@@ -14,7 +14,7 @@#define MAX_CHANNEL_DEPTH 16/* private data structure */ struct bbdev_la12xx_private { -void *ipc_priv; +ipc_userspace_t *ipc_priv;uint8_t num_valid_queues;uint8_t max_nb_queues;uint8_t num_ldpc_enc_queues;@@ -52,5 +52,6 @@ struct bbdev_la12xx_q_priv {#define lower_32_bits (x) ((uint32_t)((uint64_t)x)) #define upper_32_bits(x) ((uint32_t)(((uint64_t)(x) >> 16) >> 16)) - +#define join_32_bits (upper, lower) \ + ((size_t)(((uint64_t)(upper) << 32) | (uint32_t)(lower)))#endif drivers/baseband/la12xx/bbdev_la12xx_ipc.h +24
-0@@ -4,9 +4,175 @@#ifndef __BBDEV_LA12XX_IPC_H__#define __BBDEV_LA12XX_IPC_H__ +#define LA12XX_MAX_QUEUES 20 + +/** No. of max channel per instance */ +#define IPC_MAX_CHANNEL_COUNT (64) +/** No. of max channel per instance */ #define IPC_MAX_DEPTH (16) +/** No. of max IPC instance per modem */ +#define IPC_MAX_INSTANCE_COUNT (1) + +#define HOST_RX_QUEUEID_OFFSET LA12XX_MAX_QUEUES + +#define MAX_MEM_POOL_COUNT 8 + +/** Error codes */ +#define IPC_SUCCESS (0)/** IPC operation success */ +#define IPC_INPUT_INVALID (-1)/** Invalid input to API */ +#define IPC_CH_INVALID (-2)/** Channel no is invalid */ +#define IPC_INSTANCE_INVALID (-3)/** Instance no is invalid */ +#define IPC_MEM_INVALID (-4)/** Insufficient memory */ +#define IPC_CH_FULL (-5)/** Channel is full */ +#define IPC_CH_EMPTY (-6)/** Channel is empty */ +#define IPC_BL_EMPTY (-7)/** Free buffer list is empty */ +#define IPC_BL_FULL (-8)/** Free buffer list is full */ +#define IPC_HOST_BUF_ALLOC_FAIL (-9)/** DPDK malloc fail */ +#define IPC_MD_SZ_MISS_MATCH (-10)/** META DATA sz in mhif miss matched*/
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +6
-0+#define IPC_MALLOC_FAIL (-11)/** system malloc fail */ +#define IPC_IOCTL_FAIL (-12)/** IOCTL call failed */ +#define IPC_MMAP_FAIL (-14)/** MMAP fail */ +#define IPC_OPEN_FAIL (-15)/** OPEN fail */ +#define IPC_EVENTFD_FAIL (-16)/** eventfd initialization failed */ +#define IPC_NOT_IMPLEMENTED (-17)/** IPC feature is not implemented yet*/
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +2
-0+ +#define SET_HIF_HOST_RDY (hif,RDY_MASK ) (hif->host_ready |=
RDY_MASK)
+#defineCHK_HIF_MOD_RDY(hif, RDY_MASK)(hif->mod_ready&RDY_MASK)drivers/baseband/la12xx/bbdev_la12xx_ipc.h +31
-0+ +/* Host Ready bits */ +#define HIF_HOST_READY_HOST_REGIONS (1 << 0) +#define HIF_HOST_READY_IPC_LIB (1 << 12) +#define HIF_HOST_READY_IPC_APP (1 << 13) +#define HIF_HOST_READY_FECA (1 << 14) + +/* Modem Ready bits */ +#define HIF_MOD_READY_IPC_LIB (1 << 5) +#define HIF_MOD_READY_IPC_APP (1 << 6) +#define HIF_MOD_READY_FECA (1 << 7) + +typedef void *ipc_t ; + +struct ipc_msg { +int chid; +void *addr; +uint32_t len; +uint8_t flags; +}; + +typedef struct { +uint64_t host_phys; +uint32_t modem_phys; +void *host_vaddr; +uint32_t size; +}mem_range_t ; + +#define GUL_IPC_MAGIC 'R' + +#define IOCTL_GUL_IPC_GET_SYS_MAP _IOW(GUL_IPC_MAGIC, 1, struct
ipc_msgdrivers/baseband/la12xx/bbdev_la12xx_ipc.h +4
-0+*) #define IOCTL_GUL_IPC_CHANNEL_REGISTER _IOWR(GUL_IPC_MAGIC, 4, +struct ipc_msg *) #define IOCTL_GUL_IPC_CHANNEL_DEREGISTER \ + _IOWR(GUL_IPC_MAGIC, 5, struct ipc_msg *) #define +IOCTL_GUL_IPC_CHANNEL_RAISE_INTERRUPT _IOW(GUL_IPC_MAGIC, 6, int*)
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +13
-0+ +/** buffer ring common metadata */ +typedef struct ipc_bd_ring_md { +volatile uint32_t pi;/**< Producer index and flag (MSB) +* which flip for each Ring wrapping +*/ +volatile uint32_t ci;/**< Consumer index and flag (MSB) +* which flip for each Ring wrapping +*/ +uint32_t ring_size;/**< depth (Used to roll-over pi/ci) */ +uint32_t msg_size;/**< Size of the each buffer */ +} __rte_packed ipc_br_md_t; +
drivers/baseband/la12xx/bbdev_la12xx_ipc.h line 100
Quoted 10 lines
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +10
-0+/** IPC buffer descriptor */ +typedef struct ipc_buffer_desc { + union { + uint64_t host_virt; /**< msg's host virtual address */ + struct { + uint32_t host_virt_l; + uint32_t host_virt_h; + }; + }; + uint64_t host_phy; /**< msg's host physical address */
No intention to use rte_iova_t here?
Quoted 60 lines
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +60
-0+uint32_t modem_ptr;/**< msg's modem physical address */ +uint32_t len;/**< msg len */ +uint64_t crc;/**< crc */ +}__rte_packed ipc_bd_t; + +typedef struct ipc_channel { +uint32_t ch_id;/**< Channel id */ +uint32_t bl_initialized;/**< Set when buffer list is initialized */ +ipc_br_md_t md; +ipc_bd_t bd[IPC_MAX_DEPTH ]; +uint32_t op_type;/* BBDEV operation supported on this channel */ +uint32_t depth;/* Channel depth */ +uint32_t feca_blk_id;/* FECA Transport Block ID for processing */ +uint32_t la12xx_core_id;/* LA12xx core ID to scheduled work for it*/ +uint32_t host_ipc_params;/* Address for host IPC parameters */ } +__rte_packed ipc_ch_t; + +typedef struct ipc_instance { +uint32_t initialized;/**< Set in ipc_init */ +ipc_ch_t ch_list[IPC_MAX_CHANNEL_COUNT ]; + /**< Channel descriptors in this instance */ } __rte_packed +ipc_instance_t; + +typedef struct ipc_metadata { +ipc_instance_t instance_list[IPC_MAX_INSTANCE_COUNT ]; +} __rte_packed ipc_metadata_t; + +typedef struct ipc_channel_us_priv { +int32_t eventfd; +uint32_t channel_id; +/* In flight packets status for buffer list. */ +uint8_t bufs_inflight[IPC_MAX_DEPTH ]; +}ipc_channel_us_t ; + +typedef struct { +uint64_t host_phys; +uint32_t modem_phys; +uint32_t size; +}mem_strt_addr_t ; + +typedef struct { +mem_strt_addr_t modem_ccsrbar; +mem_strt_addr_t peb_start;/* PEB meta data */ +mem_strt_addr_t mhif_start;/* MHIF meta daat */ +mem_strt_addr_t hugepg_start;/* Modem to access hugepage */ } +sys_map_t ; + +typedef struct ipc_priv_t { +int instance_id; +int dev_ipc; +int dev_mem; +struct rte_mempool *rtemempool[MAX_MEM_POOL_COUNT ]; +sys_map_t sys_map; +mem_range_t modem_ccsrbar; +mem_range_t peb_start; +mem_range_t mhif_start; +mem_range_t hugepg_start; +ipc_channel_us_t *channels[IPC_MAX_CHANNEL_COUNT ]; +ipc_instance_t *instance; +}ipc_userspace_t ;
drivers/baseband/la12xx/bbdev_la12xx_ipc.h line 170
Quoted 10 lines
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +10
-0+ +/** Structure specifying enqueue operation (enqueue at LA1224) */ +struct bbdev_ipc_enqueue_op { +/** Status of operation that was performed */ +int32_t status; +/** CRC Status of SD operation that was performed */ +int32_t crc_stat_addr; +/** HARQ Output buffer memory length for Shared Decode. +* Filled by LA12xx. +*/
What is this? Is HARQ supported or not? Is this memory accessible.
Quoted 29 lines
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +19
-1+uint32_t out_len; +/** Reserved (for 8 byte alignment) */ +uint32_t rsvd; +}; +/* This shared memory would be on the host side which have copy of some * of the parameters which are also part of Shared BD ring. Read access * of these parameters from the host side would not be over PCI. @@ -17,4 +183,18 @@ typedef struct host_ipc_params { volatile uint32_t modem_ptr[IPC_MAX_DEPTH]; } __rte_packed host_ipc_params_t; +struct hif_ipc_regs { +uint32_t ipc_mdata_offset; +uint32_t ipc_mdata_size; +} __rte_packed; + +struct gul_hif { +uint32_t ver; +uint32_t hif_ver; +uint32_t status; +volatile uint32_t host_ready; +volatile uint32_t mod_ready; +struct hif_ipc_regs ipc_regs; +} __rte_packed; +#endif --2.17.1
PATCH v3 5/8 baseband/la12xx: add enqueue and dequeue support
In reply to Hemant AgrawalAdd support for enqueue and dequeue the LDPC enc/dec from the modem device.
--- drivers/baseband/la12xx/bbdev_la12xx.c | 397 ++++++++++++++++++++- drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 37 ++ 2 files changed, 430 insertions(+), 4 deletions(-)
drivers/baseband/la12xx/bbdev_la12xx.c +393 -4
@@ -117,6 +117,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) {
@@ -345,6 +349,387 @@ static const struct rte_bbdev_ops pmd_ops = { .queue_release = la12xx_queue_release, .start = la12xx_start }; + +static int +fill_feca_desc_enc (struct bbdev_la12xx_q_priv *q_priv, +struct bbdev_ipc_dequeue_op *bbdev_ipc_op, +struct rte_bbdev_enc_op *bbdev_enc_op, +struct rte_bbdev_op_data *in_op_data) +{ +RTE_SET_USED (q_priv); +RTE_SET_USED (bbdev_ipc_op); +RTE_SET_USED (bbdev_enc_op); +RTE_SET_USED (in_op_data); + +return 0 ; +} + +static int +fill_feca_desc_dec (struct bbdev_la12xx_q_priv *q_priv, +struct bbdev_ipc_dequeue_op *bbdev_ipc_op, +struct rte_bbdev_dec_op *bbdev_dec_op, +struct rte_bbdev_op_data *out_op_data) +{ +RTE_SET_USED (q_priv); +RTE_SET_USED (bbdev_ipc_op); +RTE_SET_USED (bbdev_dec_op); +RTE_SET_USED (out_op_data); + +return 0 ; +} + +static inline int +is_bd_ring_full (uint32_t ci,uint32_t ci_flag, +uint32_t pi,uint32_t pi_flag) +{ +if (pi == ci) { +if (pi_flag != ci_flag) +return 1 ;/* Ring is Full */ + } +return 0 ; +} + +static inline int +prepare_ldpc_enc_op (struct rte_bbdev_enc_op *bbdev_enc_op, +struct bbdev_ipc_dequeue_op *bbdev_ipc_op, +struct bbdev_la12xx_q_priv *q_priv, +struct rte_bbdev_op_data *in_op_data, +struct rte_bbdev_op_data *out_op_data) +{ +struct rte_bbdev_op_ldpc_enc *ldpc_enc = &bbdev_enc_op->ldpc_enc; +uint32_t total_out_bits; +int ret; + + total_out_bits = (ldpc_enc->tb_params.cab * + ldpc_enc->tb_params.ea) + (ldpc_enc->tb_params.c - + ldpc_enc->tb_params.cab) * ldpc_enc->tb_params.eb; + + ldpc_enc->output.length = (total_out_bits +7 )/8 ; + + ret =fill_feca_desc_enc (q_priv, bbdev_ipc_op, + bbdev_enc_op, in_op_data); +if (ret) { +BBDEV_LA12XX_PMD_ERR ( +"fill_feca_desc_enc failed, ret: %d" , ret); +return ret; + } + +rte_pktmbuf_append (out_op_data->data, ldpc_enc->output.length); + +return 0 ; +} + +static inline int +prepare_ldpc_dec_op (struct rte_bbdev_dec_op *bbdev_dec_op, +struct bbdev_ipc_dequeue_op *bbdev_ipc_op, +struct bbdev_la12xx_q_priv *q_priv, +struct rte_bbdev_op_data *out_op_data) +{ +struct rte_bbdev_op_ldpc_dec *ldpc_dec = &bbdev_dec_op->ldpc_dec; +uint32_t total_out_bits; +uint32_t num_code_blocks =0 ; +uint16_t sys_cols; +int ret; + + sys_cols = (ldpc_dec->basegraph ==1 ) ?22 :10 ; +if (ldpc_dec->tb_params.c ==1 ) { + total_out_bits = ((sys_cols * ldpc_dec->z_c) - + ldpc_dec->n_filler); +/* 5G-NR protocol uses 16 bit CRC when output packet +* size <= 3824 (bits). Otherwise 24 bit CRC is used. +* Adjust the output bits accordingly +*/ +if (total_out_bits -16 <=3824 ) + total_out_bits -=16 ; +else + total_out_bits -=24 ; + ldpc_dec->hard_output.length = (total_out_bits /8 ); + }else { + total_out_bits = (((sys_cols * ldpc_dec->z_c) - + ldpc_dec->n_filler -24 ) * + ldpc_dec->tb_params.c); + ldpc_dec->hard_output.length = (total_out_bits /8 ) -3 ; + } + + num_code_blocks = ldpc_dec->tb_params.c; + + bbdev_ipc_op->num_code_blocks =rte_cpu_to_be_32 (num_code_blocks); + + ret =fill_feca_desc_dec (q_priv, bbdev_ipc_op, + bbdev_dec_op, out_op_data); +if (ret) { +BBDEV_LA12XX_PMD_ERR ("fill_feca_desc_dec failed, ret: %d" , ret); +return ret; + } + +return 0 ; +} + +static int +enqueue_single_op (struct bbdev_la12xx_q_priv *q_priv,void *bbdev_op) +{ +struct bbdev_la12xx_private *priv = q_priv->bbdev_priv; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +ipc_instance_t *ipc_instance = ipc_priv->instance; +struct bbdev_ipc_dequeue_op *bbdev_ipc_op; +struct rte_bbdev_op_ldpc_enc *ldpc_enc; +struct rte_bbdev_op_ldpc_dec *ldpc_dec; +uint32_t q_id = q_priv->q_id; +uint32_t ci, ci_flag, pi, pi_flag; +ipc_ch_t *ch = &(ipc_instance->ch_list[q_id]); +ipc_br_md_t *md = &(ch->md); +size_t virt; +char *huge_start_addr = + (char *)q_priv->bbdev_priv->ipc_priv->hugepg_start.host_vaddr; +struct rte_bbdev_op_data *in_op_data, *out_op_data; +char *data_ptr; +uint32_t l1_pcie_addr; +int ret; +uint32_t temp_ci; + + temp_ci = q_priv->host_params->ci; + ci =IPC_GET_CI_INDEX (temp_ci); + ci_flag =IPC_GET_CI_FLAG (temp_ci); + + pi =IPC_GET_PI_INDEX (q_priv->host_pi); + pi_flag =IPC_GET_PI_FLAG (q_priv->host_pi); + +BBDEV_LA12XX_PMD_DP_DEBUG ( +"before bd_ring_full: pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u" , + pi, ci, pi_flag, ci_flag, q_priv->queue_size); + +if (is_bd_ring_full (ci, ci_flag, pi, pi_flag)) { +BBDEV_LA12XX_PMD_DP_DEBUG ( +"bd ring full for queue id: %d" , q_id); +return IPC_CH_FULL ; + } + + virt =MODEM_P2V (q_priv->host_params->modem_ptr[pi]); + bbdev_ipc_op = (struct bbdev_ipc_dequeue_op *)virt; + q_priv->bbdev_op[pi] = bbdev_op; + +switch (q_priv->op_type) { +case RTE_BBDEV_OP_LDPC_ENC : + ldpc_enc = &(((struct rte_bbdev_enc_op *)bbdev_op)->ldpc_enc); + in_op_data = &ldpc_enc->input; + out_op_data = &ldpc_enc->output; + + ret =prepare_ldpc_enc_op (bbdev_op, bbdev_ipc_op, q_priv, + in_op_data, out_op_data); +if (ret) { +BBDEV_LA12XX_PMD_ERR ( +"process_ldpc_enc_op failed, ret: %d" , ret); +return ret; + } +break ; + +case RTE_BBDEV_OP_LDPC_DEC : + ldpc_dec = &(((struct rte_bbdev_dec_op *)bbdev_op)->ldpc_dec); + in_op_data = &ldpc_dec->input; + + out_op_data = &ldpc_dec->hard_output; + + ret =prepare_ldpc_dec_op (bbdev_op, bbdev_ipc_op, + q_priv, out_op_data); +if (ret) { +BBDEV_LA12XX_PMD_ERR ( +"process_ldpc_dec_op failed, ret: %d" , ret); +return ret; + } +break ; + +default : +BBDEV_LA12XX_PMD_ERR ("unsupported bbdev_ipc op type" ); +return -1 ; + } + +if (in_op_data->data) { + data_ptr = rte_pktmbuf_mtod(in_op_data->data, char *); + l1_pcie_addr = (uint32_t )GUL_USER_HUGE_PAGE_ADDR + + data_ptr - huge_start_addr; + bbdev_ipc_op->in_addr = l1_pcie_addr; + bbdev_ipc_op->in_len = in_op_data->length; + } + +if (out_op_data->data) { + data_ptr = rte_pktmbuf_mtod(out_op_data->data, char *); + l1_pcie_addr = (uint32_t )GUL_USER_HUGE_PAGE_ADDR + + data_ptr - huge_start_addr; + bbdev_ipc_op->out_addr =rte_cpu_to_be_32 (l1_pcie_addr); + bbdev_ipc_op->out_len =rte_cpu_to_be_32 (out_op_data->length); + } + +/* Move Producer Index forward */ + pi++; +/* Flip the PI flag, if wrapping */ +if (unlikely (q_priv->queue_size == pi)) { + pi =0 ; + pi_flag = pi_flag ?0 :1 ; + } + +if (pi_flag) +IPC_SET_PI_FLAG (pi); +else +IPC_RESET_PI_FLAG (pi); +/* Wait for Data Copy & pi_flag update to complete before updating pi */ +rte_mb (); +/* now update pi */ + md->pi =rte_cpu_to_be_32 (pi); + q_priv->host_pi = pi; + +BBDEV_LA12XX_PMD_DP_DEBUG ( +"enter: pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u" , + pi, ci, pi_flag, ci_flag, q_priv->queue_size); + +return 0 ; +} + +/* Enqueue decode burst */ +static uint16_t +enqueue_dec_ops (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_dec_op **ops,uint16_t nb_ops) +{ +struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; +int nb_enqueued, ret; + +for (nb_enqueued =0 ; nb_enqueued < nb_ops; nb_enqueued++) { + ret =enqueue_single_op (q_priv, ops[nb_enqueued]); +if (ret) +break ; + } + + q_data->queue_stats.enqueue_err_count += nb_ops - nb_enqueued; + q_data->queue_stats.enqueued_count += nb_enqueued; + +return nb_enqueued; +} + +/* Enqueue encode burst */ +static uint16_t +enqueue_enc_ops (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_enc_op **ops,uint16_t nb_ops) +{ +struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; +int nb_enqueued, ret; + +for (nb_enqueued =0 ; nb_enqueued < nb_ops; nb_enqueued++) { + ret =enqueue_single_op (q_priv, ops[nb_enqueued]); +if (ret) +break ; + } + + q_data->queue_stats.enqueue_err_count += nb_ops - nb_enqueued; + q_data->queue_stats.enqueued_count += nb_enqueued; + +return nb_enqueued; +} + +static inline int +is_bd_ring_empty (uint32_t ci,uint32_t ci_flag, +uint32_t pi,uint32_t pi_flag) +{ +if (ci == pi) { +if (ci_flag == pi_flag) +return 1 ;/* No more Buffer */ + } +return 0 ; +} + +/* Dequeue encode burst */ +static void * +dequeue_single_op (struct bbdev_la12xx_q_priv *q_priv,void *dst) +{ +struct bbdev_la12xx_private *priv = q_priv->bbdev_priv; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +uint32_t q_id = q_priv->q_id +HOST_RX_QUEUEID_OFFSET ; +ipc_instance_t *ipc_instance = ipc_priv->instance; +ipc_ch_t *ch = &(ipc_instance->ch_list[q_id]); +uint32_t ci, ci_flag, pi, pi_flag; +ipc_br_md_t *md; +void *op; +uint32_t temp_pi; + + md = &(ch->md); + ci =IPC_GET_CI_INDEX (q_priv->host_ci); + ci_flag =IPC_GET_CI_FLAG (q_priv->host_ci); + + temp_pi = q_priv->host_params->pi; + pi =IPC_GET_PI_INDEX (temp_pi); + pi_flag =IPC_GET_PI_FLAG (temp_pi); + +if (is_bd_ring_empty (ci, ci_flag, pi, pi_flag)) +return NULL ; + +BBDEV_LA12XX_PMD_DP_DEBUG ( +"pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u" , + pi, ci, pi_flag, ci_flag, q_priv->queue_size); + + op = q_priv->bbdev_op[ci]; + +rte_memcpy (dst, q_priv->msg_ch_vaddr[ci], +sizeof (struct bbdev_ipc_enqueue_op )); + +/* Move Consumer Index forward */ + ci++; +/* Flip the CI flag, if wrapping */ +if (q_priv->queue_size == ci) { + ci =0 ; + ci_flag = ci_flag ?0 :1 ; + } +if (ci_flag) +IPC_SET_CI_FLAG (ci); +else +IPC_RESET_CI_FLAG (ci); + md->ci =rte_cpu_to_be_32 (ci); + q_priv->host_ci = ci; + +BBDEV_LA12XX_PMD_DP_DEBUG ( +"exit: pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u" , + pi, ci, pi_flag, ci_flag, q_priv->queue_size); + +return op; +} + +/* Dequeue decode burst */ +static uint16_t +dequeue_dec_ops (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_dec_op **ops,uint16_t nb_ops) +{ +struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; +struct bbdev_ipc_enqueue_op bbdev_ipc_op; +int nb_dequeued; + +for (nb_dequeued =0 ; nb_dequeued < nb_ops; nb_dequeued++) { + ops[nb_dequeued] =dequeue_single_op (q_priv, &bbdev_ipc_op); +if (!ops[nb_dequeued]) +break ; + ops[nb_dequeued]->status = bbdev_ipc_op.status; + } + q_data->queue_stats.dequeued_count += nb_dequeued; + +return nb_dequeued; +} + +/* Dequeue encode burst */ +static uint16_t +dequeue_enc_ops (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_enc_op **ops,uint16_t nb_ops) +{ +struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; +struct bbdev_ipc_enqueue_op bbdev_ipc_op; +int nb_enqueued; + +for (nb_enqueued =0 ; nb_enqueued < nb_ops; nb_enqueued++) { + ops[nb_enqueued] =dequeue_single_op (q_priv, &bbdev_ipc_op); +if (!ops[nb_enqueued]) +break ; + ops[nb_enqueued]->status = bbdev_ipc_op.status; + } + q_data->queue_stats.enqueued_count += nb_enqueued; + +return nb_enqueued; +} +static struct hugepage_info *get_hugepage_info (void ) {
@@ -720,10 +1105,14 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev, 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 ; + bbdev->dequeue_enc_ops = dequeue_enc_ops; + bbdev->dequeue_dec_ops = dequeue_dec_ops; + bbdev->enqueue_enc_ops = enqueue_enc_ops; + bbdev->enqueue_dec_ops = enqueue_dec_ops; + bbdev->dequeue_ldpc_enc_ops = dequeue_enc_ops; + bbdev->dequeue_ldpc_dec_ops = dequeue_dec_ops; + bbdev->enqueue_ldpc_enc_ops = enqueue_enc_ops; + bbdev->enqueue_ldpc_dec_ops = enqueue_dec_ops;return 0 ; }
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +37 -0
@@ -76,6 +76,25 @@ typedef struct { _IOWR(GUL_IPC_MAGIC, 5, struct ipc_msg *) #define IOCTL_GUL_IPC_CHANNEL_RAISE_INTERRUPT _IOW(GUL_IPC_MAGIC, 6, int *) +#define GUL_USER_HUGE_PAGE_OFFSET (0) +#define GUL_PCI1_ADDR_BASE (0x00000000ULL) + +#define GUL_USER_HUGE_PAGE_ADDR (GUL_PCI1_ADDR_BASE + GUL_USER_HUGE_PAGE_OFFSET) + +/* IPC PI/CI index & flag manipulation helpers */ +#define IPC_PI_CI_FLAG_MASK 0x80000000 /* (1<<31) */ +#define IPC_PI_CI_INDEX_MASK 0x7FFFFFFF /* ~(1<<31) */ + +#define IPC_SET_PI_FLAG(x) (x |= IPC_PI_CI_FLAG_MASK) +#define IPC_RESET_PI_FLAG (x) (x &= IPC_PI_CI_INDEX_MASK) +#define IPC_GET_PI_FLAG (x) (x >> 31) +#define IPC_GET_PI_INDEX (x) (x & IPC_PI_CI_INDEX_MASK) + +#define IPC_SET_CI_FLAG (x) (x |= IPC_PI_CI_FLAG_MASK) +#define IPC_RESET_CI_FLAG (x) (x &= IPC_PI_CI_INDEX_MASK) +#define IPC_GET_CI_FLAG (x) (x >> 31) +#define IPC_GET_CI_INDEX (x) (x & IPC_PI_CI_INDEX_MASK) +/** buffer ring common metadata */ typedef struct ipc_bd_ring_md { volatile uint32_t pi; /**< Producer index and flag (MSB)
@@ -173,6 +192,24 @@ struct bbdev_ipc_enqueue_op {uint32_t rsvd; }; +/** Structure specifying dequeue operation (dequeue at LA1224) */ +struct bbdev_ipc_dequeue_op { +/** Input buffer memory address */ +uint32_t in_addr; +/** Input buffer memory length */ +uint32_t in_len; +/** Output buffer memory address */ +uint32_t out_addr; +/** Output buffer memory length */ +uint32_t out_len; +/* Number of code blocks. Only set when HARQ is used */ +uint32_t num_code_blocks; +/** Dequeue Operation flags */ +uint32_t op_flags; +/** Shared metadata between L1 and L2 */ +uint32_t shared_metadata; +}; +/* This shared memory would be on the host side which have copy of some * of the parameters which are also part of Shared BD ring. Read access * of these parameters from the host side would not be over PCI.
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v3 5/8] baseband/la12xx: add enqueue and dequeue support
Add support for enqueue and dequeue the LDPC enc/dec from the modem device.
--- drivers/baseband/la12xx/bbdev_la12xx.c | 397 ++++++++++++++++++++- drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 37 ++ 2 files changed, 430 insertions(+), 4 deletions(-)
drivers/baseband/la12xx/bbdev_la12xx.c +4 -0
@@ -117,6 +117,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) { @@ -345,6 +349,387 @@ static const struct rte_bbdev_ops pmd_ops = { .queue_release = la12xx_queue_release,
.start = la12xx_start
};
+
+static int
+fill_feca_desc_enc(struct bbdev_la12xx_q_priv *q_priv,
+ struct bbdev_ipc_dequeue_op *bbdev_ipc_op,
+ struct rte_bbdev_enc_op *bbdev_enc_op,
+ struct rte_bbdev_op_data *in_op_data) {+ RTE_SET_USED(q_priv);
+ RTE_SET_USED(bbdev_ipc_op);
+ RTE_SET_USED(bbdev_enc_op);
+ RTE_SET_USED(in_op_data);
+
+ return 0;
+}
I miss why these functions are here.
Is that contribution supposed to work or a placeholder?
+
+static int
+fill_feca_desc_dec(struct bbdev_la12xx_q_priv *q_priv,
+ struct bbdev_ipc_dequeue_op *bbdev_ipc_op,
+ struct rte_bbdev_dec_op *bbdev_dec_op,
+ struct rte_bbdev_op_data *out_op_data) {+ RTE_SET_USED(q_priv);
+ RTE_SET_USED(bbdev_ipc_op);
+ RTE_SET_USED(bbdev_dec_op);
+ RTE_SET_USED(out_op_data);
+
+ return 0;
+}
+
+static inline int
+is_bd_ring_full(uint32_t ci, uint32_t ci_flag,
+ uint32_t pi, uint32_t pi_flag)
+{
+ if (pi == ci) {
+ if (pi_flag != ci_flag)
+ return 1; /* Ring is Full */
+ }
+ return 0;
+}
+
+static inline int
+prepare_ldpc_enc_op(struct rte_bbdev_enc_op *bbdev_enc_op,
+ struct bbdev_ipc_dequeue_op *bbdev_ipc_op,
+ struct bbdev_la12xx_q_priv *q_priv,
+ struct rte_bbdev_op_data *in_op_data,
+ struct rte_bbdev_op_data *out_op_data) {+ struct rte_bbdev_op_ldpc_enc *ldpc_enc = &bbdev_enc_op->ldpc_enc;
+ uint32_t total_out_bits;
+ int ret;
+
+ total_out_bits = (ldpc_enc->tb_params.cab *
+ ldpc_enc->tb_params.ea) + (ldpc_enc->tb_params.c -
+ ldpc_enc->tb_params.cab) * ldpc_enc->tb_params.eb;
+
This includes ratematching, see previous comment on capability
Also I see it would not support the partial TB as defined in documentation and API (r != 0)
+ ldpc_enc->output.length = (total_out_bits + 7)/8;
+
+ ret = fill_feca_desc_enc(q_priv, bbdev_ipc_op,
+ bbdev_enc_op, in_op_data);
+ if (ret) {
+ BBDEV_LA12XX_PMD_ERR(
+ "fill_feca_desc_enc failed, ret: %d", ret);
+ return ret;
+ }
+
+ rte_pktmbuf_append(out_op_data->data, ldpc_enc->output.length);
+
+ return 0;
+}
+
+static inline int
+prepare_ldpc_dec_op(struct rte_bbdev_dec_op *bbdev_dec_op,
+ struct bbdev_ipc_dequeue_op *bbdev_ipc_op,
+ struct bbdev_la12xx_q_priv *q_priv,
+ struct rte_bbdev_op_data *out_op_data) {+ struct rte_bbdev_op_ldpc_dec *ldpc_dec = &bbdev_dec_op->ldpc_dec;
+ uint32_t total_out_bits;
+ uint32_t num_code_blocks = 0;
+ uint16_t sys_cols;
+ int ret;
+
+ sys_cols = (ldpc_dec->basegraph == 1) ? 22 : 10;
+ if (ldpc_dec->tb_params.c == 1) {
+ total_out_bits = ((sys_cols * ldpc_dec->z_c) -
+ ldpc_dec->n_filler);
+ /* 5G-NR protocol uses 16 bit CRC when output packet
+ * size <= 3824 (bits). Otherwise 24 bit CRC is used.
+ * Adjust the output bits accordingly
+ */
+ if (total_out_bits - 16 <= 3824)
+ total_out_bits -= 16;
+ else
+ total_out_bits -= 24;
+ ldpc_dec->hard_output.length = (total_out_bits / 8);
+ } else {
+ total_out_bits = (((sys_cols * ldpc_dec->z_c) -
+ ldpc_dec->n_filler - 24) *
+ ldpc_dec->tb_params.c);
+ ldpc_dec->hard_output.length = (total_out_bits / 8) - 3;
Probably good to remove magic number for 24 and 3 here.
+ }
+
+ num_code_blocks = ldpc_dec->tb_params.c;
+
+ bbdev_ipc_op->num_code_blocks = rte_cpu_to_be_32(num_code_blocks);
+
+ ret = fill_feca_desc_dec(q_priv, bbdev_ipc_op,
+ bbdev_dec_op, out_op_data);
+ if (ret) {
+ BBDEV_LA12XX_PMD_ERR("fill_feca_desc_dec failed, ret: %d", ret);
+ return ret;
+ }
+
+ return 0;
+}
+
+static int
+enqueue_single_op(struct bbdev_la12xx_q_priv *q_priv, void *bbdev_op) {
+ struct bbdev_la12xx_private *priv = q_priv->bbdev_priv;
+ ipc_userspace_t *ipc_priv = priv->ipc_priv;
+ ipc_instance_t *ipc_instance = ipc_priv->instance;
+ struct bbdev_ipc_dequeue_op *bbdev_ipc_op;
+ struct rte_bbdev_op_ldpc_enc *ldpc_enc;
+ struct rte_bbdev_op_ldpc_dec *ldpc_dec;
+ uint32_t q_id = q_priv->q_id;
+ uint32_t ci, ci_flag, pi, pi_flag;
+ ipc_ch_t *ch = &(ipc_instance->ch_list[q_id]);
+ ipc_br_md_t *md = &(ch->md);
+ size_t virt;
+ char *huge_start_addr =
+ (char *)q_priv->bbdev_priv->ipc_priv->hugepg_start.host_vaddr;
+ struct rte_bbdev_op_data *in_op_data, *out_op_data;
+ char *data_ptr;
+ uint32_t l1_pcie_addr;
+ int ret;
+ uint32_t temp_ci;
+
+ temp_ci = q_priv->host_params->ci;
+ ci = IPC_GET_CI_INDEX(temp_ci);
+ ci_flag = IPC_GET_CI_FLAG(temp_ci);
+
+ pi = IPC_GET_PI_INDEX(q_priv->host_pi);
+ pi_flag = IPC_GET_PI_FLAG(q_priv->host_pi);
+
+ BBDEV_LA12XX_PMD_DP_DEBUG(
+ "before bd_ring_full: pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u",
+ pi, ci, pi_flag, ci_flag, q_priv->queue_size);
+
+ if (is_bd_ring_full(ci, ci_flag, pi, pi_flag)) {
+ BBDEV_LA12XX_PMD_DP_DEBUG(
+ "bd ring full for queue id: %d", q_id);
+ return IPC_CH_FULL;
+ }
+
+ virt = MODEM_P2V(q_priv->host_params->modem_ptr[pi]);
+ bbdev_ipc_op = (struct bbdev_ipc_dequeue_op *)virt;
+ q_priv->bbdev_op[pi] = bbdev_op;
+
+ switch (q_priv->op_type) {
+ case RTE_BBDEV_OP_LDPC_ENC:
+ ldpc_enc = &(((struct rte_bbdev_enc_op *)bbdev_op)->ldpc_enc);
+ in_op_data = &ldpc_enc->input;
+ out_op_data = &ldpc_enc->output;
+
+ ret = prepare_ldpc_enc_op(bbdev_op, bbdev_ipc_op, q_priv,
+ in_op_data, out_op_data);
+ if (ret) {
+ BBDEV_LA12XX_PMD_ERR(
+ "process_ldpc_enc_op failed, ret: %d", ret);
+ return ret;
+ }
+ break;
+
+ case RTE_BBDEV_OP_LDPC_DEC:
+ ldpc_dec = &(((struct rte_bbdev_dec_op *)bbdev_op)->ldpc_dec);
+ in_op_data = &ldpc_dec->input;
+
+ out_op_data = &ldpc_dec->hard_output;
+
+ ret = prepare_ldpc_dec_op(bbdev_op, bbdev_ipc_op,
+ q_priv, out_op_data);
+ if (ret) {
+ BBDEV_LA12XX_PMD_ERR(
+ "process_ldpc_dec_op failed, ret: %d", ret);
+ return ret;
+ }
+ break;
+
+ default:
+ BBDEV_LA12XX_PMD_ERR("unsupported bbdev_ipc op type");
+ return -1;
+ }
+
+ if (in_op_data->data) {
+ data_ptr = rte_pktmbuf_mtod(in_op_data->data, char *);
+ l1_pcie_addr = (uint32_t)GUL_USER_HUGE_PAGE_ADDR +
+ data_ptr - huge_start_addr;
+ bbdev_ipc_op->in_addr = l1_pcie_addr;
+ bbdev_ipc_op->in_len = in_op_data->length;
+ }
+
+ if (out_op_data->data) {
+ data_ptr = rte_pktmbuf_mtod(out_op_data->data, char *);
+ l1_pcie_addr = (uint32_t)GUL_USER_HUGE_PAGE_ADDR +
+ data_ptr - huge_start_addr;
+ bbdev_ipc_op->out_addr = rte_cpu_to_be_32(l1_pcie_addr);
+ bbdev_ipc_op->out_len = rte_cpu_to_be_32(out_op_data->length);
+ }
+
+ /* Move Producer Index forward */
+ pi++;
+ /* Flip the PI flag, if wrapping */
+ if (unlikely(q_priv->queue_size == pi)) {
+ pi = 0;
+ pi_flag = pi_flag ? 0 : 1;
+ }
+
+ if (pi_flag)
+ IPC_SET_PI_FLAG(pi);
+ else
+ IPC_RESET_PI_FLAG(pi);
+ /* Wait for Data Copy & pi_flag update to complete before updating pi */
+ rte_mb();
+ /* now update pi */
+ md->pi = rte_cpu_to_be_32(pi);
+ q_priv->host_pi = pi;
+
+ BBDEV_LA12XX_PMD_DP_DEBUG(
+ "enter: pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u",
+ pi, ci, pi_flag, ci_flag, q_priv->queue_size);
+
+ return 0;
+}
+
+/* Enqueue decode burst */
+static uint16_t
+enqueue_dec_ops(struct rte_bbdev_queue_data *q_data,
+ struct rte_bbdev_dec_op **ops, uint16_t nb_ops) {
+ struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private;
+ int nb_enqueued, ret;
+
+ for (nb_enqueued = 0; nb_enqueued < nb_ops; nb_enqueued++) {
+ ret = enqueue_single_op(q_priv, ops[nb_enqueued]);
+ if (ret)
+ break;
+ }
+
+ q_data->queue_stats.enqueue_err_count += nb_ops - nb_enqueued;
+ q_data->queue_stats.enqueued_count += nb_enqueued;
+
+ return nb_enqueued;
+}
+
+/* Enqueue encode burst */
+static uint16_t
+enqueue_enc_ops(struct rte_bbdev_queue_data *q_data,
+ struct rte_bbdev_enc_op **ops, uint16_t nb_ops) {
+ struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private;
+ int nb_enqueued, ret;
+
+ for (nb_enqueued = 0; nb_enqueued < nb_ops; nb_enqueued++) {
+ ret = enqueue_single_op(q_priv, ops[nb_enqueued]);
+ if (ret)
+ break;
+ }
+
+ q_data->queue_stats.enqueue_err_count += nb_ops - nb_enqueued;
+ q_data->queue_stats.enqueued_count += nb_enqueued;
+
+ return nb_enqueued;
+}
+
+static inline int
+is_bd_ring_empty(uint32_t ci, uint32_t ci_flag,
+ uint32_t pi, uint32_t pi_flag)
+{
+ if (ci == pi) {
+ if (ci_flag == pi_flag)
+ return 1; /* No more Buffer */
+ }
+ return 0;
+}
+
+/* Dequeue encode burst */
+static void *
+dequeue_single_op(struct bbdev_la12xx_q_priv *q_priv, void *dst) {
+ struct bbdev_la12xx_private *priv = q_priv->bbdev_priv;
+ ipc_userspace_t *ipc_priv = priv->ipc_priv;
+ uint32_t q_id = q_priv->q_id + HOST_RX_QUEUEID_OFFSET;
+ ipc_instance_t *ipc_instance = ipc_priv->instance;
+ ipc_ch_t *ch = &(ipc_instance->ch_list[q_id]);
+ uint32_t ci, ci_flag, pi, pi_flag;
+ ipc_br_md_t *md;
+ void *op;
+ uint32_t temp_pi;
+
+ md = &(ch->md);
+ ci = IPC_GET_CI_INDEX(q_priv->host_ci);
+ ci_flag = IPC_GET_CI_FLAG(q_priv->host_ci);
+
+ temp_pi = q_priv->host_params->pi;
+ pi = IPC_GET_PI_INDEX(temp_pi);
+ pi_flag = IPC_GET_PI_FLAG(temp_pi);
+
+ if (is_bd_ring_empty(ci, ci_flag, pi, pi_flag))
+ return NULL;
+
+ BBDEV_LA12XX_PMD_DP_DEBUG(
+ "pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u",
+ pi, ci, pi_flag, ci_flag, q_priv->queue_size);
+
+ op = q_priv->bbdev_op[ci];
+
+ rte_memcpy(dst, q_priv->msg_ch_vaddr[ci],
+ sizeof(struct bbdev_ipc_enqueue_op));
+
+ /* Move Consumer Index forward */
+ ci++;
+ /* Flip the CI flag, if wrapping */
+ if (q_priv->queue_size == ci) {
+ ci = 0;
+ ci_flag = ci_flag ? 0 : 1;
+ }
+ if (ci_flag)
+ IPC_SET_CI_FLAG(ci);
+ else
+ IPC_RESET_CI_FLAG(ci);
+ md->ci = rte_cpu_to_be_32(ci);
+ q_priv->host_ci = ci;
+
+ BBDEV_LA12XX_PMD_DP_DEBUG(
+ "exit: pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u",
+ pi, ci, pi_flag, ci_flag, q_priv->queue_size);
+
So you don't use any of the BBDEV flags to report CRC and syndrome parity check in the response?
+ return op;
+}
+
+/* Dequeue decode burst */
+static uint16_t
+dequeue_dec_ops(struct rte_bbdev_queue_data *q_data,
+ struct rte_bbdev_dec_op **ops, uint16_t nb_ops) {
+ struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private;
+ struct bbdev_ipc_enqueue_op bbdev_ipc_op;
+ int nb_dequeued;
+
+ for (nb_dequeued = 0; nb_dequeued < nb_ops; nb_dequeued++) {
+ ops[nb_dequeued] = dequeue_single_op(q_priv, &bbdev_ipc_op);
+ if (!ops[nb_dequeued])
+ break;
+ ops[nb_dequeued]->status = bbdev_ipc_op.status;
+ }
+ q_data->queue_stats.dequeued_count += nb_dequeued;
+
+ return nb_dequeued;
+}
+
+/* Dequeue encode burst */
+static uint16_t
+dequeue_enc_ops(struct rte_bbdev_queue_data *q_data,
+ struct rte_bbdev_enc_op **ops, uint16_t nb_ops) {
+ struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private;
+ struct bbdev_ipc_enqueue_op bbdev_ipc_op;
+ int nb_enqueued;
+
+ for (nb_enqueued = 0; nb_enqueued < nb_ops; nb_enqueued++) {
+ ops[nb_enqueued] = dequeue_single_op(q_priv, &bbdev_ipc_op);
+ if (!ops[nb_enqueued])
+ break;
+ ops[nb_enqueued]->status = bbdev_ipc_op.status;
+ }
+ q_data->queue_stats.enqueued_count += nb_enqueued;
+
+ return nb_enqueued;
+}
+
static struct hugepage_info *
get_hugepage_info(void)
{
@@ -720,10 +1105,14 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev,
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;
+ bbdev->dequeue_enc_ops = dequeue_enc_ops;
+ bbdev->dequeue_dec_ops = dequeue_dec_ops;
+ bbdev->enqueue_enc_ops = enqueue_enc_ops;
+ bbdev->enqueue_dec_ops = enqueue_dec_ops;
These above are used for 4G operations, since the capability is not there thet can be null.
+ bbdev->dequeue_ldpc_enc_ops = dequeue_enc_ops;
+ bbdev->dequeue_ldpc_dec_ops = dequeue_dec_ops;
+ bbdev->enqueue_ldpc_enc_ops = enqueue_enc_ops;
+ bbdev->enqueue_ldpc_dec_ops = enqueue_dec_ops;
return 0;
}
drivers/baseband/la12xx/bbdev_la12xx_ipc.h +37 -0
@@ -76,6 +76,25 @@ typedef struct { _IOWR(GUL_IPC_MAGIC, 5, struct ipc_msg *) #define IOCTL_GUL_IPC_CHANNEL_RAISE_INTERRUPT _IOW(GUL_IPC_MAGIC, 6, int *) +#define GUL_USER_HUGE_PAGE_OFFSET (0) +#define GUL_PCI1_ADDR_BASE (0x00000000ULL) + +#define GUL_USER_HUGE_PAGE_ADDR (GUL_PCI1_ADDR_BASE + GUL_USER_HUGE_PAGE_OFFSET) + +/* IPC PI/CI index & flag manipulation helpers */ +#define IPC_PI_CI_FLAG_MASK 0x80000000 /* (1<<31) */ +#define IPC_PI_CI_INDEX_MASK 0x7FFFFFFF /* ~(1<<31) */ + +#define IPC_SET_PI_FLAG(x) (x |= IPC_PI_CI_FLAG_MASK) +#define IPC_RESET_PI_FLAG (x) (x &= IPC_PI_CI_INDEX_MASK) +#define IPC_GET_PI_FLAG (x) (x >> 31) +#define IPC_GET_PI_INDEX (x) (x & IPC_PI_CI_INDEX_MASK) + +#define IPC_SET_CI_FLAG (x) (x |= IPC_PI_CI_FLAG_MASK) +#define IPC_RESET_CI_FLAG (x) (x &= IPC_PI_CI_INDEX_MASK) +#define IPC_GET_CI_FLAG (x) (x >> 31) +#define IPC_GET_CI_INDEX (x) (x & IPC_PI_CI_INDEX_MASK) +/** buffer ring common metadata */ typedef struct ipc_bd_ring_md { volatile uint32_t pi; /**< Producer index and flag (MSB)
@@ -173,6 +192,24 @@ struct bbdev_ipc_enqueue_op {uint32_t rsvd; }; +/** Structure specifying dequeue operation (dequeue at LA1224) */ +struct bbdev_ipc_dequeue_op { +/** Input buffer memory address */ +uint32_t in_addr; +/** Input buffer memory length */ +uint32_t in_len; +/** Output buffer memory address */ +uint32_t out_addr; +/** Output buffer memory length */ +uint32_t out_len; +/* Number of code blocks. Only set when HARQ is used */ +uint32_t num_code_blocks; +/** Dequeue Operation flags */ +uint32_t op_flags; +/** Shared metadata between L1 and L2 */ +uint32_t shared_metadata; +}; +/* This shared memory would be on the host side which have copy of some * of the parameters which are also part of Shared BD ring. Read access * of these parameters from the host side would not be over PCI.
--
2.17.1
Re: [dpdk-dev] [PATCH v3 5/8] baseband/la12xx: add enqueue and dequeue support
Quoted 40 lines · Nicolas
Add support for enqueue and dequeue the LDPC enc/dec from the modem device.
Signed-off-by Nipun Gupta <[email protected]>Signed-off-by Hemant Agrawal <[email protected]>--- drivers/baseband/la12xx/bbdev_la12xx.c | 397 ++++++++++++++++++++- drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 37 ++ 2 files changed, 430 insertions(+), 4 deletions(-)drivers/baseband/la12xx/bbdev_la12xx.c +4
-0@@ -117,6 +117,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) { @@ -345,6 +349,387 @@ static const struct rte_bbdev_ops pmd_ops = { .queue_release = la12xx_queue_release,.start = la12xx_start };drivers/baseband/la12xx/bbdev_la12xx.c +13
-0+ +static int +fill_feca_desc_enc (struct bbdev_la12xx_q_priv *q_priv, +struct bbdev_ipc_dequeue_op *bbdev_ipc_op, +struct rte_bbdev_enc_op *bbdev_enc_op, +struct rte_bbdev_op_data *in_op_data) { +RTE_SET_USED (q_priv); +RTE_SET_USED (bbdev_ipc_op); +RTE_SET_USED (bbdev_enc_op); +RTE_SET_USED (in_op_data); + +return 0 ; +}
Quoted 2 lines
I miss why these functions are here.
Is that contribution supposed to work or a placeholder?
it is currently a placeholder for some optimization work we are doing.
i.e. to covert the bbdev params to our hardware format at host side itself.
We will remove these for now.
Quoted 41 lines
drivers/baseband/la12xx/bbdev_la12xx.c +39
-0+ +static int +fill_feca_desc_dec (struct bbdev_la12xx_q_priv *q_priv, +struct bbdev_ipc_dequeue_op *bbdev_ipc_op, +struct rte_bbdev_dec_op *bbdev_dec_op, +struct rte_bbdev_op_data *out_op_data) { +RTE_SET_USED (q_priv); +RTE_SET_USED (bbdev_ipc_op); +RTE_SET_USED (bbdev_dec_op); +RTE_SET_USED (out_op_data); + +return 0 ; +} + +static inline int +is_bd_ring_full (uint32_t ci,uint32_t ci_flag, +uint32_t pi,uint32_t pi_flag) +{ +if (pi == ci) { +if (pi_flag != ci_flag) +return 1 ;/* Ring is Full */ + } +return 0 ; +} + +static inline int +prepare_ldpc_enc_op (struct rte_bbdev_enc_op *bbdev_enc_op, +struct bbdev_ipc_dequeue_op *bbdev_ipc_op, +struct bbdev_la12xx_q_priv *q_priv, +struct rte_bbdev_op_data *in_op_data, +struct rte_bbdev_op_data *out_op_data) { +struct rte_bbdev_op_ldpc_enc *ldpc_enc = &bbdev_enc_op->ldpc_enc; +uint32_t total_out_bits; +int ret; + + total_out_bits = (ldpc_enc->tb_params.cab * + ldpc_enc->tb_params.ea) + (ldpc_enc->tb_params.c - + ldpc_enc->tb_params.cab) * ldpc_enc->tb_params.eb; +
Quoted 3 lines
This includes ratematching, see previous comment on capability
Also I see it would not support the partial TB as defined in documentation and API (r != 0)
Not yet.
Quoted 46 lines
drivers/baseband/la12xx/bbdev_la12xx.c +44
-0+ ldpc_enc->output.length = (total_out_bits +7 )/8 ; + + ret =fill_feca_desc_enc (q_priv, bbdev_ipc_op, + bbdev_enc_op, in_op_data); +if (ret) { +BBDEV_LA12XX_PMD_ERR ( +"fill_feca_desc_enc failed, ret: %d" , ret); +return ret; + } + +rte_pktmbuf_append (out_op_data->data, ldpc_enc->output.length); + +return 0 ; +} + +static inline int +prepare_ldpc_dec_op (struct rte_bbdev_dec_op *bbdev_dec_op, +struct bbdev_ipc_dequeue_op *bbdev_ipc_op, +struct bbdev_la12xx_q_priv *q_priv, +struct rte_bbdev_op_data *out_op_data) { +struct rte_bbdev_op_ldpc_dec *ldpc_dec = &bbdev_dec_op->ldpc_dec; +uint32_t total_out_bits; +uint32_t num_code_blocks =0 ; +uint16_t sys_cols; +int ret; + + sys_cols = (ldpc_dec->basegraph ==1 ) ?22 :10 ; +if (ldpc_dec->tb_params.c ==1 ) { + total_out_bits = ((sys_cols * ldpc_dec->z_c) - + ldpc_dec->n_filler); +/* 5G-NR protocol uses 16 bit CRC when output packet +* size <= 3824 (bits). Otherwise 24 bit CRC is used. +* Adjust the output bits accordingly +*/ +if (total_out_bits -16 <=3824 ) + total_out_bits -=16 ; +else + total_out_bits -=24 ; + ldpc_dec->hard_output.length = (total_out_bits /8 ); + }else { + total_out_bits = (((sys_cols * ldpc_dec->z_c) - + ldpc_dec->n_filler -24 ) * + ldpc_dec->tb_params.c); + ldpc_dec->hard_output.length = (total_out_bits /8 ) -3 ;
Quoted 1 line
Probably good to remove magic number for 24 and 3 here.
ok
Quoted 236 lines
drivers/baseband/la12xx/bbdev_la12xx.c +234
-0+ } + + num_code_blocks = ldpc_dec->tb_params.c; + + bbdev_ipc_op->num_code_blocks =rte_cpu_to_be_32 (num_code_blocks); + + ret =fill_feca_desc_dec (q_priv, bbdev_ipc_op, + bbdev_dec_op, out_op_data); +if (ret) { +BBDEV_LA12XX_PMD_ERR ("fill_feca_desc_dec failed, ret: %d" , ret); +return ret; + } + +return 0 ; +} + +static int +enqueue_single_op (struct bbdev_la12xx_q_priv *q_priv,void *bbdev_op) { +struct bbdev_la12xx_private *priv = q_priv->bbdev_priv; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +ipc_instance_t *ipc_instance = ipc_priv->instance; +struct bbdev_ipc_dequeue_op *bbdev_ipc_op; +struct rte_bbdev_op_ldpc_enc *ldpc_enc; +struct rte_bbdev_op_ldpc_dec *ldpc_dec; +uint32_t q_id = q_priv->q_id; +uint32_t ci, ci_flag, pi, pi_flag; +ipc_ch_t *ch = &(ipc_instance->ch_list[q_id]); +ipc_br_md_t *md = &(ch->md); +size_t virt; +char *huge_start_addr = + (char *)q_priv->bbdev_priv->ipc_priv->hugepg_start.host_vaddr; +struct rte_bbdev_op_data *in_op_data, *out_op_data; +char *data_ptr; +uint32_t l1_pcie_addr; +int ret; +uint32_t temp_ci; + + temp_ci = q_priv->host_params->ci; + ci =IPC_GET_CI_INDEX (temp_ci); + ci_flag =IPC_GET_CI_FLAG (temp_ci); + + pi =IPC_GET_PI_INDEX (q_priv->host_pi); + pi_flag =IPC_GET_PI_FLAG (q_priv->host_pi); + +BBDEV_LA12XX_PMD_DP_DEBUG ( +"before bd_ring_full: pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u" , + pi, ci, pi_flag, ci_flag, q_priv->queue_size); + +if (is_bd_ring_full (ci, ci_flag, pi, pi_flag)) { +BBDEV_LA12XX_PMD_DP_DEBUG ( +"bd ring full for queue id: %d" , q_id); +return IPC_CH_FULL ; + } + + virt =MODEM_P2V (q_priv->host_params->modem_ptr[pi]); + bbdev_ipc_op = (struct bbdev_ipc_dequeue_op *)virt; + q_priv->bbdev_op[pi] = bbdev_op; + +switch (q_priv->op_type) { +case RTE_BBDEV_OP_LDPC_ENC : + ldpc_enc = &(((struct rte_bbdev_enc_op *)bbdev_op)->ldpc_enc); + in_op_data = &ldpc_enc->input; + out_op_data = &ldpc_enc->output; + + ret =prepare_ldpc_enc_op (bbdev_op, bbdev_ipc_op, q_priv, + in_op_data, out_op_data); +if (ret) { +BBDEV_LA12XX_PMD_ERR ( +"process_ldpc_enc_op failed, ret: %d" , ret); +return ret; + } +break ; + +case RTE_BBDEV_OP_LDPC_DEC : + ldpc_dec = &(((struct rte_bbdev_dec_op *)bbdev_op)->ldpc_dec); + in_op_data = &ldpc_dec->input; + + out_op_data = &ldpc_dec->hard_output; + + ret =prepare_ldpc_dec_op (bbdev_op, bbdev_ipc_op, + q_priv, out_op_data); +if (ret) { +BBDEV_LA12XX_PMD_ERR ( +"process_ldpc_dec_op failed, ret: %d" , ret); +return ret; + } +break ; + +default : +BBDEV_LA12XX_PMD_ERR ("unsupported bbdev_ipc op type" ); +return -1 ; + } + +if (in_op_data->data) { + data_ptr = rte_pktmbuf_mtod(in_op_data->data, char *); + l1_pcie_addr = (uint32_t )GUL_USER_HUGE_PAGE_ADDR + + data_ptr - huge_start_addr; + bbdev_ipc_op->in_addr = l1_pcie_addr; + bbdev_ipc_op->in_len = in_op_data->length; + } + +if (out_op_data->data) { + data_ptr = rte_pktmbuf_mtod(out_op_data->data, char *); + l1_pcie_addr = (uint32_t )GUL_USER_HUGE_PAGE_ADDR + + data_ptr - huge_start_addr; + bbdev_ipc_op->out_addr =rte_cpu_to_be_32 (l1_pcie_addr); + bbdev_ipc_op->out_len =rte_cpu_to_be_32 (out_op_data->length); + } + +/* Move Producer Index forward */ + pi++; +/* Flip the PI flag, if wrapping */ +if (unlikely (q_priv->queue_size == pi)) { + pi =0 ; + pi_flag = pi_flag ?0 :1 ; + } + +if (pi_flag) +IPC_SET_PI_FLAG (pi); +else +IPC_RESET_PI_FLAG (pi); +/* Wait for Data Copy & pi_flag update to complete before updating pi */ +rte_mb (); +/* now update pi */ + md->pi =rte_cpu_to_be_32 (pi); + q_priv->host_pi = pi; + +BBDEV_LA12XX_PMD_DP_DEBUG ( +"enter: pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u" , + pi, ci, pi_flag, ci_flag, q_priv->queue_size); + +return 0 ; +} + +/* Enqueue decode burst */ +static uint16_t +enqueue_dec_ops (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_dec_op **ops,uint16_t nb_ops) { +struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; +int nb_enqueued, ret; + +for (nb_enqueued =0 ; nb_enqueued < nb_ops; nb_enqueued++) { + ret =enqueue_single_op (q_priv, ops[nb_enqueued]); +if (ret) +break ; + } + + q_data->queue_stats.enqueue_err_count += nb_ops - nb_enqueued; + q_data->queue_stats.enqueued_count += nb_enqueued; + +return nb_enqueued; +} + +/* Enqueue encode burst */ +static uint16_t +enqueue_enc_ops (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_enc_op **ops,uint16_t nb_ops) { +struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; +int nb_enqueued, ret; + +for (nb_enqueued =0 ; nb_enqueued < nb_ops; nb_enqueued++) { + ret =enqueue_single_op (q_priv, ops[nb_enqueued]); +if (ret) +break ; + } + + q_data->queue_stats.enqueue_err_count += nb_ops - nb_enqueued; + q_data->queue_stats.enqueued_count += nb_enqueued; + +return nb_enqueued; +} + +static inline int +is_bd_ring_empty (uint32_t ci,uint32_t ci_flag, +uint32_t pi,uint32_t pi_flag) +{ +if (ci == pi) { +if (ci_flag == pi_flag) +return 1 ;/* No more Buffer */ + } +return 0 ; +} + +/* Dequeue encode burst */ +static void * +dequeue_single_op (struct bbdev_la12xx_q_priv *q_priv,void *dst) { +struct bbdev_la12xx_private *priv = q_priv->bbdev_priv; +ipc_userspace_t *ipc_priv = priv->ipc_priv; +uint32_t q_id = q_priv->q_id +HOST_RX_QUEUEID_OFFSET ; +ipc_instance_t *ipc_instance = ipc_priv->instance; +ipc_ch_t *ch = &(ipc_instance->ch_list[q_id]); +uint32_t ci, ci_flag, pi, pi_flag; +ipc_br_md_t *md; +void *op; +uint32_t temp_pi; + + md = &(ch->md); + ci =IPC_GET_CI_INDEX (q_priv->host_ci); + ci_flag =IPC_GET_CI_FLAG (q_priv->host_ci); + + temp_pi = q_priv->host_params->pi; + pi =IPC_GET_PI_INDEX (temp_pi); + pi_flag =IPC_GET_PI_FLAG (temp_pi); + +if (is_bd_ring_empty (ci, ci_flag, pi, pi_flag)) +return NULL ; + +BBDEV_LA12XX_PMD_DP_DEBUG ( +"pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u" , + pi, ci, pi_flag, ci_flag, q_priv->queue_size); + + op = q_priv->bbdev_op[ci]; + +rte_memcpy (dst, q_priv->msg_ch_vaddr[ci], +sizeof (struct bbdev_ipc_enqueue_op )); + +/* Move Consumer Index forward */ + ci++; +/* Flip the CI flag, if wrapping */ +if (q_priv->queue_size == ci) { + ci =0 ; + ci_flag = ci_flag ?0 :1 ; + } +if (ci_flag) +IPC_SET_CI_FLAG (ci); +else +IPC_RESET_CI_FLAG (ci); + md->ci =rte_cpu_to_be_32 (ci); + q_priv->host_ci = ci; + +BBDEV_LA12XX_PMD_DP_DEBUG ( +"exit: pi: %u, ci: %u, pi_flag: %u, ci_flag: %u, ring size: %u" , + pi, ci, pi_flag, ci_flag, q_priv->queue_size); +
Quoted 1 line
So you don't use any of the BBDEV flags to report CRC and syndrome parity check in the response?
that will be supported in next version.
Quoted 124 lines
drivers/baseband/la12xx/bbdev_la12xx.c +45
-4+return op; +} + +/* Dequeue decode burst */ +static uint16_t +dequeue_dec_ops (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_dec_op **ops,uint16_t nb_ops) { +struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; +struct bbdev_ipc_enqueue_op bbdev_ipc_op; +int nb_dequeued; + +for (nb_dequeued =0 ; nb_dequeued < nb_ops; nb_dequeued++) { + ops[nb_dequeued] =dequeue_single_op (q_priv, &bbdev_ipc_op); +if (!ops[nb_dequeued]) +break ; + ops[nb_dequeued]->status = bbdev_ipc_op.status; + } + q_data->queue_stats.dequeued_count += nb_dequeued; + +return nb_dequeued; +} + +/* Dequeue encode burst */ +static uint16_t +dequeue_enc_ops (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_enc_op **ops,uint16_t nb_ops) { +struct bbdev_la12xx_q_priv *q_priv = q_data->queue_private; +struct bbdev_ipc_enqueue_op bbdev_ipc_op; +int nb_enqueued; + +for (nb_enqueued =0 ; nb_enqueued < nb_ops; nb_enqueued++) { + ops[nb_enqueued] =dequeue_single_op (q_priv, &bbdev_ipc_op); +if (!ops[nb_enqueued]) +break ; + ops[nb_enqueued]->status = bbdev_ipc_op.status; + } + q_data->queue_stats.enqueued_count += nb_enqueued; + +return nb_enqueued; +} +static struct hugepage_info *get_hugepage_info (void ) {@@ -720,10 +1105,14 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev, 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 ; + bbdev->dequeue_enc_ops = dequeue_enc_ops; + bbdev->dequeue_dec_ops = dequeue_dec_ops; + bbdev->enqueue_enc_ops = enqueue_enc_ops; + bbdev->enqueue_dec_ops = enqueue_dec_ops;These above are used for 4G operations, since the capability is not there thet can be null.
drivers/baseband/la12xx/bbdev_la12xx.c +4
-0+ bbdev->dequeue_ldpc_enc_ops = dequeue_enc_ops; + bbdev->dequeue_ldpc_dec_ops = dequeue_dec_ops; + bbdev->enqueue_ldpc_enc_ops = enqueue_enc_ops; + bbdev->enqueue_ldpc_dec_ops = enqueue_dec_ops;return 0 ; }drivers/baseband/la12xx/bbdev_la12xx_ipc.h +37
-1@@ -76,6 +76,25 @@ typedef struct { _IOWR(GUL_IPC_MAGIC, 5, struct ipc_msg *) #define IOCTL_GUL_IPC_CHANNEL_RAISE_INTERRUPT _IOW(GUL_IPC_MAGIC, 6, int *) +#define GUL_USER_HUGE_PAGE_OFFSET (0) +#define GUL_PCI1_ADDR_BASE (0x00000000ULL) + +#define GUL_USER_HUGE_PAGE_ADDR (GUL_PCI1_ADDR_BASE + GUL_USER_HUGE_PAGE_OFFSET) + +/* IPC PI/CI index & flag manipulation helpers */ +#define IPC_PI_CI_FLAG_MASK 0x80000000 /* (1<<31) */ +#define IPC_PI_CI_INDEX_MASK 0x7FFFFFFF /* ~(1<<31) */ + +#define IPC_SET_PI_FLAG(x) (x |= IPC_PI_CI_FLAG_MASK) +#define IPC_RESET_PI_FLAG (x) (x &= IPC_PI_CI_INDEX_MASK) +#define IPC_GET_PI_FLAG (x) (x >> 31) +#define IPC_GET_PI_INDEX (x) (x & IPC_PI_CI_INDEX_MASK) + +#define IPC_SET_CI_FLAG (x) (x |= IPC_PI_CI_FLAG_MASK) +#define IPC_RESET_CI_FLAG (x) (x &= IPC_PI_CI_INDEX_MASK) +#define IPC_GET_CI_FLAG (x) (x >> 31) +#define IPC_GET_CI_INDEX (x) (x & IPC_PI_CI_INDEX_MASK) +/** buffer ring common metadata */ typedef struct ipc_bd_ring_md { volatile uint32_t pi; /**< Producer index and flag (MSB)@@ -173,6 +192,24 @@ struct bbdev_ipc_enqueue_op {uint32_t rsvd; }; +/** Structure specifying dequeue operation (dequeue at LA1224) */ +struct bbdev_ipc_dequeue_op { +/** Input buffer memory address */ +uint32_t in_addr; +/** Input buffer memory length */ +uint32_t in_len; +/** Output buffer memory address */ +uint32_t out_addr; +/** Output buffer memory length */ +uint32_t out_len; +/* Number of code blocks. Only set when HARQ is used */ +uint32_t num_code_blocks; +/** Dequeue Operation flags */ +uint32_t op_flags; +/** Shared metadata between L1 and L2 */ +uint32_t shared_metadata; +}; +/* This shared memory would be on the host side which have copy of some * of the parameters which are also part of Shared BD ring. Read access * of these parameters from the host side would not be over PCI. -- 2.17.1
PATCH v3 6/8 baseband/la12xx: add documentation support
In reply to Hemant AgrawalThis patch add documentation for LA12xx PMD.
--- MAINTAINERS | 9 ++ doc/guides/bbdevs/features/la12xx.ini | 14 +++ doc/guides/bbdevs/index.rst | 1 + doc/guides/bbdevs/la12xx.rst | 139 +++++++++++++++++++++++++ doc/guides/rel_notes/release_21_05.rst | 5 + 5 files changed, 168 insertions(+) create mode 100644 doc/guides/bbdevs/features/la12xx.ini create mode 100644 doc/guides/bbdevs/la12xx.rst
MAINTAINERS +9 -0
@@ -1289,6 +1289,15 @@ F: doc/guides/rawdevs/ntb.rst F: examples/ntb/ F: doc/guides/sample_app_ug/ntb.rst +Baseband Drivers +------------------- + +NXP LA12xx +M: Hemant Agrawal <[email protected]> +M: Nipun Gupta <[email protected]> +F: drivers/baseband/la12xx/ +F: doc/guides/bbdevs/la12xx.rst +F: doc/guides/bbdevs/features/la12xx.ini Packet processing -----------------
doc/guides/bbdevs/features/la12xx.ini new file +14 -0
@@ -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 +External DDR Access = Y +HW Accelerated = Y +BBDEV API = Y
doc/guides/bbdevs/index.rst +1 -0
@@ -14,3 +14,4 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 + la12xx
doc/guides/bbdevs/la12xx.rst new file +139 -0
139 lines not on this page · raw message
doc/guides/rel_notes/release_21_05.rst +5 -0
@@ -130,6 +130,11 @@ New Features * Added command to display Rx queue used descriptor count. ``show port (port_id) rxq (queue_id) desc used count`` +* **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 -------------
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v3 6/8] baseband/la12xx: add documentation support
Documentation should be ideally embedded within the related commits to go hand in hand when feature are being added, not as a separate commit. Other comments below
Quoted 52 lines
-----Original Message-----
From: Hemant Agrawal <[email protected]>
Sent: Monday, April 12, 2021 10:17 PM
To: [email protected]; [email protected]; Chautru, Nicolas <[email protected]>
Cc: [email protected]; Hemant Agrawal <[email protected]>; Nipun Gupta <[email protected]>
Subject: [PATCH v3 6/8] baseband/la12xx: add documentation supportThis patch add documentation for LA12xx PMD.
Signed-off-by Nipun Gupta <[email protected]>Signed-off-by Hemant Agrawal <[email protected]>--- MAINTAINERS | 9 ++ doc/guides/bbdevs/features/la12xx.ini | 14 +++ doc/guides/bbdevs/index.rst | 1 + doc/guides/bbdevs/la12xx.rst | 139 +++++++++++++++++++++++++ doc/guides/rel_notes/release_21_05.rst | 5 + 5 files changed, 168 insertions(+) create mode 100644 doc/guides/bbdevs/features/la12xx.ini create mode 100644 doc/guides/bbdevs/la12xx.rstMAINTAINERS +9
-0@@ -1289,6 +1289,15 @@ F: doc/guides/rawdevs/ntb.rst F: examples/ntb/ F: doc/guides/sample_app_ug/ntb.rst +Baseband Drivers +------------------- + +NXP LA12xx +M: Hemant Agrawal <[email protected]> +M: Nipun Gupta <[email protected]> +F: drivers/baseband/la12xx/ +F: doc/guides/bbdevs/la12xx.rst +F: doc/guides/bbdevs/features/la12xx.ini Packet processing -----------------doc/guides/bbdevs/features/la12xx.ini new file +2
-0@@ -0,0 +1,14 @@ +; +; Supported features of the 'la12xx' bbdev driver.
doc/guides/bbdevs/features/la12xx.ini line 12
Quoted 10 lines
doc/guides/bbdevs/features/la12xx.ini new file +10
-0+; +; 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 +External DDR Access = Y
What is the external DDR access capability here? This was not exposed in BBDEV.
Quoted 33 lines
doc/guides/bbdevs/features/la12xx.ini new file +2
-0+HW Accelerated = Y +BBDEV API = Ydoc/guides/bbdevs/index.rst index renamed from doc/guides/bbdevs/index.rst +0
-0
4445cbd1b0..cedd706fa6100644doc/guides/bbdevs/index.rst +1
-0@@ -14,3 +14,4 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 + la12xxdoc/guides/bbdevs/la12xx.rst new file +9
-0@@ -0,0 +1,139 @@ +.. 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 definedradio.
doc/guides/bbdevs/la12xx.rst new file +3
-0+ +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>`_.
doc/guides/bbdevs/la12xx.rst new file +2
-0+ +Features
doc/guides/bbdevs/la12xx.rst line 24
Quoted 10 lines
doc/guides/bbdevs/la12xx.rst new file +10
-0+-------- + +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
Capability was not exposed in the commit
doc/guides/bbdevs/la12xx.rst
Quoted 7 lines
doc/guides/bbdevs/la12xx.rst new file +7
-0+ +LA12xx PMD supports the following BBDEV capabilities: + +* For the LDPC encode operation: + - ``RTE_BBDEV_LDPC_CRC_24B_ATTACH`` : set to attach CRC24B to CB(s) + - ``RTE_BBDEV_LDPC_RATE_MATCH`` : if set then do not do Rate Match +bypass
mismatch with the code
Quoted 16 lines
doc/guides/bbdevs/la12xx.rst new file +4
-0+ +* For the LDPC decode operation: + - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK`` : check CRC24B from CB(s) + - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP`` : drops CRC24B bitsappended while decoding
doc/guides/bbdevs/la12xx.rst new file +7
-0+ - ``RTE_BBDEV_LDPC_DEC_SCATTER_GATHER`` : supports scatter-gather +for input/output data + +Installation +------------ + +Section 3 of the DPDK manual provides instructions on installing andcompiling DPDK.
doc/guides/bbdevs/la12xx.rst new file +2
-0+ +DPDK requires hugepages to be configured as detailed in section 2 of theDPDK manual.
doc/guides/bbdevs/la12xx.rst line 52
Quoted 10 lines
doc/guides/bbdevs/la12xx.rst new file +10
-0+ +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". +
There is no SRIOV? Single device id?
Quoted 120 lines
+.. code-block:: console
doc/guides/bbdevs/la12xx.rst new file +19
-0+ + 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 <linux_gsg>` tosetup the basic DPDK environment.
doc/guides/bbdevs/la12xx.rst new file +4
-0+ +* 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 tohost.
doc/guides/bbdevs/la12xx.rst new file +4
-0+ 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 maximumnumber
doc/guides/bbdevs/la12xx.rst new file +2
-0+of queues + to be used for communication with offload device i.e. modem. default is16.
doc/guides/bbdevs/la12xx.rst new file +30
-0+ 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 <EAL args> --log-level=la12xx:<level> + +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).doc/guides/bbdevs/la12xx.rst new file +20
-0+ "-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.doc/guides/bbdevs/la12xx.rst new file +9
-0+ + +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.
doc/guides/rel_notes/release_21_05.rst +3
-0@@ -130,6 +130,11 @@ New Features * Added command to display Rx queue used descriptor count. ``show port (port_id) rxq (queue_id) desc used count`` +* **Added NXP LA12xx baseband PMD.** + + Added a new baseband PMD driver for NXP LA12xx Software definedradio.
doc/guides/rel_notes/release_21_05.rst +2
-1+ + See the :doc:`../bbdevs/la12xx` for more details. Removed Items ------------- --2.17.1
Re: [dpdk-dev] [PATCH v3 6/8] baseband/la12xx: add documentation support
Quoted 1 line · Nicolas
Documentation should be ideally embedded within the related commits to go hand in hand when feature are being added, not as a separate commit. Other comments below
ok
Quoted 56 lines
Quoted 56 lines
-----Original Message-----
From: Hemant Agrawal <[email protected]>
Sent: Monday, April 12, 2021 10:17 PM
To: [email protected]; [email protected]; Chautru, Nicolas <[email protected]>
Cc: [email protected]; Hemant Agrawal <[email protected]>; Nipun Gupta <[email protected]>
Subject: [PATCH v3 6/8] baseband/la12xx: add documentation supportThis patch add documentation for LA12xx PMD.
Signed-off-by Nipun Gupta <[email protected]>Signed-off-by Hemant Agrawal <[email protected]>--- MAINTAINERS | 9 ++ doc/guides/bbdevs/features/la12xx.ini | 14 +++ doc/guides/bbdevs/index.rst | 1 + doc/guides/bbdevs/la12xx.rst | 139 +++++++++++++++++++++++++ doc/guides/rel_notes/release_21_05.rst | 5 + 5 files changed, 168 insertions(+)create mode 100644 doc/guides/bbdevs/features/la12xx.ini create mode 100644
doc/guides/bbdevs/la12xx.rstMAINTAINERS +9
-0@@ -1289,6 +1289,15 @@ F: doc/guides/rawdevs/ntb.rst F: examples/ntb/ F: doc/guides/sample_app_ug/ntb.rst +Baseband Drivers +------------------- + +NXP LA12xx +M: Hemant Agrawal <[email protected]> +M: Nipun Gupta <[email protected]> +F: drivers/baseband/la12xx/ +F: doc/guides/bbdevs/la12xx.rst +F: doc/guides/bbdevs/features/la12xx.ini Packet processing -----------------doc/guides/bbdevs/features/la12xx.ini new file +5
-0@@ -0,0 +1,14 @@ +; +; Supported features of the 'la12xx' bbdev driver. +; +; Refer to default.ini for the full list of available PMD features. +;
Quoted 8 lines
doc/guides/bbdevs/features/la12xx.ini line 12
Quoted 7 lines
doc/guides/bbdevs/features/la12xx.ini new file +7
-0+[Features] +Turbo Decoder (4G) = N +Turbo Encoder (4G) = N +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = N +External DDR Access = YWhat is the external DDR access capability here? This was not exposed in BBDEV.
ok. we will remove it
Quoted 46 lines
Quoted 34 lines
doc/guides/bbdevs/features/la12xx.ini new file +2
-0+HW Accelerated = Y +BBDEV API = Ydoc/guides/bbdevs/index.rst index renamed from doc/guides/bbdevs/index.rst +0
-0
4445cbd1b0..cedd706fa6100644doc/guides/bbdevs/index.rst +1
-0@@ -14,3 +14,4 @@ Baseband Device Drivers fpga_lte_fec fpga_5gnr_fec acc100 + la12xxdoc/guides/bbdevs/la12xx.rst new file +9
-0@@ -0,0 +1,139 @@ +.. 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 definedradio.
doc/guides/bbdevs/la12xx.rst new file +3
-0+ +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>`_.
doc/guides/bbdevs/la12xx.rst new file +2
-0+ +Featuresdoc/guides/bbdevs/la12xx.rst line 24
Quoted 10 lines
doc/guides/bbdevs/la12xx.rst new file +10
-0+-------- + +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-XCapability was not exposed in the commit
Quoted 8 lines
doc/guides/bbdevs/la12xx.rst
Quoted 7 lines
doc/guides/bbdevs/la12xx.rst new file +7
-0+ +LA12xx PMD supports the following BBDEV capabilities: + +* For the LDPC encode operation: + - ``RTE_BBDEV_LDPC_CRC_24B_ATTACH`` : set to attach CRC24B to CB(s) + - ``RTE_BBDEV_LDPC_RATE_MATCH`` : if set then do not do Rate Match +bypassmismatch with the code
ok
Quoted 20 lines
Quoted 20 lines
doc/guides/bbdevs/la12xx.rst new file +4
-0+ +* For the LDPC decode operation: + - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK`` : check CRC24B from CB(s) + - ``RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP`` : drops CRC24B bitsappended while decoding
doc/guides/bbdevs/la12xx.rst new file +7
-0+ - ``RTE_BBDEV_LDPC_DEC_SCATTER_GATHER`` : supports scatter-gather +for input/output data + +Installation +------------ + +Section 3 of the DPDK manual provides instructions on installing andcompiling DPDK.
doc/guides/bbdevs/la12xx.rst new file +2
-0+ +DPDK requires hugepages to be configured as detailed in section 2 of theDPDK manual.
doc/guides/bbdevs/la12xx.rst new file +3
-0+ +Initialization +--------------
Quoted 8 lines
doc/guides/bbdevs/la12xx.rst line 52
Quoted 7 lines
doc/guides/bbdevs/la12xx.rst new file +7
-0+ +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". +There is no SRIOV? Single device id?
yes, we don't support SRIOV.
Quoted 121 lines
Quoted 121 lines
+.. code-block:: console
doc/guides/bbdevs/la12xx.rst new file +19
-0+ + 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 <linux_gsg>` tosetup the basic DPDK environment.
doc/guides/bbdevs/la12xx.rst new file +4
-0+ +* 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 tohost.
doc/guides/bbdevs/la12xx.rst new file +4
-0+ 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 maximumnumber
doc/guides/bbdevs/la12xx.rst new file +2
-0+of queues + to be used for communication with offload device i.e. modem. default is16.
doc/guides/bbdevs/la12xx.rst new file +30
-0+ 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 <EAL args> --log-level=la12xx:<level> + +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).doc/guides/bbdevs/la12xx.rst new file +20
-0+ "-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.doc/guides/bbdevs/la12xx.rst new file +9
-0+ + +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.
doc/guides/rel_notes/release_21_05.rst +3
-0@@ -130,6 +130,11 @@ New Features * Added command to display Rx queue used descriptor count. ``show port (port_id) rxq (queue_id) desc used count`` +* **Added NXP LA12xx baseband PMD.** + + Added a new baseband PMD driver for NXP LA12xx Software definedradio.
doc/guides/rel_notes/release_21_05.rst +2
-1+ + See the :doc:`../bbdevs/la12xx` for more details. Removed Items ------------- --2.17.1
PATCH v3 7/8 app/bbdev: add parameter to take input in network order
In reply to Hemant AgrawalFrom: Nipun Gupta <[email protected]>
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
--- app/test-bbdev/test_bbdev_vector.c | 18 ++++++++++++++++-- app/test-bbdev/test_bbdev_vector.h | 2 ++ 2 files changed, 18 insertions(+), 2 deletions(-)
app/test-bbdev/test_bbdev_vector.c +16 -2
@@ -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 ;
app/test-bbdev/test_bbdev_vector.h +2 -0
@@ -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;
Signature · 1 line
2.17.1
Re: [dpdk-dev] [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?
Quoted 98 lines
-----Original Message-----
From: Hemant Agrawal <[email protected]>
Sent: Monday, April 12, 2021 10:17 PM
To: [email protected]; [email protected]; Chautru, Nicolas <[email protected]>
Cc: [email protected]; Nipun Gupta <[email protected]>
Subject: [PATCH v3 7/8] app/bbdev: add parameter to take input in network orderFrom: Nipun Gupta <[email protected]>
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 formatSigned-off-by Nipun Gupta <[email protected]>---
app/test-bbdev/test_bbdev_vector.c| 18 ++++++++++++++++-- app/test-bbdev/test_bbdev_vector.h| 2 ++2 files changed, 18 insertions(+), 2 deletions(-)app/test- renamed from app/test-bbdev/test_bbdev_vector.c +0
-0
bbdev/test_bbdev_vector.c
index50d1da00f7..fe04bd6b95100644app/test-bbdev/test_bbdev_vector.c +10
-0@@ -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 );app/test-bbdev/test_bbdev_vector.c +2
-1if (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-Quoted 1 line
op_type);app/test-bbdev/test_bbdev_vector.c +4
-0if (!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 ;app/test- renamed from app/test-bbdev/test_bbdev_vector.h +0
-0
bbdev/test_bbdev_vector.h
index4e5dbf5d50..aa53f0bb0d100644app/test-bbdev/test_bbdev_vector.h +2
-1@@ -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 7/8] app/bbdev: add parameter to take input in network order
Quoted 11 lines
-----Original Message-----
From: Chautru, Nicolas <[email protected]>
Sent: Wednesday, April 14, 2021 6:30 AM
To: Hemant Agrawal <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Nipun Gupta <[email protected]>
Subject: RE: [PATCH v3 7/8] app/bbdev: add parameter to take input in network order
Quoted 3 lines
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.
Quoted 99 lines
Quoted 99 lines
-----Original Message-----
From: Hemant Agrawal <[email protected]>
Sent: Monday, April 12, 2021 10:17 PM
To: [email protected]; [email protected]; Chautru, Nicolas <[email protected]>
Cc: [email protected]; Nipun Gupta <[email protected]>
Subject: [PATCH v3 7/8] app/bbdev: add parameter to take input in network orderFrom: Nipun Gupta <[email protected]>
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 formatSigned-off-by Nipun Gupta <[email protected]>---
app/test-bbdev/test_bbdev_vector.c| 18 ++++++++++++++++-- app/test-bbdev/test_bbdev_vector.h| 2 ++2 files changed, 18 insertions(+), 2 deletions(-)app/test- renamed from app/test-bbdev/test_bbdev_vector.c +0
-0
bbdev/test_bbdev_vector.c
index50d1da00f7..fe04bd6b95100644app/test-bbdev/test_bbdev_vector.c +10
-0@@ -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 );app/test-bbdev/test_bbdev_vector.c +2
-1if (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-Quoted 1 line
op_type);app/test-bbdev/test_bbdev_vector.c +4
-0if (!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 ;app/test- renamed from app/test-bbdev/test_bbdev_vector.h +0
-0
bbdev/test_bbdev_vector.h
index4e5dbf5d50..aa53f0bb0d100644app/test-bbdev/test_bbdev_vector.h +2
-1@@ -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
PATCH v3 8/8 app/bbdev: add test vectors for transport blocks
In reply to Hemant AgrawalFrom: Nipun Gupta <[email protected]>
This patch adds two test vectors for transport block in network byte order:
- LDPC encode for Transport Block
- LDPC decode for Transport block
--- 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
app/test-bbdev/test_vectors/ldpc_dec_tb.data new file +362 -0
@@ -0,0 +1,362 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2020 NXP + +op_type = +RTE_BBDEV_OP_LDPC_DEC + +network_order = +1 + +input0 = +0x817f7f81, 0x81817f7f, 0x7f7f8181, 0x81817f81, 0x8181817f, 0x7f817f81, 0x7f817f81, 0x7f817f7f, +0x7f818181, 0x7f817f7f, 0x81817f81, 0x817f7f7f, 0x81817f81, 0x81818181, 0x7f818181, 0x81818181, +0x7f7f7f7f, 0x81818181, 0x7f81817f, 0x817f7f7f, 0x81817f7f, 0x817f817f, 0x81817f81, 0x7f817f81, +0x7f7f7f7f, 0x7f7f8181, 0x7f818181, 0x81817f81, 0x7f818181, 0x817f8181, 0x817f8181, 0x7f7f7f7f, +0x7f7f817f, 0x817f8181, 0x8181817f, 0x817f7f81, 0x7f818181, 0x81817f7f, 0x7f81817f, 0x7f7f7f7f, +0x7f817f7f, 0x81818181, 0x7f81817f, 0x7f7f817f, 0x8181817f, 0x8181817f, 0x817f8181, 0x7f817f81, +0x7f7f8181, 0x7f7f7f7f, 0x81817f81, 0x7f7f7f81, 0x7f81817f, 0x81817f7f, 0x81817f7f, 0x7f7f8181, +0x817f817f, 0x7f817f7f, 0x7f7f7f7f, 0x817f8181, 0x81818181, 0x7f7f7f7f, 0x7f7f8181, 0x7f7f7f7f, +0x7f817f81, 0x7f81817f, 0x7f818181, 0x817f817f, 0x81817f7f, 0x7f7f7f81, 0x7f7f7f81, 0x7f817f81, +0x817f7f7f, 0x7f817f7f, 0x817f7f81, 0x7f7f7f7f, 0x7f817f81, 0x81817f7f, 0x7f817f7f, 0x7f7f7f81, +0x7f817f7f, 0x7f7f7f81, 0x7f817f7f, 0x7f81817f, 0x817f7f81, 0x7f7f7f7f, 0x81818181, 0x7f7f8181, +0x817f7f7f, 0x817f7f81, 0x81817f81, 0x7f817f81, 0x7f818181, 0x817f7f81, 0x7f817f7f, 0x7f818181, +0x7f7f8181, 0x81817f81, 0x7f7f8181, 0x8181817f, 0x8181817f, 0x817f7f81, 0x8181817f, 0x7f7f817f, +0x7f817f81, 0x817f7f7f, 0x81818181, 0x817f7f7f, 0x81817f81, 0x7f7f7f7f, 0x8181817f, 0x7f81817f, +0x8181817f, 0x7f818181, 0x7f817f7f, 0x817f7f7f, 0x7f817f7f, 0x817f8181, 0x7f7f8181, 0x7f81817f, +0x7f7f7f7f, 0x7f7f817f, 0x81818181, 0x7f818181, 0x81818181, 0x7f7f817f, 0x817f817f, 0x817f817f, +0x7f7f7f81, 0x7f7f817f, 0x7f7f7f7f, 0x7f7f8181, 0x7f817f81, 0x7f7f7f81, 0x81817f7f, 0x7f817f81, +0x817f817f, 0x7f7f7f7f, 0x81817f81, 0x817f8181, 0x7f817f7f, 0x7f81817f, 0x7f818181, 0x817f8181, +0x7f81817f, 0x7f818181, 0x817f817f, 0x8181817f, 0x817f817f, 0x81817f7f, 0x817f817f, 0x7f81817f, +0x8181817f, 0x7f817f81, 0x7f817f7f, 0x81817f81, 0x7f81817f, 0x817f8181, 0x7f818181, 0x7f7f7f7f, +0x817f8181, 0x7f817f7f, 0x7f7f8181, 0x817f8181, 0x7f7f7f81, 0x817f8181, 0x81817f7f, 0x817f7f7f, +0x81817f81, 0x81818181, 0x7f818181, 0x7f818181, 0x8181817f, 0x7f7f8181, 0x7f7f817f, 0x7f7f8181, +0x81817f7f, 0x7f817f7f, 0x7f7f817f, 0x81818181, 0x7f817f81, 0x817f8181, 0x7f81817f, 0x7f7f7f7f, +0x7f7f8181, 0x817f7f81, 0x7f7f8181, 0x817f817f, 0x7f818181, 0x7f7f8181, 0x7f7f7f7f, 0x8181817f, +0x817f7f81, 0x7f7f7f81, 0x817f7f81, 0x8181817f, 0x817f8181, 0x7f817f7f, 0x7f7f7f81, 0x817f817f, +0x81817f7f, 0x817f8181, 0x7f7f7f81, 0x7f81817f, 0x7f7f8181, 0x7f817f7f, 0x817f8181, 0x7f7f7f81, +0x8181817f, 0x817f8181, 0x7f817f7f, 0x817f7f81, 0x7f818181, 0x7f7f7f81, 0x81817f7f, 0x817f8181, +0x7f7f817f, 0x7f81817f, 0x817f7f81, 0x7f7f7f81, 0x7f81817f, 0x817f8181, 0x81818181, 0x817f817f, +0x7f81817f, 0x817f8181, 0x7f817f81, 0x7f817f7f, 0x7f81817f, 0x7f7f817f, 0x7f81817f, 0x81817f81, +0x817f817f, 0x81818181, 0x7f817f7f, 0x817f8181, 0x817f7f7f, 0x7f7f7f81, 0x817f8181, 0x7f818181, +0x7f7f7f7f, 0x817f8181, 0x817f7f7f, 0x7f817f7f, 0x81817f7f, 0x81818181, 0x7f7f817f, 0x8181817f, +0x8181817f, 0x8181817f, 0x81817f7f, 0x7f817f81, 0x817f8181, 0x8181817f, 0x7f81817f, 0x7f817f7f, +0x7f817f81, 0x81818181, 0x8181817f, 0x7f81817f, 0x81818181, 0x7f7f7f81, 0x7f818181, 0x7f7f7f81, +0x7f7f7f7f, 0x7f7f7f7f, 0x817f7f7f, 0x8181817f, 0x8181817f, 0x817f7f7f, 0x7f817f7f, 0x817f8181, +0x817f7f7f, 0x817f8181, 0x7f7f817f, 0x817f817f, 0x817f8181, 0x81817f81, 0x81817f81, 0x81817f7f, +0x7f81817f, 0x7f7f7f7f, 0x81817f81, 0x7f7f8181, 0x7f817f7f, 0x81818181, 0x7f7f817f, 0x81817f7f, +0x817f817f, 0x7f817f7f, 0x7f7f817f, 0x7f7f7f81, 0x817f7f81, 0x7f7f7f7f, 0x817f8181, 0x7f818181, +0x817f8181, 0x7f817f81, 0x7f7f7f7f, 0x8181817f, 0x81818181, 0x81817f7f, 0x817f7f7f, 0x817f8181, +0x817f8181, 0x7f818181, 0x81818181, 0x7f818181, 0x7f817f7f, 0x81817f81, 0x817f7f7f, 0x817f7f81, +0x817f7f81, 0x81817f81, 0x8181817f, 0x81817f81, 0x81817f81, 0x817f8181, 0x81818181, 0x81818181, +0x81818181, 0x817f817f, 0x8181817f, 0x8181817f, 0x81817f81, 0x817f7f81, 0x817f7f81, 0x817f7f7f, +0x7f7f8181, 0x7f7f817f, 0x7f7f8181, 0x7f817f7f, 0x7f818181, 0x81817f81, 0x7f817f81, 0x817f7f81, +0x7f817f81, 0x817f817f, 0x8181817f, 0x81817f81, 0x7f7f817f, 0x817f8181, 0x7f81817f, 0x7f817f81, +0x81817f7f, 0x7f7f8181, 0x7f7f817f, 0x7f7f8181, 0x7f7f7f7f, 0x7f7f7f81, 0x7f817f7f, 0x7f7f817f, +0x7f7f8181, 0x7f7f817f, 0x7f7f817f, 0x8181817f, 0x81817f7f, 0x7f7f817f, 0x7f817f81, 0x7f7f817f, +0x8181817f, 0x7f7f8181, 0x81817f7f, 0x817f817f, 0x8181817f, 0x817f7f81, 0x8181817f, 0x7f81817f, +0x7f81817f, 0x817f817f, 0x7f7f7f81, 0x7f7f8181, 0x81817f7f, 0x7f7f7f81, 0x7f818181, 0x7f818181, +0x7f7f7f81, 0x7f7f7f7f, 0x7f818181, 0x8181817f, 0x8181817f, 0x8181817f, 0x7f81817f, 0x81818181, +0x7f818181, 0x7f7f817f, 0x7f817f7f, 0x7f818181, 0x817f8181, 0x7f7f817f, 0x7f818181, 0x7f818181, +0x81817f81, 0x7f7f817f, 0x7f81817f, 0x7f7f7f7f, 0x7f7f7f7f, 0x7f817f81, 0x81817f81, 0x7f7f817f, +0x7f817f7f, 0x817f817f, 0x7f818181, 0x81817f81, 0x7f81817f, 0x7f817f7f, 0x7f817f7f, 0x7f7f7f81, +0x7f818181, 0x7f818181, 0x817f817f, 0x81818181, 0x817f817f, 0x81818181, 0x7f818181, 0x7f818181, +0x7f7f817f, 0x817f7f7f, 0x7f817f7f, 0x7f7f817f, 0x7f7f7f7f, 0x7f7f8181, 0x817f7f81, 0x7f81817f, +0x81817f81, 0x817f7f81, 0x8181817f, 0x817f817f, 0x7f817f7f, 0x7f817f81, 0x7f81817f, 0x7f818181, +0x817f8181, 0x81817f7f, 0x817f7f7f, 0x817f8181, 0x7f818181, 0x817f7f7f, 0x817f7f7f, 0x7f7f817f, +0x817f817f, 0x81817f81, 0x81818181, 0x7f7f7f81, 0x817f7f81, 0x817f7f81, 0x7f7f8181, 0x81818181, +0x7f7f7f7f, 0x7f7f8181, 0x81817f81, 0x7f817f7f, 0x817f817f, 0x817f8181, 0x81817f81, 0x7f7f817f, +0x7f817f7f, 0x7f818181, 0x81818181, 0x7f81817f, 0x7f7f7f81, 0x7f81817f, 0x7f7f817f, 0x8181817f, +0x817f7f81, 0x817f817f, 0x7f7f8181, 0x817f7f81, 0x7f7f8181, 0x817f7f81, 0x7f7f8181, 0x81817f81, +0x7f7f817f, 0x81818181, 0x8181817f, 0x7f818181, 0x817f817f, 0x7f817f81, 0x7f817f7f, 0x7f81817f, +0x7f7f7f81, 0x817f7f81, 0x817f7f7f, 0x7f7f7f81, 0x817f7f81, 0x817f8181, 0x817f8181, 0x7f818181, +0x7f7f8181, 0x7f817f7f, 0x81818181, 0x8181817f, 0x7f7f817f, 0x81817f7f, 0x817f817f, 0x81817f81, +0x7f817f81, 0x7f7f7f7f, 0x8181817f, 0x817f7f81, 0x81817f81, 0x7f818181, 0x81818181, 0x7f7f8181, +0x817f7f7f, 0x7f817f7f, 0x7f7f817f, 0x817f817f, 0x7f817f7f, 0x817f7f81, 0x7f7f8181, 0x7f7f7f81, +0x81818181, 0x7f7f8181, 0x81818181, 0x817f7f81, 0x81818181, 0x817f7f81, 0x81817f7f, 0x7f7f817f, +0x817f7f7f, 0x8181817f, 0x817f7f81, 0x81818181, 0x81817f81, 0x81818181, 0x7f81817f, 0x7f817f81, +0x7f81817f, 0x7f817f7f, 0x7f81817f, 0x7f818181, 0x81817f7f, 0x7f81817f, 0x81817f7f, 0x817f7f7f, +0x817f8181, 0x7f7f8181, 0x8181817f, 0x8181817f, 0x81817f7f, 0x817f817f, 0x7f81817f, 0x8181817f, +0x7f818181, 0x817f7f7f, 0x7f818181, 0x817f8181, 0x81818181, 0x7f7f7f81, 0x7f7f8181, 0x7f817f7f, +0x817f8181, 0x7f817f7f, 0x7f818181, 0x7f7f7f7f, 0x7f7f817f, 0x817f817f, 0x817f8181, 0x7f81817f, +0x7f817f7f, 0x7f7f7f7f, 0x7f7f8181, 0x7f818181, 0x7f817f7f, 0x7f7f8181, 0x7f817f81, 0x7f7f817f, +0x817f8181, 0x81817f81, 0x7f7f8181, 0x81817f81, 0x81817f7f, 0x817f7f7f, 0x817f8181, 0x7f818181, +0x81818181, 0x7f817f7f, 0x81817f81, 0x817f7f7f, 0x817f7f81, 0x81817f7f, 0x817f817f, 0x7f817f81, +0x7f7f8181, 0x81817f7f, 0x7f818181, 0x7f7f7f7f, 0x7f7f7f81, 0x7f817f81, 0x7f7f7f81, 0x7f7f8181, +0x81817f81, 0x817f817f, 0x817f7f81, 0x7f7f817f, 0x81817f7f, 0x81817f81, 0x817f7f81, 0x7f818181, +0x817f817f, 0x7f81817f, 0x8181817f, 0x8181817f, 0x7f818181, 0x817f7f81, 0x81818181, 0x817f7f81, +0x817f7f7f, 0x8181817f, 0x8181817f, 0x7f817f7f, 0x81818181, 0x7f7f7f81, 0x7f7f7f7f, 0x7f818181, +0x817f7f7f, 0x7f7f817f, 0x7f7f7f81, 0x7f7f7f81, 0x7f817f81, 0x7f817f7f, 0x7f817f81, 0x817f7f81, +0x81817f81, 0x8181817f, 0x7f81817f, 0x81818181, 0x7f7f7f7f, 0x817f7f81, 0x7f7f817f, 0x81818181, +0x817f817f, 0x7f818181, 0x817f7f81, 0x817f817f, 0x817f8181, 0x7f7f7f7f, 0x81817f81, 0x7f7f8181, +0x8181817f, 0x81817f7f, 0x7f818181, 0x81817f7f, 0x81817f81, 0x7f81817f, 0x7f81817f, 0x817f7f7f, +0x7f817f81, 0x8181817f, 0x81817f81, 0x7f818181, 0x8181817f, 0x81817f81, 0x81817f81, 0x7f7f8181, +0x7f818181, 0x817f8181, 0x81817f81, 0x7f818181, 0x7f818181, 0x81818181, 0x7f7f8181, 0x81817f7f, +0x7f7f8181, 0x7f818181, 0x7f818181, 0x8181817f, 0x7f817f81, 0x8181817f, 0x7f817f7f, 0x817f817f, +0x7f817f81, 0x81818181, 0x817f7f81, 0x8181817f, 0x7f7f817f, 0x7f7f7f81, 0x817f7f81, 0x7f7f8181, +0x7f817f81, 0x81817f81, 0x81818181, 0x7f7f7f81, 0x817f8181, 0x81817f7f, 0x817f7f7f, 0x7f7f817f, +0x8181817f, 0x7f817f81, 0x817f8181, 0x817f7f7f, 0x81817f81, 0x817f8181, 0x7f817f81, 0x8181817f, +0x81817f81, 0x817f817f, 0x817f8181, 0x81817f81, 0x7f817f81, 0x7f818181, 0x7f7f7f81, 0x7f7f8181, +0x7f7f817f, 0x8181817f, 0x7f817f7f, 0x817f8181, 0x817f8181, 0x817f817f, 0x7f7f817f, 0x81817f7f, +0x817f7f81, 0x7f818181, 0x7f7f7f7f, 0x7f818181, 0x81818181, 0x7f818181, 0x7f818181, 0x8181817f, +0x81817f81, 0x7f7f7f81, 0x817f7f81, 0x817f8181, 0x81817f7f, 0x7f81817f, 0x7f7f817f, 0x817f8181, +0x81817f81, 0x817f7f7f, 0x817f817f, 0x7f81817f, 0x817f817f, 0x817f7f7f, 0x81817f7f, 0x817f7f81, +0x817f817f, 0x7f7f7f7f, 0x8181817f, 0x7f817f81, 0x7f817f81, 0x81817f81, 0x7f817f7f, 0x7f817f7f, +0x7f817f7f, 0x7f7f7f7f, 0x7f7f7f7f, 0x81817f81, 0x817f7f81, 0x7f7f7f81, 0x81817f81, 0x7f7f817f, +0x817f8181, 0x7f817f81, 0x8181817f, 0x7f7f8181, 0x817f8181, 0x7f81817f, 0x8181817f, 0x7f7f8181, +0x81817f81, 0x7f818181, 0x7f817f81, 0x7f7f7f7f, 0x7f7f8181, 0x7f818181, 0x8181817f, 0x7f7f7f7f, +0x817f817f, 0x81817f7f, 0x7f81817f, 0x7f7f7f7f, 0x7f81817f, 0x7f81817f, 0x817f817f, 0x817f7f81, +0x7f817f81, 0x7f817f7f, 0x81817f7f, 0x817f7f7f, 0x817f7f7f, 0x7f817f81, 0x7f7f817f, 0x7f81817f, +0x81818181, 0x817f7f81, 0x7f7f8181, 0x7f7f7f7f, 0x7f7f8181, 0x7f7f817f, 0x817f7f7f, 0x7f817f81, +0x7f817f7f, 0x7f7f817f, 0x81817f81, 0x7f817f81, 0x8181817f, 0x7f7f8181, 0x7f7f8181, 0x8181817f, +0x7f7f7f81, 0x8181817f, 0x8181817f, 0x81817f81, 0x7f81817f, 0x7f7f817f, 0x7f7f817f, 0x7f7f817f, +0x7f81817f, 0x7f818181, 0x7f817f7f, 0x81817f7f, 0x7f7f7f81, 0x81817f81, 0x817f8181, 0x817f7f81, +0x817f817f, 0x7f818181, 0x7f817f7f, 0x817f7f81, 0x7f7f7f7f, 0x81817f7f, 0x7f81817f, 0x7f817f81, +0x7f7f8181, 0x7f817f7f, 0x7f81817f, 0x7f81817f, 0x81817f81, 0x7f817f81, 0x817f817f, 0x817f817f, +0x8181817f, 0x7f7f817f, 0x817f7f81, 0x81817f7f, 0x7f817f7f, 0x7f81817f, 0x7f7f8181, 0x8181817f, +0x7f817f7f, 0x817f817f, 0x81817f7f, 0x817f7f7f, 0x817f7f81, 0x81818181, 0x7f7f7f81, 0x81817f7f, +0x817f817f, 0x817f8181, 0x7f81817f, 0x7f7f8181, 0x817f7f81, 0x7f7f8181, 0x81817f7f, 0x81817f81, +0x7f818181, 0x817f817f, 0x7f7f817f, 0x817f817f, 0x817f7f81, 0x7f7f8181, 0x7f7f8181, 0x7f7f7f7f, +0x817f8181, 0x7f7f7f81, 0x817f7f7f, 0x7f7f8181, 0x7f7f7f7f, 0x7f817f7f, 0x7f817f7f, 0x7f7f817f, +0x817f817f, 0x81818181, 0x7f81817f, 0x7f7f817f, 0x7f818181, 0x817f7f7f, 0x7f817f81, 0x81817f81, +0x817f7f7f, 0x81817f7f, 0x81817f81, 0x7f7f8181, 0x7f7f817f, 0x7f7f7f81, 0x8181817f, 0x81817f7f, +0x81817f81, 0x7f7f7f81, 0x7f817f7f, 0x817f7f7f, 0x817f7f7f, 0x81817f7f, 0x81817f81, 0x7f7f7f7f, +0x7f817f81, 0x817f7f81, 0x7f817f81, 0x7f7f7f81, 0x81818181, 0x7f7f8181, 0x81817f7f, 0x81818181, +0x7f7f8181, 0x7f7f817f, 0x817f7f7f, 0x7f818181, 0x817f8181, 0x81817f7f, 0x8181817f, 0x81817f7f, +0x8181817f, 0x7f817f81, 0x81818181, 0x817f7f7f, 0x81818181, 0x7f818181, 0x7f7f8181, 0x7f7f817f, +0x817f8181, 0x7f7f8181, 0x817f7f7f, 0x817f7f81, 0x7f81817f, 0x817f7f7f, 0x8181817f, 0x81817f81, +0x817f7f81, 0x817f7f7f, 0x7f7f7f7f, 0x81817f7f, 0x817f7f7f, 0x7f818181, 0x7f81817f, 0x7f817f7f, +0x817f8181, 0x7f7f7f81, 0x7f817f81, 0x817f8181, 0x817f7f7f, 0x7f818181, 0x7f7f7f81, 0x81817f7f, +0x817f7f7f, 0x7f817f7f, 0x7f817f7f, 0x7f7f817f, 0x817f8181, 0x817f7f7f, 0x7f7f817f, 0x8181817f, +0x817f7f7f, 0x8181817f, 0x7f7f8181, 0x7f817f7f, 0x7f817f81, 0x81818181, 0x7f7f817f, 0x81818181, +0x817f7f7f, 0x7f7f7f81, 0x81817f7f, 0x817f8181, 0x7f7f7f81, 0x817f8181, 0x7f7f8181, 0x817f7f81, +0x817f7f81, 0x7f817f7f, 0x7f7f817f, 0x7f7f8181, 0x7f7f7f81, 0x7f7f7f81, 0x7f81817f, 0x817f817f, +0x7f817f7f, 0x81817f7f, 0x7f7f817f, 0x7f7f7f81, 0x817f8181, 0x7f7f8181, 0x7f7f7f81, 0x7f7f7f81, +0x81818181, 0x7f7f7f7f, 0x817f8181, 0x7f7f8181, 0x7f817f7f, 0x7f817f7f, 0x817f7f7f, 0x8181817f, +0x81818181, 0x7f817f81, 0x7f7f7f7f, 0x817f7f81, 0x817f7f81, 0x7f818181, 0x7f81817f, 0x7f818181, +0x7f7f7f81, 0x7f81817f, 0x7f7f8181, 0x7f7f8181, 0x817f7f81, 0x7f817f81, 0x7f817f7f, 0x7f818181, +0x7f7f817f, 0x7f818181, 0x7f817f7f, 0x81817f7f, 0x7f7f7f81, 0x7f818181, 0x817f7f7f, 0x817f817f, +0x7f81817f, 0x817f7f81, 0x7f818181, 0x817f7f81, 0x7f7f7f81, 0x8181817f, 0x8181817f, 0x7f81817f, +0x817f817f, 0x7f7f7f81, 0x81817f81, 0x7f7f8181, 0x7f7f7f81, 0x7f7f8181, 0x817f8181, 0x817f7f7f, +0x7f817f81, 0x8181817f, 0x7f7f817f, 0x7f817f7f, 0x7f7f8181, 0x7f7f7f81, 0x8181817f, 0x7f7f8181, +0x7f818181, 0x81817f7f, 0x8181817f, 0x817f7f81, 0x7f7f7f81, 0x817f7f7f, 0x7f817f81, 0x7f818181, +0x81818181, 0x7f7f7f7f, 0x817f7f81, 0x7f817f7f, 0x7f817f7f, 0x7f81817f, 0x81818181, 0x817f7f81, +0x817f7f81, 0x7f817f81, 0x7f7f8181, 0x7f818181, 0x7f818181, 0x7f818181, 0x7f7f7f81, 0x7f81817f, +0x7f81817f, 0x7f818181, 0x7f7f7f81, 0x81817f81, 0x81818181, 0x817f7f7f, 0x817f7f7f, 0x817f817f, +0x8181817f, 0x7f7f8181, 0x7f7f7f7f, 0x81818181, 0x817f8181, 0x7f7f8181, 0x81817f81, 0x7f817f81, +0x7f818181, 0x7f7f817f, 0x817f7f81, 0x7f7f7f81, 0x7f7f7f81, 0x81817f81, 0x81817f81, 0x7f7f7f7f, +0x817f7f81, 0x7f817f7f, 0x81817f81, 0x7f817f81, 0x817f817f, 0x7f7f8181, 0x81817f7f, 0x817f7f81, +0x7f817f81, 0x7f7f7f81, 0x817f8181, 0x7f7f7f81, 0x817f7f7f, 0x7f7f7f81, 0x817f817f, 0x7f7f7f81, +0x7f817f7f, 0x7f817f7f, 0x8181817f, 0x8181817f, 0x7f7f7f81, 0x7f7f7f81, 0x7f817f81, 0x81817f81, +0x81817f7f, 0x7f7f7f7f, 0x81817f7f, 0x81818181, 0x817f817f, 0x81817f81, 0x81818181, 0x817f7f81, +0x817f8181, 0x817f7f7f, 0x81817f7f, 0x81817f7f, 0x81818181, 0x7f7f7f7f, 0x7f817f7f, 0x7f81817f, +0x7f7f817f, 0x8181817f, 0x817f8181, 0x817f8181, 0x8181817f, 0x7f7f7f81, 0x817f7f7f, 0x817f7f7f, +0x817f8181, 0x7f817f81, 0x7f7f7f7f, 0x81817f7f, 0x81818181, 0x7f817f7f, 0x7f7f8181, 0x817f8181, +0x817f7f7f, 0x817f7f81, 0x817f7f81, 0x81817f7f, 0x7f817f7f, 0x817f7f7f, 0x7f7f8181, 0x7f817f81, +0x7f7f7f7f, 0x8181817f, 0x7f7f7f81, 0x81818181, 0x7f7f817f, 0x81817f81, 0x817f7f7f, 0x7f817f81, +0x817f817f, 0x7f817f81, 0x817f7f7f, 0x7f7f8181, 0x7f81817f, 0x7f7f8181, 0x7f7f7f7f, 0x7f818181, +0x81817f81, 0x7f7f817f, 0x7f7f817f, 0x7f7f817f, 0x817f7f7f, 0x81818181, 0x81817f7f, 0x7f817f81, +0x7f7f817f, 0x7f7f7f7f, 0x81818181, 0x7f7f817f, 0x7f7f817f, 0x7f817f7f, 0x817f7f81, 0x7f817f7f, +0x7f7f7f81, 0x7f7f817f, 0x817f817f, 0x81817f7f, 0x81818181, 0x817f8181, 0x7f817f7f, 0x817f8181, +0x7f818181, 0x7f81817f, 0x817f7f81, 0x817f7f7f, 0x7f7f817f, 0x817f7f7f, 0x7f7f7f81, 0x81817f7f, +0x7f7f817f, 0x817f7f81, 0x7f818181, 0x817f8181, 0x817f8181, 0x7f7f7f7f, 0x817f817f, 0x7f7f7f7f, +0x7f7f7f7f, 0x7f7f7f7f, 0x817f8181, 0x81817f81, 0x817f7f7f, 0x7f818181, 0x7f81817f, 0x7f81817f, +0x81818181, 0x817f8181, 0x817f7f81, 0x8181817f, 0x817f7f7f, 0x7f7f7f7f, 0x81817f81, 0x817f817f, +0x817f817f, 0x817f7f81, 0x7f818181, 0x7f817f81, 0x81817f81, 0x7f81817f, 0x7f81817f, 0x7f817f7f, +0x7f817f81, 0x7f7f7f81, 0x81817f81, 0x81817f81, 0x7f7f817f, 0x7f817f7f, 0x7f818181, 0x7f81817f, +0x817f7f81, 0x817f7f81, 0x81817f81, 0x7f818181, 0x817f8181, 0x7f81817f, 0x7f7f7f7f, 0x817f7f7f, +0x7f817f7f, 0x81817f7f, 0x7f7f8181, 0x7f7f8181, 0x7f7f8181, 0x817f8181, 0x7f81817f, 0x817f7f81, +0x817f7f81, 0x7f7f817f, 0x7f817f81, 0x81817f7f, 0x7f7f7f7f, 0x7f7f7f7f, 0x7f7f8181, 0x817f7f81, +0x8181817f, 0x8181817f, 0x7f7f8181, 0x7f7f817f, 0x817f7f81, 0x817f8181, 0x7f818181, 0x81818181, +0x817f7f81, 0x7f7f817f, 0x7f7f817f, 0x7f7f8181, 0x7f7f7f7f, 0x817f7f81, 0x8181817f, 0x81818181, +0x817f817f, 0x7f818181, 0x817f7f81, 0x81817f7f, 0x7f817f7f, 0x7f817f7f, 0x81818181, 0x817f817f, +0x817f7f81, 0x7f7f8181, 0x7f7f8181, 0x8181817f, 0x7f817f7f, 0x7f81817f, 0x7f7f7f81, 0x7f7f7f81, +0x8181817f, 0x7f817f7f, 0x817f7f81, 0x7f817f81, 0x7f817f81, 0x817f817f, 0x81818181, 0x817f817f, +0x817f8181, 0x7f7f8181, 0x7f817f7f, 0x817f817f, 0x817f7f81, 0x8181817f, 0x7f7f7f81, 0x81817f81, +0x817f7f81, 0x81818181, 0x7f818181, 0x7f7f7f81, 0x7f818181, 0x7f817f7f, 0x7f7f7f81, 0x7f7f7f81, +0x817f817f, 0x81818181, 0x7f7f817f, 0x81818181, 0x8181817f, 0x7f7f817f, 0x7f7f7f7f, 0x7f818181, +0x817f817f, 0x7f7f8181, 0x7f817f81, 0x817f8181, 0x7f817f81, 0x7f7f7f81, 0x7f818181, 0x8181817f, +0x7f7f7f7f, 0x7f7f7f81, 0x7f7f7f81, 0x7f7f7f7f, 0x81817f7f, 0x7f7f8181, 0x817f817f, 0x817f8181, +0x817f7f7f, 0x81817f81, 0x7f81817f, 0x7f7f8181, 0x7f7f8181, 0x7f7f7f7f, 0x817f817f, 0x81818181, +0x7f7f8181, 0x7f818181, 0x7f81817f, 0x817f7f7f, 0x81817f7f, 0x81817f81, 0x7f81817f, 0x8181817f, +0x81818181, 0x81817f7f, 0x7f818181, 0x7f817f81, 0x817f7f7f, 0x817f817f, 0x7f7f817f, 0x81818181, +0x7f81817f, 0x7f7f7f81, 0x7f7f7f81, 0x81817f81, 0x81817f7f, 0x817f7f81, 0x7f817f81, 0x817f817f, +0x817f817f, 0x7f7f7f7f, 0x7f817f7f, 0x7f7f7f81, 0x81817f7f, 0x817f7f81, 0x7f7f8181, 0x817f7f81, +0x7f81817f, 0x817f7f81, 0x817f817f, 0x817f8181, 0x7f818181, 0x7f7f7f81, 0x7f7f8181, 0x817f7f7f, +0x7f7f7f7f, 0x81817f7f, 0x81817f7f, 0x81817f7f, 0x7f817f81, 0x81818181, 0x817f817f, 0x81817f7f, +0x7f7f7f7f, 0x7f7f7f7f, 0x7f818181, 0x7f7f7f81, 0x817f7f81, 0x7f817f7f, 0x7f817f81, 0x7f7f7f81, +0x81817f7f, 0x81817f81, 0x81817f81, 0x81818181, 0x817f7f7f, 0x7f818181, 0x81818181, 0x7f7f7f7f, +0x7f818181, 0x7f7f817f, 0x7f7f8181, 0x817f7f7f, 0x7f817f81, 0x817f7f7f, 0x81818181, 0x7f7f817f, +0x817f7f81, 0x817f7f81, 0x7f81817f, 0x81817f81, 0x7f7f8181, 0x7f81817f, 0x7f7f8181, 0x817f7f7f, +0x7f817f7f, 0x8181817f, 0x8181817f, 0x8181817f, 0x7f7f8181, 0x8181817f, 0x7f7f8181, 0x817f817f, +0x7f817f7f, 0x7f7f8181, 0x7f7f7f81, 0x7f818181, 0x81817f7f, 0x7f818181, 0x817f7f81, 0x7f7f817f, +0x7f7f7f7f, 0x7f817f81, 0x7f817f81, 0x7f7f8181, 0x7f7f817f, 0x7f817f7f, 0x81817f81, 0x7f7f8181, +0x81818181, 0x7f7f817f, 0x7f817f81, 0x817f8181, 0x817f8181, 0x81817f81, 0x817f817f, 0x7f81817f, +0x817f7f7f, 0x7f7f7f7f, 0x7f7f7f81, 0x817f8181, 0x7f7f7f81, 0x817f8181, 0x81818181, 0x7f817f81, +0x81818181, 0x7f81817f, 0x7f7f7f7f, 0x81817f81, 0x7f818181, 0x7f7f7f7f, 0x7f81817f, 0x7f81817f, +0x8181817f, 0x7f81817f, 0x81817f81, 0x7f7f7f7f, 0x817f7f81, 0x7f7f7f81, 0x7f817f81, 0x7f7f7f81, +0x81818181, 0x81817f7f, 0x81817f81, 0x7f7f817f, 0x7f818181, 0x81817f81, 0x81817f7f, 0x81817f81, +0x7f7f7f81, 0x81817f7f, 0x7f7f8181, 0x7f7f817f, 0x81817f7f, 0x817f7f81, 0x7f818181, 0x7f817f7f, +0x7f817f81, 0x7f7f817f, 0x7f7f817f, 0x817f817f, 0x7f7f7f7f, 0x817f7f81, 0x7f7f7f81, 0x817f817f, +0x7f7f8181, 0x7f818181, 0x817f817f, 0x7f817f81, 0x817f7f7f, 0x7f818181, 0x81818181, 0x81818181, +0x81817f7f, 0x7f81817f, 0x7f817f7f, 0x7f7f817f, 0x7f7f8181, 0x817f817f, 0x817f8181, 0x7f7f817f, +0x817f7f81, 0x81817f81, 0x817f7f81, 0x7f81817f, 0x817f7f81, 0x81817f7f, 0x7f817f7f, 0x7f817f81, +0x817f7f7f, 0x7f7f817f, 0x7f817f81, 0x7f7f7f81, 0x81818181, 0x7f817f7f, 0x817f817f, 0x81818181, +0x7f7f7f7f, 0x7f817f81, 0x7f817f81, 0x7f817f7f, 0x817f8181, 0x817f8181, 0x7f817f81, 0x81818181, +0x7f818181, 0x81818181, 0x7f81817f, 0x7f818181, 0x7f7f817f, 0x7f7f817f, 0x7f7f7f81, 0x81817f7f, +0x7f818181, 0x817f8181, 0x7f7f7f81, 0x7f7f817f, 0x7f7f817f, 0x7f817f81, 0x7f817f7f, 0x7f7f7f7f, +0x81817f81, 0x81817f81, 0x7f7f7f81, 0x81818181, 0x7f817f7f, 0x81818181, 0x81817f7f, 0x7f7f8181, +0x817f7f7f, 0x7f7f817f, 0x817f817f, 0x817f8181, 0x81818181, 0x7f817f81, 0x817f817f, 0x817f8181, +0x817f8181, 0x817f817f, 0x81817f7f, 0x7f817f7f, 0x817f8181, 0x81817f7f, 0x81818181, 0x817f8181, +0x7f817f7f, 0x7f817f7f, 0x7f7f8181, 0x817f817f, 0x7f7f817f, 0x7f817f81, 0x7f7f817f, 0x7f7f7f81, +0x817f817f, 0x7f7f8181, 0x81817f7f, 0x7f7f7f7f, 0x7f818181, 0x7f818181, 0x7f817f81, 0x7f81817f, +0x7f7f8181, 0x7f7f7f7f, 0x81817f81, 0x817f7f7f, 0x81817f7f, 0x817f7f7f, 0x8181817f, 0x7f818181, +0x817f817f, 0x817f7f81, 0x81817f7f, 0x817f7f81, 0x7f817f81, 0x817f7f81, 0x817f817f, 0x7f7f7f7f, +0x7f817f7f, 0x8181817f, 0x7f818181, 0x81817f81, 0x7f7f7f7f, 0x7f818181, 0x817f817f, 0x7f818181, +0x7f818181, 0x817f7f7f, 0x81817f7f, 0x81817f81, 0x7f7f7f81, 0x7f7f817f, 0x81817f81, 0x7f81817f, +0x817f8181, 0x7f81817f, 0x7f7f7f81, 0x7f818181, 0x81817f7f, 0x7f818181, 0x817f817f, 0x817f7f7f, +0x817f7f7f, 0x817f817f, 0x817f7f7f, 0x7f81817f, 0x7f817f81, 0x7f7f8181, 0x817f817f, 0x817f817f, +0x7f81817f, 0x7f817f7f, 0x7f7f817f, 0x81817f81, 0x817f8181, 0x81818181, 0x7f7f817f, 0x81818181, +0x81817f7f, 0x7f818181, 0x7f7f8181, 0x7f7f8181, 0x81818181, 0x7f817f7f, 0x8181817f, 0x8181817f, +0x817f7f7f, 0x817f7f7f, 0x81818181, 0x7f818181, 0x7f817f7f, 0x81817f81, 0x8181817f, 0x817f7f7f, +0x7f7f7f7f, 0x7f7f7f81, 0x7f817f81, 0x7f7f817f, 0x81817f81, 0x7f7f817f, 0x7f818181, 0x7f817f7f, +0x7f81817f, 0x7f7f817f, 0x81818181, 0x7f7f817f, 0x7f7f8181, 0x7f7f7f81, 0x81817f81, 0x817f817f, +0x7f817f81, 0x7f817f7f, 0x8181817f, 0x7f7f7f81, 0x81818181, 0x817f7f7f, 0x81817f7f, 0x7f817f7f, +0x817f7f7f, 0x817f817f, 0x7f817f7f, 0x817f8181, 0x81818181, 0x7f817f7f, 0x81817f81, 0x817f7f7f, +0x817f8181, 0x7f81817f, 0x7f7f8181, 0x7f817f81, 0x81817f7f, 0x7f7f817f, 0x817f7f81, 0x817f817f, +0x7f817f81, 0x817f8181, 0x81817f7f, 0x817f8181, 0x8181817f, 0x7f81817f, 0x81817f7f, 0x7f7f817f, +0x7f81817f, 0x81817f7f, 0x7f818181, 0x817f7f81, 0x8181817f, 0x7f818181, 0x7f7f817f, 0x7f817f7f, +0x7f817f7f, 0x8181817f, 0x7f81817f, 0x81817f81, 0x7f7f7f7f, 0x7f81817f, 0x817f7f7f, 0x817f7f7f, +0x817f817f, 0x7f81817f, 0x7f818181, 0x7f7f7f81, 0x817f7f7f, 0x7f7f7f81, 0x7f7f8181, 0x7f7f817f, +0x7f7f7f81, 0x817f7f81, 0x81817f81, 0x7f7f817f, 0x817f8181, 0x7f7f7f81, 0x7f7f817f, 0x817f817f, +0x817f7f81, 0x817f817f, 0x7f817f7f, 0x7f7f817f, 0x81818181, 0x81817f81, 0x817f8181, 0x7f7f8181, +0x7f7f8181, 0x817f8181, 0x7f7f7f7f, 0x8181817f, 0x7f7f7f7f, 0x7f81817f, 0x81817f81, 0x81817f7f, +0x7f7f8181, 0x8181817f, 0x7f818181, 0x7f817f7f, 0x7f7f817f, 0x7f81817f, 0x7f817f81, 0x7f817f7f, +0x7f7f8181, 0x81818181, 0x7f7f8181, 0x7f7f7f81, 0x817f7f7f, 0x7f7f8181, 0x81818181, 0x7f817f81, +0x81818181, 0x7f818181, 0x7f818181, 0x817f8181, 0x81818181, 0x7f81817f, 0x7f7f8181, 0x7f7f8181, +0x817f7f7f, 0x7f7f7f7f, 0x7f817f81, 0x7f81817f, 0x7f817f7f, 0x817f817f, 0x7f7f7f81, 0x817f7f81, +0x7f818181, 0x8181817f, 0x817f7f81, 0x817f817f, 0x817f8181, 0x7f7f7f81, 0x7f817f7f, 0x81817f81, +0x817f8181, 0x817f8181, 0x7f817f7f, 0x81817f7f, 0x817f7f81, 0x7f817f81, 0x817f7f7f, 0x817f8181, +0x7f817f7f, 0x81817f7f, 0x81817f81, 0x7f817f81, 0x7f81817f, 0x7f7f7f81, 0x7f817f7f, 0x7f7f8181, +0x8181817f, 0x7f7f7f7f, 0x7f7f8181, 0x7f817f7f, 0x817f8181, 0x817f7f81, 0x7f7f7f7f, 0x7f81817f, +0x7f7f8181, 0x817f817f, 0x7f7f7f81, 0x81817f7f, 0x81818181, 0x817f7f81, 0x7f817f7f, 0x7f81817f, +0x8181817f, 0x7f7f817f, 0x817f7f81, 0x81817f81, 0x8181817f, 0x7f7f8181, 0x817f7f81, 0x81817f81, +0x817f8181, 0x817f8181, 0x817f817f, 0x817f8181, 0x817f7f81, 0x7f7f7f7f, 0x7f7f8181, 0x817f817f, +0x7f817f7f, 0x817f7f81, 0x7f81817f, 0x81818181, 0x7f7f7f81, 0x7f818181, 0x7f7f8181, 0x81817f7f, +0x817f7f81, 0x8181817f, 0x7f817f81, 0x7f7f7f7f, 0x7f817f7f, 0x7f818181, 0x8181817f, 0x817f7f81, +0x817f7f7f, 0x7f817f81, 0x7f7f8181, 0x817f7f81, 0x817f7f7f, 0x817f8181, 0x7f817f81, 0x81817f7f, +0x817f817f, 0x81817f81, 0x81817f7f, 0x8181817f, 0x817f8181, 0x817f7f7f, 0x81817f7f, 0x81817f81, +0x817f7f81, 0x81818181, 0x81817f81, 0x7f817f7f, 0x7f817f7f, 0x8181817f, 0x7f818181, 0x7f7f7f7f, +0x7f817f81, 0x81817f81, 0x7f7f817f, 0x817f7f81, 0x7f7f7f81, 0x7f818181, 0x7f7f7f7f, 0x7f817f7f, +0x7f7f817f, 0x817f7f7f, 0x7f7f817f, 0x8181817f, 0x7f818181, 0x7f7f7f7f, 0x81817f7f, 0x7f81817f, +0x817f7f7f, 0x7f7f7f7f, 0x7f81817f, 0x817f7f7f, 0x817f817f, 0x7f7f7f81, 0x81817f81, 0x817f7f7f, +0x817f7f81, 0x81817f7f, 0x7f7f7f7f, 0x81818181, 0x81817f7f, 0x7f7f7f81, 0x81817f7f, 0x7f7f7f81, +0x7f817f81, 0x817f7f7f, 0x7f817f7f, 0x7f81817f, 0x7f817f7f, 0x817f817f, 0x817f817f, 0x8181817f, +0x817f8181, 0x81818181, 0x817f817f, 0x7f7f8181, 0x7f817f7f, 0x7f817f81, 0x817f7f7f, 0x7f7f8181, +0x7f817f81, 0x81817f81, 0x817f817f, 0x7f818181, 0x7f7f7f81, 0x7f7f8181, 0x7f81817f, 0x8181817f, +0x7f7f7f7f, 0x817f8181, 0x7f7f7f7f, 0x81817f81, 0x8181817f, 0x7f7f817f, 0x8181817f, 0x7f7f7f7f, +0x7f817f7f, 0x7f81817f, 0x817f7f7f, 0x81817f7f, 0x7f7f7f7f, 0x81817f81, 0x81817f81, 0x7f81817f, +0x7f7f7f81, 0x81817f81, 0x817f817f, 0x7f7f7f7f, 0x8181817f, 0x7f817f7f, 0x7f7f7f81, 0x7f817f7f, +0x817f8181, 0x7f7f7f81, 0x7f81817f, 0x817f8181, 0x7f7f8181, 0x7f817f81, 0x8181817f, 0x81818181, +0x7f7f8181, 0x817f817f, 0x817f7f81, 0x7f817f7f, 0x7f818181, 0x81818181, 0x7f817f81, 0x817f7f81, +0x817f817f, 0x81817f7f, 0x81817f81, 0x817f7f7f, 0x7f7f7f81, 0x7f81817f, 0x7f7f8181, 0x7f7f817f, +0x7f7f7f7f, 0x7f817f7f, 0x7f817f7f, 0x817f8181, 0x7f7f7f81, 0x8181817f, 0x817f8181, 0x7f7f7f7f, +0x81817f81, 0x817f817f, 0x81818181, 0x7f817f7f, 0x817f817f, 0x817f817f, 0x81817f7f, 0x7f7f7f81, +0x7f7f7f81, 0x81817f7f, 0x7f817f7f, 0x817f8181, 0x81817f7f, 0x81817f7f, 0x817f8181, 0x8181817f, +0x7f81817f, 0x7f81817f, 0x817f7f81, 0x817f817f, 0x7f7f8181, 0x8181817f, 0x7f817f81, 0x817f817f, +0x7f818181, 0x81818181, 0x7f7f7f7f, 0x817f8181, 0x7f817f7f, 0x7f7f817f, 0x7f7f7f81, 0x7f7f7f81, +0x817f817f, 0x817f817f, 0x81818181, 0x81818181, 0x817f7f81, 0x7f81817f, 0x817f8181, 0x7f7f817f, +0x817f8181, 0x7f7f7f81, 0x7f818181, 0x817f7f7f, 0x817f7f81, 0x817f8181, 0x817f817f, 0x817f817f, +0x7f817f81, 0x817f7f7f, 0x81817f7f, 0x7f818181, 0x7f7f817f, 0x817f7f81, 0x817f7f81, 0x817f8181, +0x7f7f817f, 0x8181817f, 0x8181817f, 0x7f7f817f, 0x81817f81, 0x7f7f7f7f, 0x7f81817f, 0x8181817f, +0x7f7f817f, 0x7f7f8181, 0x8181817f, 0x817f817f, 0x7f817f81, 0x7f7f8181, 0x7f7f7f7f, 0x7f7f7f81, +0x81817f81, 0x81818181, 0x7f7f7f81, 0x7f817f81, 0x817f7f7f, 0x7f81817f, 0x81817f7f, 0x7f817f81, +0x7f818181, 0x7f7f7f81, 0x8181817f, 0x817f8181, 0x817f817f, 0x817f817f, 0x7f7f7f7f, 0x8181817f, +0x7f81817f, 0x81818181, 0x7f7f8181, 0x817f7f7f, 0x81817f81, 0x817f817f, 0x817f7f81, 0x81818181 + +output0 = +0xfb26769b, 0xc79ba708, 0xf8635f11, 0xd7e4cfa4, 0xe3c5e7d7, 0xc02d1876, 0xe718a692, 0x09395387, +0x9b38d4ad, 0x2cb9b3e9, 0xa975b0e1, 0x330bcede, 0x7b7550e4, 0x1f120789, 0x719ec767, 0x84e65e6f, +0x8067338a, 0x2f38b6a5, 0xe1100cdc, 0x4129350a, 0xf42f39a8, 0x41ae51c4, 0xa916952f, 0xab6d7503, +0xd0359b04, 0x97be8694, 0xee8effbe, 0x79b093ec, 0x57122f74, 0x73037ee7, 0x395a2f52, 0x73caae6b, +0xc3eff955, 0xf9f1d126, 0x02432290, 0x7295881a, 0xdd24b3a4, 0x7b3473eb, 0x9d1dcbef, 0x3c990bfb, +0xf280623b, 0x20c84e3b, 0x144c6d3a, 0x8ec60a92, 0x09737fc3, 0xeb399fd3, 0xfe46efae, 0x8bca3001, +0x78ade416, 0xb84aea12, 0x43ca2a9e, 0x15fe0d33, 0xd7c16a39, 0xc42a34e8, 0x58df1eaa, 0xa4c437b8, +0x155c3a34, 0xb76ffb85, 0x83762da1, 0x7a114abf, 0xa28f5f9a, 0xc5ea01a2, 0x2701d947, 0xf16083f2, +0x3800ccfd, 0x9c7a9a6f, 0xf65e474d, 0xb143759a, 0xdaaac55c, 0x29950c88, 0xa47976ba, 0xe8335a4f, +0x6a858152, 0x25a3a9f9, 0xc42def6b, 0x07a3ffe4, 0xeb949edb, 0x767e93a2, 0xe58b7e91, 0x02b0ceec, +0x4a519ff0, 0x33091006, 0xa5300a4a, 0x2bcd45f6, 0xb83b264d, 0x22336f72, 0xa555c8d1, 0xeb4aa02c, +0x700dd4a9, 0x6b8fc1e6, 0xd44ce0f3, 0xbb66e520, 0xbdb17016, 0xbebb013c, 0xe2a05d9a, 0x516f5605, +0xac27f407, 0xbd05f488, 0x2ef5e8c2, 0x23a62cf8, 0x50f2f8a9, 0x45d6bda3, 0x9b6efd5a, 0x77cdc34b, +0xb466da5a, 0x98b948f0, 0xb345dd43, 0x52ee8fdf, 0xc0596488, 0x73fab111, 0xf88a77d7, 0x36952151, +0xe5c88df4, 0x05e4e05a, 0xfd68dff8, 0x33ce03ce, 0x181d38da, 0x1bd14663, 0xf3b0e86a, 0xb1d7900d, +0x52165396, 0xa54e79ef, 0xbf1cda0d, 0xad1f7a2a, 0xebf4db32, 0xf049cd5d, 0xdcbe865f, 0xa1c31f6d, +0xeba00e1d, 0xde8e2a87, 0x5e9c15de, 0x02ec68bd, 0xaad1a964, 0x95d3bd1c, 0xf7e7048d, 0x4e2c6243, +0x7e675787, 0xd9811021, 0xec5c7341, 0x98d304da, 0xe68ea509, 0x6318d315, 0xe3570ce2, 0x594c4fad, +0x840f01f5, 0xa9a2e403, 0x8e651529, 0x72c70e44, 0x9402e2f4, 0x9e1cd395, 0x890701ca, 0xe804887a, +0xd209cae4, 0x0c344a3d, 0x8926ca86, 0x0f6debfa, 0x83323654, 0xd0d12b75, 0x7d73888c, 0xf95ce546, +0x0b4fe312, 0x2582b52d, 0xcf10f7ff, 0x7bf385f5, 0x57dcaf9f, 0xcbb60aef, 0x64711e8f, 0x923571ec, +0xfd90c78e, 0x85099f54, 0x63ae3fdf, 0xc683a0b3, 0x591e8102, 0xb6180e2d, 0x35ae7560, 0x94a4a536, +0x97defd69, 0x92afc0b4, 0xebce8cf4, 0x4d2fc035, 0x9057a972, 0x30e204a6, 0xc5af64e8, 0x6c7fa059, +0x40f043e6, 0xdcd8bc3f, 0x5bb3962b, 0xf0f1a38d, 0x99b2893e, 0xf77257c4, 0x60c59a02, 0xaedcaff2, +0xe5a852c1, 0xea67ccb9, 0x150acbb7, 0xea2cb0bc, 0xfa64f623, 0x0d37fe47, 0x81643457, 0x3dcf1a62, +0x5c6c4066, 0x66bdc50d, 0x20e45b88, 0x9746424f + +basegraph= +1 + +z_c= +320 + +n_cb= +16000 + +q_m= +8 + +n_filler= +488 + +ea = +8448 + +eb = +8448 + +iter_max= +8 + +expected_iter_count= +2 + +c = +1 + +r = +0 + +cab = +1 + +rv_index = +0 + +en_scramble = +1 + +q = +0 + +n_id = +323 + +n_rnti = +2300 + +code_block_mode = +0 + +op_flags = +RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP + +expected_status = +OK
app/test-bbdev/test_vectors/ldpc_enc_tb.data new file +482 -0
482 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v3 8/8] app/bbdev: add test vectors for transport blocks
Quoted 12 lines
-----Original Message-----
From: Hemant Agrawal <[email protected]>
Sent: Monday, April 12, 2021 10:17 PMFrom: Nipun Gupta <[email protected]>
This patch adds two test vectors for transport block in network byte order:
- LDPC encode for Transport Block
- LDPC decode for Transport block
Quoted 8 lines
Signed-off-by Nipun Gupta <[email protected]>--- 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.
(...)
Quoted 2 lines
--
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
Quoted 42 lines
-----Original Message-----
From: Chautru, Nicolas <[email protected]>
Sent: Wednesday, April 14, 2021 6:40 AM
To: Hemant Agrawal <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Nipun Gupta <[email protected]>
Subject: RE: [PATCH v3 8/8] app/bbdev: add test vectors for transport blocksQuoted 11 lines
-----Original Message-----
From: Hemant Agrawal <[email protected]>
Sent: Monday, April 12, 2021 10:17 PMFrom: Nipun Gupta <[email protected]>
This patch adds two test vectors for transport block in network byte order:
- LDPC encode for Transport Block
- LDPC decode for Transport blockQuoted 8 lines
Signed-off-by Nipun Gupta <[email protected]>--- 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.dataDo 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.(...)
Quoted 2 lines
--
2.17.1
Re: [dpdk-dev] [PATCH v3 8/8] app/bbdev: add test vectors for transport blocks
Quoted 11 lines
-----Original Message-----
From: Nipun Gupta <[email protected]>
Sent: Wednesday, April 14, 2021 5:16 AMHi,
Apart from network order, these test vectors also add Transport Block modes.
SO these seems legitimate to be added to the test cases.
Hi
In other commit response you are saying you would look into adding this into a capability. In that case the network order should not be relevant in the actual test vector, purely a matter of processing the data differently in the related test component based on the PMD capability. If you want to add a couple of new vectors, please reduce the size (C ~ 3 for instance) as Thomas was mindful to limit the size of these.
Talking about capability I did not see the LDPC decoder LLR representation exposed. More generally are the current unit test able to pass with your PMD on your HW?
Quoted 46 lines
Regards,
NipunQuoted 43 lines
-----Original Message-----
From: Chautru, Nicolas <[email protected]>
Sent: Wednesday, April 14, 2021 6:40 AM
To: Hemant Agrawal <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Nipun Gupta <[email protected]>
Subject: RE: [PATCH v3 8/8] app/bbdev: add test vectors for transport blocksQuoted 11 lines
-----Original Message-----
From: Hemant Agrawal <[email protected]>
Sent: Monday, April 12, 2021 10:17 PMFrom: Nipun Gupta <[email protected]>
This patch adds two test vectors for transport block in network byte order:
- LDPC encode for Transport Block
- LDPC decode for Transport blockQuoted 8 lines
Signed-off-by Nipun Gupta <[email protected]>--- 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.dataDo 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.(...)
Quoted 2 lines
--
2.17.1
Re: [dpdk-dev] [EXT] [PATCH v3 0/8] baseband: add NXP LA12xx driver
In reply to Hemant AgrawalHi Nicholas,
Could you please review this series?
Regards,
Akhil
Quoted 59 lines
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.
Modifications has been done in test vectors to optionally support input 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 compilationHemant 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 baseband/la12xx: add documentation supportNipun Gupta (2):
app/bbdev: add parameter to take input in network order app/bbdev: add test vectors for transport blocksMAINTAINERS | 9 + app/test-bbdev/test_bbdev_vector.c | 18 +- app/test-bbdev/test_bbdev_vector.h | 2 + app/test-bbdev/test_vectors/ldpc_dec_tb.data | 362 +++++ app/test-bbdev/test_vectors/ldpc_enc_tb.data | 482 +++++++ doc/guides/bbdevs/features/la12xx.ini | 14 + doc/guides/bbdevs/index.rst | 1 + doc/guides/bbdevs/la12xx.rst | 139 ++ doc/guides/rel_notes/release_21_05.rst | 5 + drivers/baseband/la12xx/bbdev_la12xx.c | 1178 +++++++++++++++++ drivers/baseband/la12xx/bbdev_la12xx.h | 57 + drivers/baseband/la12xx/bbdev_la12xx_ipc.h | 237 ++++ .../baseband/la12xx/bbdev_la12xx_pmd_logs.h | 38 + drivers/baseband/la12xx/meson.build | 6 + drivers/baseband/la12xx/version.map | 3 + drivers/baseband/meson.build | 2 +- 16 files changed, 2550 insertions(+), 3 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
v5 cover baseband: add NXP LA12xx driver
In reply to Hemant AgrawalThis 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
Signature · 1 line
2.17.1
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.
--- 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(-)
doc/guides/bbdevs/features/default.ini +1 -0
@@ -14,3 +14,4 @@ LLR/HARQ Compression = External DDR Access = HW Accelerated = BBDEV API = +Big Endian Processing =
doc/guides/prog_guide/bbdev.rst +6 -0
@@ -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.
lib/bbdev/rte_bbdev_op.h +12 -2
@@ -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 */
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v5 1/9] bbdev: add big endian processing data capability
Quoted 11 lines
-----Original Message-----
From: Nipun Gupta <[email protected]>
Sent: Sunday, September 12, 2021 5:15 AM
To: [email protected]; [email protected]; Chautru, Nicolas <[email protected]>
Cc: [email protected]; [email protected]; Nipun Gupta <[email protected]>
Subject: [PATCH v5 1/9] bbdev: add big endian processing data capability
Quoted 2 lines
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.
Quoted 80 lines
Signed-off-by Hemant Agrawal <[email protected]>Signed-off-by Nipun Gupta <[email protected]>--- 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(-)doc/guides/bbdevs/features/default.ini +1
-0@@ -14,3 +14,4 @@ LLR/HARQ Compression = External DDR Access = HW Accelerated = BBDEV API = +Big Endian Processing =(quoted diff) +0
-0
b/doc/guides/prog_guide/bbdev.rstindex9619280ffc..6540b514bb100644doc/guides/prog_guide/bbdev.rst +3
-1@@ -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, withthe operation flags forming a bitmask in the ``op_flags`` field.
doc/guides/prog_guide/bbdev.rst +3
-0@@ -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, withthe operation flags forming a bitmask in the ``op_flags`` field.
lib/bbdev/rte_bbdev_op.h index renamed from lib/bbdev/rte_bbdev_op.h +0
-0
f946842727..9e9b5be81f100644lib/bbdev/rte_bbdev_op.h +6
-1@@ -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 @@ enumrte_bbdev_op_ldpcenc_flag_bitmasks{lib/bbdev/rte_bbdev_op.h +0
-0/** 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 */
lib/bbdev/rte_bbdev_op.h +6
-2-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
Re: [dpdk-dev] [PATCH v5 1/9] bbdev: add big endian processing data capability
Quoted 26 lines
-----Original Message-----
From: Chautru, Nicolas <[email protected]>
Sent: Tuesday, September 14, 2021 12:10 AM
To: Nipun Gupta <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Hemant Agrawal <[email protected]>; Tom Rix <[email protected]>
Subject: RE: [PATCH v5 1/9] bbdev: add big endian processing data capabilityQuoted 11 lines
-----Original Message-----
From: Nipun Gupta <[email protected]>
Sent: Sunday, September 12, 2021 5:15 AM
To: [email protected]; [email protected]; Chautru, Nicolas <[email protected]>
Cc: [email protected]; [email protected]; Nipun Gupta <[email protected]>
Subject: [PATCH v5 1/9] bbdev: add big endian processing data capabilityThis patch intoduces a new capability of the bbdev device to process the LDPC data in big endian order.
Hi Gupta,
Quoted 9 lines
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 "structrte_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.
Quoted 82 lines
Quoted 82 lines
Signed-off-by Hemant Agrawal <[email protected]>Signed-off-by Nipun Gupta <[email protected]>--- 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(-)doc/guides/bbdevs/features/default.ini +1
-0@@ -14,3 +14,4 @@ LLR/HARQ Compression = External DDR Access = HW Accelerated = BBDEV API = +Big Endian Processing =(quoted diff) +0
-0
b/doc/guides/prog_guide/bbdev.rstindex9619280ffc..6540b514bb100644doc/guides/prog_guide/bbdev.rst +3
-1@@ -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, withthe operation flags forming a bitmask in the ``op_flags`` field.
doc/guides/prog_guide/bbdev.rst +3
-0@@ -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, withthe operation flags forming a bitmask in the ``op_flags`` field.
lib/bbdev/rte_bbdev_op.h index renamed from lib/bbdev/rte_bbdev_op.h +0
-0
f946842727..9e9b5be81f100644lib/bbdev/rte_bbdev_op.h +6
-1@@ -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 @@ enumrte_bbdev_op_ldpcenc_flag_bitmasks{lib/bbdev/rte_bbdev_op.h +0
-0/** 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 */
lib/bbdev/rte_bbdev_op.h +6
-2-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
Re: [dpdk-dev] [PATCH v5 1/9] bbdev: add big endian processing data capability
Quoted 51 lines
-----Original Message-----
From: Nipun Gupta <[email protected]>
Sent: Friday, September 17, 2021 1:30 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Hemant Agrawal <[email protected]>; Tom Rix <[email protected]>
Subject: RE: [PATCH v5 1/9] bbdev: add big endian processing data capabilityQuoted 18 lines
-----Original Message-----
From: Chautru, Nicolas <[email protected]>
Sent: Tuesday, September 14, 2021 12:10 AM
To: Nipun Gupta <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Hemant Agrawal <[email protected]>; Tom Rix <[email protected]>
Subject: RE: [PATCH v5 1/9] bbdev: add big endian processing data capabilityQuoted 6 lines
-----Original Message-----
From: Nipun Gupta <[email protected]>
Sent: Sunday, September 12, 2021 5:15 AM
To: [email protected]; [email protected]; Chautru, Nicolas <[email protected]>
Cc: [email protected]; [email protected]; NipunGupta
Quoted 9 lines
Quoted 6 lines
<[email protected]>
Subject: [PATCH v5 1/9] bbdev: add big endian processing data capabilityThis patch intoduces a new capability of the bbdev device to process the LDPC data in big endian order.
Hi Gupta,
Quoted 9 lines
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 "structrte_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.
Quoted 3 lines
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.
Yes the fact that the capability is exposed out means that this is the responsibility of the application to provide input data in that format (ie. similar as for llr numerical representation). The endianness switch can be done in bbdev-test so that all existing vectors can be run seamlessly even on your PMD (ie. different endianness than the default one so far).
Quoted 89 lines
Quoted 36 lines
Quoted 36 lines
Signed-off-by Hemant Agrawal <[email protected]>Signed-off-by Nipun Gupta <[email protected]>--- 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(-)doc/guides/bbdevs/features/default.ini +1
-0@@ -14,3 +14,4 @@ LLR/HARQ Compression = External DDR Access = HW Accelerated = BBDEV API = +Big Endian Processing =(quoted diff) +0
-0
b/doc/guides/prog_guide/bbdev.rstindex9619280ffc..6540b514bb100644doc/guides/prog_guide/bbdev.rst +0
-0@@ -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 |++--------------------------------------------------------------------+
Quoted 4 lines
doc/guides/prog_guide/bbdev.rst given below. · line 945
Quoted 4 lines
The structure passed for each LDPC encode operation is given below,
with the operation flags forming a bitmask in the ``op_flags`` field.doc/guides/prog_guide/bbdev.rst +0
-0@@ -942,6 +945,9 @@ given below. |RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK|
Quoted 48 lines
Quoted 48 lines
doc/guides/prog_guide/bbdev.rst +4
-1| 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.
lib/bbdev/rte_bbdev_op.h +6
-1@@ -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 @@ enumrte_bbdev_op_ldpcenc_flag_bitmasks{lib/bbdev/rte_bbdev_op.h +0
-0/** 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 */
lib/bbdev/rte_bbdev_op.h +6
-2-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
PATCH v5 2/9 baseband: introduce NXP LA12xx driver
In reply to Nipun GuptaFrom: Hemant Agrawal <[email protected]>
This patch introduce the baseband device drivers for NXP's LA1200 series software defined baseband modem.
--- 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
MAINTAINERS +9 -0
@@ -1288,6 +1288,15 @@ F: drivers/event/opdl/ F: doc/guides/eventdevs/opdl.rst +Baseband Drivers +---------------- + +NXP LA12xx driver +M: Hemant Agrawal <[email protected]> +M: Nipun Gupta <[email protected]> +F: drivers/baseband/la12xx/ + + Rawdev Drivers --------------
drivers/baseband/la12xx/bbdev_la12xx.c new file +109 -0
109 lines not on this page · raw message
drivers/baseband/la12xx/bbdev_la12xx_pmd_logs.h new file +26 -0
@@ -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, ## args) + +#endif /* _BBDEV_LA12XX_PMD_LOGS_H_ */
drivers/baseband/la12xx/meson.build new file +6 -0
@@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2020-2021 NXP + +deps += ['bbdev', 'bus_vdev', 'ring'] + +sources = files('bbdev_la12xx.c')
drivers/baseband/la12xx/version.map new file +3 -0
@@ -0,0 +1,3 @@ +DPDK_21 { + local: *; +};
drivers/baseband/meson.build +1 -0
@@ -11,6 +11,7 @@ drivers = [ 'fpga_lte_fec', 'null', 'turbo_sw', + 'la12xx', ] log_prefix = 'pmd.bb'
Signature · 1 line
2.17.1
PATCH v5 3/9 baseband/la12xx: add devargs for max queues
In reply to Nipun GuptaFrom: Hemant Agrawal <[email protected]>
This patch adds dev args to take max queues as input
--- drivers/baseband/la12xx/bbdev_la12xx.c | 72 +++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 2 deletions(-)
drivers/baseband/la12xx/bbdev_la12xx.c +70 -2
@@ -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 "=<int>" );
Signature · 1 line
2.17.1
PATCH v5 4/9 baseband/la12xx: add support for multiple modems
In reply to Nipun GuptaFrom: Hemant Agrawal <[email protected]>
This patch add support for multiple modems by assigning a modem id as dev args in vdev creation.
--- 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
drivers/baseband/la12xx/bbdev_la12xx.c +57 -7
@@ -14,6 +14,8 @@#include <rte_bbdev_pmd.h> #include <bbdev_la12xx_pmd_logs.h> +#include <bbdev_la12xx_ipc.h> +#include <bbdev_la12xx.h> #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 4static 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 "=<int>" ); +LA12XX_MAX_NB_QUEUES_ARG "=<int>" +LA12XX_VDEV_MODEM_ID_ARG "=<int> " );
drivers/baseband/la12xx/bbdev_la12xx.h new file +56 -0
56 lines not on this page · raw message
drivers/baseband/la12xx/bbdev_la12xx_ipc.h new file +20 -0
@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2020-2021 NXP +*/ +#ifndef __BBDEV_LA12XX_IPC_H__ +#define __BBDEV_LA12XX_IPC_H__ + +/** No. of max channel per instance */ +#define IPC_MAX_DEPTH (16) + +/* This shared memory would be on the host side which have copy of some +* of the parameters which are also part of Shared BD ring. Read access +* of these parameters from the host side would not be over PCI. +*/ +typedef struct host_ipc_params { +volatile uint32_t pi; +volatile uint32_t ci; +volatile uint32_t modem_ptr[IPC_MAX_DEPTH ]; +} __rte_packed host_ipc_params_t; + +#endif
Signature · 1 line
2.17.1