bbdev: add device info on queue topology
PATCH v6 1/7 bbdev: allow operation type enum for growth
In reply to Nicolas ChautruUpdating the enum for rte_bbdev_op_type
to allow to keep ABI compatible for enum insertion while adding padded maximum value for array need. Removing RTE_BBDEV_OP_TYPE_COUNT and instead exposing RTE_BBDEV_OP_TYPE_PADDED_MAX.
--- app/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 4 ++-- examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 8 +++++--- lib/bbdev/rte_bbdev_op.h | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-)
app/test-bbdev/test_bbdev.c +1 -1
@@ -521,7 +521,7 @@ struct bbdev_testsuite_params {rte_mempool_free (mp);TEST_ASSERT ((mp =rte_bbdev_op_pool_create ("Test_INV" , -RTE_BBDEV_OP_TYPE_COUNT , size, cache_size,0 )) ==NULL , +RTE_BBDEV_OP_TYPE_PADDED_MAX , size, cache_size,0 )) ==NULL ,"Failed test for rte_bbdev_op_pool_create: " "returned value is not NULL for invalid type" );
app/test-bbdev/test_bbdev_perf.c +2 -2
@@ -2428,13 +2428,13 @@ typedef int (test_case_function)(struct active_device *ad,/* Find capabilities */ const struct rte_bbdev_op_cap *cap = info.drv.capabilities; -for (i =0 ; i <RTE_BBDEV_OP_TYPE_COUNT ; i++) { +do {if (cap->type == test_vector.op_type) { capabilities = cap;break ; } cap++; - } + }while (cap->type !=RTE_BBDEV_OP_NONE );TEST_ASSERT_NOT_NULL (capabilities,"Couldn't find capabilities" );
examples/bbdev_app/main.c +1 -1
@@ -1041,7 +1041,7 @@ uint16_t bbdev_parse_number(const char *mask)void *sigret;struct app_config_params app_params = def_app_config;struct rte_mempool *ethdev_mbuf_mempool, *bbdev_mbuf_mempool; -struct rte_mempool *bbdev_op_pools[RTE_BBDEV_OP_TYPE_COUNT ]; +struct rte_mempool *bbdev_op_pools[RTE_BBDEV_OP_TYPE_PADDED_MAX ];struct lcore_conf lcore_conf[RTE_MAX_LCORE ] = { {0 } };struct lcore_statistics lcore_stats[RTE_MAX_LCORE ] = { {0 } };struct stats_lcore_params stats_lcore;
lib/bbdev/rte_bbdev.c +5 -3
@@ -23,6 +23,8 @@#define DEV_NAME "BBDEV" +/* Number of supported operation types */ +#define BBDEV_OP_TYPE_COUNT 5/* BBDev library logging ID */ RTE_LOG_REGISTER_DEFAULT (bbdev_logtype,NOTICE );
@@ -890,10 +892,10 @@ struct rte_mempool *return NULL ; } -if (type >=RTE_BBDEV_OP_TYPE_COUNT ) { +if (type >=BBDEV_OP_TYPE_COUNT ) {rte_bbdev_log (ERR ,"Invalid op type (%u), should be less than %u" , - type,RTE_BBDEV_OP_TYPE_COUNT ); + type,BBDEV_OP_TYPE_COUNT );return NULL ; }
@@ -1125,7 +1127,7 @@ struct rte_mempool * "RTE_BBDEV_OP_LDPC_ENC", }; -if (op_type <RTE_BBDEV_OP_TYPE_COUNT ) +if (op_type <BBDEV_OP_TYPE_COUNT )return op_types[op_type];rte_bbdev_log (ERR ,"Invalid operation type" );
lib/bbdev/rte_bbdev_op.h +1 -1
@@ -748,7 +748,7 @@ enum rte_bbdev_op_type {RTE_BBDEV_OP_TURBO_ENC ,/**< Turbo encode */ RTE_BBDEV_OP_LDPC_DEC ,/**< LDPC decode */ RTE_BBDEV_OP_LDPC_ENC ,/**< LDPC encode */ - RTE_BBDEV_OP_TYPE_COUNT, /**< Count of different op types */ + RTE_BBDEV_OP_TYPE_PADDED_MAX = 8, /**< Maximum op type number including padding */ };/** Bit indexes of possible errors reported through status field */
Signature · 1 line
1.8.3.1
PATCH v6 2/7 bbdev: add device status info
In reply to Nicolas ChautruAdded device status information, so that the PMD can
expose information related to the underlying accelerator device status. Minor order change in structure to fit into padding hole.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 1 + drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 1 + drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 1 + drivers/baseband/la12xx/bbdev_la12xx.c | 1 + drivers/baseband/null/bbdev_null.c | 1 + drivers/baseband/turbo_sw/bbdev_turbo_software.c | 1 + lib/bbdev/rte_bbdev.c | 22 ++++++++++++++ lib/bbdev/rte_bbdev.h | 35 ++++++++++++++++++++-- lib/bbdev/version.map | 7 +++++ 9 files changed, 68 insertions(+), 2 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +1 -0
@@ -1060,6 +1060,7 @@/* Read and save the populated config from ACC100 registers */ fetch_acc100_config (dev); + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* This isn't ideal because it reports the maximum number of queues but * does not provide info on how many can be uplink/downlink or different
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +1 -0
@@ -369,6 +369,7 @@ dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* Calculates number of queues assigned to device */ dev_info->max_num_queues =0 ;
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +1 -0
@@ -645,6 +645,7 @@ struct __rte_cache_aligned fpga_queue { dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* Calculates number of queues assigned to device */ dev_info->max_num_queues =0 ;
drivers/baseband/la12xx/bbdev_la12xx.c +1 -0
@@ -100,6 +100,7 @@ struct bbdev_la12xx_params { dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->min_alignment =64 ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/null/bbdev_null.c +1 -0
@@ -82,6 +82,7 @@ struct bbdev_queue {* here for code completeness. */ dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/turbo_sw/bbdev_turbo_software.c +1 -0
@@ -254,6 +254,7 @@ struct turbo_sw_queue { dev_info->min_alignment =64 ; dev_info->harq_buffer_size =0 ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u\n" , dev->data->dev_id); }
lib/bbdev/rte_bbdev.c +22 -0
@@ -1133,3 +1133,25 @@ struct rte_mempool *rte_bbdev_log (ERR ,"Invalid operation type" );return NULL ; } + +const char * +rte_bbdev_device_status_str (enum rte_bbdev_device_status status) +{ +static const char *const dev_sta_string[] = { +"RTE_BBDEV_DEV_NOSTATUS" , +"RTE_BBDEV_DEV_NOT_SUPPORTED" , +"RTE_BBDEV_DEV_RESET" , +"RTE_BBDEV_DEV_CONFIGURED" , +"RTE_BBDEV_DEV_ACTIVE" , +"RTE_BBDEV_DEV_FATAL_ERR" , +"RTE_BBDEV_DEV_RESTART_REQ" , +"RTE_BBDEV_DEV_RECONFIG_REQ" , +"RTE_BBDEV_DEV_CORRECT_ERR" , + }; + +if (status <sizeof (dev_sta_string) /sizeof (char *)) +return dev_sta_string[status]; + +rte_bbdev_log (ERR ,"Invalid device status" ); +return NULL ; +}
lib/bbdev/rte_bbdev.h +33 -2
@@ -223,6 +223,21 @@ struct rte_bbdev_queue_conf {int rte_bbdev_queue_stop (uint16_t dev_id,uint16_t queue_id); +/** +* Flags indicate the status of the device +*/ +enum rte_bbdev_device_status { +RTE_BBDEV_DEV_NOSTATUS ,/**< Nothing being reported */ +RTE_BBDEV_DEV_NOT_SUPPORTED ,/**< Device status is not supported on the PMD */ +RTE_BBDEV_DEV_RESET ,/**< Device in reset and un-configured state */ +RTE_BBDEV_DEV_CONFIGURED ,/**< Device is configured and ready to use */ +RTE_BBDEV_DEV_ACTIVE ,/**< Device is configured and VF is being used */ +RTE_BBDEV_DEV_FATAL_ERR ,/**< Device has hit a fatal uncorrectable error */ +RTE_BBDEV_DEV_RESTART_REQ ,/**< Device requires application to restart */ +RTE_BBDEV_DEV_RECONFIG_REQ ,/**< Device requires application to reconfigure queues */ +RTE_BBDEV_DEV_CORRECT_ERR ,/**< Warning of a correctable error event happened */ +}; +/** Device statistics. */ struct rte_bbdev_stats {uint64_t enqueued_count;/**< Count of all operations enqueued */
@@ -285,12 +300,14 @@ struct rte_bbdev_driver_info {/** Set if device supports per-queue interrupts */ bool queue_intr_supported;/** Minimum alignment of buffers, in bytes */ -uint16_t min_alignment; -/** HARQ memory available in kB */ +/** Device Status */ +enum rte_bbdev_device_status device_status;uint32_t harq_buffer_size;/** Byte endianness (RTE_BIG_ENDIAN/RTE_LITTLE_ENDIAN) supported * for input/output data */ +uint16_t min_alignment; +/** HARQ memory available in kB */ uint8_t data_endianness;/** Default queue configuration used if none is supplied */ struct rte_bbdev_queue_conf default_queue_conf;
@@ -827,6 +844,20 @@ typedef void (*rte_bbdev_cb_fn)(uint16_t dev_id, rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op, void *data); +/** +* Converts device status from enum to string +* +* @param status +* Device status as enum +* +* @returns +* Operation type as string or NULL if op_type is invalid +* +*/ +__rte_experimental +const char* +rte_bbdev_device_status_str (enum rte_bbdev_device_status status); + #ifdef __cplusplus }#endif
lib/bbdev/version.map +7 -0
@@ -39,3 +39,10 @@ DPDK_22 { local: *; }; + +EXPERIMENTAL { + global: + + # added in 22.11 + rte_bbdev_device_status_str; +};
Signature · 1 line
1.8.3.1
PATCH v6 3/7 bbdev: add device info on queue topology
In reply to Nicolas ChautruAdding more options in the API to expose the number of queues exposed and related priority.
--- lib/bbdev/rte_bbdev.h | 4 ++++ 1 file changed, 4 insertions(+)
lib/bbdev/rte_bbdev.h +4 -0
@@ -289,6 +289,10 @@ struct rte_bbdev_driver_info {/** Maximum number of queues supported by the device */ unsigned int max_num_queues; +/** Maximum number of queues supported per operation type */ +unsigned int num_queues[RTE_BBDEV_OP_TYPE_PADDED_MAX ]; +/** Priority level supported per operation type */ +unsigned int queue_priority[RTE_BBDEV_OP_TYPE_PADDED_MAX ];/** Queue size limit (queue size must also be power of 2) */ uint32_t queue_size_lim;/** Set if device off-loads operation to hardware */
Signature · 1 line
1.8.3.1
PATCH v6 4/7 drivers/baseband: update PMDs to expose queue per operation
In reply to Nicolas ChautruAdd support in existing bbdev PMDs for the explicit number of queue and priority for each operation type configured on the device.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 29 +++++++++++++--------- drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 8 ++++++ drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 8 ++++++ drivers/baseband/la12xx/bbdev_la12xx.c | 7 ++++++ drivers/baseband/turbo_sw/bbdev_turbo_software.c | 11 ++++++++ 5 files changed, 51 insertions(+), 12 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +17 -12
@@ -966,6 +966,7 @@ struct rte_bbdev_driver_info *dev_info) {struct acc100_device *d = dev->data->dev_private; +int i;static const struct rte_bbdev_op_cap bbdev_capabilities[] = { {
@@ -1062,19 +1063,23 @@fetch_acc100_config (dev); dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; -/* This isn't ideal because it reports the maximum number of queues but -* does not provide info on how many can be uplink/downlink or different -* priorities -*/ - dev_info->max_num_queues = - d->acc100_conf.q_dl_5g.num_aqs_per_groups * - d->acc100_conf.q_dl_5g.num_qgroups + - d->acc100_conf.q_ul_5g.num_aqs_per_groups * - d->acc100_conf.q_ul_5g.num_qgroups + - d->acc100_conf.q_dl_4g.num_aqs_per_groups * - d->acc100_conf.q_dl_4g.num_qgroups + - d->acc100_conf.q_ul_4g.num_aqs_per_groups * +/* Expose number of queues */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] = d->acc100_conf.q_ul_4g.num_aqs_per_groups * d->acc100_conf.q_ul_4g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] = d->acc100_conf.q_dl_4g.num_aqs_per_groups * + d->acc100_conf.q_dl_4g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] = d->acc100_conf.q_ul_5g.num_aqs_per_groups * + d->acc100_conf.q_ul_5g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] = d->acc100_conf.q_dl_5g.num_aqs_per_groups * + d->acc100_conf.q_dl_5g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_DEC ] = d->acc100_conf.q_ul_4g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_ENC ] = d->acc100_conf.q_dl_4g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] = d->acc100_conf.q_ul_5g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] = d->acc100_conf.q_dl_5g.num_qgroups; + dev_info->max_num_queues =0 ; +for (i =RTE_BBDEV_OP_TURBO_DEC ; i <=RTE_BBDEV_OP_LDPC_ENC ; i++) + dev_info->max_num_queues += dev_info->num_queues[i]; dev_info->queue_size_lim =ACC100_MAX_QUEUE_DEPTH ; dev_info->hardware_accelerated = true; dev_info->max_dl_queue_priority =
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +8 -0
@@ -379,6 +379,14 @@if (hw_q_id !=FPGA_INVALID_HW_QUEUE_ID ) dev_info->max_num_queues++; } +/* Expose number of queue per operation type */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] = dev_info->max_num_queues /2 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] =1 ; }/**
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +8 -0
@@ -655,6 +655,14 @@ struct __rte_cache_aligned fpga_queue {if (hw_q_id !=FPGA_INVALID_HW_QUEUE_ID ) dev_info->max_num_queues++; } +/* Expose number of queue per operation type */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] =0 ; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_ENC ] =1 ; }/**
drivers/baseband/la12xx/bbdev_la12xx.c +7 -0
@@ -102,6 +102,13 @@ struct bbdev_la12xx_params { dev_info->min_alignment =64 ; dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] =LA12XX_MAX_QUEUES /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] =LA12XX_MAX_QUEUES /2 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] =1 ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/turbo_sw/bbdev_turbo_software.c +11 -0
@@ -256,6 +256,17 @@ struct turbo_sw_queue { dev_info->data_endianness =RTE_LITTLE_ENDIAN ; dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; +const struct rte_bbdev_op_cap *op_cap = bbdev_capabilities; +int num_op_type =0 ; +for (; op_cap->type !=RTE_BBDEV_OP_NONE ; ++op_cap) + num_op_type++; + op_cap = bbdev_capabilities; +if (num_op_type >0 ) { +int num_queue_per_type = dev_info->max_num_queues / num_op_type; +for (; op_cap->type !=RTE_BBDEV_OP_NONE ; ++op_cap) + dev_info->num_queues[op_cap->type] = num_queue_per_type; + } +rte_bbdev_log_debug ("got device info from %u\n" , dev->data->dev_id); }
Signature · 1 line
1.8.3.1
Re: [PATCH v6 4/7] drivers/baseband: update PMDs to expose queue per operation
Quoted 1 line · Nicolas Chautru
Add support in existing bbdev PMDs for the explicit number of queue
queues
Quoted 11 lines
and priority for each operation type configured on the device.
Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc100/rte_acc100_pmd.c | 29 +++++++++++++--------- drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 8 ++++++ drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 8 ++++++ drivers/baseband/la12xx/bbdev_la12xx.c | 7 ++++++ drivers/baseband/turbo_sw/bbdev_turbo_software.c | 11 ++++++++ 5 files changed, 51 insertions(+), 12 deletions(-)
Thanks,
Maxime
PATCH v6 5/7 bbdev: add new operation for FFT processing
In reply to Nicolas ChautruExtension of bbdev operation to support FFT based operations.
--- doc/guides/prog_guide/bbdev.rst | 130 +++++++++++++++++++++++++++++++++++ lib/bbdev/rte_bbdev.c | 10 ++- lib/bbdev/rte_bbdev.h | 76 ++++++++++++++++++++ lib/bbdev/rte_bbdev_op.h | 149 ++++++++++++++++++++++++++++++++++++++++ lib/bbdev/version.map | 4 ++ 5 files changed, 368 insertions(+), 1 deletion(-)
doc/guides/prog_guide/bbdev.rst +130 -0
@@ -1118,6 +1118,136 @@ Figure :numref:`figure_turbo_tb_decode` above showing the Turbo decoding of CBs using BBDEV interface in TB-mode is also valid for LDPC decode. +BBDEV FFT Operation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This operation allows to run a combination of DFT and/or IDFT and/or time-domain windowing. +These can be used in a modular fashion (using bypass modes) or as a processing pipeline +which can be used for FFT-based baseband signal processing. +In more details it allows : +- to process the data first through an IDFT of adjustable size and padding; +- to perform the windowing as a programmable cyclic shift offset of the data followed by a +pointwise multiplication by a time domain window; +- to process the related data through a DFT of adjustable size and depadding for each such cyclic +shift output. + +A flexible number of Rx antennas are being processed in parallel with the same configuration. +The API allows more generally for flexibility in what the PMD may support (cabability flags) and +flexibility to adjust some of the parameters of the processing. + +The operation/capability flags that can be set for each FFT operation are given below. + + **NOTE:** The actual operation flags that may be used with a specific + BBDEV PMD are dependent on the driver capabilities as reported via + ``rte_bbdev_info_get()``, and may be a subset of those below. + ++--------------------------------------------------------------------+ +|Description of FFT capability flags | ++====================================================================+ +|RTE_BBDEV_FFT_WINDOWING | +| Set to enable/support windowing in time domain | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_CS_ADJUSTMENT | +| Set to enable/support the cyclic shift time offset adjustment | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_DFT_BYPASS | +| Set to bypass the DFT and use directly the IDFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_IDFT_BYPASS | +| Set to bypass the IDFT and use directly the DFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_WINDOWING_BYPASS | +| Set to bypass the time domain windowing as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_POWER_MEAS | +| Set to provide an optional power measurement of the DFT output | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_INPUT | +| Set if the input data shall use FP16 format instead of INT16 | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_OUTPUT | +| Set if the output data shall use FP16 format instead of INT16 | ++--------------------------------------------------------------------+ + +The structure passed for each FFT operation is given below, +with the operation flags forming a bitmask in the ``op_flags`` field. + +.. code-block:: c + + struct rte_bbdev_op_fft { + struct rte_bbdev_op_data base_input; + struct rte_bbdev_op_data base_output; + struct rte_bbdev_op_data power_meas_output; + uint32_t op_flags; + uint16_t input_sequence_size; + uint16_t input_leading_padding; + uint16_t output_sequence_size; + uint16_t output_leading_depadding; + uint8_t window_index[RTE_BBDEV_MAX_CS_2]; + uint16_t cs_bitmap; + uint8_t num_antennas_log2; + uint8_t idft_log2; + uint8_t dft_log2; + int8_t cs_time_adjustment; + int8_t idft_shift; + int8_t dft_shift; + uint16_t ncs_reciprocal; + uint16_t power_shift; + uint16_t fp16_exp_adjust; + }; + +The FFT parameters are set out in the table below. + ++-------------------------+--------------------------------------------------------------+ +|Parameter |Description | ++=========================+==============================================================+ +|base_input |input data | ++-------------------------+--------------------------------------------------------------+ +|base_output |output data | ++-------------------------+--------------------------------------------------------------+ +|power_meas_output |optional output data with power measurement on DFT output | ++-------------------------+--------------------------------------------------------------+ +|op_flags |bitmask of all active operation capabilities | ++-------------------------+--------------------------------------------------------------+ +|input_sequence_size |size of the input sequence in 32-bits points per antenna | ++-------------------------+--------------------------------------------------------------+ +|input_leading_padding |number of points padded at the start of input data | ++-------------------------+--------------------------------------------------------------+ +|output_sequence_size |size of the output sequence per antenna and cyclic shift | ++-------------------------+--------------------------------------------------------------+ +|output_leading_depadding |number of points depadded at the start of output data | ++-------------------------+--------------------------------------------------------------+ +|window_index |optional windowing profile index used for each cyclic shift | ++-------------------------+--------------------------------------------------------------+ +|cs_bitmap |bitmap of the cyclic shift output requested (LSB for index 0) | ++-------------------------+--------------------------------------------------------------+ +|num_antennas_log2 |number of antennas as a log2 (10 maps to 1024...) | ++-------------------------+--------------------------------------------------------------+ +|idft_log2 |iDFT size as a log2 | ++-------------------------+--------------------------------------------------------------+ +|dft_log2 |DFT size as a log2 | ++-------------------------+--------------------------------------------------------------+ +|cs_time_adjustment |adjustment of time position of all the cyclic shift output | ++-------------------------+--------------------------------------------------------------+ +|idft_shift |shift down of signal level post iDFT | ++-------------------------+--------------------------------------------------------------+ +|dft_shift |shift down of signal level post DFT | ++-------------------------+--------------------------------------------------------------+ +|ncs_reciprocal |inverse of max number of CS normalized to 15b (ie. 231 for 12)| ++-------------------------+--------------------------------------------------------------+ +|power_shift |shift down of level of power measurement when enabled | ++-------------------------+--------------------------------------------------------------+ +|fp16_exp_adjust |value added to FP16 exponent at conversion from INT16 | ++-------------------------+--------------------------------------------------------------+ + +The mbuf input ``base_input`` is mandatory for all BBDEV PMDs and is the +incoming data for the processing. Its size may not fit into an actual mbuf, but the +structure is used to pass iova address. +The mbuf output ``output`` is mandatory and is output of the FFT processing chain. +Each point is a complex number of 32bits : either as 2 INT16 or as 2 FP16 based when the option +supported. +The data layout is based on contiguous concatenation of output data first by cyclic shift then +by antenna. Sample code -----------
lib/bbdev/rte_bbdev.c +9 -1
@@ -24,7 +24,7 @@#define DEV_NAME "BBDEV"/* Number of supported operation types */ -#define BBDEV_OP_TYPE_COUNT 5 +#define BBDEV_OP_TYPE_COUNT 6/* BBDev library logging ID */ RTE_LOG_REGISTER_DEFAULT (bbdev_logtype,NOTICE );
@@ -852,6 +852,9 @@ struct rte_bbdev *case RTE_BBDEV_OP_LDPC_ENC : result =sizeof (struct rte_bbdev_enc_op );break ; +case RTE_BBDEV_OP_FFT : + result =sizeof (struct rte_bbdev_fft_op ); +break ;default :break ; }
@@ -875,6 +878,10 @@ struct rte_bbdev *struct rte_bbdev_enc_op *op = element;memset (op,0 , mempool->elt_size); op->mempool = mempool; + }else if (type ==RTE_BBDEV_OP_FFT ) { +struct rte_bbdev_fft_op *op = element; +memset (op,0 , mempool->elt_size); + op->mempool = mempool; } }
@@ -1125,6 +1132,7 @@ struct rte_mempool *"RTE_BBDEV_OP_TURBO_ENC" ,"RTE_BBDEV_OP_LDPC_DEC" ,"RTE_BBDEV_OP_LDPC_ENC" , + "RTE_BBDEV_OP_FFT", };if (op_type <BBDEV_OP_TYPE_COUNT )
lib/bbdev/rte_bbdev.h +76 -0
106 lines not on this page · raw message
lib/bbdev/rte_bbdev_op.h +149 -0
203 lines not on this page · raw message
lib/bbdev/version.map +4 -0
@@ -45,4 +45,8 @@ EXPERIMENTAL { # added in 22.11 rte_bbdev_device_status_str; + rte_bbdev_enqueue_fft_ops; + rte_bbdev_dequeue_fft_ops; + rte_bbdev_fft_op_alloc_bulk; + rte_bbdev_fft_op_free_bulk; };
Signature · 1 line
1.8.3.1
Re: [PATCH v6 5/7] bbdev: add new operation for FFT processing
Quoted 21 lines · Nicolas Chautru
Extension of bbdev operation to support FFT based operations.
Signed-off-by Nicolas Chautru <[email protected]>Acked-by Hemant Agrawal <[email protected]>--- doc/guides/prog_guide/bbdev.rst | 130 +++++++++++++++++++++++++++++++++++ lib/bbdev/rte_bbdev.c | 10 ++- lib/bbdev/rte_bbdev.h | 76 ++++++++++++++++++++ lib/bbdev/rte_bbdev_op.h | 149 ++++++++++++++++++++++++++++++++++++++++ lib/bbdev/version.map | 4 ++ 5 files changed, 368 insertions(+), 1 deletion(-)doc/guides/prog_guide/bbdev.rst +1
-0@@ -1118,6 +1118,136 @@ Figure :numref:`figure_turbo_tb_decode` above showing the Turbo decoding of CBs using BBDEV interface in TB-mode is also valid for LDPC decode. +BBDEV FFT Operation
doc/guides/prog_guide/bbdev.rst Figure :numref:`figure_turbo_tb_decode` above · line 1131
Quoted 10 lines
doc/guides/prog_guide/bbdev.rst +10
-0+~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This operation allows to run a combination of DFT and/or IDFT and/or time-domain windowing. +These can be used in a modular fashion (using bypass modes) or as a processing pipeline +which can be used for FFT-based baseband signal processing. +In more details it allows : +- to process the data first through an IDFT of adjustable size and padding; +- to perform the windowing as a programmable cyclic shift offset of the data followed by a +pointwise multiplication by a time domain window; +- to process the related data through a DFT of adjustable size and depadding for each such cyclic
depadding?
doc/guides/prog_guide/bbdev.rst Figure :numref:`figure_turbo_tb_decode` above · line 1135
Quoted 4 lines
doc/guides/prog_guide/bbdev.rst +4
-0+shift output. + +A flexible number of Rx antennas are being processed in parallel with the same configuration. +The API allows more generally for flexibility in what the PMD may support (cabability flags) and
s/cabability/capability/
With above typos fixed:
Thanks,
Maxime
RE: [PATCH v6 5/7] bbdev: add new operation for FFT processing
Hi Maxime,
Quoted 43 lines
-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: Friday, August 26, 2022 5:08 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; Richardson, Bruce <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH v6 5/7] bbdev: add new operation for FFT processingQuoted 6 lines · Nicolas Chautru
Extension of bbdev operation to support FFT based operations.
Signed-off-by Nicolas Chautru <[email protected]>Acked-by Hemant Agrawal <[email protected]>--- doc/guides/prog_guide/bbdev.rst | 130+++++++++++++++++++++++++++++++++++
Quoted 3 lines
lib/bbdev/rte_bbdev.c | 10 ++- lib/bbdev/rte_bbdev.h | 76 ++++++++++++++++++++ lib/bbdev/rte_bbdev_op.h | 149++++++++++++++++++++++++++++++++++++++++
Quoted 8 lines
lib/bbdev/version.map | 4 ++ 5 files changed, 368 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/doc/guides/prog_guide/bbdev.rstindex 70fa01a..150161b 100644doc/guides/prog_guide/bbdev.rst Figure :numref:`figure_turbo_tb_decode` above · line 1124
Quoted 7 lines
doc/guides/prog_guide/bbdev.rst +4
-0@@ -1118,6 +1118,136 @@ Figure :numref:`figure_turbo_tb_decode` above showing the Turbo decoding of CBs using BBDEV interface in TB-mode is also valid for LDPC decode. +BBDEV FFT Operation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This operation allows to run a combination of DFT and/or IDFT and/or time-domain windowing.
doc/guides/prog_guide/bbdev.rst Figure :numref:`figure_turbo_tb_decode` above · line 1126
Quoted 2 lines
doc/guides/prog_guide/bbdev.rst +2
-0+These can be used in a modular fashion (using bypass modes) or as a +processing pipeline which can be used for FFT-based baseband signalprocessing.
Quoted 10 lines
doc/guides/prog_guide/bbdev.rst Figure :numref:`figure_turbo_tb_decode` above · line 1134
Quoted 8 lines
doc/guides/prog_guide/bbdev.rst +8
-0+In more details it allows : +- to process the data first through an IDFT of adjustable size and +padding; +- to perform the windowing as a programmable cyclic shift offset of +the data followed by a pointwise multiplication by a time domain +window; +- to process the related data through a DFT of adjustable size and +depadding for each such cyclicdepadding?
This is the opposite processing of padding bits to the buffer (take out such bits either leading or trailing). From googling around, this is more often written as "de-padding" so will correct.
Quoted 10 lines
doc/guides/prog_guide/bbdev.rst Figure :numref:`figure_turbo_tb_decode` above
Quoted 4 lines
doc/guides/prog_guide/bbdev.rst +3
-0+shift output. + +A flexible number of Rx antennas are being processed in parallel with thesame configuration.
doc/guides/prog_guide/bbdev.rst Figure :numref:`figure_turbo_tb_decode` above · line 1139
Quoted 2 lines
doc/guides/prog_guide/bbdev.rst +2
-0+The API allows more generally for flexibility in what the PMD may +support (cabability flags) ands/cabability/capability/
Thanks! I will fix now
Quoted 5 lines
With above typos fixed:
Acked-by Maxime Coquelin <[email protected]>Thanks,
Maxime
PATCH v6 6/7 bbdev: add queue related warning and status information
In reply to Nicolas ChautruThis allows to expose more information with regards to any queue related failure and warning which cannot be supported in existing API.
--- app/test-bbdev/test_bbdev_perf.c | 2 ++ lib/bbdev/rte_bbdev.c | 19 +++++++++++++++++++ lib/bbdev/rte_bbdev.h | 34 ++++++++++++++++++++++++++++++++++ lib/bbdev/version.map | 1 + 4 files changed, 56 insertions(+)
app/test-bbdev/test_bbdev_perf.c +2 -0
@@ -4360,6 +4360,8 @@ typedef int (test_case_function)(struct active_device *ad, stats->dequeued_count = q_stats->dequeued_count; stats->enqueue_err_count = q_stats->enqueue_err_count; stats->dequeue_err_count = q_stats->dequeue_err_count; + stats->enqueue_warning_count = q_stats->enqueue_warning_count; + stats->dequeue_warning_count = q_stats->dequeue_warning_count; stats->acc_offload_cycles = q_stats->acc_offload_cycles;return 0 ;
lib/bbdev/rte_bbdev.c +19 -0
@@ -721,6 +721,8 @@ struct rte_bbdev * stats->dequeued_count += q_stats->dequeued_count; stats->enqueue_err_count += q_stats->enqueue_err_count; stats->dequeue_err_count += q_stats->dequeue_err_count; + stats->enqueue_warn_count += q_stats->enqueue_warn_count; + stats->dequeue_warn_count += q_stats->dequeue_warn_count; }rte_bbdev_log_debug ("Got stats on %u" , dev->data->dev_id); }
@@ -1163,3 +1165,20 @@ struct rte_mempool *rte_bbdev_log (ERR ,"Invalid device status" );return NULL ; } + +const char * +rte_bbdev_enqueue_status_str (enum rte_bbdev_enqueue_status status) +{ +static const char *const enq_sta_string[] = { +"RTE_BBDEV_ENQ_STATUS_NONE" , +"RTE_BBDEV_ENQ_STATUS_QUEUE_FULL" , +"RTE_BBDEV_ENQ_STATUS_RING_FULL" , +"RTE_BBDEV_ENQ_STATUS_INVALID_OP" , + }; + +if (status <sizeof (enq_sta_string) /sizeof (char *)) +return enq_sta_string[status]; + +rte_bbdev_log (ERR ,"Invalid enqueue status" ); +return NULL ; +}
lib/bbdev/rte_bbdev.h +34 -0
@@ -224,6 +224,19 @@ struct rte_bbdev_queue_conf { rte_bbdev_queue_stop(uint16_t dev_id, uint16_t queue_id);/** +* Flags indicate the reason why a previous enqueue may not have +* consumed all requested operations +* In case of multiple reasons the latter superdes a previous one +*/ +enum rte_bbdev_enqueue_status { +RTE_BBDEV_ENQ_STATUS_NONE ,/**< Nothing to report */ +RTE_BBDEV_ENQ_STATUS_QUEUE_FULL ,/**< Not enough room in queue */ +RTE_BBDEV_ENQ_STATUS_RING_FULL ,/**< Not enough room in ring */ +RTE_BBDEV_ENQ_STATUS_INVALID_OP ,/**< Operation was rejected as invalid */ +RTE_BBDEV_ENQ_STATUS_PADDED_MAX =6 ,/**< Maximum enq status number including padding */ +}; + +/** * Flags indicate the status of the device */ enum rte_bbdev_device_status {
@@ -246,6 +259,12 @@ struct rte_bbdev_stats {uint64_t enqueue_err_count;/** Total error count on operations dequeued */ uint64_t dequeue_err_count; +/** Total warning count on operations enqueued */ +uint64_t enqueue_warn_count; +/** Total warning count on operations dequeued */ +uint64_t dequeue_warn_count; +/** Total enqueue status count based on rte_bbdev_enqueue_status enum */ +uint64_t enqueue_status_count[RTE_BBDEV_ENQ_STATUS_PADDED_MAX ];/** CPU cycles consumed by the (HW/SW) accelerator device to offload * the enqueue request to its internal queues. * - For a HW device this is the cycles consumed in MMIO write
@@ -386,6 +405,7 @@ struct rte_bbdev_queue_data {void *queue_private;/**< Driver-specific per-queue data */ struct rte_bbdev_queue_conf conf;/**< Current configuration */ struct rte_bbdev_stats queue_stats;/**< Queue statistics */ +enum rte_bbdev_enqueue_status enqueue_status;/**< Enqueue status when op is rejected */ bool started;/**< Queue state */ };
@@ -938,6 +958,20 @@ typedef void (*rte_bbdev_cb_fn)(uint16_t dev_id,const char *rte_bbdev_device_status_str (enum rte_bbdev_device_status status); +/** +* Converts queue status from enum to string +* +* @param status +* Queue status as enum +* +* @returns +* Queue status as string or NULL if op_type is invalid +* +*/ +__rte_experimental +const char* +rte_bbdev_enqueue_status_str (enum rte_bbdev_enqueue_status status); + #ifdef __cplusplus }#endif
lib/bbdev/version.map +1 -0
@@ -45,6 +45,7 @@ EXPERIMENTAL { # added in 22.11 rte_bbdev_device_status_str; + rte_bbdev_enqueue_status_str; rte_bbdev_enqueue_fft_ops; rte_bbdev_dequeue_fft_ops; rte_bbdev_fft_op_alloc_bulk;
Signature · 1 line
1.8.3.1
Re: [PATCH v6 6/7] bbdev: add queue related warning and status information
Quoted 4 lines · Nicolas Chautru
This allows to expose more information with regards to any queue related failure and warning which cannot be supported in existing API.
Quoted 8 lines
Signed-off-by Nicolas Chautru <[email protected]>--- app/test-bbdev/test_bbdev_perf.c | 2 ++ lib/bbdev/rte_bbdev.c | 19 +++++++++++++++++++ lib/bbdev/rte_bbdev.h | 34 ++++++++++++++++++++++++++++++++++ lib/bbdev/version.map | 1 + 4 files changed, 56 insertions(+)
Thanks,
Maxime
PATCH v6 7/7 bbdev: remove unnecessary if-check
In reply to Nicolas ChautruCode clean up due to if-check not required
--- lib/bbdev/rte_bbdev_op.h | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-)
lib/bbdev/rte_bbdev_op.h +4 -11
@@ -970,10 +970,8 @@ struct rte_mempool */* Get elements */ ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; -return 0 ; +return ret; }/**
@@ -1006,10 +1004,8 @@ struct rte_mempool */* Get elements */ ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; -return 0 ; +return ret; }/**
@@ -1035,17 +1031,14 @@ struct rte_mempool *int ret;/* Check type */ - priv = (struct rte_bbdev_op_pool_private *) -rte_mempool_get_priv (mempool); + priv = (struct rte_bbdev_op_pool_private *)rte_mempool_get_priv (mempool);if (unlikely (priv->type !=RTE_BBDEV_OP_FFT ))return -EINVAL ;/* Get elements */ ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; -return 0 ; +return ret; }/**
Signature · 1 line
1.8.3.1
Re: [PATCH v6 7/7] bbdev: remove unnecessary if-check
Quoted 45 lines · Nicolas Chautru
Code clean up due to if-check not required
Signed-off-by Nicolas Chautru <[email protected]>--- lib/bbdev/rte_bbdev_op.h | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-)lib/bbdev/rte_bbdev_op.h +3
-8@@ -970,10 +970,8 @@ struct rte_mempool */* Get elements */ ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; -return 0 ; +return ret; }/** @@ -1006,10 +1004,8 @@ struct rte_mempool */* Get elements */ ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; -return 0 ; +return ret; }/** @@ -1035,17 +1031,14 @@ struct rte_mempool *int ret;/* Check type */ - priv = (struct rte_bbdev_op_pool_private *) -rte_mempool_get_priv (mempool); + priv = (struct rte_bbdev_op_pool_private *)rte_mempool_get_priv (mempool);if (unlikely (priv->type !=RTE_BBDEV_OP_FFT ))return -EINVAL ;
lib/bbdev/rte_bbdev_op.h struct rte_mempool * · line 1044
Quoted 10 lines
lib/bbdev/rte_bbdev_op.h +1
-3/* Get elements */ ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; -return 0 ; +return ret; }/**
Thanks,
Maxime
v7 cover bbdev changes for 22.11
In reply to Nicolas Chautruv7: couple of typos in documentation spotted by Maxime. Thanks.
v6: added one comment in commit 2/7 suggested by Maxime.
v5: update base on review from Tom Rix. Number of typos reported and resolved,
removed the commit related to rw_lock for now, added a commit for
code clean up from review, resolved one rebase issue between 2 commits, used size of array for some bound check implementation. Thanks.
v4: update to the last 2 commits to include function to print the queue status and a fix to the rte_lock within the wrong structure
v3: update to device status info to also use padded size for the related array.
Adding also 2 additionals commits to allow the API struc to expose more information related to queues corner cases/warning as well as an optional rw lock. Hemant, Maxime, this is planned for DPDK 21.11 but would like review/ack early is possible to get this applied earlier and due to time off this summer. Thanks
Nic
Nicolas Chautru (7):
bbdev: allow operation type enum for growth
bbdev: add device status info
bbdev: add device info on queue topology drivers/baseband: update PMDs to expose queue per operation
bbdev: add new operation for FFT processing
bbdev: add queue related warning and status information
bbdev: remove unnecessary if-check
app/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 6 +- doc/guides/prog_guide/bbdev.rst | 130 +++++++++++++++++ drivers/baseband/acc100/rte_acc100_pmd.c | 30 ++-- drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 9 ++ drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 9 ++ drivers/baseband/la12xx/bbdev_la12xx.c | 10 +- drivers/baseband/null/bbdev_null.c | 1 + drivers/baseband/turbo_sw/bbdev_turbo_software.c | 12 ++ examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 57 +++++++- lib/bbdev/rte_bbdev.h | 149 +++++++++++++++++++- lib/bbdev/rte_bbdev_op.h | 156 ++++++++++++++++++++- lib/bbdev/version.map | 12 ++ 14 files changed, 556 insertions(+), 29 deletions(-)
Signature · 1 line
1.8.3.1
PATCH v7 1/7 bbdev: allow operation type enum for growth
Updating the enum for rte_bbdev_op_type
to allow to keep ABI compatible for enum insertion while adding padded maximum value for array need. Removing RTE_BBDEV_OP_TYPE_COUNT and instead exposing RTE_BBDEV_OP_TYPE_PADDED_MAX.
--- app/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 4 ++-- examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 8 +++++--- lib/bbdev/rte_bbdev_op.h | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-)
app/test-bbdev/test_bbdev.c +1 -1
@@ -521,7 +521,7 @@ struct bbdev_testsuite_params {rte_mempool_free (mp);TEST_ASSERT ((mp =rte_bbdev_op_pool_create ("Test_INV" , -RTE_BBDEV_OP_TYPE_COUNT , size, cache_size,0 )) ==NULL , +RTE_BBDEV_OP_TYPE_PADDED_MAX , size, cache_size,0 )) ==NULL ,"Failed test for rte_bbdev_op_pool_create: " "returned value is not NULL for invalid type" );
app/test-bbdev/test_bbdev_perf.c +2 -2
@@ -2428,13 +2428,13 @@ typedef int (test_case_function)(struct active_device *ad,/* Find capabilities */ const struct rte_bbdev_op_cap *cap = info.drv.capabilities; -for (i =0 ; i <RTE_BBDEV_OP_TYPE_COUNT ; i++) { +do {if (cap->type == test_vector.op_type) { capabilities = cap;break ; } cap++; - } + }while (cap->type !=RTE_BBDEV_OP_NONE );TEST_ASSERT_NOT_NULL (capabilities,"Couldn't find capabilities" );
examples/bbdev_app/main.c +1 -1
@@ -1041,7 +1041,7 @@ uint16_t bbdev_parse_number(const char *mask)void *sigret;struct app_config_params app_params = def_app_config;struct rte_mempool *ethdev_mbuf_mempool, *bbdev_mbuf_mempool; -struct rte_mempool *bbdev_op_pools[RTE_BBDEV_OP_TYPE_COUNT ]; +struct rte_mempool *bbdev_op_pools[RTE_BBDEV_OP_TYPE_PADDED_MAX ];struct lcore_conf lcore_conf[RTE_MAX_LCORE ] = { {0 } };struct lcore_statistics lcore_stats[RTE_MAX_LCORE ] = { {0 } };struct stats_lcore_params stats_lcore;
lib/bbdev/rte_bbdev.c +5 -3
@@ -23,6 +23,8 @@#define DEV_NAME "BBDEV" +/* Number of supported operation types */ +#define BBDEV_OP_TYPE_COUNT 5/* BBDev library logging ID */ RTE_LOG_REGISTER_DEFAULT (bbdev_logtype,NOTICE );
@@ -890,10 +892,10 @@ struct rte_mempool *return NULL ; } -if (type >=RTE_BBDEV_OP_TYPE_COUNT ) { +if (type >=BBDEV_OP_TYPE_COUNT ) {rte_bbdev_log (ERR ,"Invalid op type (%u), should be less than %u" , - type,RTE_BBDEV_OP_TYPE_COUNT ); + type,BBDEV_OP_TYPE_COUNT );return NULL ; }
@@ -1125,7 +1127,7 @@ struct rte_mempool * "RTE_BBDEV_OP_LDPC_ENC", }; -if (op_type <RTE_BBDEV_OP_TYPE_COUNT ) +if (op_type <BBDEV_OP_TYPE_COUNT )return op_types[op_type];rte_bbdev_log (ERR ,"Invalid operation type" );
lib/bbdev/rte_bbdev_op.h +1 -1
@@ -748,7 +748,7 @@ enum rte_bbdev_op_type {RTE_BBDEV_OP_TURBO_ENC ,/**< Turbo encode */ RTE_BBDEV_OP_LDPC_DEC ,/**< LDPC decode */ RTE_BBDEV_OP_LDPC_ENC ,/**< LDPC encode */ - RTE_BBDEV_OP_TYPE_COUNT, /**< Count of different op types */ + RTE_BBDEV_OP_TYPE_PADDED_MAX = 8, /**< Maximum op type number including padding */ };/** Bit indexes of possible errors reported through status field */
Signature · 1 line
1.8.3.1
PATCH v7 2/7 bbdev: add device status info
In reply to Nicolas ChautruAdded device status information, so that the PMD can
expose information related to the underlying accelerator device status. Minor order change in structure to fit into padding hole.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 1 + drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 1 + drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 1 + drivers/baseband/la12xx/bbdev_la12xx.c | 1 + drivers/baseband/null/bbdev_null.c | 1 + drivers/baseband/turbo_sw/bbdev_turbo_software.c | 1 + lib/bbdev/rte_bbdev.c | 22 ++++++++++++++ lib/bbdev/rte_bbdev.h | 35 ++++++++++++++++++++-- lib/bbdev/version.map | 7 +++++ 9 files changed, 68 insertions(+), 2 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +1 -0
@@ -1060,6 +1060,7 @@/* Read and save the populated config from ACC100 registers */ fetch_acc100_config (dev); + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* This isn't ideal because it reports the maximum number of queues but * does not provide info on how many can be uplink/downlink or different
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +1 -0
@@ -369,6 +369,7 @@ dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* Calculates number of queues assigned to device */ dev_info->max_num_queues =0 ;
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +1 -0
@@ -645,6 +645,7 @@ struct __rte_cache_aligned fpga_queue { dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* Calculates number of queues assigned to device */ dev_info->max_num_queues =0 ;
drivers/baseband/la12xx/bbdev_la12xx.c +1 -0
@@ -100,6 +100,7 @@ struct bbdev_la12xx_params { dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->min_alignment =64 ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/null/bbdev_null.c +1 -0
@@ -82,6 +82,7 @@ struct bbdev_queue {* here for code completeness. */ dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/turbo_sw/bbdev_turbo_software.c +1 -0
@@ -254,6 +254,7 @@ struct turbo_sw_queue { dev_info->min_alignment =64 ; dev_info->harq_buffer_size =0 ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u\n" , dev->data->dev_id); }
lib/bbdev/rte_bbdev.c +22 -0
@@ -1133,3 +1133,25 @@ struct rte_mempool *rte_bbdev_log (ERR ,"Invalid operation type" );return NULL ; } + +const char * +rte_bbdev_device_status_str (enum rte_bbdev_device_status status) +{ +static const char *const dev_sta_string[] = { +"RTE_BBDEV_DEV_NOSTATUS" , +"RTE_BBDEV_DEV_NOT_SUPPORTED" , +"RTE_BBDEV_DEV_RESET" , +"RTE_BBDEV_DEV_CONFIGURED" , +"RTE_BBDEV_DEV_ACTIVE" , +"RTE_BBDEV_DEV_FATAL_ERR" , +"RTE_BBDEV_DEV_RESTART_REQ" , +"RTE_BBDEV_DEV_RECONFIG_REQ" , +"RTE_BBDEV_DEV_CORRECT_ERR" , + }; + +if (status <sizeof (dev_sta_string) /sizeof (char *)) +return dev_sta_string[status]; + +rte_bbdev_log (ERR ,"Invalid device status" ); +return NULL ; +}
lib/bbdev/rte_bbdev.h +33 -2
@@ -223,6 +223,21 @@ struct rte_bbdev_queue_conf {int rte_bbdev_queue_stop (uint16_t dev_id,uint16_t queue_id); +/** +* Flags indicate the status of the device +*/ +enum rte_bbdev_device_status { +RTE_BBDEV_DEV_NOSTATUS ,/**< Nothing being reported */ +RTE_BBDEV_DEV_NOT_SUPPORTED ,/**< Device status is not supported on the PMD */ +RTE_BBDEV_DEV_RESET ,/**< Device in reset and un-configured state */ +RTE_BBDEV_DEV_CONFIGURED ,/**< Device is configured and ready to use */ +RTE_BBDEV_DEV_ACTIVE ,/**< Device is configured and VF is being used */ +RTE_BBDEV_DEV_FATAL_ERR ,/**< Device has hit a fatal uncorrectable error */ +RTE_BBDEV_DEV_RESTART_REQ ,/**< Device requires application to restart */ +RTE_BBDEV_DEV_RECONFIG_REQ ,/**< Device requires application to reconfigure queues */ +RTE_BBDEV_DEV_CORRECT_ERR ,/**< Warning of a correctable error event happened */ +}; +/** Device statistics. */ struct rte_bbdev_stats {uint64_t enqueued_count;/**< Count of all operations enqueued */
@@ -285,12 +300,14 @@ struct rte_bbdev_driver_info {/** Set if device supports per-queue interrupts */ bool queue_intr_supported;/** Minimum alignment of buffers, in bytes */ -uint16_t min_alignment; -/** HARQ memory available in kB */ +/** Device Status */ +enum rte_bbdev_device_status device_status;uint32_t harq_buffer_size;/** Byte endianness (RTE_BIG_ENDIAN/RTE_LITTLE_ENDIAN) supported * for input/output data */ +uint16_t min_alignment; +/** HARQ memory available in kB */ uint8_t data_endianness;/** Default queue configuration used if none is supplied */ struct rte_bbdev_queue_conf default_queue_conf;
@@ -827,6 +844,20 @@ typedef void (*rte_bbdev_cb_fn)(uint16_t dev_id, rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op, void *data); +/** +* Converts device status from enum to string +* +* @param status +* Device status as enum +* +* @returns +* Operation type as string or NULL if op_type is invalid +* +*/ +__rte_experimental +const char* +rte_bbdev_device_status_str (enum rte_bbdev_device_status status); + #ifdef __cplusplus }#endif
lib/bbdev/version.map +7 -0
@@ -39,3 +39,10 @@ DPDK_22 { local: *; }; + +EXPERIMENTAL { + global: + + # added in 22.11 + rte_bbdev_device_status_str; +};
Signature · 1 line
1.8.3.1
Re: [PATCH v7 2/7] bbdev: add device status info
Quoted 5 lines · Nicolas Chautru
Added device status information, so that the PMD can
expose information related to the underlying accelerator device status. Minor order change in structure to fit into padding hole.Signed-off-by Nicolas Chautru <[email protected]>
RE: [PATCH v7 2/7] bbdev: add device status info
In reply to Nicolas ChautruQuoted 224 lines
-----Original Message-----
From: Chautru, Nicolas <[email protected]>
Sent: Tuesday, August 30, 2022 2:07 AM
To: [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Richardson, Bruce <[email protected]>; [email protected]; [email protected]; Zhang, Mingshan <[email protected]>; Chautru, Nicolas <[email protected]>
Subject: [PATCH v7 2/7] bbdev: add device status infoAdded device status information, so that the PMD can expose information related to the underlying accelerator device status.
Minor order change in structure to fit into padding hole.Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc100/rte_acc100_pmd.c | 1 + drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 1 + drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 1 + drivers/baseband/la12xx/bbdev_la12xx.c | 1 + drivers/baseband/null/bbdev_null.c | 1 + drivers/baseband/turbo_sw/bbdev_turbo_software.c | 1 + lib/bbdev/rte_bbdev.c | 22 ++++++++++++++ lib/bbdev/rte_bbdev.h | 35 ++++++++++++++++++++-- lib/bbdev/version.map | 7 +++++ 9 files changed, 68 insertions(+), 2 deletions(-)drivers/baseband/acc100/rte_acc100_pmd.c +1
-0@@ -1060,6 +1060,7 @@/* Read and save the populated config from ACC100 registers */ fetch_acc100_config (dev); + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* This isn't ideal because it reports the maximum number of queues but
* does not provide info on how many can be uplink/downlink or
different diff --gita/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.cb/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c
index 82ae6ba..57b12af 100644drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +1
-0@@ -369,6 +369,7 @@ dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* Calculates number of queues assigned to device */ dev_info->max_num_queues =0 ;drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +1
-0@@ -645,6 +645,7 @@ struct __rte_cache_aligned fpga_queue { dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* Calculates number of queues assigned to device */ dev_info->max_num_queues =0 ;drivers/baseband/la12xx/bbdev_la12xx.c +1
-0@@ -100,6 +100,7 @@ struct bbdev_la12xx_params { dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->min_alignment =64 ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; rte_bbdev_log_debug("got device info from %u", dev->data-Quoted 1 line
dev_id); } diff --gita/drivers/baseband/null/bbdev_null.c
b/drivers/baseband/null/bbdev_null.c
index 248e129..94a1976 100644drivers/baseband/null/bbdev_null.c +1
-0@@ -82,6 +82,7 @@ struct bbdev_queue {* here for code completeness. */ dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; rte_bbdev_log_debug("got device info from %u", dev->data-Quoted 1 line
dev_id); } diff --git
a/drivers/baseband/turbo_sw/bbdev_turbo_software.cb/drivers/baseband/turbo_sw/bbdev_turbo_software.cindex af7bc41..dbc5524 100644drivers/baseband/turbo_sw/bbdev_turbo_software.c +1
-0@@ -254,6 +254,7 @@ struct turbo_sw_queue { dev_info->min_alignment =64 ; dev_info->harq_buffer_size =0 ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; rte_bbdev_log_debug("got device info from %u\n", dev->data-Quoted 1 line
dev_id); } diff --gita/lib/bbdev/rte_bbdev.cb/lib/bbdev/rte_bbdev.cindex 4da8047..38630a2 100644
lib/bbdev/rte_bbdev.c +21
-0@@ -1133,3 +1133,25 @@ struct rte_mempool *rte_bbdev_log (ERR ,"Invalid operation type" );return NULL ; } + +const char * +rte_bbdev_device_status_str (enum rte_bbdev_device_status status) { +static const char *const dev_sta_string[] = { +"RTE_BBDEV_DEV_NOSTATUS" , +"RTE_BBDEV_DEV_NOT_SUPPORTED" , +"RTE_BBDEV_DEV_RESET" , +"RTE_BBDEV_DEV_CONFIGURED" , +"RTE_BBDEV_DEV_ACTIVE" , +"RTE_BBDEV_DEV_FATAL_ERR" , +"RTE_BBDEV_DEV_RESTART_REQ" , +"RTE_BBDEV_DEV_RECONFIG_REQ" , +"RTE_BBDEV_DEV_CORRECT_ERR" , + }; + +if (status <sizeof (dev_sta_string) /sizeof (char *)) +return dev_sta_string[status]; + +rte_bbdev_log (ERR ,"Invalid device status" ); +return NULL ; +}lib/bbdev/rte_bbdev.h index renamed from lib/bbdev/rte_bbdev.h +0
-0b88c881..9b1ffa4 100644
lib/bbdev/rte_bbdev.h +5
-0@@ -223,6 +223,21 @@ struct rte_bbdev_queue_conf { int rte_bbdev_queue_stop(uint16_t dev_id, uint16_t queue_id); +/** +* Flags indicate the status of the device */ enum +rte_bbdev_device_status { +RTE_BBDEV_DEV_NOSTATUS ,/**< Nothing being reported */ +RTE_BBDEV_DEV_NOT_SUPPORTED ,/**< Device status is not supported on the PMD */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_DEV_RESET, /**< Device in reset and un-configured state */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_DEV_CONFIGURED, /**< Device is configured andready to use */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_DEV_ACTIVE, /**< Device is configured and VF isbeing used */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_DEV_FATAL_ERR, /**< Device has hit a fataluncorrectable error */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_DEV_RESTART_REQ, /**< Device requires applicationto restart */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_DEV_RECONFIG_REQ, /**< Device requires applicationto reconfigure queues */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_DEV_CORRECT_ERR, /**< Warning of a correctableerror event happened */
lib/bbdev/rte_bbdev.h +2
-0+}; +/** Device statistics. */ struct rte_bbdev_stats {uint64_t enqueued_count;/**< Count of all operations enqueued */ @@ -285,12 +300,14 @@ struct
rte_bbdev_driver_info{lib/bbdev/rte_bbdev.h +2
-2/** Set if device supports per-queue interrupts */ bool queue_intr_supported;/** Minimum alignment of buffers, in bytes */ -uint16_t min_alignment; -/** HARQ memory available in kB */ +/** Device Status */ +enum rte_bbdev_device_status device_status;uint32_t harq_buffer_size;/** Byte endianness (RTE_BIG_ENDIAN/RTE_LITTLE_ENDIAN) supported
lib/bbdev/rte_bbdev.h +3
-0* for input/output data */ +uint16_t min_alignment; +/** HARQ memory available in kB */ uint8_t data_endianness;/** Default queue configuration used if none is supplied */ struct rte_bbdev_queue_conf default_queue_conf; @@ -827,6 +844,20 @@ typedef void (*rte_bbdev_cb_fn)(uint16_t dev_id,rte_bbdev_queue_intr_ctl(uint16_t
dev_id,uint16_tqueue_id, int epfd, int op,lib/bbdev/rte_bbdev.h +14
-0void *data); +/** +* Converts device status from enum to string +* +* @param status +* Device status as enum +* +* @returns +* Operation type as string or NULL if op_type is invalid +* +*/ +__rte_experimental +const char* +rte_bbdev_device_status_str (enum rte_bbdev_device_status status); + #ifdef __cplusplus }#endif lib/bbdev/version.map index renamed from lib/bbdev/version.map +0
-0cce3f3c..f0a072e 100644
lib/bbdev/version.map +7
-1@@ -39,3 +39,10 @@ DPDK_22 { local: *; }; + +EXPERIMENTAL { + global: + + # added in 22.11 + rte_bbdev_device_status_str; +}; --1.8.3.1
RE: [EXT] [PATCH v7 2/7] bbdev: add device status info
In reply to Nicolas ChautruQuoted 14 lines
/** Device statistics. */
structrte_bbdev_stats{lib/bbdev/rte_bbdev.h +2
-2uint64_t enqueued_count;/**< Count of all operations enqueued */ @@ -285,12 +300,14 @@ struct rte_bbdev_driver_info {/** Set if device supports per-queue interrupts */ bool queue_intr_supported;/** Minimum alignment of buffers, in bytes */ -uint16_t min_alignment; -/** HARQ memory available in kB */ +/** Device Status */ +enum rte_bbdev_device_status device_status;uint32_t harq_buffer_size;/** Byte endianness (RTE_BIG_ENDIAN/RTE_LITTLE_ENDIAN) supported
lib/bbdev/rte_bbdev.h struct rte_bbdev_driver_info { · line 310
Quoted 4 lines
lib/bbdev/rte_bbdev.h +2
-0* for input/output data */ +uint16_t min_alignment; +/** HARQ memory available in kB */
Wrong comment copied.
Quoted 3 lines
lib/bbdev/rte_bbdev.h +0
-0uint8_t data_endianness;/** Default queue configuration used if none is supplied */ struct rte_bbdev_queue_conf default_queue_conf;
RE: [EXT] [PATCH v7 2/7] bbdev: add device status info
Thanks Akhil. Fixing now in v3.
Quoted 26 lines
-----Original Message-----
From: Akhil Goyal <[email protected]>Quoted 14 lines
/** Device statistics. */
structrte_bbdev_stats{lib/bbdev/rte_bbdev.h +2
-2uint64_t enqueued_count;/**< Count of all operations enqueued */ @@ -285,12 +300,14 @@ struct rte_bbdev_driver_info {/** Set if device supports per-queue interrupts */ bool queue_intr_supported;/** Minimum alignment of buffers, in bytes */ -uint16_t min_alignment; -/** HARQ memory available in kB */ +/** Device Status */ +enum rte_bbdev_device_status device_status;uint32_t harq_buffer_size;/** Byte endianness (RTE_BIG_ENDIAN/RTE_LITTLE_ENDIAN) supported
lib/bbdev/rte_bbdev.h struct rte_bbdev_driver_info { · line 310
Quoted 4 lines
lib/bbdev/rte_bbdev.h +2
-0* for input/output data */ +uint16_t min_alignment; +/** HARQ memory available in kB */ Wrong comment copied.
Quoted 3 lines
lib/bbdev/rte_bbdev.h +0
-0uint8_t data_endianness;/** Default queue configuration used if none is supplied */ struct rte_bbdev_queue_conf default_queue_conf;
PATCH v7 3/7 bbdev: add device info on queue topology
In reply to Nicolas ChautruAdding more options in the API to expose the number of queues exposed and related priority.
--- lib/bbdev/rte_bbdev.h | 4 ++++ 1 file changed, 4 insertions(+)
lib/bbdev/rte_bbdev.h +4 -0
@@ -289,6 +289,10 @@ struct rte_bbdev_driver_info {/** Maximum number of queues supported by the device */ unsigned int max_num_queues; +/** Maximum number of queues supported per operation type */ +unsigned int num_queues[RTE_BBDEV_OP_TYPE_PADDED_MAX ]; +/** Priority level supported per operation type */ +unsigned int queue_priority[RTE_BBDEV_OP_TYPE_PADDED_MAX ];/** Queue size limit (queue size must also be power of 2) */ uint32_t queue_size_lim;/** Set if device off-loads operation to hardware */
Signature · 1 line
1.8.3.1
PATCH v7 4/7 drivers/baseband: update PMDs to expose queue per operation
In reply to Nicolas ChautruAdd support in existing bbdev PMDs for the explicit number of queues and priority for each operation type configured on the device.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 29 +++++++++++++--------- drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 8 ++++++ drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 8 ++++++ drivers/baseband/la12xx/bbdev_la12xx.c | 7 ++++++ drivers/baseband/turbo_sw/bbdev_turbo_software.c | 11 ++++++++ 5 files changed, 51 insertions(+), 12 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +17 -12
@@ -966,6 +966,7 @@ struct rte_bbdev_driver_info *dev_info) {struct acc100_device *d = dev->data->dev_private; +int i;static const struct rte_bbdev_op_cap bbdev_capabilities[] = { {
@@ -1062,19 +1063,23 @@fetch_acc100_config (dev); dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; -/* This isn't ideal because it reports the maximum number of queues but -* does not provide info on how many can be uplink/downlink or different -* priorities -*/ - dev_info->max_num_queues = - d->acc100_conf.q_dl_5g.num_aqs_per_groups * - d->acc100_conf.q_dl_5g.num_qgroups + - d->acc100_conf.q_ul_5g.num_aqs_per_groups * - d->acc100_conf.q_ul_5g.num_qgroups + - d->acc100_conf.q_dl_4g.num_aqs_per_groups * - d->acc100_conf.q_dl_4g.num_qgroups + - d->acc100_conf.q_ul_4g.num_aqs_per_groups * +/* Expose number of queues */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] = d->acc100_conf.q_ul_4g.num_aqs_per_groups * d->acc100_conf.q_ul_4g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] = d->acc100_conf.q_dl_4g.num_aqs_per_groups * + d->acc100_conf.q_dl_4g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] = d->acc100_conf.q_ul_5g.num_aqs_per_groups * + d->acc100_conf.q_ul_5g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] = d->acc100_conf.q_dl_5g.num_aqs_per_groups * + d->acc100_conf.q_dl_5g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_DEC ] = d->acc100_conf.q_ul_4g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_ENC ] = d->acc100_conf.q_dl_4g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] = d->acc100_conf.q_ul_5g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] = d->acc100_conf.q_dl_5g.num_qgroups; + dev_info->max_num_queues =0 ; +for (i =RTE_BBDEV_OP_TURBO_DEC ; i <=RTE_BBDEV_OP_LDPC_ENC ; i++) + dev_info->max_num_queues += dev_info->num_queues[i]; dev_info->queue_size_lim =ACC100_MAX_QUEUE_DEPTH ; dev_info->hardware_accelerated = true; dev_info->max_dl_queue_priority =
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +8 -0
@@ -379,6 +379,14 @@if (hw_q_id !=FPGA_INVALID_HW_QUEUE_ID ) dev_info->max_num_queues++; } +/* Expose number of queue per operation type */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] = dev_info->max_num_queues /2 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] =1 ; }/**
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +8 -0
@@ -655,6 +655,14 @@ struct __rte_cache_aligned fpga_queue {if (hw_q_id !=FPGA_INVALID_HW_QUEUE_ID ) dev_info->max_num_queues++; } +/* Expose number of queue per operation type */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] =0 ; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_ENC ] =1 ; }/**
drivers/baseband/la12xx/bbdev_la12xx.c +7 -0
@@ -102,6 +102,13 @@ struct bbdev_la12xx_params { dev_info->min_alignment =64 ; dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] =LA12XX_MAX_QUEUES /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] =LA12XX_MAX_QUEUES /2 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] =1 ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/turbo_sw/bbdev_turbo_software.c +11 -0
@@ -256,6 +256,17 @@ struct turbo_sw_queue { dev_info->data_endianness =RTE_LITTLE_ENDIAN ; dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; +const struct rte_bbdev_op_cap *op_cap = bbdev_capabilities; +int num_op_type =0 ; +for (; op_cap->type !=RTE_BBDEV_OP_NONE ; ++op_cap) + num_op_type++; + op_cap = bbdev_capabilities; +if (num_op_type >0 ) { +int num_queue_per_type = dev_info->max_num_queues / num_op_type; +for (; op_cap->type !=RTE_BBDEV_OP_NONE ; ++op_cap) + dev_info->num_queues[op_cap->type] = num_queue_per_type; + } +rte_bbdev_log_debug ("got device info from %u\n" , dev->data->dev_id); }
Signature · 1 line
1.8.3.1
Re: [PATCH v7 4/7] drivers/baseband: update PMDs to expose queue per operation
Quoted 4 lines · Nicolas Chautru
Add support in existing bbdev PMDs for the explicit number of queues and priority for each operation type configured on the device.
RE: [EXT] [PATCH v7 4/7] drivers/baseband: update PMDs to expose queue per operation
In reply to Nicolas ChautruQuoted 143 lines
Add support in existing bbdev PMDs for the explicit number of queues and priority for each operation type configured on the device.
Signed-off-by Nicolas Chautru <[email protected]>Acked-by Maxime Coquelin <[email protected]>--- drivers/baseband/acc100/rte_acc100_pmd.c | 29 +++++++++++++--------- drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 8 ++++++ drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 8 ++++++ drivers/baseband/la12xx/bbdev_la12xx.c | 7 ++++++ drivers/baseband/turbo_sw/bbdev_turbo_software.c | 11 ++++++++ 5 files changed, 51 insertions(+), 12 deletions(-)drivers/baseband/acc100/rte_acc100_pmd.c +1
-2@@ -966,6 +966,7 @@ struct rte_bbdev_driver_info *dev_info) {struct acc100_device *d = dev->data->dev_private; +int i;static const struct rte_bbdev_op_cap bbdev_capabilities[] = { {@@ -1062,19 +1063,23 @@fetch_acc100_config (dev); dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; -/* This isn't ideal because it reports the maximum number of queues but -* does not provide info on how many can be uplink/downlink or different
drivers/baseband/acc100/rte_acc100_pmd.c +3
-10-* priorities -*/ - dev_info->max_num_queues = - d->acc100_conf.q_dl_5g.num_aqs_per_groups * - d->acc100_conf.q_dl_5g.num_qgroups + - d->acc100_conf.q_ul_5g.num_aqs_per_groups * - d->acc100_conf.q_ul_5g.num_qgroups + - d->acc100_conf.q_dl_4g.num_aqs_per_groups * - d->acc100_conf.q_dl_4g.num_qgroups + - d->acc100_conf.q_ul_4g.num_aqs_per_groups * +/* Expose number of queues */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC] = d-Quoted 1 line
acc100_conf.q_ul_4g.num_aqs_per_groups *
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0d->acc100_conf.q_ul_4g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC] = d-Quoted 1 line
acc100_conf.q_dl_4g.num_aqs_per_groups *
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+ d->acc100_conf.q_dl_4g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC] = d-Quoted 1 line
acc100_conf.q_ul_5g.num_aqs_per_groups *
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+ d->acc100_conf.q_ul_5g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC] = d-Quoted 1 line
acc100_conf.q_dl_5g.num_aqs_per_groups *
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+ d->acc100_conf.q_dl_5g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_DEC] = d-Quoted 1 line
acc100_conf.q_ul_4g.num_qgroups;
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ dev_info->queue_priority[RTE_BBDEV_OP_TURBO_ENC] = d-Quoted 1 line
acc100_conf.q_dl_4g.num_qgroups;
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC] = d-Quoted 1 line
acc100_conf.q_ul_5g.num_qgroups;
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC] = d-Quoted 1 line
acc100_conf.q_dl_5g.num_qgroups;
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+ dev_info->max_num_queues =0 ; + for (i = RTE_BBDEV_OP_TURBO_DEC; i <= RTE_BBDEV_OP_LDPC_ENC;i++)
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ dev_info->max_num_queues += dev_info->num_queues[i]; dev_info->queue_size_lim =ACC100_MAX_QUEUE_DEPTH ; dev_info->hardware_accelerated = true; dev_info->max_dl_queue_priority =drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +8
-0@@ -379,6 +379,14 @@if (hw_q_id !=FPGA_INVALID_HW_QUEUE_ID ) dev_info->max_num_queues++; } +/* Expose number of queue per operation type */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] = dev_info- >max_num_queues / 2; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] = dev_info- >max_num_queues / 2; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] =1 ; }/**
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +8
-0@@ -655,6 +655,14 @@ struct __rte_cache_aligned fpga_queue {if (hw_q_id !=FPGA_INVALID_HW_QUEUE_ID ) dev_info->max_num_queues++; } +/* Expose number of queue per operation type */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] = dev_info- >max_num_queues / 2; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] = dev_info- >max_num_queues / 2; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] =0 ; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_ENC ] =1 ; }/**
drivers/baseband/la12xx/bbdev_la12xx.c +7
-0@@ -102,6 +102,13 @@ struct bbdev_la12xx_params { dev_info->min_alignment =64 ; dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] =LA12XX_MAX_QUEUES /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] =LA12XX_MAX_QUEUES /2 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] =1 ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id);}
drivers/baseband/turbo_sw/bbdev_turbo_software.c +0
-0
drivers/baseband/turbo_sw/bbdev_turbo_software.c struct turbo_sw_queue { · line 260
Quoted 5 lines
drivers/baseband/turbo_sw/bbdev_turbo_software.c +2
-0@@ -256,6 +256,17 @@ struct turbo_sw_queue { dev_info->data_endianness =RTE_LITTLE_ENDIAN ; dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; +const struct rte_bbdev_op_cap *op_cap = bbdev_capabilities; +int num_op_type =0 ;
Variables should not be defined in middle of the function. Also add a blank line after that.
Quoted 16 lines
drivers/baseband/turbo_sw/bbdev_turbo_software.c +9
-0+for (; op_cap->type !=RTE_BBDEV_OP_NONE ; ++op_cap) + num_op_type++; + op_cap = bbdev_capabilities; +if (num_op_type >0 ) { +int num_queue_per_type = dev_info->max_num_queues / num_op_type; +for (; op_cap->type !=RTE_BBDEV_OP_NONE ; ++op_cap) + dev_info->num_queues[op_cap->type] = num_queue_per_type; + } +rte_bbdev_log_debug ("got device info from %u\n" , dev->data->dev_id);}
--
1.8.3.1
RE: [EXT] [PATCH v7 4/7] drivers/baseband: update PMDs to expose queue per operation
Thanks Akhil. Fixing now in v8.
Quoted 184 lines
-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Wednesday, September 21, 2022 12:00 PM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Richardson, Bruce <[email protected]>; [email protected]; [email protected]; Zhang, Mingshan <[email protected]>
Subject: RE: [EXT] [PATCH v7 4/7]drivers/baseband: update PMDs to expose queue per operationQuoted 7 lines
Add support in existing bbdev PMDs for the explicit number of queues and priority for each operation type configured on the device.
Signed-off-by Nicolas Chautru <[email protected]>Acked-by Maxime Coquelin <[email protected]>--- drivers/baseband/acc100/rte_acc100_pmd.c | 29 +++++++++++++---------
Quoted 19 lines
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 8 ++++++ drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 8 ++++++ drivers/baseband/la12xx/bbdev_la12xx.c | 7 ++++++ drivers/baseband/turbo_sw/bbdev_turbo_software.c | 11 ++++++++ 5 files changed, 51 insertions(+), 12 deletions(-)drivers/baseband/acc100/rte_acc100_pmd.c +1
-0@@ -966,6 +966,7 @@ struct rte_bbdev_driver_info *dev_info) {struct acc100_device *d = dev->data->dev_private; +int i;static const struct rte_bbdev_op_cap bbdev_capabilities[] = { {drivers/baseband/acc100/rte_acc100_pmd.c line 1065
Quoted 4 lines
drivers/baseband/acc100/rte_acc100_pmd.c +0
-1@@ -1062,19 +1063,23 @@fetch_acc100_config (dev); dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; -/* This isn't ideal because it reports the maximum number of queues but
Quoted 34 lines
drivers/baseband/acc100/rte_acc100_pmd.c +0
-1-* does not provide info on how many can be uplink/downlink or different
drivers/baseband/acc100/rte_acc100_pmd.c +3
-10-* priorities -*/ - dev_info->max_num_queues = - d->acc100_conf.q_dl_5g.num_aqs_per_groups * - d->acc100_conf.q_dl_5g.num_qgroups + - d->acc100_conf.q_ul_5g.num_aqs_per_groups * - d->acc100_conf.q_ul_5g.num_qgroups + - d->acc100_conf.q_dl_4g.num_aqs_per_groups * - d->acc100_conf.q_dl_4g.num_qgroups + - d->acc100_conf.q_ul_4g.num_aqs_per_groups * +/* Expose number of queues */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC] = d-Quoted 1 line
acc100_conf.q_ul_4g.num_aqs_per_groups *
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0d->acc100_conf.q_ul_4g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC] = d-Quoted 1 line
acc100_conf.q_dl_4g.num_aqs_per_groups *
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+ d->acc100_conf.q_dl_4g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC] = d-Quoted 1 line
acc100_conf.q_ul_5g.num_aqs_per_groups *
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+ d->acc100_conf.q_ul_5g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC] = d-Quoted 1 line
acc100_conf.q_dl_5g.num_aqs_per_groups *
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+ d->acc100_conf.q_dl_5g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_DEC] = d-Quoted 1 line
acc100_conf.q_ul_4g.num_qgroups;
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ dev_info->queue_priority[RTE_BBDEV_OP_TURBO_ENC] = d-Quoted 1 line
acc100_conf.q_dl_4g.num_qgroups;
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC] = d-Quoted 1 line
acc100_conf.q_ul_5g.num_qgroups;
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC] = d-Quoted 1 line
acc100_conf.q_dl_5g.num_qgroups;
drivers/baseband/acc100/rte_acc100_pmd.c
Quoted 2 lines
drivers/baseband/acc100/rte_acc100_pmd.c +2
-0+ dev_info->max_num_queues =0 ; + for (i = RTE_BBDEV_OP_TURBO_DEC; i <=
RTE_BBDEV_OP_LDPC_ENC;Quoted 77 lines
i++)
drivers/baseband/acc100/rte_acc100_pmd.c +1
-0+ dev_info->max_num_queues += dev_info->num_queues[i]; dev_info->queue_size_lim =ACC100_MAX_QUEUE_DEPTH ; dev_info->hardware_accelerated = true; dev_info->max_dl_queue_priority =drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +8
-0@@ -379,6 +379,14 @@if (hw_q_id !=FPGA_INVALID_HW_QUEUE_ID ) dev_info->max_num_queues++; } +/* Expose number of queue per operation type */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] = dev_info- >max_num_queues / 2; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] = dev_info- >max_num_queues / 2; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] =1 ; }/**
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +8
-0@@ -655,6 +655,14 @@ struct __rte_cache_aligned fpga_queue {if (hw_q_id !=FPGA_INVALID_HW_QUEUE_ID ) dev_info->max_num_queues++; } +/* Expose number of queue per operation type */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] = dev_info- >max_num_queues / 2; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] = dev_info- >max_num_queues / 2; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] =0 ; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_ENC ] =1 ; }/**
drivers/baseband/la12xx/bbdev_la12xx.c +7
-0@@ -102,6 +102,13 @@ struct bbdev_la12xx_params { dev_info->min_alignment =64 ; dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] =LA12XX_MAX_QUEUES /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] =LA12XX_MAX_QUEUES /2 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] =1 ; rte_bbdev_log_debug("got device info from %u", dev->data-
dev_id);
}drivers/baseband/turbo_sw/bbdev_turbo_software.c +0
-0drivers/baseband/turbo_sw/bbdev_turbo_software.c struct turbo_sw_queue { · line 260
Quoted 5 lines
drivers/baseband/turbo_sw/bbdev_turbo_software.c +2
-0@@ -256,6 +256,17 @@ struct turbo_sw_queue { dev_info->data_endianness =RTE_LITTLE_ENDIAN ; dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; +const struct rte_bbdev_op_cap *op_cap = bbdev_capabilities; +int num_op_type =0 ;Variables should not be defined in middle of the function. Also add a blank line after that.
Quoted 17 lines
drivers/baseband/turbo_sw/bbdev_turbo_software.c +9
-0+for (; op_cap->type !=RTE_BBDEV_OP_NONE ; ++op_cap) + num_op_type++; + op_cap = bbdev_capabilities; +if (num_op_type >0 ) { +int num_queue_per_type = dev_info->max_num_queues / num_op_type; +for (; op_cap->type !=RTE_BBDEV_OP_NONE ; ++op_cap) + dev_info->num_queues[op_cap->type] = num_queue_per_type; + } + rte_bbdev_log_debug("got device info from %u\n", dev->data-
dev_id);
}--
1.8.3.1
PATCH v7 5/7 bbdev: add new operation for FFT processing
In reply to Nicolas ChautruExtension of bbdev operation to support FFT based operations.
--- doc/guides/prog_guide/bbdev.rst | 130 +++++++++++++++++++++++++++++++++++ lib/bbdev/rte_bbdev.c | 10 ++- lib/bbdev/rte_bbdev.h | 76 ++++++++++++++++++++ lib/bbdev/rte_bbdev_op.h | 149 ++++++++++++++++++++++++++++++++++++++++ lib/bbdev/version.map | 4 ++ 5 files changed, 368 insertions(+), 1 deletion(-)
doc/guides/prog_guide/bbdev.rst +130 -0
@@ -1118,6 +1118,136 @@ Figure :numref:`figure_turbo_tb_decode` above showing the Turbo decoding of CBs using BBDEV interface in TB-mode is also valid for LDPC decode. +BBDEV FFT Operation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This operation allows to run a combination of DFT and/or IDFT and/or time-domain windowing. +These can be used in a modular fashion (using bypass modes) or as a processing pipeline +which can be used for FFT-based baseband signal processing. +In more details it allows : +- to process the data first through an IDFT of adjustable size and padding; +- to perform the windowing as a programmable cyclic shift offset of the data followed by a +pointwise multiplication by a time domain window; +- to process the related data through a DFT of adjustable size and de-padding for each such cyclic +shift output. + +A flexible number of Rx antennas are being processed in parallel with the same configuration. +The API allows more generally for flexibility in what the PMD may support (capability flags) and +flexibility to adjust some of the parameters of the processing. + +The operation/capability flags that can be set for each FFT operation are given below. + + **NOTE:** The actual operation flags that may be used with a specific + BBDEV PMD are dependent on the driver capabilities as reported via + ``rte_bbdev_info_get()``, and may be a subset of those below. + ++--------------------------------------------------------------------+ +|Description of FFT capability flags | ++====================================================================+ +|RTE_BBDEV_FFT_WINDOWING | +| Set to enable/support windowing in time domain | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_CS_ADJUSTMENT | +| Set to enable/support the cyclic shift time offset adjustment | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_DFT_BYPASS | +| Set to bypass the DFT and use directly the IDFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_IDFT_BYPASS | +| Set to bypass the IDFT and use directly the DFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_WINDOWING_BYPASS | +| Set to bypass the time domain windowing as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_POWER_MEAS | +| Set to provide an optional power measurement of the DFT output | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_INPUT | +| Set if the input data shall use FP16 format instead of INT16 | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_OUTPUT | +| Set if the output data shall use FP16 format instead of INT16 | ++--------------------------------------------------------------------+ + +The structure passed for each FFT operation is given below, +with the operation flags forming a bitmask in the ``op_flags`` field. + +.. code-block:: c + + struct rte_bbdev_op_fft { + struct rte_bbdev_op_data base_input; + struct rte_bbdev_op_data base_output; + struct rte_bbdev_op_data power_meas_output; + uint32_t op_flags; + uint16_t input_sequence_size; + uint16_t input_leading_padding; + uint16_t output_sequence_size; + uint16_t output_leading_depadding; + uint8_t window_index[RTE_BBDEV_MAX_CS_2]; + uint16_t cs_bitmap; + uint8_t num_antennas_log2; + uint8_t idft_log2; + uint8_t dft_log2; + int8_t cs_time_adjustment; + int8_t idft_shift; + int8_t dft_shift; + uint16_t ncs_reciprocal; + uint16_t power_shift; + uint16_t fp16_exp_adjust; + }; + +The FFT parameters are set out in the table below. + ++-------------------------+--------------------------------------------------------------+ +|Parameter |Description | ++=========================+==============================================================+ +|base_input |input data | ++-------------------------+--------------------------------------------------------------+ +|base_output |output data | ++-------------------------+--------------------------------------------------------------+ +|power_meas_output |optional output data with power measurement on DFT output | ++-------------------------+--------------------------------------------------------------+ +|op_flags |bitmask of all active operation capabilities | ++-------------------------+--------------------------------------------------------------+ +|input_sequence_size |size of the input sequence in 32-bits points per antenna | ++-------------------------+--------------------------------------------------------------+ +|input_leading_padding |number of points padded at the start of input data | ++-------------------------+--------------------------------------------------------------+ +|output_sequence_size |size of the output sequence per antenna and cyclic shift | ++-------------------------+--------------------------------------------------------------+ +|output_leading_depadding |number of points de-padded at the start of output data | ++-------------------------+--------------------------------------------------------------+ +|window_index |optional windowing profile index used for each cyclic shift | ++-------------------------+--------------------------------------------------------------+ +|cs_bitmap |bitmap of the cyclic shift output requested (LSB for index 0) | ++-------------------------+--------------------------------------------------------------+ +|num_antennas_log2 |number of antennas as a log2 (10 maps to 1024...) | ++-------------------------+--------------------------------------------------------------+ +|idft_log2 |iDFT size as a log2 | ++-------------------------+--------------------------------------------------------------+ +|dft_log2 |DFT size as a log2 | ++-------------------------+--------------------------------------------------------------+ +|cs_time_adjustment |adjustment of time position of all the cyclic shift output | ++-------------------------+--------------------------------------------------------------+ +|idft_shift |shift down of signal level post iDFT | ++-------------------------+--------------------------------------------------------------+ +|dft_shift |shift down of signal level post DFT | ++-------------------------+--------------------------------------------------------------+ +|ncs_reciprocal |inverse of max number of CS normalized to 15b (ie. 231 for 12)| ++-------------------------+--------------------------------------------------------------+ +|power_shift |shift down of level of power measurement when enabled | ++-------------------------+--------------------------------------------------------------+ +|fp16_exp_adjust |value added to FP16 exponent at conversion from INT16 | ++-------------------------+--------------------------------------------------------------+ + +The mbuf input ``base_input`` is mandatory for all BBDEV PMDs and is the +incoming data for the processing. Its size may not fit into an actual mbuf, but the +structure is used to pass iova address. +The mbuf output ``output`` is mandatory and is output of the FFT processing chain. +Each point is a complex number of 32bits : either as 2 INT16 or as 2 FP16 based when the option +supported. +The data layout is based on contiguous concatenation of output data first by cyclic shift then +by antenna. Sample code -----------
lib/bbdev/rte_bbdev.c +9 -1
@@ -24,7 +24,7 @@#define DEV_NAME "BBDEV"/* Number of supported operation types */ -#define BBDEV_OP_TYPE_COUNT 5 +#define BBDEV_OP_TYPE_COUNT 6/* BBDev library logging ID */ RTE_LOG_REGISTER_DEFAULT (bbdev_logtype,NOTICE );
@@ -852,6 +852,9 @@ struct rte_bbdev *case RTE_BBDEV_OP_LDPC_ENC : result =sizeof (struct rte_bbdev_enc_op );break ; +case RTE_BBDEV_OP_FFT : + result =sizeof (struct rte_bbdev_fft_op ); +break ;default :break ; }
@@ -875,6 +878,10 @@ struct rte_bbdev *struct rte_bbdev_enc_op *op = element;memset (op,0 , mempool->elt_size); op->mempool = mempool; + }else if (type ==RTE_BBDEV_OP_FFT ) { +struct rte_bbdev_fft_op *op = element; +memset (op,0 , mempool->elt_size); + op->mempool = mempool; } }
@@ -1125,6 +1132,7 @@ struct rte_mempool *"RTE_BBDEV_OP_TURBO_ENC" ,"RTE_BBDEV_OP_LDPC_DEC" ,"RTE_BBDEV_OP_LDPC_ENC" , + "RTE_BBDEV_OP_FFT", };if (op_type <BBDEV_OP_TYPE_COUNT )
lib/bbdev/rte_bbdev.h +76 -0
106 lines not on this page · raw message
lib/bbdev/rte_bbdev_op.h +149 -0
203 lines not on this page · raw message
lib/bbdev/version.map +4 -0
@@ -45,4 +45,8 @@ EXPERIMENTAL { # added in 22.11 rte_bbdev_device_status_str; + rte_bbdev_enqueue_fft_ops; + rte_bbdev_dequeue_fft_ops; + rte_bbdev_fft_op_alloc_bulk; + rte_bbdev_fft_op_free_bulk; };
Signature · 1 line
1.8.3.1
RE: [EXT] [PATCH v7 5/7] bbdev: add new operation for FFT processing
Quoted 99 lines
Extension of bbdev operation to support FFT based operations.
Signed-off-by Nicolas Chautru <[email protected]>Acked-by Hemant Agrawal <[email protected]>Acked-by Maxime Coquelin <[email protected]>--- doc/guides/prog_guide/bbdev.rst | 130 +++++++++++++++++++++++++++++++++++ lib/bbdev/rte_bbdev.c | 10 ++- lib/bbdev/rte_bbdev.h | 76 ++++++++++++++++++++ lib/bbdev/rte_bbdev_op.h | 149 ++++++++++++++++++++++++++++++++++++++++ lib/bbdev/version.map | 4 ++ 5 files changed, 368 insertions(+), 1 deletion(-)doc/guides/prog_guide/bbdev.rst +4
-0@@ -1118,6 +1118,136 @@ Figure :numref:`figure_turbo_tb_decode` above showing the Turbo decoding of CBs using BBDEV interface in TB-mode is also valid for LDPC decode. +BBDEV FFT Operation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This operation allows to run a combination of DFT and/or IDFT and/or time-domain windowing.
+These can be used in a modular fashion (using bypass modes) or as a processing pipelinedoc/guides/prog_guide/bbdev.rst +4
-0+which can be used for FFT-based baseband signal processing. +In more details it allows : +- to process the data first through an IDFT of adjustable size and padding; +- to perform the windowing as a programmable cyclic shift offset of the datafollowed by a
+pointwise multiplication by a time domain window;
+- to process the related data through a DFT of adjustable size and de-padding for each such cyclicdoc/guides/prog_guide/bbdev.rst +3
-0+shift output. + +A flexible number of Rx antennas are being processed in parallel with the sameconfiguration.
+The API allows more generally for flexibility in what the PMD may support (capability flags) anddoc/guides/prog_guide/bbdev.rst +3
-0+flexibility to adjust some of the parameters of the processing. + +The operation/capability flags that can be set for each FFT operation are givenbelow.
doc/guides/prog_guide/bbdev.rst +8
-0+ + **NOTE:** The actual operation flags that may be used with a specific + BBDEV PMD are dependent on the driver capabilities as reported via + ``rte_bbdev_info_get()``, and may be a subset of those below. + ++--------------------------------------------------------------------+ +|Description of FFT capability flags | ++====================================================================+
+|RTE_BBDEV_FFT_WINDOWING | +| Set to enable/support windowing in time domain | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_CS_ADJUSTMENT | +| Set to enable/support the cyclic shift time offset adjustment | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_DFT_BYPASS | +| Set to bypass the DFT and use directly the IDFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_IDFT_BYPASS | +| Set to bypass the IDFT and use directly the DFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_WINDOWING_BYPASS | +| Set to bypass the time domain windowing as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_POWER_MEAS | +| Set to provide an optional power measurement of the DFT output | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_INPUT | +| Set if the input data shall use FP16 format instead of INT16 | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_OUTPUT | +| Set if the output data shall use FP16 format instead of INT16 |++--------------------------------------------------------------------+
doc/guides/prog_guide/bbdev.rst +17
-0+ +The structure passed for each FFT operation is given below, +with the operation flags forming a bitmask in the ``op_flags`` field. + +.. code-block:: c + + struct rte_bbdev_op_fft { + struct rte_bbdev_op_data base_input; + struct rte_bbdev_op_data base_output; + struct rte_bbdev_op_data power_meas_output; + uint32_t op_flags; + uint16_t input_sequence_size; + uint16_t input_leading_padding; + uint16_t output_sequence_size; + uint16_t output_leading_depadding; + uint8_t window_index[RTE_BBDEV_MAX_CS_2]; + uint16_t cs_bitmap;
doc/guides/prog_guide/bbdev.rst Figure :numref:`figure_turbo_tb_decode` above · line 1197
Quoted 10 lines
doc/guides/prog_guide/bbdev.rst +10
-0+ uint8_t num_antennas_log2; + uint8_t idft_log2; + uint8_t dft_log2; + int8_t cs_time_adjustment; + int8_t idft_shift; + int8_t dft_shift; + uint16_t ncs_reciprocal; + uint16_t power_shift; + uint16_t fp16_exp_adjust; + };
Why is this codeblock added in this guide? Isn't it covered in the doxygen API doc?
Quoted 157 lines
doc/guides/prog_guide/bbdev.rst +6
-0+ +The FFT parameters are set out in the table below. + ++-------------------------+--------------------------------------------------------------+ +|Parameter |Description | ++=========================+==============================================================+
+|base_input |input data |
++-------------------------+--------------------------------------------------------------+
+|base_output |output data |
++-------------------------+--------------------------------------------------------------+
+|power_meas_output |optional output data with power measurement on
DFT output |
++-------------------------+--------------------------------------------------------------+
+|op_flags |bitmask of all active operation capabilities |
++-------------------------+--------------------------------------------------------------+
+|input_sequence_size |size of the input sequence in 32-bits points per
antenna |
++-------------------------+--------------------------------------------------------------+
+|input_leading_padding |number of points padded at the start of input data
|
++-------------------------+--------------------------------------------------------------+
+|output_sequence_size |size of the output sequence per antenna and cyclic
shift |
++-------------------------+--------------------------------------------------------------+
+|output_leading_depadding |number of points de-padded at the start of
output data |
++-------------------------+--------------------------------------------------------------+
+|window_index |optional windowing profile index used for each cyclic
shift |
++-------------------------+--------------------------------------------------------------+
+|cs_bitmap |bitmap of the cyclic shift output requested (LSB for index
0) |
++-------------------------+--------------------------------------------------------------+
+|num_antennas_log2 |number of antennas as a log2 (10 maps to 1024...)
|
++-------------------------+--------------------------------------------------------------+
+|idft_log2 |iDFT size as a log2 |
++-------------------------+--------------------------------------------------------------+
+|dft_log2 |DFT size as a log2 |
++-------------------------+--------------------------------------------------------------+
+|cs_time_adjustment |adjustment of time position of all the cyclic shift
output |
++-------------------------+--------------------------------------------------------------+
+|idft_shift |shift down of signal level post iDFT |
++-------------------------+--------------------------------------------------------------+
+|dft_shift |shift down of signal level post DFT |
++-------------------------+--------------------------------------------------------------+
+|ncs_reciprocal |inverse of max number of CS normalized to 15b (ie. 231
for 12)|
++-------------------------+--------------------------------------------------------------+
+|power_shift |shift down of level of power measurement when enabled
|
++-------------------------+--------------------------------------------------------------+
+|fp16_exp_adjust |value added to FP16 exponent at conversion from
INT16 |
++-------------------------+--------------------------------------------------------------+doc/guides/prog_guide/bbdev.rst +3
-0+ +The mbuf input ``base_input`` is mandatory for all BBDEV PMDs and is the +incoming data for the processing. Its size may not fit into an actual mbuf, butthe
doc/guides/prog_guide/bbdev.rst +2
-0+structure is used to pass iova address. +The mbuf output ``output`` is mandatory and is output of the FFT processingchain.
+Each point is a complex number of 32bits : either as 2 INT16 or as 2 FP16 based when the optiondoc/guides/prog_guide/bbdev.rst +2
-0+supported. +The data layout is based on contiguous concatenation of output data first bycyclic shift then
doc/guides/prog_guide/bbdev.rst +1
-0+by antenna. Sample code -----------lib/bbdev/rte_bbdev.c +9
-1@@ -24,7 +24,7 @@#define DEV_NAME "BBDEV"/* Number of supported operation types */ -#define BBDEV_OP_TYPE_COUNT 5 +#define BBDEV_OP_TYPE_COUNT 6/* BBDev library logging ID */ RTE_LOG_REGISTER_DEFAULT (bbdev_logtype,NOTICE );@@ -852,6 +852,9 @@ struct rte_bbdev *case RTE_BBDEV_OP_LDPC_ENC : result =sizeof (struct rte_bbdev_enc_op );break ; +case RTE_BBDEV_OP_FFT : + result =sizeof (struct rte_bbdev_fft_op ); +break ;default :break ; }@@ -875,6 +878,10 @@ struct rte_bbdev *struct rte_bbdev_enc_op *op = element;memset (op,0 , mempool->elt_size); op->mempool = mempool; + }else if (type ==RTE_BBDEV_OP_FFT ) { +struct rte_bbdev_fft_op *op = element; +memset (op,0 , mempool->elt_size); + op->mempool = mempool; } }@@ -1125,6 +1132,7 @@ struct rte_mempool *"RTE_BBDEV_OP_TURBO_ENC" ,"RTE_BBDEV_OP_LDPC_DEC" ,"RTE_BBDEV_OP_LDPC_ENC" , + "RTE_BBDEV_OP_FFT", };if (op_type <BBDEV_OP_TYPE_COUNT )lib/bbdev/rte_bbdev.h +15
-0@@ -401,6 +401,12 @@ typedef uint16_t (*rte_bbdev_enqueue_dec_ops_t)(struct rte_bbdev_dec_op **ops, uint16_t num); +/** @internal Enqueue fft operations for processing on queue of a device. */ +typedef uint16_t (*rte_bbdev_enqueue_fft_ops_t )( +struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_fft_op **ops, +uint16_t num); +/** @internal Dequeue encode operations from a queue of a device. */ typedef uint16_t (*rte_bbdev_dequeue_enc_ops_t)( struct rte_bbdev_queue_data *q_data,@@ -411,6 +417,11 @@ typedef uint16_t (*rte_bbdev_dequeue_dec_ops_t)(struct rte_bbdev_queue_data *q_data, struct rte_bbdev_dec_op **ops, uint16_t num); +/** @internal Dequeue fft operations from a queue of a device. */ +typedef uint16_t (*rte_bbdev_dequeue_fft_ops_t )( +struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_fft_op **ops,uint16_t num); +#define RTE_BBDEV_NAME_MAX_LEN 64/**< Max length of device name */ /** @@ -459,6 +470,10 @@ struct __rte_cache_aligned rte_bbdev {rte_bbdev_dequeue_enc_ops_t dequeue_ldpc_enc_ops;/** Dequeue decode function */ rte_bbdev_dequeue_dec_ops_t dequeue_ldpc_dec_ops; +/** Enqueue FFT function */ +rte_bbdev_enqueue_fft_ops_t enqueue_fft_ops; +/** Dequeue FFT function */ +rte_bbdev_dequeue_fft_ops_t dequeue_fft_ops;const struct rte_bbdev_ops *dev_ops;/**< Functions exported by PMD */ struct rte_bbdev_data *data;/**< Pointer to device data */ lib/bbdev/rte_bbdev.h +0
-0enum rte_bbdev_state state;/**< If device is currently used or not */
lib/bbdev/rte_bbdev.h struct __rte_cache_aligned rte_bbdev { · line 610
Quoted 5 lines
lib/bbdev/rte_bbdev.h +2
-0@@ -591,6 +606,36 @@ struct __rte_cache_aligned rte_bbdev {return dev->enqueue_ldpc_dec_ops (q_data, ops, num_ops); } +/** +* Enqueue a burst of fft operations to a queue of the device.
Please be consistent of using fft or FFT in comments. It should be FFT always in comments.
Quoted 265 lines
lib/bbdev/rte_bbdev.h +17
-0+* This functions only enqueues as many operations as currently possible and +* does not block until @p num_ops entries in the queue are available. +* This function does not provide any error notification to avoid the +* corresponding overhead. +* +* @param dev_id +* The identifier of the device. +* @param queue_id +* The index of the queue. +* @param ops +* Pointer array containing operations to be enqueued Must have at least +* @p num_ops entries +* @param num_ops +* The maximum number of operations to enqueue. +* +* @return +* The number of operations actually enqueued (this is the number of processed
+ * entries in the @p ops array).
+ */lib/bbdev/rte_bbdev.h +7
-0+__rte_experimental +static inline uint16_t +rte_bbdev_enqueue_fft_ops (uint16_t dev_id,uint16_t queue_id, +struct rte_bbdev_fft_op **ops,uint16_t num_ops) +{ +struct rte_bbdev *dev = &rte_bbdev_devices[dev_id]; + struct rte_bbdev_queue_data *q_data = &dev->data-Quoted 1 line
queues[queue_id];
lib/bbdev/rte_bbdev.h +33
-0+return dev->enqueue_fft_ops (q_data, ops, num_ops); +}/** * Dequeue a burst of processed encode operations from a queue of the device. @@ -716,6 +761,37 @@ struct __rte_cache_aligned rte_bbdev {return dev->dequeue_ldpc_dec_ops (q_data, ops, num_ops); } +/** +* Dequeue a burst of fft operations from a queue of the device. +* This functions returns only the current contents of the queue, and does not +* block until @ num_ops is available. +* This function does not provide any error notification to avoid the +* corresponding overhead. +* +* @param dev_id +* The identifier of the device. +* @param queue_id +* The index of the queue. +* @param ops +* Pointer array where operations will be dequeued to. Must have at least +* @p num_ops entries +* @param num_ops +* The maximum number of operations to dequeue. +* +* @return +* The number of operations actually dequeued (this is the number of entries +* copied into the @p ops array). +*/ +__rte_experimental +static inline uint16_t +rte_bbdev_dequeue_fft_ops (uint16_t dev_id,uint16_t queue_id, +struct rte_bbdev_fft_op **ops,uint16_t num_ops) +{ +struct rte_bbdev *dev = &rte_bbdev_devices[dev_id]; +struct rte_bbdev_queue_data *q_data = &dev->data- >queues[queue_id]; +return dev->dequeue_fft_ops (q_data, ops, num_ops); +} +/** Definitions of device event types */ enum rte_bbdev_event_type {lib/bbdev/rte_bbdev.h +0
-0RTE_BBDEV_EVENT_UNKNOWN, /**< unknown event type */lib/bbdev/rte_bbdev_op.h +82
-0@@ -47,6 +47,8 @@#define RTE_BBDEV_TURBO_MAX_CODE_BLOCKS (64)/* LDPC: Maximum number of Code Blocks in Transport Block.*/ #define RTE_BBDEV_LDPC_MAX_CODE_BLOCKS (256) +/* 12 CS maximum */ +#define RTE_BBDEV_MAX_CS_2 (6)/** Flags for turbo decoder operation and capability structure */ enum rte_bbdev_op_td_flag_bitmasks {@@ -211,6 +213,26 @@ enum rte_bbdev_op_ldpcenc_flag_bitmasks {RTE_BBDEV_LDPC_ENC_CONCATENATION = (1ULL <<7 ) }; +/** Flags for DFT operation and capability structure */ +enum rte_bbdev_op_fft_flag_bitmasks { +/** Flexible windowing capability */ +RTE_BBDEV_FFT_WINDOWING = (1ULL <<0 ), +/** Flexible adjustment of Cyclic Shift time offset */ +RTE_BBDEV_FFT_CS_ADJUSTMENT = (1ULL <<1 ), +/** Set for bypass the DFT and get directly into iDFT input */ +RTE_BBDEV_FFT_DFT_BYPASS = (1ULL <<2 ), +/** Set for bypass the IDFT and get directly the DFT output */ +RTE_BBDEV_FFT_IDFT_BYPASS = (1ULL <<3 ), +/** Set for bypass time domain windowing */ +RTE_BBDEV_FFT_WINDOWING_BYPASS = (1ULL <<4 ), +/** Set for optional power measurement on DFT output */ +RTE_BBDEV_FFT_POWER_MEAS = (1ULL <<5 ), +/** Set if the input data used FP16 format */ +RTE_BBDEV_FFT_FP16_INPUT = (1ULL <<6 ), +/** Set if the output data uses FP16 format */ +RTE_BBDEV_FFT_FP16_OUTPUT = (1ULL <<7 ) +}; +/** Flags for the Code Block/Transport block mode */ enum rte_bbdev_op_cb_mode {/** One operation is one or fraction of one transport block */ @@ -689,6 +711,55 @@ struct rte_bbdev_op_ldpc_enc { }; }; +/** Operation structure for FFT processing. +* +* The operation processes the data for multiple antennas in a single call +* (.i.e for all the REs belonging to a given SRS sequence for instance) +* +* The output mbuf data structure is expected to be allocated by the +* application with enough room for the output data. +*/ +struct rte_bbdev_op_fft { +/** Input data starting from first antenna */ +struct rte_bbdev_op_data base_input; +/** Output data starting from first antenna and first cyclic shift */ +struct rte_bbdev_op_data base_output; +/** Optional power measurement output data */ +struct rte_bbdev_op_data power_meas_output; +/** Flags from rte_bbdev_op_fft_flag_bitmasks */ +uint32_t op_flags; +/** Input sequence size in 32-bits points */ +uint16_t input_sequence_size; +/** Padding at the start of the sequence */ +uint16_t input_leading_padding; +/** Output sequence size in 32-bits points */ +uint16_t output_sequence_size; +/** Depadding at the start of the DFT output */ +uint16_t output_leading_depadding; +/** Window index being used for each cyclic shift output */ +uint8_t window_index[RTE_BBDEV_MAX_CS_2 ]; +/** Bitmap of the cyclic shift output requested */ +uint16_t cs_bitmap; +/** Number of antennas as a log2 – 8 to 128 */ +uint8_t num_antennas_log2; +/** iDFT size as a log2 - 32 to 2048 */ +uint8_t idft_log2; +/** DFT size as a log2 - 8 to 2048 */ +uint8_t dft_log2; +/** Adjustment of position of the cyclic shifts - -31 to 31 */ +int8_t cs_time_adjustment; +/** iDFT shift down */ +int8_t idft_shift; +/** DFT shift down */ +int8_t dft_shift; +/** NCS reciprocal factor */ +uint16_t ncs_reciprocal; +/** power measurement out shift down */ +uint16_t power_shift; +/** Adjust the FP6 exponent for INT<->FP16 conversion */ +uint16_t fp16_exp_adjust; +}; +/** List of the capabilities for the Turbo Decoder */ struct rte_bbdev_op_cap_turbo_dec {/** Flags from rte_bbdev_op_td_flag_bitmasks */ @@ -741,6 +812,16 @@ struct rte_bbdev_op_cap_ldpc_enc {uint16_t num_buffers_dst; }; +/** List of the capabilities for the FFT */ +struct rte_bbdev_op_cap_fft { +/** Flags from rte_bbdev_op_fft_flag_bitmasks */ +uint32_t capability_flags; +/** Num input code block buffers */ +uint16_t num_buffers_src; +/** Num output code block buffers */ +uint16_t num_buffers_dst; +}; +/** Different operation types supported by the device */ enum rte_bbdev_op_type {RTE_BBDEV_OP_NONE ,/**< Dummy operation that does nothing */ @@ -748,6 +829,7 @@ enum rte_bbdev_op_type {RTE_BBDEV_OP_TURBO_ENC ,/**< Turbo encode */ RTE_BBDEV_OP_LDPC_DEC ,/**< LDPC decode */ RTE_BBDEV_OP_LDPC_ENC ,/**< LDPC encode */ +RTE_BBDEV_OP_FFT ,/**< FFT */ RTE_BBDEV_OP_TYPE_PADDED_MAX = 8, /**< Maximum op typenumber including padding */
};lib/bbdev/rte_bbdev_op.h +49
-0@@ -791,6 +873,18 @@ struct rte_bbdev_dec_op { }; }; +/** Structure specifying a single fft operation */ +struct rte_bbdev_fft_op { +/** Status of operation that was performed */ +int status; +/** Mempool which op instance is in */ +struct rte_mempool *mempool; +/** Opaque pointer for user data */ +void *opaque_data; +/** Contains turbo decoder specific parameters */ +struct rte_bbdev_op_fft fft; +}; +/** Operation capabilities supported by a device */ struct rte_bbdev_op_cap {enum rte_bbdev_op_type type;/**< Type of operation */ @@ -799,6 +893,7 @@ struct rte_bbdev_op_cap {struct rte_bbdev_op_cap_turbo_enc turbo_enc;struct rte_bbdev_op_cap_ldpc_dec ldpc_dec;struct rte_bbdev_op_cap_ldpc_enc ldpc_enc; +struct rte_bbdev_op_cap_fft fft; } cap;/**< Operation-type specific capabilities */ };@@ -918,6 +1013,42 @@ struct rte_mempool * }/** +* Bulk allocate fft operations from a mempool with parameter defaults reset. +* +* @param mempool +* Operation mempool, created by rte_bbdev_op_pool_create(). +* @param ops +* Output array to place allocated operations +* @param num_ops +* Number of operations to allocate +* +* @returns +* - 0 on success +* - EINVAL if invalid mempool is provided +*/ +__rte_experimental +static inline int +rte_bbdev_fft_op_alloc_bulk (struct rte_mempool *mempool, +struct rte_bbdev_fft_op **ops,uint16_t num_ops) +{ +struct rte_bbdev_op_pool_private *priv; +int ret; + +/* Check type */ + priv = (struct rte_bbdev_op_pool_private *) +rte_mempool_get_priv (mempool); +if (unlikely (priv->type !=RTE_BBDEV_OP_FFT )) +return -EINVAL ; + +/* Get elements */ + ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); +if (unlikely (ret <0 )) +return ret; + +return 0 ; +} + +/** * Free decode operation structures that were allocated by * rte_bbdev_dec_op_alloc_bulk(). * All structures must belong to the same mempool.
lib/bbdev/rte_bbdev_op.h struct rte_mempool * · line 1088
Quoted 7 lines
lib/bbdev/rte_bbdev_op.h +3
-0@@ -951,6 +1082,24 @@ struct rte_mempool *rte_mempool_put_bulk (ops[0 ]->mempool, (void **)ops, num_ops); } +/** +* Free encode operation structures that were allocated by +* rte_bbdev_fft_op_alloc_bulk().
Use *rte_bbdev_fft_op_alloc_bulk*
Quoted 35 lines
lib/bbdev/rte_bbdev_op.h +15
-0+* All structures must belong to the same mempool. +* +* @param ops +* Operation structures +* @param num_ops +* Number of structures +*/ +__rte_experimental +static inline void +rte_bbdev_fft_op_free_bulk (struct rte_bbdev_fft_op **ops,unsigned int num_ops) +{ +if (num_ops >0 ) +rte_mempool_put_bulk (ops[0 ]->mempool, (void **)ops, num_ops); +} +#ifdef
__cplusplus
}
#endiflib/bbdev/version.map +4
-1@@ -45,4 +45,8 @@ EXPERIMENTAL { # added in 22.11 rte_bbdev_device_status_str; + rte_bbdev_enqueue_fft_ops; + rte_bbdev_dequeue_fft_ops; + rte_bbdev_fft_op_alloc_bulk; + rte_bbdev_fft_op_free_bulk; }; --1.8.3.1
RE: [EXT] [PATCH v7 5/7] bbdev: add new operation for FFT processing
Hi Akhil,
Quoted 118 lines
-----Original Message-----
From: Akhil Goyal <[email protected]>doc/guides/prog_guide/bbdev.rst Figure :numref:`figure_turbo_tb_decode`
Quoted 20 lines
Extension of bbdev operation to support FFT based operations.
Signed-off-by Nicolas Chautru <[email protected]>Acked-by Hemant Agrawal <[email protected]>Acked-by Maxime Coquelin <[email protected]>--- doc/guides/prog_guide/bbdev.rst | 130 +++++++++++++++++++++++++++++++++++ lib/bbdev/rte_bbdev.c | 10 ++- lib/bbdev/rte_bbdev.h | 76 ++++++++++++++++++++ lib/bbdev/rte_bbdev_op.h | 149 ++++++++++++++++++++++++++++++++++++++++ lib/bbdev/version.map | 4 ++ 5 files changed, 368 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/doc/guides/prog_guide/bbdev.rstindex 70fa01a..5dcc7b5 100644doc/guides/prog_guide/bbdev.rst +0
-0@@ -1118,6 +1118,136 @@ Figure :numref:`figure_turbo_tb_decode`above
Quoted 36 lines
showing the Turbo decoding of CBs using BBDEV interface in TB-mode is also valid for LDPC decode.
doc/guides/prog_guide/bbdev.rst +5
-0+BBDEV FFT Operation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This operation allows to run a combination of DFT and/or IDFT and/or +time-domain windowing.
doc/guides/prog_guide/bbdev.rst +2
-0+These can be used in a modular fashion (using bypass modes) or as a +processingpipeline
doc/guides/prog_guide/bbdev.rst +6
-0+which can be used for FFT-based baseband signal processing. +In more details it allows : +- to process the data first through an IDFT of adjustable size and +padding; +- to perform the windowing as a programmable cyclic shift offset of +the datafollowed by a
doc/guides/prog_guide/bbdev.rst +3
-0+pointwise multiplication by a time domain window; +- to process the related data through a DFT of adjustable size and +de-paddingfor each such cyclic
doc/guides/prog_guide/bbdev.rst +4
-0+shift output. + +A flexible number of Rx antennas are being processed in parallel with +the sameconfiguration.
doc/guides/prog_guide/bbdev.rst +2
-0+The API allows more generally for flexibility in what the PMD may +support(capability flags) and
doc/guides/prog_guide/bbdev.rst +4
-0+flexibility to adjust some of the parameters of the processing. + +The operation/capability flags that can be set for each FFT operation +are givenbelow.
doc/guides/prog_guide/bbdev.rst
Quoted 4 lines
doc/guides/prog_guide/bbdev.rst +4
-0+ + **NOTE:** The actual operation flags that may be used with a + specific BBDEV PMD are dependent on the driver capabilities as + reported via ``rte_bbdev_info_get()``, and may be a subset of thosebelow.
Quoted 4 lines
+
++--------------------------------------------------------------------+
+|Description of FFT capability flags |++============================================================
===Quoted 47 lines
=====+
+|RTE_BBDEV_FFT_WINDOWING | +| Set to enable/support windowing in time domain | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_CS_ADJUSTMENT | +| Set to enable/support the cyclic shift time offset adjustment | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_DFT_BYPASS | +| Set to bypass the DFT and use directly the IDFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_IDFT_BYPASS | +| Set to bypass the IDFT and use directly the DFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_WINDOWING_BYPASS | +| Set to bypass the time domain windowing as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_POWER_MEAS | +| Set to provide an optional power measurement of the DFT output | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_INPUT | +| Set if the input data shall use FP16 format instead of INT16 | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_OUTPUT | +| Set if the output data shall use FP16 format instead of INT16 |++--------------------------------------------------------------------+
doc/guides/prog_guide/bbdev.rst +22
-0+ +The structure passed for each FFT operation is given below, with the +operation flags forming a bitmask in the ``op_flags`` field. + +.. code-block:: c + + struct rte_bbdev_op_fft { + struct rte_bbdev_op_data base_input; + struct rte_bbdev_op_data base_output; + struct rte_bbdev_op_data power_meas_output; + uint32_t op_flags; + uint16_t input_sequence_size; + uint16_t input_leading_padding; + uint16_t output_sequence_size; + uint16_t output_leading_depadding; + uint8_t window_index[RTE_BBDEV_MAX_CS_2]; + uint16_t cs_bitmap; + uint8_t num_antennas_log2; + uint8_t idft_log2; + uint8_t dft_log2; + int8_t cs_time_adjustment; + int8_t idft_shift;
Quoted 8 lines
doc/guides/prog_guide/bbdev.rst Figure :numref:`figure_turbo_tb_decode` above · line 1197
Quoted 5 lines
doc/guides/prog_guide/bbdev.rst +5
-0+ int8_t dft_shift; + uint16_t ncs_reciprocal; + uint16_t power_shift; + uint16_t fp16_exp_adjust; + };Why is this codeblock added in this guide? Isn't it covered in the doxygen API doc?
It is but here this detailed in context and with additional details. Note that this is the exact same format being used for all the other existing operations.
Are you okay to keep as is?
Quoted 200 lines
doc/guides/prog_guide/bbdev.rst Figure :numref:`figure_turbo_tb_decode` above
Quoted 5 lines
doc/guides/prog_guide/bbdev.rst +4
-0+ +The FFT parameters are set out in the table below. + ++-------------------------+--------------------------------------------------------------+
Quoted 2 lines
+|Parameter |Description |
++=========================+==================================
===Quoted 3 lines
=========================+
+|base_input |input data |
++-------------------------+--------------------------------------------------------------+
Quoted 2 lines
+|base_output |output data |
++-------------------------+--------------------------------------------------------------+
Quoted 1 line
+|power_meas_output |optional output data with power
measurement on
Quoted 2 lines
DFT output |
++-------------------------+--------------------------------------------------------------+
Quoted 2 lines
+|op_flags |bitmask of all active operation capabilities |
++-------------------------+--------------------------------------------------------------+
Quoted 3 lines
+|input_sequence_size |size of the input sequence in 32-bits points per
antenna |
++-------------------------+--------------------------------------------------------------+
Quoted 1 line
+|input_leading_padding |number of points padded at the start of input
data
Quoted 2 lines
|
++-------------------------+--------------------------------------------------------------+
Quoted 1 line
+|output_sequence_size |size of the output sequence per antenna and
cyclic
Quoted 2 lines
shift |
++-------------------------+--------------------------------------------------------------+
Quoted 3 lines
+|output_leading_depadding |number of points de-padded at the start of
output data |
++-------------------------+--------------------------------------------------------------+
Quoted 1 line
+|window_index |optional windowing profile index used for each
cyclic
Quoted 2 lines
shift |
++-------------------------+--------------------------------------------------------------+
Quoted 1 line
+|cs_bitmap |bitmap of the cyclic shift output requested (LSB for
index
Quoted 2 lines
0) |
++-------------------------+--------------------------------------------------------------+
Quoted 1 line
+|num_antennas_log2 |number of antennas as a log2 (10 maps to
1024...)
Quoted 2 lines
|
++-------------------------+--------------------------------------------------------------+
Quoted 2 lines
+|idft_log2 |iDFT size as a log2 |
++-------------------------+--------------------------------------------------------------+
Quoted 2 lines
+|dft_log2 |DFT size as a log2 |
++-------------------------+--------------------------------------------------------------+
Quoted 1 line
+|cs_time_adjustment |adjustment of time position of all the cyclic
shift
Quoted 2 lines
output |
++-------------------------+--------------------------------------------------------------+
Quoted 2 lines
+|idft_shift |shift down of signal level post iDFT |
++-------------------------+--------------------------------------------------------------+
Quoted 2 lines
+|dft_shift |shift down of signal level post DFT |
++-------------------------+--------------------------------------------------------------+
Quoted 1 line
+|ncs_reciprocal |inverse of max number of CS normalized to 15b (ie.
231
Quoted 2 lines
for 12)|
++-------------------------+--------------------------------------------------------------+
Quoted 1 line
+|power_shift |shift down of level of power measurement when
enabled
Quoted 2 lines
|
++-------------------------+--------------------------------------------------------------+
Quoted 3 lines
+|fp16_exp_adjust |value added to FP16 exponent at conversion from
INT16 |
++-------------------------+--------------------------------------------------------------+
Quoted 31 lines
doc/guides/prog_guide/bbdev.rst +4
-0+ +The mbuf input ``base_input`` is mandatory for all BBDEV PMDs and is +the incoming data for the processing. Its size may not fit into an +actual mbuf, butthe
doc/guides/prog_guide/bbdev.rst +3
-0+structure is used to pass iova address. +The mbuf output ``output`` is mandatory and is output of the FFT +processingchain.
doc/guides/prog_guide/bbdev.rst +2
-0+Each point is a complex number of 32bits : either as 2 INT16 or as 2 +FP16 basedwhen the option
doc/guides/prog_guide/bbdev.rst +3
-0+supported. +The data layout is based on contiguous concatenation of output data +first bycyclic shift then
doc/guides/prog_guide/bbdev.rst +1
-0+by antenna. Sample code -----------lib/bbdev/rte_bbdev.c index renamed from lib/bbdev/rte_bbdev.c +0
-038630a2..9d65ba8 100644
lib/bbdev/rte_bbdev.c +0
-0@@ -24,7 +24,7 @@#define DEV_NAME "BBDEV" /* Number of supported operation types */ -#define
BBDEV_OP_TYPE_COUNT5
+#defineBBDEV_OP_TYPE_COUNT6Quoted 2 lines
/* BBDev library logging ID */
RTE_LOG_REGISTER_DEFAULT(bbdev_logtype, NOTICE); @@ -852,6+852,9 @@
lib/bbdev/rte_bbdev.h typedef uint16_t
Quoted 34 lines
struct
rte_bbdev*lib/bbdev/rte_bbdev.c +8
-0case RTE_BBDEV_OP_LDPC_ENC : result =sizeof (struct rte_bbdev_enc_op );break ; +case RTE_BBDEV_OP_FFT : + result =sizeof (struct rte_bbdev_fft_op ); +break ;default :break ; }@@ -875,6 +878,10 @@ struct rte_bbdev *struct rte_bbdev_enc_op *op = element;memset (op,0 , mempool->elt_size); op->mempool = mempool; + }else if (type ==RTE_BBDEV_OP_FFT ) { +struct rte_bbdev_fft_op *op = element; +memset (op,0 , mempool->elt_size); + op->mempool = mempool; } }@@ -1125,6 +1132,7 @@ struct rte_mempool *"RTE_BBDEV_OP_TURBO_ENC" ,"RTE_BBDEV_OP_LDPC_DEC" ,"RTE_BBDEV_OP_LDPC_ENC" , + "RTE_BBDEV_OP_FFT", };if (op_type <BBDEV_OP_TYPE_COUNT )lib/bbdev/rte_bbdev.h index renamed from lib/bbdev/rte_bbdev.h +0
-0ac941d6..ed528b8 100644
lib/bbdev/rte_bbdev.h +0
-0@@ -401,6 +401,12 @@ typedef uint16_t(*rte_bbdev_enqueue_dec_ops_t)(
Quoted 10 lines
lib/bbdev/rte_bbdev.h +6
-0struct rte_bbdev_dec_op **ops, uint16_t num); +/** @internal Enqueue fft operations for processing on queue of a +device. */ typedef uint16_t (*rte_bbdev_enqueue_fft_ops_t )( +struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_fft_op **ops, +uint16_t num); +/** @internal Dequeue encode operations from a queue of a device. */ Quoted 2 lines
typedef
uint16_t(*rte_bbdev_dequeue_enc_ops_t)(
structrte_bbdev_queue_data*q_data, @@ -411,6 +417,11@@ typedef
lib/bbdev/rte_bbdev.h typedef uint16_t (*rte_bbdev_dequeue_dec_ops_t)(
Quoted 10 lines
uint16_t(*rte_bbdev_dequeue_dec_ops_t)(lib/bbdev/rte_bbdev.h +5
-0struct rte_bbdev_queue_data *q_data, struct rte_bbdev_dec_op **ops, uint16_t num); +/** @internal Dequeue fft operations from a queue of a device. */ +typedef uint16_t (*rte_bbdev_dequeue_fft_ops_t )( +struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_fft_op **ops,uint16_t num); +#define RTE_BBDEV_NAME_MAX_LEN 64/**< Max length of device name */
lib/bbdev/rte_bbdev.h struct __rte_cache_aligned rte_bbdev { · line 477
Quoted 11 lines
/**
lib/bbdev/rte_bbdev.h +4
-0@@ -459,6 +470,10 @@ struct __rte_cache_aligned rte_bbdev {rte_bbdev_dequeue_enc_ops_t dequeue_ldpc_enc_ops;/** Dequeue decode function */ rte_bbdev_dequeue_dec_ops_t dequeue_ldpc_dec_ops; +/** Enqueue FFT function */ +rte_bbdev_enqueue_fft_ops_t enqueue_fft_ops; +/** Dequeue FFT function */ +rte_bbdev_dequeue_fft_ops_t dequeue_fft_ops;const struct rte_bbdev_ops *dev_ops;/**< Functions exported by PMD
Quoted 6 lines
lib/bbdev/rte_bbdev.h +0
-0*/ struct rte_bbdev_data *data;/**< Pointer to device data */ enum
rte_bbdev_statestate; /**< If device is currently used or not
*/ @@ -591,6 +606,36 @@ struct__rte_cache_alignedrte_bbdev{
returndev->enqueue_ldpc_dec_ops(q_data, ops, num_ops); }
Quoted 5 lines
Quoted 2 lines
+/**
+ * Enqueue a burst of fft operations to a queue of the device.Please be consistent of using fft or FFT in comments. It should be FFT always in comments.
Thanks, fixing in v8.
Quoted 270 lines
Quoted 29 lines
+ * This functions only enqueues as many operations as currently
+ possible and
+ * does not block until @pnum_opsentries in the queue are available.
+ * This function does not provide any error notification to avoid the
+ * corresponding overhead.
+ *
+ * @paramdev_id
+ * The identifier of the device.
+ * @paramqueue_id
+ * The index of the queue.
+ * @param ops
+ * Pointer array containing operations to be enqueued Must have at least
+ * @pnum_opsentries
+ * @paramnum_ops
+ * The maximum number of operations to enqueue.
+ *
+ * @return
+ * The number of operations actually enqueued (this is the number of
processed
+ * entries in the @p ops array).
+ */lib/bbdev/rte_bbdev.h +6
-0+__rte_experimental +static inline uint16_t +rte_bbdev_enqueue_fft_ops (uint16_t dev_id,uint16_t queue_id, +struct rte_bbdev_fft_op **ops,uint16_t num_ops) { +struct rte_bbdev *dev = &rte_bbdev_devices[dev_id]; + struct rte_bbdev_queue_data *q_data = &dev->data-Quoted 1 line
queues[queue_id];
lib/bbdev/rte_bbdev.h
Quoted 4 lines
lib/bbdev/rte_bbdev.h +1
-0+return dev->enqueue_fft_ops (q_data, ops, num_ops); }/** * Dequeue a burst of processed encode operations from a queue of the device.
Quoted 7 lines
lib/bbdev/rte_bbdev.h +4
-0@@ -716,6 +761,37 @@ struct __rte_cache_aligned rte_bbdev {return dev->dequeue_ldpc_dec_ops (q_data, ops, num_ops); } +/** +* Dequeue a burst of fft operations from a queue of the device. +* This functions returns only the current contents of the queue, and +does not lib/bbdev/rte_bbdev.h struct __rte_cache_aligned rte_bbdev { · line 776
Quoted 10 lines
lib/bbdev/rte_bbdev.h +10
-0+* block until @ num_ops is available. +* This function does not provide any error notification to avoid the +* corresponding overhead. +* +* @param dev_id +* The identifier of the device. +* @param queue_id +* The index of the queue. +* @param ops +* Pointer array where operations will be dequeued to. Must have at least
lib/bbdev/rte_bbdev.h struct __rte_cache_aligned rte_bbdev {
Quoted 6 lines
lib/bbdev/rte_bbdev.h +6
-0+* @p num_ops entries +* @param num_ops +* The maximum number of operations to dequeue. +* +* @return +* The number of operations actually dequeued (this is the number of entries
lib/bbdev/rte_bbdev.h struct __rte_cache_aligned rte_bbdev {
Quoted 13 lines
lib/bbdev/rte_bbdev.h +10
-0+* copied into the @p ops array). +*/ +__rte_experimental +static inline uint16_t +rte_bbdev_dequeue_fft_ops (uint16_t dev_id,uint16_t queue_id, +struct rte_bbdev_fft_op **ops,uint16_t num_ops) { +struct rte_bbdev *dev = &rte_bbdev_devices[dev_id]; +struct rte_bbdev_queue_data *q_data = &dev->data- >queues[queue_id]; +return dev->dequeue_fft_ops (q_data, ops, num_ops); } +/** Definitions of device event types */ enum rte_bbdev_event_type { RTE_BBDEV_EVENT_UNKNOWN, /**< unknown event type */ diff --git
Quoted 94 lines
a/lib/bbdev/rte_bbdev_op.hb/lib/bbdev/rte_bbdev_op.hindex cd82418..afa1a71 100644lib/bbdev/rte_bbdev_op.h +2
-0@@ -47,6 +47,8 @@#define RTE_BBDEV_TURBO_MAX_CODE_BLOCKS (64)/* LDPC: Maximum number of Code Blocks in Transport Block.*/ #define RTE_BBDEV_LDPC_MAX_CODE_BLOCKS (256) +/* 12 CS maximum */ +#define RTE_BBDEV_MAX_CS_2 (6)/** Flags for turbo decoder operation and capability structure */ enum
rte_bbdev_op_td_flag_bitmasks{ @@ -211,6 +213,26 @@ enumrte_bbdev_op_ldpcenc_flag_bitmasks{lib/bbdev/rte_bbdev_op.h +19
-0RTE_BBDEV_LDPC_ENC_CONCATENATION = (1ULL << 7) }; +/** Flags for DFT operation and capability structure */ enum +rte_bbdev_op_fft_flag_bitmasks { +/** Flexible windowing capability */ +RTE_BBDEV_FFT_WINDOWING = (1ULL <<0 ), +/** Flexible adjustment of Cyclic Shift time offset */ +RTE_BBDEV_FFT_CS_ADJUSTMENT = (1ULL <<1 ), +/** Set for bypass the DFT and get directly into iDFT input */ +RTE_BBDEV_FFT_DFT_BYPASS = (1ULL <<2 ), +/** Set for bypass the IDFT and get directly the DFT output */ +RTE_BBDEV_FFT_IDFT_BYPASS = (1ULL <<3 ), +/** Set for bypass time domain windowing */ +RTE_BBDEV_FFT_WINDOWING_BYPASS = (1ULL <<4 ), +/** Set for optional power measurement on DFT output */ +RTE_BBDEV_FFT_POWER_MEAS = (1ULL <<5 ), +/** Set if the input data used FP16 format */ +RTE_BBDEV_FFT_FP16_INPUT = (1ULL <<6 ), +/** Set if the output data uses FP16 format */ +RTE_BBDEV_FFT_FP16_OUTPUT = (1ULL <<7 ) }; + /** Flags for the Code Block/Transport block mode */ enum
rte_bbdev_op_cb_mode{lib/bbdev/rte_bbdev_op.h +51
-1/** One operation is one or fraction of one transport block */ @@ -689,6 +711,55 @@ struct rte_bbdev_op_ldpc_enc { }; }; +/** Operation structure for FFT processing. +* +* The operation processes the data for multiple antennas in a single +call +* (.i.e for all the REs belonging to a given SRS sequence for +instance) +* +* The output mbuf data structure is expected to be allocated by the +* application with enough room for the output data. +*/ +struct rte_bbdev_op_fft { +/** Input data starting from first antenna */ +struct rte_bbdev_op_data base_input; +/** Output data starting from first antenna and first cyclic shift */ +struct rte_bbdev_op_data base_output; +/** Optional power measurement output data */ +struct rte_bbdev_op_data power_meas_output; +/** Flags from rte_bbdev_op_fft_flag_bitmasks */ +uint32_t op_flags; +/** Input sequence size in 32-bits points */ +uint16_t input_sequence_size; +/** Padding at the start of the sequence */ +uint16_t input_leading_padding; +/** Output sequence size in 32-bits points */ +uint16_t output_sequence_size; +/** Depadding at the start of the DFT output */ +uint16_t output_leading_depadding; +/** Window index being used for each cyclic shift output */ +uint8_t window_index[RTE_BBDEV_MAX_CS_2 ]; +/** Bitmap of the cyclic shift output requested */ +uint16_t cs_bitmap; +/** Number of antennas as a log2 – 8 to 128 */ +uint8_t num_antennas_log2; +/** iDFT size as a log2 - 32 to 2048 */ +uint8_t idft_log2; +/** DFT size as a log2 - 8 to 2048 */ +uint8_t dft_log2; +/** Adjustment of position of the cyclic shifts - -31 to 31 */ +int8_t cs_time_adjustment; +/** iDFT shift down */ +int8_t idft_shift; +/** DFT shift down */ +int8_t dft_shift; +/** NCS reciprocal factor */ +uint16_t ncs_reciprocal; +/** power measurement out shift down */ +uint16_t power_shift; +/** Adjust the FP6 exponent for INT<->FP16 conversion */ +uint16_t fp16_exp_adjust; +}; + /** List of the capabilities for the Turbo Decoder */ structQuoted 2 lines
rte_bbdev_op_cap_turbo_dec{
/** Flags fromrte_bbdev_op_td_flag_bitmasks*/ @@ -741,6+812,16 @@
Quoted 15 lines
struct
rte_bbdev_op_cap_ldpc_enc{lib/bbdev/rte_bbdev_op.h +10
-0uint16_t num_buffers_dst; }; +/** List of the capabilities for the FFT */ struct +rte_bbdev_op_cap_fft { +/** Flags from rte_bbdev_op_fft_flag_bitmasks */ +uint32_t capability_flags; +/** Num input code block buffers */ +uint16_t num_buffers_src; +/** Num output code block buffers */ +uint16_t num_buffers_dst; +}; + /** Different operation types supported by the device */ enumQuoted 2 lines
rte_bbdev_op_type{
RTE_BBDEV_OP_NONE, /**< Dummy operation that does nothing*/ @@
lib/bbdev/rte_bbdev_op.h enum rte_bbdev_op_type {
Quoted 6 lines
-748,6 +829,7 @@ enum
rte_bbdev_op_type{lib/bbdev/rte_bbdev_op.h +1
-0RTE_BBDEV_OP_TURBO_ENC ,/**< Turbo encode */ RTE_BBDEV_OP_LDPC_DEC ,/**< LDPC decode */ RTE_BBDEV_OP_LDPC_ENC ,/**< LDPC encode */ +RTE_BBDEV_OP_FFT ,/**< FFT */ RTE_BBDEV_OP_TYPE_PADDED_MAX = 8, /**< Maximum op typenumber
Quoted 11 lines
including padding */ };
lib/bbdev/rte_bbdev_op.h +5
-0@@ -791,6 +873,18 @@ struct rte_bbdev_dec_op { }; }; +/** Structure specifying a single fft operation */ struct +rte_bbdev_fft_op { +/** Status of operation that was performed */ +int status; +/** Mempool which op instance is in */ lib/bbdev/rte_bbdev_op.h struct rte_bbdev_dec_op { · line 890
Quoted 10 lines
lib/bbdev/rte_bbdev_op.h +7
-0+struct rte_mempool *mempool; +/** Opaque pointer for user data */ +void *opaque_data; +/** Contains turbo decoder specific parameters */ +struct rte_bbdev_op_fft fft; +}; +/** Operation capabilities supported by a device */ struct rte_bbdev_op_cap { enum rte_bbdev_op_type type; /**< Type of operation */ @@ -799,6
lib/bbdev/rte_bbdev_op.h struct rte_mempool * } · line 1015
Quoted 11 lines
+893,7 @@ struct
rte_bbdev_op_cap{lib/bbdev/rte_bbdev_op.h +2
-0struct rte_bbdev_op_cap_turbo_enc turbo_enc;struct rte_bbdev_op_cap_ldpc_dec ldpc_dec;struct rte_bbdev_op_cap_ldpc_enc ldpc_enc; +struct rte_bbdev_op_cap_fft fft; } cap;/**< Operation-type specific capabilities */ };@@ -918,6 +1013,42 @@ struct rte_mempool * }/** +* Bulk allocate fft operations from a mempool with parameter defaults reset.
Quoted 38 lines
lib/bbdev/rte_bbdev_op.h +34
-0+* +* @param mempool +* Operation mempool, created by rte_bbdev_op_pool_create(). +* @param ops +* Output array to place allocated operations +* @param num_ops +* Number of operations to allocate +* +* @returns +* - 0 on success +* - EINVAL if invalid mempool is provided +*/ +__rte_experimental +static inline int +rte_bbdev_fft_op_alloc_bulk (struct rte_mempool *mempool, +struct rte_bbdev_fft_op **ops,uint16_t num_ops) { +struct rte_bbdev_op_pool_private *priv; +int ret; + +/* Check type */ + priv = (struct rte_bbdev_op_pool_private *) +rte_mempool_get_priv (mempool); +if (unlikely (priv->type !=RTE_BBDEV_OP_FFT )) +return -EINVAL ; + +/* Get elements */ + ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); +if (unlikely (ret <0 )) +return ret; + +return 0 ; +} + +/** * Free decode operation structures that were allocated by * rte_bbdev_dec_op_alloc_bulk(). * All structures must belong to the same mempool. lib/bbdev/rte_bbdev_op.h struct rte_mempool * · line 1082
Quoted 1 line
lib/bbdev/rte_bbdev_op.h +0
-0@@ -951,6 +1082,24 @@ struct rte_mempool * rte_mempool_put_bulk(ops[0]->mempool, (void **)ops,
num_ops); }Quoted 1 line
Quoted 5 lines
Quoted 3 lines
+/**
+ * Free encode operation structures that were allocated by
+ *rte_bbdev_fft_op_alloc_bulk().Use *rte_bbdev_fft_op_alloc_bulk*
Thanks, fixing now in v8
Quoted 37 lines
Quoted 37 lines
+ * All structures must belong to the same mempool.
+ *
+ * @param ops
+ * Operation structures
+ * @paramnum_ops
+ * Number of structures
+ */lib/bbdev/rte_bbdev_op.h +4
-0+__rte_experimental +static inline void +rte_bbdev_fft_op_free_bulk (struct rte_bbdev_fft_op **ops,unsigned +int
num_ops)lib/bbdev/rte_bbdev_op.h +3
-0+{ +if (num_ops >0 ) + rte_mempool_put_bulk(ops[0]->mempool, (void **)ops,
num_ops);lib/bbdev/rte_bbdev_op.h +2
-0+} + #ifdef __cplusplus }#endif lib/bbdev/version.map index renamed from lib/bbdev/version.map +0
-0f0a072e..0cbeab3 100644
lib/bbdev/version.map +4
-1@@ -45,4 +45,8 @@ EXPERIMENTAL { # added in 22.11 rte_bbdev_device_status_str; + rte_bbdev_enqueue_fft_ops; + rte_bbdev_dequeue_fft_ops; + rte_bbdev_fft_op_alloc_bulk; + rte_bbdev_fft_op_free_bulk; }; --1.8.3.1
RE: [EXT] [PATCH v7 5/7] bbdev: add new operation for FFT processing
Quoted 129 lines
Hi Akhil,
Quoted 118 lines
-----Original Message-----
From: Akhil Goyal <[email protected]>doc/guides/prog_guide/bbdev.rst Figure :numref:`figure_turbo_tb_decode`
Quoted 20 lines
Extension of bbdev operation to support FFT based operations.
Signed-off-by Nicolas Chautru <[email protected]>Acked-by Hemant Agrawal <[email protected]>Acked-by Maxime Coquelin <[email protected]>--- doc/guides/prog_guide/bbdev.rst | 130 +++++++++++++++++++++++++++++++++++ lib/bbdev/rte_bbdev.c | 10 ++- lib/bbdev/rte_bbdev.h | 76 ++++++++++++++++++++ lib/bbdev/rte_bbdev_op.h | 149 ++++++++++++++++++++++++++++++++++++++++ lib/bbdev/version.map | 4 ++ 5 files changed, 368 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/doc/guides/prog_guide/bbdev.rstindex 70fa01a..5dcc7b5 100644doc/guides/prog_guide/bbdev.rst +0
-0@@ -1118,6 +1118,136 @@ Figure :numref:`figure_turbo_tb_decode`above
Quoted 36 lines
showing the Turbo decoding of CBs using BBDEV interface in TB-mode is also valid for LDPC decode.
doc/guides/prog_guide/bbdev.rst +5
-0+BBDEV FFT Operation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This operation allows to run a combination of DFT and/or IDFT and/or +time-domain windowing.
doc/guides/prog_guide/bbdev.rst +2
-0+These can be used in a modular fashion (using bypass modes) or as a +processingpipeline
doc/guides/prog_guide/bbdev.rst +6
-0+which can be used for FFT-based baseband signal processing. +In more details it allows : +- to process the data first through an IDFT of adjustable size and +padding; +- to perform the windowing as a programmable cyclic shift offset of +the datafollowed by a
doc/guides/prog_guide/bbdev.rst +3
-0+pointwise multiplication by a time domain window; +- to process the related data through a DFT of adjustable size and +de-paddingfor each such cyclic
doc/guides/prog_guide/bbdev.rst +4
-0+shift output. + +A flexible number of Rx antennas are being processed in parallel with +the sameconfiguration.
doc/guides/prog_guide/bbdev.rst +2
-0+The API allows more generally for flexibility in what the PMD may +support(capability flags) and
doc/guides/prog_guide/bbdev.rst +4
-0+flexibility to adjust some of the parameters of the processing. + +The operation/capability flags that can be set for each FFT operation +are givenbelow.
doc/guides/prog_guide/bbdev.rst
Quoted 4 lines
doc/guides/prog_guide/bbdev.rst +4
-0+ + **NOTE:** The actual operation flags that may be used with a + specific BBDEV PMD are dependent on the driver capabilities as + reported via ``rte_bbdev_info_get()``, and may be a subset of thosebelow.
Quoted 4 lines
+
++--------------------------------------------------------------------+
+|Description of FFT capability flags |++============================================================
===Quoted 47 lines
=====+
+|RTE_BBDEV_FFT_WINDOWING | +| Set to enable/support windowing in time domain | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_CS_ADJUSTMENT | +| Set to enable/support the cyclic shift time offset adjustment | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_DFT_BYPASS | +| Set to bypass the DFT and use directly the IDFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_IDFT_BYPASS | +| Set to bypass the IDFT and use directly the DFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_WINDOWING_BYPASS | +| Set to bypass the time domain windowing as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_POWER_MEAS | +| Set to provide an optional power measurement of the DFT output | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_INPUT | +| Set if the input data shall use FP16 format instead of INT16 | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_OUTPUT | +| Set if the output data shall use FP16 format instead of INT16 |++--------------------------------------------------------------------+
doc/guides/prog_guide/bbdev.rst +22
-0+ +The structure passed for each FFT operation is given below, with the +operation flags forming a bitmask in the ``op_flags`` field. + +.. code-block:: c + + struct rte_bbdev_op_fft { + struct rte_bbdev_op_data base_input; + struct rte_bbdev_op_data base_output; + struct rte_bbdev_op_data power_meas_output; + uint32_t op_flags; + uint16_t input_sequence_size; + uint16_t input_leading_padding; + uint16_t output_sequence_size; + uint16_t output_leading_depadding; + uint8_t window_index[RTE_BBDEV_MAX_CS_2]; + uint16_t cs_bitmap; + uint8_t num_antennas_log2; + uint8_t idft_log2; + uint8_t dft_log2; + int8_t cs_time_adjustment; + int8_t idft_shift;Quoted 8 lines
doc/guides/prog_guide/bbdev.rst Figure :numref:`figure_turbo_tb_decode` above · line 1197
Quoted 5 lines
doc/guides/prog_guide/bbdev.rst +5
-0+ int8_t dft_shift; + uint16_t ncs_reciprocal; + uint16_t power_shift; + uint16_t fp16_exp_adjust; + };Why is this codeblock added in this guide? Isn't it covered in the doxygen API doc?
Quoted 4 lines
It is but here this detailed in context and with additional details. Note that this is the
exact same format being used for all the other existing operations.
Are you okay to keep as is?
I would suggest to remove it and others as well. I think we can add more info In the API guide if needed.
Otherwise it will be difficult to maintain/track in future for any changes that are done in these structs.
RE: [EXT] [PATCH v7 5/7] bbdev: add new operation for FFT processing
Hi Akhil,
Quoted 150 lines
-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Thursday, September 22, 2022 7:20 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Richardson, Bruce <[email protected]>; [email protected]; [email protected]; Zhang, Mingshan <[email protected]>
Subject: RE: [EXT] [PATCH v7 5/7] bbdev: add new operation for FFT processingQuoted 74 lines
Hi Akhil,
Quoted 72 lines
-----Original Message-----
From: Akhil Goyal <[email protected]>doc/guides/prog_guide/bbdev.rst Figure :numref:`figure_turbo_tb_decode`
Quoted 20 lines
Extension of bbdev operation to support FFT based operations.
Signed-off-by Nicolas Chautru <[email protected]>Acked-by Hemant Agrawal <[email protected]>Acked-by Maxime Coquelin <[email protected]>--- doc/guides/prog_guide/bbdev.rst | 130 +++++++++++++++++++++++++++++++++++ lib/bbdev/rte_bbdev.c | 10 ++- lib/bbdev/rte_bbdev.h | 76 ++++++++++++++++++++ lib/bbdev/rte_bbdev_op.h | 149 ++++++++++++++++++++++++++++++++++++++++ lib/bbdev/version.map | 4 ++ 5 files changed, 368 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/doc/guides/prog_guide/bbdev.rstindex 70fa01a..5dcc7b5 100644doc/guides/prog_guide/bbdev.rst +0
-0@@ -1118,6 +1118,136 @@ Figure :numref:`figure_turbo_tb_decode`above
Quoted 37 lines
showing the Turbo decoding of CBs using BBDEV interface in TB-mode is also valid for LDPC decode.
doc/guides/prog_guide/bbdev.rst +6
-0+BBDEV FFT Operation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This operation allows to run a combination of DFT and/or IDFT +and/or +time-domain windowing.
doc/guides/prog_guide/bbdev.rst +2
-0+These can be used in a modular fashion (using bypass modes) or as +a processingpipeline
doc/guides/prog_guide/bbdev.rst +6
-0+which can be used for FFT-based baseband signal processing. +In more details it allows : +- to process the data first through an IDFT of adjustable size +and padding; +- to perform the windowing as a programmable cyclic shift offset +of the datafollowed by a
doc/guides/prog_guide/bbdev.rst +3
-0+pointwise multiplication by a time domain window; +- to process the related data through a DFT of adjustable size +and de-paddingfor each such cyclic
doc/guides/prog_guide/bbdev.rst +4
-0+shift output. + +A flexible number of Rx antennas are being processed in parallel +with the sameconfiguration.
doc/guides/prog_guide/bbdev.rst +2
-0+The API allows more generally for flexibility in what the PMD may +support(capability flags) and
doc/guides/prog_guide/bbdev.rst +4
-0+flexibility to adjust some of the parameters of the processing. + +The operation/capability flags that can be set for each FFT +operation are givenbelow.
doc/guides/prog_guide/bbdev.rst
Quoted 5 lines
doc/guides/prog_guide/bbdev.rst +5
-0+ + **NOTE:** The actual operation flags that may be used with a + specific BBDEV PMD are dependent on the driver capabilities as + reported via ``rte_bbdev_info_get()``, and may be a subset of + thosebelow.
Quoted 4 lines
+
++--------------------------------------------------------------------+
+|Description of FFT capability flags |++============================================================
Quoted 11 lines
Quoted 11 lines
===
Quoted 10 lines
=====+
+|RTE_BBDEV_FFT_WINDOWING | +| Set to enable/support windowing in time domain | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_CS_ADJUSTMENT | +| Set to enable/support the cyclic shift time offset adjustment | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_DFT_BYPASS | +| Set to bypass the DFT and use directly the IDFT as an option |++--------------------------------------------------------------------+
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
+|RTE_BBDEV_FFT_IDFT_BYPASS | +| Set to bypass the IDFT and use directly the DFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_WINDOWING_BYPASS | +| Set to bypass the time domain windowing as an option |++--------------------------------------------------------------------+
+|RTE_BBDEV_FFT_POWER_MEAS |
+| Set to provide an optional power measurement of the DFT output|
Quoted 38 lines
Quoted 29 lines
Quoted 29 lines
++--------------------------------------------------------------------+
+|RTE_BBDEV_FFT_FP16_INPUT | +| Set if the input data shall use FP16 format instead of INT16 | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_OUTPUT | +| Set if the output data shall use FP16 format instead of INT16 |++--------------------------------------------------------------------+
doc/guides/prog_guide/bbdev.rst +22
-0+ +The structure passed for each FFT operation is given below, with +the operation flags forming a bitmask in the ``op_flags`` field. + +.. code-block:: c + + struct rte_bbdev_op_fft { + struct rte_bbdev_op_data base_input; + struct rte_bbdev_op_data base_output; + struct rte_bbdev_op_data power_meas_output; + uint32_t op_flags; + uint16_t input_sequence_size; + uint16_t input_leading_padding; + uint16_t output_sequence_size; + uint16_t output_leading_depadding; + uint8_t window_index[RTE_BBDEV_MAX_CS_2]; + uint16_t cs_bitmap; + uint8_t num_antennas_log2; + uint8_t idft_log2; + uint8_t dft_log2; + int8_t cs_time_adjustment; + int8_t idft_shift;Quoted 8 lines
doc/guides/prog_guide/bbdev.rst Figure :numref:`figure_turbo_tb_decode` above · line 1197
Quoted 5 lines
doc/guides/prog_guide/bbdev.rst +5
-0+ int8_t dft_shift; + uint16_t ncs_reciprocal; + uint16_t power_shift; + uint16_t fp16_exp_adjust; + };Why is this codeblock added in this guide? Isn't it covered in the doxygen API doc?
Quoted 4 lines
It is but here this detailed in context and with additional details. Note that this is the exact same format being used for all the other existing operations.
Are you okay to keep as is?
Quoted 4 lines
I would suggest to remove it and others as well. I think we can add more info In the API guide if needed.
Otherwise it will be difficult to maintain/track in future for any changes that are done in these structs.
Do we really want to do this now?
That documentation is tightly tied with the API, so the doc would always have to be updated when the API structure is modified.
If you read this through most of the documentation would become barely readable without direct pointer to the relevant structure and related parameters (not just for FFT but also for the existing operations). I see also some code snippets insertions for other parallel documentation when relevant.
I can see your point about avoid duplicates but in that very case it is arguably sensible to be readable and would personally not change it in so far as I am concerned.
Are you okay to keep current documentation flow for now as is, and we can look into improving/updating documentation as a future item based on agreed guidance?
Thanks
Nic
RE: [EXT] [PATCH v7 5/7] bbdev: add new operation for FFT processing
Hi Nicolas,
Quoted 52 lines
Quoted 35 lines
Quoted 30 lines
Quoted 21 lines
Quoted 21 lines
doc/guides/prog_guide/bbdev.rst +21
-0+The structure passed for each FFT operation is given below, with +the operation flags forming a bitmask in the ``op_flags`` field. + +.. code-block:: c + + struct rte_bbdev_op_fft { + struct rte_bbdev_op_data base_input; + struct rte_bbdev_op_data base_output; + struct rte_bbdev_op_data power_meas_output; + uint32_t op_flags; + uint16_t input_sequence_size; + uint16_t input_leading_padding; + uint16_t output_sequence_size; + uint16_t output_leading_depadding; + uint8_t window_index[RTE_BBDEV_MAX_CS_2]; + uint16_t cs_bitmap; + uint8_t num_antennas_log2; + uint8_t idft_log2; + uint8_t dft_log2; + int8_t cs_time_adjustment; + int8_t idft_shift;Quoted 8 lines
doc/guides/prog_guide/bbdev.rst Figure :numref:`figure_turbo_tb_decode` above · line 1197
Quoted 5 lines
doc/guides/prog_guide/bbdev.rst +5
-0+ int8_t dft_shift; + uint16_t ncs_reciprocal; + uint16_t power_shift; + uint16_t fp16_exp_adjust; + };Why is this codeblock added in this guide? Isn't it covered in the doxygen API doc?
Quoted 4 lines
It is but here this detailed in context and with additional details. Note that this is the exact same format being used for all the other existing operations.
Are you okay to keep as is?Quoted 4 lines
I would suggest to remove it and others as well. I think we can add more info In the API guide if needed.
Otherwise it will be difficult to maintain/track in future for any changes that are done in these structs.Do we really want to do this now?
That documentation is tightly tied with the API, so the doc would always have to be updated when the API structure is modified.
If you read this through most of the documentation would become barely readable without direct pointer to the relevant structure and related parameters (not just for FFT but also for the existing operations).
I see also some code snippets insertions for other parallel documentation when relevant.
I can see your point about avoid duplicates but in that very case it is arguably sensible to be readable and would personally not change it in so far as I am concerned.
Quoted 4 lines
Are you okay to keep current documentation flow for now as is, and we can look into improving/updating documentation as a future item based on agreed guidance?
The maintenance of this documentation is difficult in longer run.
It will be unnecessary burden for the developer to sync both code and documentation.
We have seen this thing in past that people tend to forget about updating documentation. And we are trying to remove unnecessary code snippets from the documentation. We should not add new such code in documentation.
I would say remove this one from this patch. And you can submit a patch later to remove the rest.
Regards,
Akhil
RE: [EXT] [PATCH v7 5/7] bbdev: add new operation for FFT processing
Hi Akhil,
Quoted 73 lines
-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Thursday, September 22, 2022 9:49 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Richardson, Bruce <[email protected]>; [email protected]; [email protected]; Zhang, Mingshan <[email protected]>
Subject: RE: [EXT] [PATCH v7 5/7] bbdev: add new operation for FFT processingHi Nicolas,
Quoted 52 lines
Quoted 35 lines
Quoted 30 lines
Quoted 21 lines
Quoted 21 lines
doc/guides/prog_guide/bbdev.rst +21
-0+The structure passed for each FFT operation is given below, +with the operation flags forming a bitmask in the ``op_flags`` field. + +.. code-block:: c + + struct rte_bbdev_op_fft { + struct rte_bbdev_op_data base_input; + struct rte_bbdev_op_data base_output; + struct rte_bbdev_op_data power_meas_output; + uint32_t op_flags; + uint16_t input_sequence_size; + uint16_t input_leading_padding; + uint16_t output_sequence_size; + uint16_t output_leading_depadding; + uint8_t window_index[RTE_BBDEV_MAX_CS_2]; + uint16_t cs_bitmap; + uint8_t num_antennas_log2; + uint8_t idft_log2; + uint8_t dft_log2; + int8_t cs_time_adjustment; + int8_t idft_shift;Quoted 8 lines
doc/guides/prog_guide/bbdev.rst Figure :numref:`figure_turbo_tb_decode` above · line 1197
Quoted 5 lines
doc/guides/prog_guide/bbdev.rst +5
-0+ int8_t dft_shift; + uint16_t ncs_reciprocal; + uint16_t power_shift; + uint16_t fp16_exp_adjust; + };Why is this codeblock added in this guide? Isn't it covered in the doxygen API doc?
Quoted 4 lines
It is but here this detailed in context and with additional details. Note that this is the exact same format being used for all the other existing operations.
Are you okay to keep as is?Quoted 4 lines
I would suggest to remove it and others as well. I think we can add more info In the API guide if needed.
Otherwise it will be difficult to maintain/track in future for any changes that are done in these structs.Do we really want to do this now?
That documentation is tightly tied with the API, so the doc would always have to be updated when the API structure is modified. If you read this through most of the documentation would become barely readable without direct pointer to the relevant structure and related parameters (not just for FFT but also for the existing operations). I see also some code snippets insertions for other parallel documentation when relevant.
I can see your point about avoid duplicates but in that very case it is arguably sensible to be readable and would personally not change it in so far as I am concerned.Quoted 4 lines
Are you okay to keep current documentation flow for now as is, and we can look into improving/updating documentation as a future item based on agreed guidance?
The maintenance of this documentation is difficult in longer run. It will be unnecessary burden for the developer to sync both code and documentation.
Quoted 7 lines
We have seen this thing in past that people tend to forget about updating documentation.
And we are trying to remove unnecessary code snippets from the documentation.
We should not add new such code in documentation.
I would say remove this one from this patch. And you can submit a patch later to remove the rest.
OK will remove the C code-block and push a v8 now. Thanks.
Quoted 3 lines
Regards,
Akhil
PATCH v7 6/7 bbdev: add queue related warning and status information
In reply to Nicolas ChautruThis allows to expose more information with regards to any queue related failure and warning which cannot be supported in existing API.
--- app/test-bbdev/test_bbdev_perf.c | 2 ++ lib/bbdev/rte_bbdev.c | 19 +++++++++++++++++++ lib/bbdev/rte_bbdev.h | 34 ++++++++++++++++++++++++++++++++++ lib/bbdev/version.map | 1 + 4 files changed, 56 insertions(+)
app/test-bbdev/test_bbdev_perf.c +2 -0
@@ -4360,6 +4360,8 @@ typedef int (test_case_function)(struct active_device *ad, stats->dequeued_count = q_stats->dequeued_count; stats->enqueue_err_count = q_stats->enqueue_err_count; stats->dequeue_err_count = q_stats->dequeue_err_count; + stats->enqueue_warning_count = q_stats->enqueue_warning_count; + stats->dequeue_warning_count = q_stats->dequeue_warning_count; stats->acc_offload_cycles = q_stats->acc_offload_cycles;return 0 ;
lib/bbdev/rte_bbdev.c +19 -0
@@ -721,6 +721,8 @@ struct rte_bbdev * stats->dequeued_count += q_stats->dequeued_count; stats->enqueue_err_count += q_stats->enqueue_err_count; stats->dequeue_err_count += q_stats->dequeue_err_count; + stats->enqueue_warn_count += q_stats->enqueue_warn_count; + stats->dequeue_warn_count += q_stats->dequeue_warn_count; }rte_bbdev_log_debug ("Got stats on %u" , dev->data->dev_id); }
@@ -1163,3 +1165,20 @@ struct rte_mempool *rte_bbdev_log (ERR ,"Invalid device status" );return NULL ; } + +const char * +rte_bbdev_enqueue_status_str (enum rte_bbdev_enqueue_status status) +{ +static const char *const enq_sta_string[] = { +"RTE_BBDEV_ENQ_STATUS_NONE" , +"RTE_BBDEV_ENQ_STATUS_QUEUE_FULL" , +"RTE_BBDEV_ENQ_STATUS_RING_FULL" , +"RTE_BBDEV_ENQ_STATUS_INVALID_OP" , + }; + +if (status <sizeof (enq_sta_string) /sizeof (char *)) +return enq_sta_string[status]; + +rte_bbdev_log (ERR ,"Invalid enqueue status" ); +return NULL ; +}
lib/bbdev/rte_bbdev.h +34 -0
@@ -224,6 +224,19 @@ struct rte_bbdev_queue_conf { rte_bbdev_queue_stop(uint16_t dev_id, uint16_t queue_id);/** +* Flags indicate the reason why a previous enqueue may not have +* consumed all requested operations +* In case of multiple reasons the latter superdes a previous one +*/ +enum rte_bbdev_enqueue_status { +RTE_BBDEV_ENQ_STATUS_NONE ,/**< Nothing to report */ +RTE_BBDEV_ENQ_STATUS_QUEUE_FULL ,/**< Not enough room in queue */ +RTE_BBDEV_ENQ_STATUS_RING_FULL ,/**< Not enough room in ring */ +RTE_BBDEV_ENQ_STATUS_INVALID_OP ,/**< Operation was rejected as invalid */ +RTE_BBDEV_ENQ_STATUS_PADDED_MAX =6 ,/**< Maximum enq status number including padding */ +}; + +/** * Flags indicate the status of the device */ enum rte_bbdev_device_status {
@@ -246,6 +259,12 @@ struct rte_bbdev_stats {uint64_t enqueue_err_count;/** Total error count on operations dequeued */ uint64_t dequeue_err_count; +/** Total warning count on operations enqueued */ +uint64_t enqueue_warn_count; +/** Total warning count on operations dequeued */ +uint64_t dequeue_warn_count; +/** Total enqueue status count based on rte_bbdev_enqueue_status enum */ +uint64_t enqueue_status_count[RTE_BBDEV_ENQ_STATUS_PADDED_MAX ];/** CPU cycles consumed by the (HW/SW) accelerator device to offload * the enqueue request to its internal queues. * - For a HW device this is the cycles consumed in MMIO write
@@ -386,6 +405,7 @@ struct rte_bbdev_queue_data {void *queue_private;/**< Driver-specific per-queue data */ struct rte_bbdev_queue_conf conf;/**< Current configuration */ struct rte_bbdev_stats queue_stats;/**< Queue statistics */ +enum rte_bbdev_enqueue_status enqueue_status;/**< Enqueue status when op is rejected */ bool started;/**< Queue state */ };
@@ -938,6 +958,20 @@ typedef void (*rte_bbdev_cb_fn)(uint16_t dev_id,const char *rte_bbdev_device_status_str (enum rte_bbdev_device_status status); +/** +* Converts queue status from enum to string +* +* @param status +* Queue status as enum +* +* @returns +* Queue status as string or NULL if op_type is invalid +* +*/ +__rte_experimental +const char* +rte_bbdev_enqueue_status_str (enum rte_bbdev_enqueue_status status); + #ifdef __cplusplus }#endif
lib/bbdev/version.map +1 -0
@@ -45,6 +45,7 @@ EXPERIMENTAL { # added in 22.11 rte_bbdev_device_status_str; + rte_bbdev_enqueue_status_str; rte_bbdev_enqueue_fft_ops; rte_bbdev_dequeue_fft_ops; rte_bbdev_fft_op_alloc_bulk;
Signature · 1 line
1.8.3.1
RE: [EXT] [PATCH v7 6/7] bbdev: add queue related warning and status information
lib/bbdev/rte_bbdev.h struct rte_bbdev_queue_conf { · line 229
Quoted 11 lines
lib/bbdev/rte_bbdev.h +3
-0@@ -224,6 +224,19 @@ struct rte_bbdev_queue_conf { rte_bbdev_queue_stop(uint16_t dev_id, uint16_t queue_id);/** +* Flags indicate the reason why a previous enqueue may not have +* consumed all requested operations +* In case of multiple reasons the latter superdes a previous one
Spell check - supersedes.
Quoted 11 lines
lib/bbdev/rte_bbdev.h +4
-0+*/ +enum rte_bbdev_enqueue_status { +RTE_BBDEV_ENQ_STATUS_NONE ,/**< Nothing to report */ +RTE_BBDEV_ENQ_STATUS_QUEUE_FULL ,/**< Not enough room in queue */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_RING_FULL, /**< Not enough room inring */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_INVALID_OP, /**< Operation wasrejected as invalid */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_PADDED_MAX = 6, /**< Maximum enqstatus number including padding */
Are we ok to have this kind of padding across DPDK for all the enums to avoid ABI issues? @Ray, @Thomas: any thoughts?
RE: [EXT] [PATCH v7 6/7] bbdev: add queue related warning and status information
Hi Akhil,
Quoted 10 lines
-----Original Message-----
From: Akhil Goyal <[email protected]>Quoted 7 lines
lib/bbdev/rte_bbdev.h index renamed from lib/bbdev/rte_bbdev.h +0
-0ed528b8..b7ecf94 100644
lib/bbdev/rte_bbdev.h +0
-0@@ -224,6 +224,19 @@ struct rte_bbdev_queue_conf { rte_bbdev_queue_stop(uint16_t dev_id, uint16_t queue_id);
Quoted 5 lines
lib/bbdev/rte_bbdev.h struct rte_bbdev_queue_conf { · line 229
Quoted 4 lines
lib/bbdev/rte_bbdev.h +3
-0/** +* Flags indicate the reason why a previous enqueue may not have +* consumed all requested operations +* In case of multiple reasons the latter superdes a previous one Spell check - supersedes.
Thanks, fixed in v8.
Quoted 9 lines
lib/bbdev/rte_bbdev.h struct rte_bbdev_queue_conf {
Quoted 5 lines
lib/bbdev/rte_bbdev.h +4
-0+*/ +enum rte_bbdev_enqueue_status { +RTE_BBDEV_ENQ_STATUS_NONE ,/**< Nothing to report */ +RTE_BBDEV_ENQ_STATUS_QUEUE_FULL ,/**< Not enough room in
lib/bbdev/rte_bbdev.h
Quoted 2 lines
queue */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_RING_FULL, /**< Not enough roomin
Quoted 10 lines
Quoted 5 lines
ring */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_INVALID_OP, /**< Operation wasrejected as invalid */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_PADDED_MAX = 6, /**< Maximum enqstatus number including padding */
Are we ok to have this kind of padding across DPDK for all the enums to avoid ABI issues?
@Ray, @Thomas: any thoughts?
This was discussed at the time notably with advises from Ray. But good to close the loop formally.
Re: [EXT] [PATCH v7 6/7] bbdev: add queue related warning and status information
In reply to Akhil GoyalQuoted 13 lines · Akhil Goyal
lib/bbdev/rte_bbdev.h struct rte_bbdev_queue_conf { · line 229
Quoted 11 lines
lib/bbdev/rte_bbdev.h +3
-0@@ -224,6 +224,19 @@ struct rte_bbdev_queue_conf { rte_bbdev_queue_stop(uint16_t dev_id, uint16_t queue_id);/** +* Flags indicate the reason why a previous enqueue may not have +* consumed all requested operations +* In case of multiple reasons the latter superdes a previous one Spell check - supersedes.
Quoted 16 lines
Quoted 11 lines
lib/bbdev/rte_bbdev.h +4
-0+*/ +enum rte_bbdev_enqueue_status { +RTE_BBDEV_ENQ_STATUS_NONE ,/**< Nothing to report */ +RTE_BBDEV_ENQ_STATUS_QUEUE_FULL ,/**< Not enough room in queue */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_RING_FULL, /**< Not enough room inring */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_INVALID_OP, /**< Operation wasrejected as invalid */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_PADDED_MAX = 6, /**< Maximum enqstatus number including padding */
Are we ok to have this kind of padding across DPDK for all the enums to avoid ABI issues? @Ray, @Thomas: any thoughts?
This kind of usage can prevent ABI tool warning, and can fix issues caused by application using returned enum as index [1].
But I think it is still problematic in case application tries to walk through till MAX, that is a common usage [2], user may miss that this is PADDED.
Overall exchanging enum values between library and application is possible trouble for binary compatibility. If application and library uses enum values independently, this is OK. Since enum cases not deleted but added in new version of the libraries, more problematic usage is passing enum value from library to application, and bbdev seems doing this in a few places.
With current approach PADDED_MAX usage is more like #define usage, it is not dynamic but a hardcoded value that is used as array size value.
Not providing a MAX enum case restricts the application, application can't use it as size of an array or can't use it walk through related array, usage reduces to if/switch comparisons. Although this may not be most convenient for application, it can provide safer usage for binary compatibility.
@Nic, what do you think provide these PADDED_MAX as #define SIZE_MAX macros?
With this application still can allocate a relevant array with correct size, or know the size of library provided array, but can't use it to iterate on these arrays.
[1]
--------------- library old version ----------------------------
enum type {
CASE_A,
CASE_B,
CASE_MAX,
};struct data {
enum type type;
union {
type specific struct
};
};int api_get(struct data *data);
--------------- application ----------------------------
struct data data;
int array[CASE_MAX];
api_get(&data);foo(array[data.type]);
--------------- library NEW version ----------------------------
enum type {
CASE_A,
CASE_B,
CASE_C,
CASE_D,
CASE_MAX,
};When application is NOT recompiled but using new version of the library, values 'CASE_C' & 'CASE_D' will crash application, so this will create a ABI compatibility issue.
Note: In the past I have claimed that application should check 'CASE_MAX', instead of using returned value directly as index, but this is refused by argument that we can't control the application and should play safe assuming application behaves wrong.
[2]
--------------- library ----------------------------
enum type {
CASE_NONE,
CASE_A,
CASE_B,
CASE_C,
CASE_D,
CASE_PADDED_MAX = 666,
};--------------- application ----------------------------
for (int i = CASE_NONE; i < CASE_PADDED_MAX; i++)
fragile_init(i);
---
A message that is not in the archive (sent off-list or not yet received): CO6PR18MB44848717BA4EA2FF8967D7CBD8509@CO6PR18MB4484.namprd18.prod.outlook.com
RE: [EXT] [PATCH v7 6/7] bbdev: add queue related warning and status information
Hi Ferruh, Ray, Akhil,
Quoted 26 lines
Quoted 26 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Friday, September 23, 2022 4:28 PM
To: Akhil Goyal <[email protected]>; Nicolas Chautru <[email protected]>; [email protected]; [email protected]; [email protected]; Ray Kinsella <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [EXT] [PATCH v7 6/7] bbdev: add queue related warning and status informationQuoted 13 lines · Akhil Goyal
lib/bbdev/rte_bbdev.h struct rte_bbdev_queue_conf { · line 229
Quoted 11 lines
lib/bbdev/rte_bbdev.h index renamed from lib/bbdev/rte_bbdev.h +0
-0ed528b8..b7ecf94 100644
lib/bbdev/rte_bbdev.h +3
-0@@ -224,6 +224,19 @@ struct rte_bbdev_queue_conf { rte_bbdev_queue_stop(uint16_t dev_id, uint16_t queue_id);/** +* Flags indicate the reason why a previous enqueue may not have +* consumed all requested operations +* In case of multiple reasons the latter superdes a previous one Spell check - supersedes.
Quoted 27 lines
Quoted 4 lines
Quoted 4 lines
lib/bbdev/rte_bbdev.h struct rte_bbdev_queue_conf {
Quoted 4 lines
lib/bbdev/rte_bbdev.h +4
-0+*/ +enum rte_bbdev_enqueue_status { +RTE_BBDEV_ENQ_STATUS_NONE ,/**< Nothing to report */ +RTE_BBDEV_ENQ_STATUS_QUEUE_FULL ,/**< Not enough room in
Quoted 2 lines
Quoted 2 lines
lib/bbdev/rte_bbdev.h
Quoted 2 lines
queue */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_RING_FULL, /**< Not enough roomin
Quoted 19 lines
Quoted 8 lines
Quoted 5 lines
ring */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_INVALID_OP, /**< Operation wasrejected as invalid */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_PADDED_MAX = 6, /**< Maximum enqstatus number including padding */
Are we ok to have this kind of padding across DPDK for all the enums to avoid
ABI issues?
Quoted 3 lines
@Ray, @Thomas: any thoughts?
This kind of usage can prevent ABI tool warning, and can fix issues caused by application using returned enum as index [1].
But I think it is still problematic in case application tries to walk through till MAX, that is a common usage [2], user may miss that this is PADDED.
Hi Ferruh,
I don’t believe that case can happen here. Even if application was using an undefined index, the related functions are protected for that :
See rte_bbdev_enqueue_status_str(enum rte_bbdev_enqueue_status status)
The reason for having padded max, is that the application may use this for array sizing if required without concern, we will never return a value that would exceeds this. In the other direction that is not a problem either since application (even it needs to store thigs in array) can used the padded version. Note that this discussed with Ray notably as a BKM.
Quoted 7 lines
Quoted 7 lines
Overall exchanging enum values between library and application is possible trouble for binary compatibility. If application and library uses enum values independently, this is OK.
Since enum cases not deleted but added in new version of the libraries, more problematic usage is passing enum value from library to application, and bbdev seems doing this in a few places.
I don’t see a case where it is a genuine issue.
An enum is being reported from library, even if due to future enum insertion there is a new enum reported between 2 ABI changes, that would still be within bounds.
Quoted 7 lines
Quoted 7 lines
With current approach
PADDED_MAXusage is more like #define usage, it is not dynamic but a hardcoded value that is used as array size value.Not providing a MAX enum case restricts the application, application can't use it as size of an array or can't use it walk through related array, usage reduces to if/switch comparisons.
It can use the padded_max to size application array. Even if application was walking through these, there is no adverse effect.
Quoted 10 lines
Quoted 10 lines
Although this may not be most convenient for application, it can provide safer usage for binary compatibility.
@Nic, what do you think provide these
PADDED_MAXas #defineSIZE_MAXmacros?
With this application still can allocate a relevant array with correct size, or know the size of library provided array, but can't use it to iterate on these arrays.
That would be back to how it was done before which made things very inflexible and prevented to change these enums between ABIs versions.
This change was highlighted and discussed many months ago and flagged in the deprecation notice in previous release for that very reason.
Ray, can you please chime in since you know best.
Thanks Ferruh,
Nic
Quoted 90 lines
Quoted 90 lines
[1]
--------------- library old version ---------------------------- enumtype { CASE_A, CASE_B, CASE_MAX, };struct data { enum type type; union { type specific struct }; };int
api_get(struct data *data);--------------- application ----------------------------
struct data data;
int array[CASE_MAX];
api_get(&data);foo(array[data.type]);--------------- library NEW version ----------------------------
enum type { CASE_A, CASE_B, CASE_C, CASE_D, CASE_MAX, };When application is NOT recompiled but using new version of the library, values '
CASE_C' & 'CASE_D' will crash application, so this will create a ABI compatibility issue.Note: In the past I have claimed that application should check '
CASE_MAX', instead of using returned value directly as index, but this is refused by argument that we can't control the application and should play safe assuming application behaves wrong.[2]
--------------- library ----------------------------
enum type { CASE_NONE, CASE_A, CASE_B, CASE_C, CASE_D, CASE_PADDED_MAX = 666, };--------------- application ----------------------------
for (int i =
CASE_NONE; i <CASE_PADDED_MAX; i++)fragile_init(i);---
Re: [EXT] [PATCH v7 6/7] bbdev: add queue related warning and status information
Quoted 53 lines · Nicolas
Hi Ferruh, Ray, Akhil,
Quoted 50 lines
Quoted 26 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Friday, September 23, 2022 4:28 PM
To: Akhil Goyal <[email protected]>; Nicolas Chautru <[email protected]>; [email protected]; [email protected]; [email protected]; Ray Kinsella <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [EXT] [PATCH v7 6/7] bbdev: add queue related warning and status informationQuoted 13 lines · Akhil Goyal
lib/bbdev/rte_bbdev.h struct rte_bbdev_queue_conf { · line 229
Quoted 11 lines
lib/bbdev/rte_bbdev.h index renamed from lib/bbdev/rte_bbdev.h +0
-0ed528b8..b7ecf94 100644
lib/bbdev/rte_bbdev.h +3
-0@@ -224,6 +224,19 @@ struct rte_bbdev_queue_conf { rte_bbdev_queue_stop(uint16_t dev_id, uint16_t queue_id);/** +* Flags indicate the reason why a previous enqueue may not have +* consumed all requested operations +* In case of multiple reasons the latter superdes a previous one Spell check - supersedes.
Quoted 4 lines
Quoted 4 lines
lib/bbdev/rte_bbdev.h struct rte_bbdev_queue_conf {
Quoted 4 lines
lib/bbdev/rte_bbdev.h +4
-0+*/ +enum rte_bbdev_enqueue_status { +RTE_BBDEV_ENQ_STATUS_NONE ,/**< Nothing to report */ +RTE_BBDEV_ENQ_STATUS_QUEUE_FULL ,/**< Not enough room in
Quoted 2 lines
Quoted 2 lines
lib/bbdev/rte_bbdev.h
Quoted 2 lines
queue */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_RING_FULL, /**< Not enough roomin
Quoted 16 lines
Quoted 8 lines
Quoted 5 lines
ring */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_INVALID_OP, /**< Operation wasrejected as invalid */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_PADDED_MAX = 6, /**< Maximum enqstatus number including padding */
Are we ok to have this kind of padding across DPDK for all the enums to avoid
ABI issues?
Quoted 3 lines
@Ray, @Thomas: any thoughts?
This kind of usage can prevent ABI tool warning, and can fix issues caused by application using returned enum as index [1].
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
But I think it is still problematic in case application tries to walk through till MAX, that is a common usage [2], user may miss that this is PADDED.
Hi Ferruh,
I don’t believe that case can happen here. Even if application was using an undefined index, the related functions are protected for that :
Seerte_bbdev_enqueue_status_str(enum rte_bbdev_enqueue_status status)
It doesn't have to use undefined index for DPDK API, application can iterate until MAX enum for application specific array or function.
Quoted 4 lines
The reason for having padded max, is that the application may use this for array sizing if required without concern, we will never return a value that would exceeds this. In the other direction that is not a problem either since application (even it needs to store thigs in array) can used the padded version. Note that this discussed with Ray notably as a BKM.
I can see usage is more for size, that is why I think it is better to have a #define that has SIZE_MAX in name, instead of enum with PADDED_MAX name.
As said above, since you will never return value exceeds PADDED_MAX it solves the issue that application using returned enum as index [1]. So, this usage is not that problematic.
But my concern was if user assumes all values valid until PADDED_MAX and tries to iterate array until that value [2].
Quoted 11 lines
Quoted 7 lines
Quoted 7 lines
Overall exchanging enum values between library and application is possible trouble for binary compatibility. If application and library uses enum values independently, this is OK.
Since enum cases not deleted but added in new version of the libraries, more problematic usage is passing enum value from library to application, and bbdev seems doing this in a few places.I don’t see a case where it is a genuine issue.
An enum is being reported from library, even if due to future enum insertion there is a new enum reported between 2 ABI changes, that would still be within bounds.
Passing enum case from library to application has problem [1], other issue can be application may miss that library added new enum cases and application code needs updating. Overall I think it is not good idea for library to exchange enum values in APIs, specially if there is an intention to have ABI compatibility.
Quoted 14 lines
Quoted 7 lines
Quoted 7 lines
With current approach
PADDED_MAXusage is more like #define usage, it is not dynamic but a hardcoded value that is used as array size value.Not providing a MAX enum case restricts the application, application can't use it as size of an array or can't use it walk through related array, usage reduces to if/switch comparisons.
It can use the
padded_maxto size application array. Even if application was walking through these, there is no adverse effect.Quoted 4 lines
Quoted 4 lines
Although this may not be most convenient for application, it can provide safer usage for binary compatibility.
Quoted 9 lines
Quoted 6 lines
Quoted 6 lines
@Nic, what do you think provide these
PADDED_MAXas #defineSIZE_MAXmacros?
With this application still can allocate a relevant array with correct size, or know the size of library provided array, but can't use it to iterate on these arrays.That would be back to how it was done before which made things very inflexible and prevented to change these enums between ABIs versions.
It would be same, the problem was MAX enum value changing. Removing MAX enum but introduce #define SIZE_MAX will be same for application. Only it would be more clear.
Quoted 2 lines
This change was highlighted and discussed many months ago and flagged in the deprecation notice in previous release for that very reason.
As far as I remember the deprecation notice was to remove MAX enum values, now you are introducing PADDED_MAX enum value.
Quoted 2 lines
Ray, can you please chime in since you know best.
I think this PADDED_MAX solution is not too problematic, but I prefer SIZE_MAX define, I hope my reasoning above is clear. This is a comment from me, not a blocker, I am OK to go with whatever consensus is.
Quoted 96 lines
Thanks Ferruh,
NicQuoted 90 lines
Quoted 90 lines
[1]
--------------- library old version ---------------------------- enumtype { CASE_A, CASE_B, CASE_MAX, };struct data { enum type type; union { type specific struct }; };int
api_get(struct data *data);--------------- application ----------------------------
struct data data;
int array[CASE_MAX];
api_get(&data);foo(array[data.type]);--------------- library NEW version ----------------------------
enum type { CASE_A, CASE_B, CASE_C, CASE_D, CASE_MAX, };When application is NOT recompiled but using new version of the library, values '
CASE_C' & 'CASE_D' will crash application, so this will create a ABI compatibility issue.Note: In the past I have claimed that application should check '
CASE_MAX', instead of using returned value directly as index, but this is refused by argument that we can't control the application and should play safe assuming application behaves wrong.[2]
--------------- library ----------------------------
enum type { CASE_NONE, CASE_A, CASE_B, CASE_C, CASE_D, CASE_PADDED_MAX = 666, };--------------- application ----------------------------
for (int i =
CASE_NONE; i <CASE_PADDED_MAX; i++)fragile_init(i);---
RE: [EXT] [PATCH v7 6/7] bbdev: add queue related warning and status information
In reply to Chautru, NicolasHi Ferruh,
Thanks for your comment.
To be totally honest I don't yet see how your suggestion would be better, but I quite possibly miss something. I did not reply in line with your comments so that to try to be clearer and avoid spreading the argument to much. Ray and Bruce feel free to chime in as well.
First to state the obvious: Nothing will change the fact that in case new enums are being added in DPDK, and if the application doesn't change, then user would not be able to interpret any such additional status/capability (backward compatible only feature parity and still ABI compliant) which is totally accepted as fine and up to the user, but the intention is at least not to have adverse effect even when they don’t update their code for such new features (notably in case they just use an older PMD not supporting such new features as a basic typical example in the ecosystem). I think we agree on that problematic.
In term of history of not using MAX value for enum, I believe there is already well documented and you agree with the reasoning of why we had to move away from this [1]. Not just cosmetically where the max value is called an enum or a #define but to have application making hardcoded assumption on the possible maximum range for such enum notably when sizing array. The only caveat being that at the time, the community did spot the weakness but did not come to an agreement with regards to the best way to manage this moving forward.
In case your point is purely cosmetic to rename the PADDED_MAX value from the enum to a #define (both public) I don't see how this would make thing clearer by obfuscating the fact it is genuinely a padded value and to have that value directly related to the enum structure. Also note that there is already an actual max value defined for these enums (but kept private on purpose) which is used by the lib/bbdev functions to restrict usage to what is actually supported in the given implementation (distinct from padded max value).
Arguably the only concern I could understand in your message would be this one " my concern was if user assumes all values valid until PADDED_MAX and tries to iterate array until that value".
But really the fact that it is indeed a padded value implies fairly explicitly that we have padded the supported enums with placeholders enums not yet defined. That is fairly tautological! I cannot see how it could confuse anyone. That is indeed to avoid such confusion that we went on that direction to expose a public future-proof padded maximum value.
Then looking at usage in practice: when integrating the bbdev api with higher level SW stacks (such as FlexRAN reference sw or 3rd party stacks) I don’t see how any of this theoretical concerns you raised would be relevant for any of these very cases (enqueue status, new capability etc...). The only genuine concern was sizing array based on MAX value being not ABI compliant.
I cannot think of any code in the application presently deployed or future that would then do what you are concerned about and cause an issue, and we definitely don’t do such things in any example for bbdev-test or in FlexRAN reference code provided to the ecosystem. The application would already have a default case when an enum being provided has no matching application, or more accurately in practice they would purely not look for these and hence these would be ignored seamlessly.
Thanks again for the discussion. I wish this had happened earlier (we only discussed this with Ray and Bruce while you were still at Intel), let me know what you think.
It may be more generally good moving forward to come to a general agreement at your technical forum level to avoid confusion. When we discussed earlier we came to the conclusion that the DPDK community had well documented what not to do to avoid ABI breakage but not necessarily what are the best alternatives. Hopefully such future discussion should not delay this serie to be applied but still let me know.
Thanks again
[1]
* lib: will fix extending some enum/define breaking the ABI. There are multiple samples in DPDK that enum/define terminated with a ``.*MAX.*`` value which is used by iterators, and arrays holding these values are sized with this ``.*MAX.*`` value. So extending this enum/define increases the ``.*MAX.*`` value which increases the size of the array and depending on how/where the array is used this may break the ABI.
``RTE_ETH_FLOW_MAX`` is one sample of the mentioned case, adding a new flow
type will break the ABI because of ``flex_mask[RTE_ETH_FLOW_MAX]`` array usage in following public struct hierarchy:
``rte_eth_fdir_flex_conf -> rte_eth_fdir_conf -> rte_eth_conf (in the middle)``. Need to identify this kind of usages and fix in 20.11, otherwise this blocks us extending existing enum/define.
One solution can be using a fixed size array instead of ``.*MAX.*`` value.
Quoted 231 lines
-----Original Message-----
From: Chautru, Nicolas
Sent: Saturday, September 24, 2022 9:35 AM
To: 'Akhil Goyal' <[email protected]>; [email protected]; Maxime Coquelin <[email protected]>; [email protected]; Ray Kinsella <[email protected]>
Cc: 'Akhil Goyal' <[email protected]>; Chautru, Nicolas <[email protected]>; '[email protected]' <[email protected]>; 'Ray Kinsella' <[email protected]>; '[email protected]' <[email protected]>; Richardson, Bruce <[email protected]>; '[email protected]' <[email protected]>; [email protected]; Zhang, Mingshan <[email protected]>; '[email protected]' <[email protected]>
Subject: RE: [EXT] [PATCH v7 6/7] bbdev: add queue related warning and status informationHi Ferruh, Ray, Akhil,
Quoted 27 lines
Quoted 27 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Friday, September 23, 2022 4:28 PM
To: Akhil Goyal <[email protected]>; Nicolas Chautru <[email protected]>; [email protected]; [email protected]; [email protected]; Ray Kinsella <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [EXT] [PATCH v7 6/7] bbdev: add queue related warning and status informationQuoted 14 lines · Akhil Goyal
lib/bbdev/rte_bbdev.h struct rte_bbdev_queue_conf { · line 230
Quoted 12 lines
lib/bbdev/rte_bbdev.h index renamed from lib/bbdev/rte_bbdev.h +0
-0ed528b8..b7ecf94 100644
lib/bbdev/rte_bbdev.h +4
-0@@ -224,6 +224,19 @@ struct rte_bbdev_queue_conf { rte_bbdev_queue_stop(uint16_t dev_id, uint16_t queue_id);/** +* Flags indicate the reason why a previous enqueue may not have +* consumed all requested operations +* In case of multiple reasons the latter superdes a previous +one Spell check - supersedes.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
lib/bbdev/rte_bbdev.h struct rte_bbdev_queue_conf {
Quoted 3 lines
lib/bbdev/rte_bbdev.h +3
-0+*/ +enum rte_bbdev_enqueue_status { +RTE_BBDEV_ENQ_STATUS_NONE ,/**< Nothing to report */
Quoted 1 line
Quoted 1 line
Quoted 1 line
lib/bbdev/rte_bbdev.h struct rte_bbdev_queue_conf { · line 234
Quoted 1 line
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_QUEUE_FULL, /**< Notenough room
Quoted 3 lines
in
Quoted 2 lines
Quoted 2 lines
lib/bbdev/rte_bbdev.h
Quoted 2 lines
queue */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_RING_FULL, /**< Notenough room
Quoted 3 lines
in
Quoted 2 lines
Quoted 2 lines
lib/bbdev/rte_bbdev.h
Quoted 2 lines
ring */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_INVALID_OP, /**< Operationwas
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
lib/bbdev/rte_bbdev.h
Quoted 2 lines
rejected as invalid */
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_PADDED_MAX = 6, /**<Maximum enq
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines
Quoted 1 line
status number including padding */
Are we ok to have this kind of padding across DPDK for all the enums to avoid
ABI issues?
Quoted 3 lines
@Ray, @Thomas: any thoughts?
Quoted 5 lines
Quoted 5 lines
This kind of usage can prevent ABI tool warning, and can fix issues caused by application using returned enum as index [1].
But I think it is still problematic in case application tries to walk through till MAX, that is a common usage [2], user may miss that
this
Quoted 1 line
Quoted 1 line
is PADDED.
Hi Ferruh,
I don’t believe that case can happen here. Even if application was using an undefined index, the related functions are protected for that :
Seerte_bbdev_enqueue_status_str(enum rte_bbdev_enqueue_status status)The reason for having padded max, is that the application may use this for array sizing if required without concern, we will never return a value that would exceeds this.
In the other direction that is not a problem either since application (even it needs to store thigs in array) can used the padded version.
Note that this discussed with Ray notably as a BKM.Quoted 7 lines
Quoted 7 lines
Overall exchanging enum values between library and application is possible trouble for binary compatibility. If application and library uses enum values independently, this is OK.
Since enum cases not deleted but added in new version of the libraries, more problematic usage is passing enum value from library to application, and bbdev seems doing this in a few places.I don’t see a case where it is a genuine issue.
An enum is being reported from library, even if due to future enum insertion there is a new enum reported between 2 ABI changes, that would still be within bounds.Quoted 7 lines
Quoted 7 lines
With current approach
PADDED_MAXusage is more like #define usage, it is not dynamic but a hardcoded value that is used as array size value.Not providing a MAX enum case restricts the application, application can't use it as size of an array or can't use it walk through related array, usage reduces to if/switch comparisons.
It can use the
padded_maxto size application array. Even if application was walking through these, there is no adverse effect.Quoted 5 lines
Quoted 5 lines
Although this may not be most convenient for application, it can provide safer usage for binary compatibility.
@Nic, what do you think provide these
PADDED_MAXas #define
SIZE_MAXQuoted 5 lines
Quoted 5 lines
macros?
With this application still can allocate a relevant array with correct size, or know the size of library provided array, but can't use it to iterate on these arrays.That would be back to how it was done before which made things very inflexible and prevented to change these enums between ABIs versions.
This change was highlighted and discussed many months ago and flagged in the deprecation notice in previous release for that very reason.
Ray, can you please chime in since you know best.
Thanks Ferruh,
NicQuoted 90 lines
Quoted 90 lines
[1]
--------------- library old version ---------------------------- enumtype { CASE_A, CASE_B, CASE_MAX, };struct data { enum type type; union { type specific struct }; };int
api_get(struct data *data);--------------- application ----------------------------
struct data data;
int array[CASE_MAX];
api_get(&data);foo(array[data.type]);--------------- library NEW version ----------------------------
enum type { CASE_A, CASE_B, CASE_C, CASE_D, CASE_MAX, };When application is NOT recompiled but using new version of the library, values '
CASE_C' & 'CASE_D' will crash application, so this will create a ABI compatibility issue.Note: In the past I have claimed that application should check '
CASE_MAX', instead of using returned value directly as index, but this is refused by argument that we can't control the application and should play safe assuming application behaves wrong.[2]
--------------- library ----------------------------
enum type { CASE_NONE, CASE_A, CASE_B, CASE_C, CASE_D, CASE_PADDED_MAX = 666, };--------------- application ----------------------------
for (int i =
CASE_NONE; i <CASE_PADDED_MAX; i++)fragile_init(i);---
Re: [EXT] [PATCH v7 6/7] bbdev: add queue related warning and status information
Quoted 17 lines · Nicolas
CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
Hi Ferruh,
Thanks for your comment.
To be totally honest I don't yet see how your suggestion would be better, but I quite possibly miss something. I did not reply in line with your comments so that to try to be clearer and avoid spreading the argument to much. Ray and Bruce feel free to chime in as well.First to state the obvious: Nothing will change the fact that in case new enums are being added in DPDK, and if the application doesn't change, then user would not be able to interpret any such additional status/capability (backward compatible only feature parity and still ABI compliant) which is totally accepted as fine and up to the user, but the intention is at least not to have adverse effect even when they don’t update their code for such new features (notably in case they just use an older PMD not supporting such new features as a basic typical example in the ecosystem). I think we agree on that problematic.
In term of history of not using MAX value for enum, I believe there is already well documented and you agree with the reasoning of why we had to move away from this [1]. Not just cosmetically where the max value is called an enum or a #define but to have application making hardcoded assumption on the possible maximum range for such enum notably when sizing array. The only caveat being that at the time, the community did spot the weakness but did not come to an agreement with regards to the best way to manage this moving forward.
In case your point is purely cosmetic to rename the
PADDED_MAXvalue from the enum to a #define (both public) I don't see how this would make thing clearer by obfuscating the fact it is genuinely a padded value and to have that value directly related to the enum structure. Also note that there is already an actual max value defined for these enums (but kept private on purpose) which is used by the lib/bbdev functions to restrict usage to what is actually supported in the given implementation (distinct from padded max value).Arguably the only concern I could understand in your message would be this one " my concern was if user assumes all values valid until
PADDED_MAXand tries to iterate array until that value".
But really the fact that it is indeed a padded value implies fairly explicitly that we have padded the supported enums with placeholders enums not yet defined. That is fairly tautological! I cannot see how it could confuse anyone. That is indeed to avoid such confusion that we went on that direction to expose a public future-proof padded maximum value.
Quoted 7 lines
Then looking at usage in practice: when integrating the bbdev api with higher level SW stacks (such as FlexRAN reference sw or 3rd party stacks) I don’t see how any of this theoretical concerns you raised would be relevant for any of these very cases (enqueue status, new capability etc...). The only genuine concern was sizing array based on MAX value being not ABI compliant.
I cannot think of any code in the application presently deployed or future that would then do what you are concerned about and cause an issue, and we definitely don’t do such things in any example for bbdev-test or in FlexRAN reference code provided to the ecosystem. The application would already have a default case when an enum being provided has no matching application, or more accurately in practice they would purely not look for these and hence these would be ignored seamlessly.Thanks again for the discussion. I wish this had happened earlier (we only discussed this with Ray and Bruce while you were still at Intel), let me know what you think.
It may be more generally good moving forward to come to a general agreement at your technical forum level to avoid confusion. When we discussed earlier we came to the conclusion that the DPDK community had well documented what not to do to avoid ABI breakage but not necessarily what are the best alternatives. Hopefully such future discussion should not delay this serie to be applied but still let me know.
Hi Nic,
I believe it is more clear/safe to convert to SIZE_MAX macros, although it is not a blocker.
Anyway, I am not sure about the value of continuing this discussion, perhaps it is better to clarify the guidance for similar case with ABI maintainer and techboard, so it can proceed according to the decision.
Thanks,
ferruh
Quoted 250 lines
Thanks again
[1]
* lib: will fix extending some enum/define breaking the ABI. There are multiple samples in DPDK that enum/define terminated with a ``.*MAX.*`` value which is used by iterators, and arrays holding these values are sized with this ``.*MAX.*`` value. So extending this enum/define increases the ``.*MAX.*`` value which increases the size of the array and depending on how/where the array is used this may break the ABI.
``RTE_ETH_FLOW_MAX`` is one sample of the mentioned case, adding a new flow
type will break the ABI because of ``flex_mask[RTE_ETH_FLOW_MAX]`` array usage in following public struct hierarchy:
``rte_eth_fdir_flex_conf ->rte_eth_fdir_conf->rte_eth_conf(in the middle)``. Need to identify this kind of usages and fix in 20.11, otherwise this blocks us extending existing enum/define.
One solution can be using a fixed size array instead of ``.*MAX.*`` value.Quoted 231 lines
-----Original Message-----
From: Chautru, Nicolas
Sent: Saturday, September 24, 2022 9:35 AM
To: 'Akhil Goyal' <[email protected]>; [email protected]; Maxime Coquelin <[email protected]>; [email protected]; Ray Kinsella <[email protected]>
Cc: 'Akhil Goyal' <[email protected]>; Chautru, Nicolas <[email protected]>; '[email protected]' <[email protected]>; 'Ray Kinsella' <[email protected]>; '[email protected]' <[email protected]>; Richardson, Bruce <[email protected]>; '[email protected]' <[email protected]>; [email protected]; Zhang, Mingshan <[email protected]>; '[email protected]' <[email protected]>
Subject: RE: [EXT] [PATCH v7 6/7] bbdev: add queue related warning and status informationHi Ferruh, Ray, Akhil,
Quoted 27 lines
Quoted 27 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Friday, September 23, 2022 4:28 PM
To: Akhil Goyal <[email protected]>; Nicolas Chautru <[email protected]>; [email protected]; [email protected]; [email protected]; Ray Kinsella <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [EXT] [PATCH v7 6/7] bbdev: add queue related warning and status informationQuoted 14 lines · Akhil Goyal
lib/bbdev/rte_bbdev.h struct rte_bbdev_queue_conf { · line 230
Quoted 12 lines
lib/bbdev/rte_bbdev.h index renamed from lib/bbdev/rte_bbdev.h +0
-0ed528b8..b7ecf94 100644
lib/bbdev/rte_bbdev.h +4
-0@@ -224,6 +224,19 @@ struct rte_bbdev_queue_conf { rte_bbdev_queue_stop(uint16_t dev_id, uint16_t queue_id);/** +* Flags indicate the reason why a previous enqueue may not have +* consumed all requested operations +* In case of multiple reasons the latter superdes a previous +one Spell check - supersedes.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
lib/bbdev/rte_bbdev.h struct rte_bbdev_queue_conf {
Quoted 3 lines
lib/bbdev/rte_bbdev.h +3
-0+*/ +enum rte_bbdev_enqueue_status { +RTE_BBDEV_ENQ_STATUS_NONE ,/**< Nothing to report */
Quoted 1 line
Quoted 1 line
Quoted 1 line
lib/bbdev/rte_bbdev.h struct rte_bbdev_queue_conf { · line 234
Quoted 1 line
lib/bbdev/rte_bbdev.h +1
-0+ RTE_BBDEV_ENQ_STATUS_QUEUE_FULL, /**< Notenough room
Quoted 3 lines
in
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
queue */
+RTE_BBDEV_ENQ_STATUS_RING_FULL, /**< Notenough room
Quoted 3 lines
in
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
ring */
+RTE_BBDEV_ENQ_STATUS_INVALID_OP, /**< Operationwas
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
rejected as invalid */
+RTE_BBDEV_ENQ_STATUS_PADDED_MAX= 6, /**<Maximum enq
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines
Quoted 1 line
status number including padding */
Are we ok to have this kind of padding across DPDK for all the enums to avoid
ABI issues?
Quoted 3 lines
@Ray, @Thomas: any thoughts?
Quoted 5 lines
Quoted 5 lines
This kind of usage can prevent ABI tool warning, and can fix issues caused by application using returned enum as index [1].
But I think it is still problematic in case application tries to walk through till MAX, that is a common usage [2], user may miss that
this
Quoted 1 line
Quoted 1 line
is PADDED.
Hi Ferruh,
I don’t believe that case can happen here. Even if application was using an undefined index, the related functions are protected for that :
Seerte_bbdev_enqueue_status_str(enum rte_bbdev_enqueue_status status)The reason for having padded max, is that the application may use this for array sizing if required without concern, we will never return a value that would exceeds this.
In the other direction that is not a problem either since application (even it needs to store thigs in array) can used the padded version.
Note that this discussed with Ray notably as a BKM.Quoted 7 lines
Quoted 7 lines
Overall exchanging enum values between library and application is possible trouble for binary compatibility. If application and library uses enum values independently, this is OK.
Since enum cases not deleted but added in new version of the libraries, more problematic usage is passing enum value from library to application, and bbdev seems doing this in a few places.I don’t see a case where it is a genuine issue.
An enum is being reported from library, even if due to future enum insertion there is a new enum reported between 2 ABI changes, that would still be within bounds.Quoted 7 lines
Quoted 7 lines
With current approach
PADDED_MAXusage is more like #define usage, it is not dynamic but a hardcoded value that is used as array size value.Not providing a MAX enum case restricts the application, application can't use it as size of an array or can't use it walk through related array, usage reduces to if/switch comparisons.
It can use the
padded_maxto size application array. Even if application was walking through these, there is no adverse effect.Quoted 5 lines
Quoted 5 lines
Although this may not be most convenient for application, it can provide safer usage for binary compatibility.
@Nic, what do you think provide these
PADDED_MAXas #define
SIZE_MAXQuoted 5 lines
Quoted 5 lines
macros?
With this application still can allocate a relevant array with correct size, or know the size of library provided array, but can't use it to iterate on these arrays.That would be back to how it was done before which made things very inflexible and prevented to change these enums between ABIs versions.
This change was highlighted and discussed many months ago and flagged in the deprecation notice in previous release for that very reason.
Ray, can you please chime in since you know best.
Thanks Ferruh,
NicQuoted 90 lines
Quoted 90 lines
[1]
--------------- library old version ---------------------------- enumtype { CASE_A, CASE_B, CASE_MAX, };struct data { enum type type; union { type specific struct }; };int
api_get(struct data *data);--------------- application ----------------------------
struct data data;
int array[CASE_MAX];
api_get(&data);foo(array[data.type]);--------------- library NEW version ----------------------------
enum type { CASE_A, CASE_B, CASE_C, CASE_D, CASE_MAX, };When application is NOT recompiled but using new version of the library, values '
CASE_C' & 'CASE_D' will crash application, so this will create a ABI compatibility issue.Note: In the past I have claimed that application should check '
CASE_MAX', instead of using returned value directly as index, but this is refused by argument that we can't control the application and should play safe assuming application behaves wrong.[2]
--------------- library ----------------------------
enum type { CASE_NONE, CASE_A, CASE_B, CASE_C, CASE_D, CASE_PADDED_MAX = 666, };--------------- application ----------------------------
for (int i =
CASE_NONE; i <CASE_PADDED_MAX; i++)
fragile_init(i);---
RE: [EXT] [PATCH v7 6/7] bbdev: add queue related warning and status information
Quoted 66 lines
Quoted 2 lines
Thanks for your comment.
To be totally honest I don't yet see how your suggestion would be better, but Iquite possibly miss something. I did not reply in line with your comments so that to try to be clearer and avoid spreading the argument to much. Ray and Bruce feel free to chime in as well.
Quoted 2 lines
First to state the obvious: Nothing will change the fact that in case new enums
are being added in DPDK, and if the application doesn't change, then user would not be able to interpret any such additional status/capability (backward compatible only feature parity and still ABI compliant) which is totally accepted as fine and up to the user, but the intention is at least not to have adverse effect even when they don’t update their code for such new features (notably in case they just use an older PMD not supporting such new features as a basic typical example in the ecosystem). I think we agree on that problematic.
Quoted 2 lines
In term of history of not using MAX value for enum, I believe there is already
well documented and you agree with the reasoning of why we had to move away from this [1]. Not just cosmetically where the max value is called an enum or a #define but to have application making hardcoded assumption on the possible maximum range for such enum notably when sizing array. The only caveat being that at the time, the community did spot the weakness but did not come to an agreement with regards to the best way to manage this moving forward.
Quoted 2 lines
In case your point is purely cosmetic to rename the
PADDED_MAXvalue fromthe enum to a #define (both public) I don't see how this would make thing clearer by obfuscating the fact it is genuinely a padded value and to have that value directly related to the enum structure. Also note that there is already an actual max value defined for these enums (but kept private on purpose) which is used by the lib/bbdev functions to restrict usage to what is actually supported in the given implementation (distinct from padded max value).
Quoted 2 lines
Arguably the only concern I could understand in your message would be this
one " my concern was if user assumes all values valid until
PADDED_MAXand tries to iterate array until that value".Quoted 1 line
But really the fact that it is indeed a padded value implies fairly explicitly that
we have padded the supported enums with placeholders enums not yet defined. That is fairly tautological! I cannot see how it could confuse anyone. That is indeed to avoid such confusion that we went on that direction to expose a public future-proof padded maximum value.
Quoted 2 lines
Then looking at usage in practice: when integrating the bbdev api with higher
level SW stacks (such as FlexRAN reference sw or 3rd party stacks) I don’t see how any of this theoretical concerns you raised would be relevant for any of these very cases (enqueue status, new capability etc...). The only genuine concern was sizing array based on MAX value being not ABI compliant.
Quoted 1 line
I cannot think of any code in the application presently deployed or future that
would then do what you are concerned about and cause an issue, and we definitely don’t do such things in any example for bbdev-test or in FlexRAN reference code provided to the ecosystem. The application would already have a default case when an enum being provided has no matching application, or more accurately in practice they would purely not look for these and hence these would be ignored seamlessly.
Quoted 2 lines
Thanks again for the discussion. I wish this had happened earlier (we only
discussed this with Ray and Bruce while you were still at Intel), let me know what you think.
Quoted 1 line
It may be more generally good moving forward to come to a general
agreement at your technical forum level to avoid confusion. When we discussed earlier we came to the conclusion that the DPDK community had well documented what not to do to avoid ABI breakage but not necessarily what are the best alternatives.
Quoted 1 line
Hopefully such future discussion should not delay this serie to be applied but
still let me know.
Quoted 1 line
Quoted 9 lines
Hi Nic,
I believe it is more clear/safe to convert to
SIZE_MAXmacros, although it is not a blocker.Anyway, I am not sure about the value of continuing this discussion, perhaps it is better to clarify the guidance for similar case with ABI maintainer and techboard, so it can proceed according to the decision.
I agree with Ferruh's comment for converting to SIZE_MAX macros.
However, it is not a strong comment from my side.
Moving to techboard would mean this patchset would skip the RC1 window.
I believe as Ray is the maintainer and go to person for ABI related issues.
I believe if he can take a look at the suggestion and provide ack/nack to whichever Approach would be fine and we can go ahead in that direction.
I would like to close this as soon as possible. There are a lot of patches to be blocked on this series.
Regards,
Akhil
RE: [EXT] [PATCH v7 6/7] bbdev: add queue related warning and status information
Hi Thomas,
In absence of Ray (I did not see email from him for a some time) can you please advise on best option so that as to move on. I can either keep as is based on initial review with Ray, or replace _PADDED_MAX to _SIZE_MAX macro as suggested by Ferruh. I am happy either way as long as we are able to move forward. There is no full consensus but not strong opinion either from anyone. Thanks,
Nic
Quoted 114 lines
-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Thursday, September 29, 2022 11:33 AM
To: Ferruh Yigit <[email protected]>; Chautru, Nicolas <[email protected]>; [email protected]; Maxime Coquelin <[email protected]>; [email protected]; Ray Kinsella <[email protected]>
Cc: [email protected]; [email protected]; Richardson, Bruce <[email protected]>; [email protected]; [email protected]; Zhang, Mingshan <[email protected]>; [email protected]
Subject: RE: [EXT] [PATCH v7 6/7] bbdev: add queue related warning and status informationQuoted 9 lines
Quoted 3 lines
Thanks for your comment.
To be totally honest I don't yet see how your suggestion would be better, but Iquite possibly miss something. I did not reply in line with your comments so that to try to be clearer and avoid spreading the argument to much. Ray and Bruce feel free to chime in as well.
Quoted 3 lines
First to state the obvious: Nothing will change the fact that in case new enums
Quoted 7 lines
are being added in DPDK, and if the application doesn't change, then user would not be able to interpret any such additional status/capability (backward compatible only feature parity and still ABI compliant) which is totally accepted as fine and up to the user, but the intention is at least not to have adverse effect even when they don’t update their code for such new features (notably in case they just use an older PMD not supporting such new features as a basic
typical example in the ecosystem). I think we agree on that problematic.
Quoted 11 lines
Quoted 3 lines
In term of history of not using MAX value for enum, I believe there is already
well documented and you agree with the reasoning of why we had to move away from this [1]. Not just cosmetically where the max value is called an enum or a #define but to have application making hardcoded assumption on the possible maximum range for such enum notably when sizing array. The only caveat being that at the time, the community did spot the weakness but did not come to an agreement with regards to the best way to manage this moving forward.
Quoted 1 line
Quoted 8 lines
Quoted 2 lines
In case your point is purely cosmetic to rename the
PADDED_MAXvalue fromthe enum to a #define (both public) I don't see how this would make thing clearer by obfuscating the fact it is genuinely a padded value and to have that value directly related to the enum structure. Also note that there is already an actual max value defined for these enums (but kept private on purpose) which is used by the lib/bbdev functions to restrict usage to what is actually supported in the given implementation
(distinct from padded max value).
Quoted 8 lines
Quoted 3 lines
Arguably the only concern I could understand in your message would be this
one " my concern was if user assumes all values valid until
PADDED_MAXand tries to iterate array until that value".Quoted 2 lines
But really the fact that it is indeed a padded value implies fairly explicitly that
we have padded the supported enums with placeholders enums not yet
defined.
Quoted 10 lines
That is fairly tautological! I cannot see how it could confuse anyone. That is indeed to avoid such confusion that we went on that direction to expose a public future-proof padded maximum value.
Quoted 3 lines
Then looking at usage in practice: when integrating the bbdev api with higher
level SW stacks (such as FlexRAN reference sw or 3rd party stacks) I don’t see how any of this theoretical concerns you raised would be relevant for any of these very cases (enqueue status, new capability etc...). The only genuine concern was sizing array based on MAX value being
not ABI compliant.
Quoted 23 lines
Quoted 2 lines
I cannot think of any code in the application presently deployed or future that
would then do what you are concerned about and cause an issue, and we definitely don’t do such things in any example for bbdev-test or in FlexRAN reference code provided to the ecosystem. The application would already have a default case when an enum being provided has no matching application, or more accurately in practice they would purely not look for these and hence these would be ignored seamlessly.
Quoted 3 lines
Thanks again for the discussion. I wish this had happened earlier (we only
discussed this with Ray and Bruce while you were still at Intel), let me know what you think.
Quoted 1 line
It may be more generally good moving forward to come to a general
agreement at your technical forum level to avoid confusion. When we discussed earlier we came to the conclusion that the DPDK community had well documented what not to do to avoid ABI breakage but not necessarily what are the best alternatives.
Quoted 2 lines
Hopefully such future discussion should not delay this serie to be applied but
still let me know.
Quoted 1 line
Quoted 9 lines
Hi Nic,
I believe it is more clear/safe to convert to
SIZE_MAXmacros, although it is not a blocker.Anyway, I am not sure about the value of continuing this discussion, perhaps it is better to clarify the guidance for similar case with ABI maintainer and techboard, so it can proceed according to the decision.
I agree with Ferruh's comment for converting to
SIZE_MAXmacros. However, it is not a strong comment from my side.
Moving to techboard would mean this patchset would skip the RC1 window. I believe as Ray is the maintainer and go to person for ABI related issues. I believe if he can take a look at the suggestion and provide ack/nack to whichever Approach would be fine and we can go ahead in that direction. I would like to close this as soon as possible. There are a lot of patches to be blocked on this series.Regards,
Akhil
Re: [EXT] [PATCH v7 6/7] bbdev: add queue related warning and status information
Hi Nic,
Quoted 4 lines · Nicolas
Hi Thomas,
In absence of Ray (I did not see email from him for a some time) can you please advise on best option so that as to move on. I can either keep as is based on initial review with Ray, or replace_PADDED_MAXto_SIZE_MAXmacro as suggested by Ferruh. I am happy either way as long as we are able to move forward. There is no full consensus but not strong opinion either from anyone.
I would go with Ferruh's suggestion.
Regards,
Maxime
Quoted 118 lines
Thanks,
NicQuoted 114 lines
-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Thursday, September 29, 2022 11:33 AM
To: Ferruh Yigit <[email protected]>; Chautru, Nicolas <[email protected]>; [email protected]; Maxime Coquelin <[email protected]>; [email protected]; Ray Kinsella <[email protected]>
Cc: [email protected]; [email protected]; Richardson, Bruce <[email protected]>; [email protected]; [email protected]; Zhang, Mingshan <[email protected]>; [email protected]
Subject: RE: [EXT] [PATCH v7 6/7] bbdev: add queue related warning and status informationQuoted 9 lines
Quoted 3 lines
Thanks for your comment.
To be totally honest I don't yet see how your suggestion would be better, but Iquite possibly miss something. I did not reply in line with your comments so that to try to be clearer and avoid spreading the argument to much. Ray and Bruce feel free to chime in as well.
Quoted 3 lines
First to state the obvious: Nothing will change the fact that in case new enums
Quoted 7 lines
are being added in DPDK, and if the application doesn't change, then user would not be able to interpret any such additional status/capability (backward compatible only feature parity and still ABI compliant) which is totally accepted as fine and up to the user, but the intention is at least not to have adverse effect even when they don’t update their code for such new features (notably in case they just use an older PMD not supporting such new features as a basic
typical example in the ecosystem). I think we agree on that problematic.
Quoted 11 lines
Quoted 3 lines
In term of history of not using MAX value for enum, I believe there is already
well documented and you agree with the reasoning of why we had to move away from this [1]. Not just cosmetically where the max value is called an enum or a #define but to have application making hardcoded assumption on the possible maximum range for such enum notably when sizing array. The only caveat being that at the time, the community did spot the weakness but did not come to an agreement with regards to the best way to manage this moving forward.
Quoted 1 line
Quoted 8 lines
Quoted 2 lines
In case your point is purely cosmetic to rename the
PADDED_MAXvalue fromthe enum to a #define (both public) I don't see how this would make thing clearer by obfuscating the fact it is genuinely a padded value and to have that value directly related to the enum structure. Also note that there is already an actual max value defined for these enums (but kept private on purpose) which is used by the lib/bbdev functions to restrict usage to what is actually supported in the given implementation
(distinct from padded max value).
Quoted 8 lines
Quoted 3 lines
Arguably the only concern I could understand in your message would be this
one " my concern was if user assumes all values valid until
PADDED_MAXand tries to iterate array until that value".Quoted 2 lines
But really the fact that it is indeed a padded value implies fairly explicitly that
we have padded the supported enums with placeholders enums not yet
defined.
Quoted 10 lines
That is fairly tautological! I cannot see how it could confuse anyone. That is indeed to avoid such confusion that we went on that direction to expose a public future-proof padded maximum value.
Quoted 3 lines
Then looking at usage in practice: when integrating the bbdev api with higher
level SW stacks (such as FlexRAN reference sw or 3rd party stacks) I don’t see how any of this theoretical concerns you raised would be relevant for any of these very cases (enqueue status, new capability etc...). The only genuine concern was sizing array based on MAX value being
not ABI compliant.
Quoted 23 lines
Quoted 2 lines
I cannot think of any code in the application presently deployed or future that
would then do what you are concerned about and cause an issue, and we definitely don’t do such things in any example for bbdev-test or in FlexRAN reference code provided to the ecosystem. The application would already have a default case when an enum being provided has no matching application, or more accurately in practice they would purely not look for these and hence these would be ignored seamlessly.
Quoted 3 lines
Thanks again for the discussion. I wish this had happened earlier (we only
discussed this with Ray and Bruce while you were still at Intel), let me know what you think.
Quoted 1 line
It may be more generally good moving forward to come to a general
agreement at your technical forum level to avoid confusion. When we discussed earlier we came to the conclusion that the DPDK community had well documented what not to do to avoid ABI breakage but not necessarily what are the best alternatives.
Quoted 2 lines
Hopefully such future discussion should not delay this serie to be applied but
still let me know.
Quoted 1 line
Quoted 9 lines
Hi Nic,
I believe it is more clear/safe to convert to
SIZE_MAXmacros, although it is not a blocker.Anyway, I am not sure about the value of continuing this discussion, perhaps it is better to clarify the guidance for similar case with ABI maintainer and techboard, so it can proceed according to the decision.
I agree with Ferruh's comment for converting to
SIZE_MAXmacros. However, it is not a strong comment from my side.
Moving to techboard would mean this patchset would skip the RC1 window. I believe as Ray is the maintainer and go to person for ABI related issues. I believe if he can take a look at the suggestion and provide ack/nack to whichever Approach would be fine and we can go ahead in that direction. I would like to close this as soon as possible. There are a lot of patches to be blocked on this series.Regards,
Akhil
PATCH v7 7/7 bbdev: remove unnecessary if-check
In reply to Nicolas ChautruCode clean up due to if-check not required
--- lib/bbdev/rte_bbdev_op.h | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-)
lib/bbdev/rte_bbdev_op.h +4 -11
@@ -970,10 +970,8 @@ struct rte_mempool */* Get elements */ ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; -return 0 ; +return ret; }/**
@@ -1006,10 +1004,8 @@ struct rte_mempool */* Get elements */ ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; -return 0 ; +return ret; }/**
@@ -1035,17 +1031,14 @@ struct rte_mempool *int ret;/* Check type */ - priv = (struct rte_bbdev_op_pool_private *) -rte_mempool_get_priv (mempool); + priv = (struct rte_bbdev_op_pool_private *)rte_mempool_get_priv (mempool);if (unlikely (priv->type !=RTE_BBDEV_OP_FFT ))return -EINVAL ;/* Get elements */ ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; -return 0 ; +return ret; }/**
Signature · 1 line
1.8.3.1
RE: [EXT] [PATCH v7 7/7] bbdev: remove unnecessary if-check
Quoted 13 lines
Code clean up due to if-check not required
Signed-off-by Nicolas Chautru <[email protected]>Acked-by Maxime Coquelin <[email protected]>--- lib/bbdev/rte_bbdev_op.h | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-)lib/bbdev/rte_bbdev_op.h +0
-0
lib/bbdev/rte_bbdev_op.h struct rte_mempool * · line 974
Quoted 8 lines
lib/bbdev/rte_bbdev_op.h +1
-3@@ -970,10 +970,8 @@ struct rte_mempool */* Get elements */ ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; -return 0 ; +return ret;
Do you really need ret?
It can be easily
return rte_mempool_get_bulk(mempool, (void **)ops, num_ops);
same comment for both cleanups
Quoted 38 lines
lib/bbdev/rte_bbdev_op.h +3
-8}/** @@ -1006,10 +1004,8 @@ struct rte_mempool */* Get elements */ ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; -return 0 ; +return ret; }/** @@ -1035,17 +1031,14 @@ struct rte_mempool *int ret;/* Check type */ - priv = (struct rte_bbdev_op_pool_private *) -rte_mempool_get_priv (mempool); + priv = (struct rte_bbdev_op_pool_private *)rte_mempool_get_priv (mempool);if (unlikely (priv->type !=RTE_BBDEV_OP_FFT ))return -EINVAL ;/* Get elements */ ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; -return 0 ; +return ret; }/**
--
1.8.3.1
RE: [EXT] [PATCH v7 7/7] bbdev: remove unnecessary if-check
Hi Akhil,
Quoted 23 lines
-----Original Message-----
From: Akhil Goyal <[email protected]>
Subject: RE: [EXT] [PATCH v7 7/7] bbdev: remove unnecessary if-checkQuoted 19 lines
Code clean up due to if-check not required
Signed-off-by Nicolas Chautru <[email protected]>Acked-by Maxime Coquelin <[email protected]>--- lib/bbdev/rte_bbdev_op.h | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-)lib/bbdev/rte_bbdev_op.h index renamed from lib/bbdev/rte_bbdev_op.h +0
-0afa1a71..386eed8 100644
lib/bbdev/rte_bbdev_op.h +0
-2@@ -970,10 +970,8 @@ struct rte_mempool */* Get elements */ ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret;
Quoted 5 lines
lib/bbdev/rte_bbdev_op.h struct rte_mempool * · line 974
Quoted 2 lines
lib/bbdev/rte_bbdev_op.h +1
-1-return 0 ; +return ret;Do you really need ret?
It can be easily
returnrte_mempool_get_bulk(mempool, (void **)ops, num_ops);
Sure, fixing in v8.
Quoted 40 lines
same comment for both cleanups
Quoted 38 lines
lib/bbdev/rte_bbdev_op.h +3
-8}/** @@ -1006,10 +1004,8 @@ struct rte_mempool */* Get elements */ ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; -return 0 ; +return ret; }/** @@ -1035,17 +1031,14 @@ struct rte_mempool *int ret;/* Check type */ - priv = (struct rte_bbdev_op_pool_private *) -rte_mempool_get_priv (mempool); + priv = (struct rte_bbdev_op_pool_private *)rte_mempool_get_priv (mempool);if (unlikely (priv->type !=RTE_BBDEV_OP_FFT ))return -EINVAL ;/* Get elements */ ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; -return 0 ; +return ret; }/**
--
1.8.3.1
Re: [PATCH v7 0/7] bbdev changes for 22.11
In reply to Nicolas ChautruSeries-
RE: [PATCH v7 0/7] bbdev changes for 22.11
In reply to Nicolas ChautruHi Akhil,
Can this very serie be applied now?
I would notably like to rebase the other PMDs series based on main branch once this one is merged.
Thanks!
Nic
Quoted 56 lines
-----Original Message-----
From: Chautru, Nicolas <[email protected]>
Sent: Monday, August 29, 2022 11:07 AM
To: [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Richardson, Bruce <[email protected]>; [email protected]; [email protected]; Zhang, Mingshan <[email protected]>; Chautru, Nicolas <[email protected]>
Subject: [PATCH v7 0/7] bbdev changes for 22.11v7: couple of typos in documentation spotted by Maxime. Thanks.
v6: added one comment in commit 2/7 suggested by Maxime.
v5: update base on review from Tom Rix. Number of typos reported and resolved, removed the commit related torw_lockfor now, added a commit for code clean up from review, resolved one rebase issue between 2 commits, used size of array for some bound check implementation. Thanks.
v4: update to the last 2 commits to include function to print the queue status and a fix to therte_lockwithin the wrong structure
v3: update to device status info to also use padded size for the related array. Adding also 2 additionals commits to allow the API struc to expose more information related to queues corner cases/warning as well as an optional rw lock.
Hemant, Maxime, this is planned for DPDK 21.11 but would like review/ack early is possible to get this applied earlier and due to time off this summer. Thanks
NicNicolas Chautru (7):
bbdev: allow operation type enum for growth
bbdev: add device status info
bbdev: add device info on queue topologydrivers/baseband: update PMDs to expose queue per operation
bbdev: add new operation for FFT processing
bbdev: add queue related warning and status information
bbdev: remove unnecessary if-checkapp/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 6 +- doc/guides/prog_guide/bbdev.rst | 130 +++++++++++++++++ drivers/baseband/acc100/rte_acc100_pmd.c | 30 ++-- drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 9 ++ drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 9 ++ drivers/baseband/la12xx/bbdev_la12xx.c | 10 +- drivers/baseband/null/bbdev_null.c | 1 + drivers/baseband/turbo_sw/bbdev_turbo_software.c | 12 ++ examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 57 +++++++- lib/bbdev/rte_bbdev.h | 149 +++++++++++++++++++- lib/bbdev/rte_bbdev_op.h | 156 ++++++++++++++++++++- lib/bbdev/version.map | 12 ++ 14 files changed, 556 insertions(+), 29 deletions(-)--
1.8.3.1
v8 cover bbdev changes for 22.11
In reply to Nicolas Chautruv8: edit based on review by Akhil : typos, coding guidelines. No functional change. Thanks
v7: couple of typos in documentation spotted by Maxime. Thanks.
v6: added one comment in commit 2/7 suggested by Maxime.
v5: update base on review from Tom Rix. Number of typos reported and resolved,
removed the commit related to rw_lock for now, added a commit for
code clean up from review, resolved one rebase issue between 2 commits, used size of array for some bound check implementation. Thanks.
v4: update to the last 2 commits to include function to print the queue status and a fix to the rte_lock within the wrong structure
v3: update to device status info to also use padded size for the related array.
Adding also 2 additionals commits to allow the API struc to expose more information related to queues corner cases/warning as well as an optional rw lock. Hemant, Maxime, this is planned for DPDK 21.11 but would like review/ack early is possible to get this applied earlier and due to time off this summer. Thanks
Nic
Nicolas Chautru (7):
bbdev: allow operation type enum for growth
bbdev: add device status info
bbdev: add device info on queue topology drivers/baseband: update PMDs to expose queue per operation
bbdev: add new operation for FFT processing
bbdev: add queue related warning and status information
bbdev: remove unnecessary if-check
app/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 6 +- doc/guides/prog_guide/bbdev.rst | 130 +++++++++++++++++ drivers/baseband/acc100/rte_acc100_pmd.c | 30 ++-- drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 9 ++ drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 9 ++ drivers/baseband/la12xx/bbdev_la12xx.c | 10 +- drivers/baseband/null/bbdev_null.c | 1 + drivers/baseband/turbo_sw/bbdev_turbo_software.c | 13 ++ examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 57 +++++++- lib/bbdev/rte_bbdev.h | 149 ++++++++++++++++++- lib/bbdev/rte_bbdev_op.h | 157 +++++++++++++++++++-- lib/bbdev/version.map | 12 ++ 14 files changed, 553 insertions(+), 34 deletions(-)
Signature · 1 line
1.8.3.1
PATCH v8 1/7 bbdev: allow operation type enum for growth
From: Nicolas Chautru <[email protected]>
Updating the enum for rte_bbdev_op_type
to allow to keep ABI compatible for enum insertion while adding padded maximum value for array need. Removing RTE_BBDEV_OP_TYPE_COUNT and instead exposing RTE_BBDEV_OP_TYPE_PADDED_MAX.
--- app/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 4 ++-- examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 8 +++++--- lib/bbdev/rte_bbdev_op.h | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-)
app/test-bbdev/test_bbdev.c +1 -1
@@ -521,7 +521,7 @@ struct bbdev_testsuite_params {rte_mempool_free (mp);TEST_ASSERT ((mp =rte_bbdev_op_pool_create ("Test_INV" , -RTE_BBDEV_OP_TYPE_COUNT , size, cache_size,0 )) ==NULL , +RTE_BBDEV_OP_TYPE_PADDED_MAX , size, cache_size,0 )) ==NULL ,"Failed test for rte_bbdev_op_pool_create: " "returned value is not NULL for invalid type" );
app/test-bbdev/test_bbdev_perf.c +2 -2
@@ -2428,13 +2428,13 @@ typedef int (test_case_function)(struct active_device *ad,/* Find capabilities */ const struct rte_bbdev_op_cap *cap = info.drv.capabilities; -for (i =0 ; i <RTE_BBDEV_OP_TYPE_COUNT ; i++) { +do {if (cap->type == test_vector.op_type) { capabilities = cap;break ; } cap++; - } + }while (cap->type !=RTE_BBDEV_OP_NONE );TEST_ASSERT_NOT_NULL (capabilities,"Couldn't find capabilities" );
examples/bbdev_app/main.c +1 -1
@@ -1041,7 +1041,7 @@ uint16_t bbdev_parse_number(const char *mask)void *sigret;struct app_config_params app_params = def_app_config;struct rte_mempool *ethdev_mbuf_mempool, *bbdev_mbuf_mempool; -struct rte_mempool *bbdev_op_pools[RTE_BBDEV_OP_TYPE_COUNT ]; +struct rte_mempool *bbdev_op_pools[RTE_BBDEV_OP_TYPE_PADDED_MAX ];struct lcore_conf lcore_conf[RTE_MAX_LCORE ] = { {0 } };struct lcore_statistics lcore_stats[RTE_MAX_LCORE ] = { {0 } };struct stats_lcore_params stats_lcore;
lib/bbdev/rte_bbdev.c +5 -3
@@ -23,6 +23,8 @@#define DEV_NAME "BBDEV" +/* Number of supported operation types */ +#define BBDEV_OP_TYPE_COUNT 5/* BBDev library logging ID */ RTE_LOG_REGISTER_DEFAULT (bbdev_logtype,NOTICE );
@@ -890,10 +892,10 @@ struct rte_mempool *return NULL ; } -if (type >=RTE_BBDEV_OP_TYPE_COUNT ) { +if (type >=BBDEV_OP_TYPE_COUNT ) {rte_bbdev_log (ERR ,"Invalid op type (%u), should be less than %u" , - type,RTE_BBDEV_OP_TYPE_COUNT ); + type,BBDEV_OP_TYPE_COUNT );return NULL ; }
@@ -1125,7 +1127,7 @@ struct rte_mempool * "RTE_BBDEV_OP_LDPC_ENC", }; -if (op_type <RTE_BBDEV_OP_TYPE_COUNT ) +if (op_type <BBDEV_OP_TYPE_COUNT )return op_types[op_type];rte_bbdev_log (ERR ,"Invalid operation type" );
lib/bbdev/rte_bbdev_op.h +1 -1
@@ -748,7 +748,7 @@ enum rte_bbdev_op_type {RTE_BBDEV_OP_TURBO_ENC ,/**< Turbo encode */ RTE_BBDEV_OP_LDPC_DEC ,/**< LDPC decode */ RTE_BBDEV_OP_LDPC_ENC ,/**< LDPC encode */ - RTE_BBDEV_OP_TYPE_COUNT, /**< Count of different op types */ + RTE_BBDEV_OP_TYPE_PADDED_MAX = 8, /**< Maximum op type number including padding */ };/** Bit indexes of possible errors reported through status field */
Signature · 1 line
1.8.3.1
PATCH v8 2/7 bbdev: add device status info
In reply to Nic ChautruFrom: Nicolas Chautru <[email protected]>
Added device status information, so that the PMD can
expose information related to the underlying accelerator device status. Minor order change in structure to fit into padding hole.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 1 + drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 1 + drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 1 + drivers/baseband/la12xx/bbdev_la12xx.c | 1 + drivers/baseband/null/bbdev_null.c | 1 + drivers/baseband/turbo_sw/bbdev_turbo_software.c | 1 + lib/bbdev/rte_bbdev.c | 22 ++++++++++++++ lib/bbdev/rte_bbdev.h | 35 ++++++++++++++++++++-- lib/bbdev/version.map | 7 +++++ 9 files changed, 68 insertions(+), 2 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +1 -0
@@ -1060,6 +1060,7 @@/* Read and save the populated config from ACC100 registers */ fetch_acc100_config (dev); + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* This isn't ideal because it reports the maximum number of queues but * does not provide info on how many can be uplink/downlink or different
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +1 -0
@@ -369,6 +369,7 @@ dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* Calculates number of queues assigned to device */ dev_info->max_num_queues =0 ;
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +1 -0
@@ -645,6 +645,7 @@ struct __rte_cache_aligned fpga_queue { dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* Calculates number of queues assigned to device */ dev_info->max_num_queues =0 ;
drivers/baseband/la12xx/bbdev_la12xx.c +1 -0
@@ -100,6 +100,7 @@ struct bbdev_la12xx_params { dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->min_alignment =64 ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/null/bbdev_null.c +1 -0
@@ -82,6 +82,7 @@ struct bbdev_queue {* here for code completeness. */ dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/turbo_sw/bbdev_turbo_software.c +1 -0
@@ -254,6 +254,7 @@ struct turbo_sw_queue { dev_info->min_alignment =64 ; dev_info->harq_buffer_size =0 ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u\n" , dev->data->dev_id); }
lib/bbdev/rte_bbdev.c +22 -0
@@ -1133,3 +1133,25 @@ struct rte_mempool *rte_bbdev_log (ERR ,"Invalid operation type" );return NULL ; } + +const char * +rte_bbdev_device_status_str (enum rte_bbdev_device_status status) +{ +static const char *const dev_sta_string[] = { +"RTE_BBDEV_DEV_NOSTATUS" , +"RTE_BBDEV_DEV_NOT_SUPPORTED" , +"RTE_BBDEV_DEV_RESET" , +"RTE_BBDEV_DEV_CONFIGURED" , +"RTE_BBDEV_DEV_ACTIVE" , +"RTE_BBDEV_DEV_FATAL_ERR" , +"RTE_BBDEV_DEV_RESTART_REQ" , +"RTE_BBDEV_DEV_RECONFIG_REQ" , +"RTE_BBDEV_DEV_CORRECT_ERR" , + }; + +if (status <sizeof (dev_sta_string) /sizeof (char *)) +return dev_sta_string[status]; + +rte_bbdev_log (ERR ,"Invalid device status" ); +return NULL ; +}
lib/bbdev/rte_bbdev.h +33 -2
@@ -223,6 +223,21 @@ struct rte_bbdev_queue_conf {int rte_bbdev_queue_stop (uint16_t dev_id,uint16_t queue_id); +/** +* Flags indicate the status of the device +*/ +enum rte_bbdev_device_status { +RTE_BBDEV_DEV_NOSTATUS ,/**< Nothing being reported */ +RTE_BBDEV_DEV_NOT_SUPPORTED ,/**< Device status is not supported on the PMD */ +RTE_BBDEV_DEV_RESET ,/**< Device in reset and un-configured state */ +RTE_BBDEV_DEV_CONFIGURED ,/**< Device is configured and ready to use */ +RTE_BBDEV_DEV_ACTIVE ,/**< Device is configured and VF is being used */ +RTE_BBDEV_DEV_FATAL_ERR ,/**< Device has hit a fatal uncorrectable error */ +RTE_BBDEV_DEV_RESTART_REQ ,/**< Device requires application to restart */ +RTE_BBDEV_DEV_RECONFIG_REQ ,/**< Device requires application to reconfigure queues */ +RTE_BBDEV_DEV_CORRECT_ERR ,/**< Warning of a correctable error event happened */ +}; +/** Device statistics. */ struct rte_bbdev_stats {uint64_t enqueued_count;/**< Count of all operations enqueued */
@@ -284,10 +299,12 @@ struct rte_bbdev_driver_info {uint8_t max_ul_queue_priority;/** Set if device supports per-queue interrupts */ bool queue_intr_supported; -/** Minimum alignment of buffers, in bytes */ -uint16_t min_alignment; +/** Device Status */ +enum rte_bbdev_device_status device_status;/** HARQ memory available in kB */ uint32_t harq_buffer_size; +/** Minimum alignment of buffers, in bytes */ +uint16_t min_alignment;/** Byte endianness (RTE_BIG_ENDIAN/RTE_LITTLE_ENDIAN) supported * for input/output data */
@@ -827,6 +844,20 @@ typedef void (*rte_bbdev_cb_fn)(uint16_t dev_id, rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op, void *data); +/** +* Converts device status from enum to string +* +* @param status +* Device status as enum +* +* @returns +* Operation type as string or NULL if op_type is invalid +* +*/ +__rte_experimental +const char* +rte_bbdev_device_status_str (enum rte_bbdev_device_status status); + #ifdef __cplusplus }#endif
lib/bbdev/version.map +7 -0
@@ -39,3 +39,10 @@ DPDK_22 { local: *; }; + +EXPERIMENTAL { + global: + + # added in 22.11 + rte_bbdev_device_status_str; +};
Signature · 1 line
1.8.3.1
PATCH v8 3/7 bbdev: add device info on queue topology
In reply to Nic ChautruFrom: Nicolas Chautru <[email protected]>
Adding more options in the API to expose the number of queues exposed and related priority.
--- lib/bbdev/rte_bbdev.h | 4 ++++ 1 file changed, 4 insertions(+)
lib/bbdev/rte_bbdev.h +4 -0
@@ -289,6 +289,10 @@ struct rte_bbdev_driver_info {/** Maximum number of queues supported by the device */ unsigned int max_num_queues; +/** Maximum number of queues supported per operation type */ +unsigned int num_queues[RTE_BBDEV_OP_TYPE_PADDED_MAX ]; +/** Priority level supported per operation type */ +unsigned int queue_priority[RTE_BBDEV_OP_TYPE_PADDED_MAX ];/** Queue size limit (queue size must also be power of 2) */ uint32_t queue_size_lim;/** Set if device off-loads operation to hardware */
Signature · 1 line
1.8.3.1
PATCH v8 4/7 drivers/baseband: update PMDs to expose queue per operation
In reply to Nic ChautruFrom: Nicolas Chautru <[email protected]>
Add support in existing bbdev PMDs for the explicit number of queues and priority for each operation type configured on the device.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 29 +++++++++++++--------- drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 8 ++++++ drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 8 ++++++ drivers/baseband/la12xx/bbdev_la12xx.c | 7 ++++++ drivers/baseband/turbo_sw/bbdev_turbo_software.c | 12 +++++++++ 5 files changed, 52 insertions(+), 12 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +17 -12
@@ -966,6 +966,7 @@ struct rte_bbdev_driver_info *dev_info) {struct acc100_device *d = dev->data->dev_private; +int i;static const struct rte_bbdev_op_cap bbdev_capabilities[] = { {
@@ -1062,19 +1063,23 @@fetch_acc100_config (dev); dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; -/* This isn't ideal because it reports the maximum number of queues but -* does not provide info on how many can be uplink/downlink or different -* priorities -*/ - dev_info->max_num_queues = - d->acc100_conf.q_dl_5g.num_aqs_per_groups * - d->acc100_conf.q_dl_5g.num_qgroups + - d->acc100_conf.q_ul_5g.num_aqs_per_groups * - d->acc100_conf.q_ul_5g.num_qgroups + - d->acc100_conf.q_dl_4g.num_aqs_per_groups * - d->acc100_conf.q_dl_4g.num_qgroups + - d->acc100_conf.q_ul_4g.num_aqs_per_groups * +/* Expose number of queues */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] = d->acc100_conf.q_ul_4g.num_aqs_per_groups * d->acc100_conf.q_ul_4g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] = d->acc100_conf.q_dl_4g.num_aqs_per_groups * + d->acc100_conf.q_dl_4g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] = d->acc100_conf.q_ul_5g.num_aqs_per_groups * + d->acc100_conf.q_ul_5g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] = d->acc100_conf.q_dl_5g.num_aqs_per_groups * + d->acc100_conf.q_dl_5g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_DEC ] = d->acc100_conf.q_ul_4g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_ENC ] = d->acc100_conf.q_dl_4g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] = d->acc100_conf.q_ul_5g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] = d->acc100_conf.q_dl_5g.num_qgroups; + dev_info->max_num_queues =0 ; +for (i =RTE_BBDEV_OP_TURBO_DEC ; i <=RTE_BBDEV_OP_LDPC_ENC ; i++) + dev_info->max_num_queues += dev_info->num_queues[i]; dev_info->queue_size_lim =ACC100_MAX_QUEUE_DEPTH ; dev_info->hardware_accelerated = true; dev_info->max_dl_queue_priority =
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +8 -0
@@ -379,6 +379,14 @@if (hw_q_id !=FPGA_INVALID_HW_QUEUE_ID ) dev_info->max_num_queues++; } +/* Expose number of queue per operation type */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] = dev_info->max_num_queues /2 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] =1 ; }/**
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +8 -0
@@ -655,6 +655,14 @@ struct __rte_cache_aligned fpga_queue {if (hw_q_id !=FPGA_INVALID_HW_QUEUE_ID ) dev_info->max_num_queues++; } +/* Expose number of queue per operation type */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] =0 ; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_ENC ] =1 ; }/**
drivers/baseband/la12xx/bbdev_la12xx.c +7 -0
@@ -102,6 +102,13 @@ struct bbdev_la12xx_params { dev_info->min_alignment =64 ; dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] =LA12XX_MAX_QUEUES /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] =LA12XX_MAX_QUEUES /2 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] =1 ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/turbo_sw/bbdev_turbo_software.c +12 -0
@@ -157,6 +157,8 @@ struct turbo_sw_queue { info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) { struct bbdev_private *internals = dev->data->dev_private; +const struct rte_bbdev_op_cap *op_cap; +int num_op_type =0 ;static const struct rte_bbdev_op_cap bbdev_capabilities[] = { #ifdef RTE_BBDEV_SDK_AVX2
@@ -256,6 +258,16 @@ struct turbo_sw_queue { dev_info->data_endianness =RTE_LITTLE_ENDIAN ; dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; + op_cap = bbdev_capabilities; +for (; op_cap->type !=RTE_BBDEV_OP_NONE ; ++op_cap) + num_op_type++; + op_cap = bbdev_capabilities; +if (num_op_type >0 ) { +int num_queue_per_type = dev_info->max_num_queues / num_op_type; +for (; op_cap->type !=RTE_BBDEV_OP_NONE ; ++op_cap) + dev_info->num_queues[op_cap->type] = num_queue_per_type; + } +rte_bbdev_log_debug ("got device info from %u\n" , dev->data->dev_id); }
Signature · 1 line
1.8.3.1
PATCH v8 5/7 bbdev: add new operation for FFT processing
In reply to Nic ChautruFrom: Nicolas Chautru <[email protected]>
Extension of bbdev operation to support FFT based operations.
--- doc/guides/prog_guide/bbdev.rst | 130 +++++++++++++++++++++++++++++++++++ lib/bbdev/rte_bbdev.c | 10 ++- lib/bbdev/rte_bbdev.h | 76 ++++++++++++++++++++ lib/bbdev/rte_bbdev_op.h | 149 ++++++++++++++++++++++++++++++++++++++++ lib/bbdev/version.map | 4 ++ 5 files changed, 368 insertions(+), 1 deletion(-)
doc/guides/prog_guide/bbdev.rst +130 -0
@@ -1118,6 +1118,136 @@ Figure :numref:`figure_turbo_tb_decode` above showing the Turbo decoding of CBs using BBDEV interface in TB-mode is also valid for LDPC decode. +BBDEV FFT Operation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This operation allows to run a combination of DFT and/or IDFT and/or time-domain windowing. +These can be used in a modular fashion (using bypass modes) or as a processing pipeline +which can be used for FFT-based baseband signal processing. +In more details it allows : +- to process the data first through an IDFT of adjustable size and padding; +- to perform the windowing as a programmable cyclic shift offset of the data followed by a +pointwise multiplication by a time domain window; +- to process the related data through a DFT of adjustable size and de-padding for each such cyclic +shift output. + +A flexible number of Rx antennas are being processed in parallel with the same configuration. +The API allows more generally for flexibility in what the PMD may support (capability flags) and +flexibility to adjust some of the parameters of the processing. + +The operation/capability flags that can be set for each FFT operation are given below. + + **NOTE:** The actual operation flags that may be used with a specific + BBDEV PMD are dependent on the driver capabilities as reported via + ``rte_bbdev_info_get()``, and may be a subset of those below. + ++--------------------------------------------------------------------+ +|Description of FFT capability flags | ++====================================================================+ +|RTE_BBDEV_FFT_WINDOWING | +| Set to enable/support windowing in time domain | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_CS_ADJUSTMENT | +| Set to enable/support the cyclic shift time offset adjustment | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_DFT_BYPASS | +| Set to bypass the DFT and use directly the IDFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_IDFT_BYPASS | +| Set to bypass the IDFT and use directly the DFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_WINDOWING_BYPASS | +| Set to bypass the time domain windowing as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_POWER_MEAS | +| Set to provide an optional power measurement of the DFT output | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_INPUT | +| Set if the input data shall use FP16 format instead of INT16 | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_OUTPUT | +| Set if the output data shall use FP16 format instead of INT16 | ++--------------------------------------------------------------------+ + +The structure passed for each FFT operation is given below, +with the operation flags forming a bitmask in the ``op_flags`` field. + +.. code-block:: c + + struct rte_bbdev_op_fft { + struct rte_bbdev_op_data base_input; + struct rte_bbdev_op_data base_output; + struct rte_bbdev_op_data power_meas_output; + uint32_t op_flags; + uint16_t input_sequence_size; + uint16_t input_leading_padding; + uint16_t output_sequence_size; + uint16_t output_leading_depadding; + uint8_t window_index[RTE_BBDEV_MAX_CS_2]; + uint16_t cs_bitmap; + uint8_t num_antennas_log2; + uint8_t idft_log2; + uint8_t dft_log2; + int8_t cs_time_adjustment; + int8_t idft_shift; + int8_t dft_shift; + uint16_t ncs_reciprocal; + uint16_t power_shift; + uint16_t fp16_exp_adjust; + }; + +The FFT parameters are set out in the table below. + ++-------------------------+--------------------------------------------------------------+ +|Parameter |Description | ++=========================+==============================================================+ +|base_input |input data | ++-------------------------+--------------------------------------------------------------+ +|base_output |output data | ++-------------------------+--------------------------------------------------------------+ +|power_meas_output |optional output data with power measurement on DFT output | ++-------------------------+--------------------------------------------------------------+ +|op_flags |bitmask of all active operation capabilities | ++-------------------------+--------------------------------------------------------------+ +|input_sequence_size |size of the input sequence in 32-bits points per antenna | ++-------------------------+--------------------------------------------------------------+ +|input_leading_padding |number of points padded at the start of input data | ++-------------------------+--------------------------------------------------------------+ +|output_sequence_size |size of the output sequence per antenna and cyclic shift | ++-------------------------+--------------------------------------------------------------+ +|output_leading_depadding |number of points de-padded at the start of output data | ++-------------------------+--------------------------------------------------------------+ +|window_index |optional windowing profile index used for each cyclic shift | ++-------------------------+--------------------------------------------------------------+ +|cs_bitmap |bitmap of the cyclic shift output requested (LSB for index 0) | ++-------------------------+--------------------------------------------------------------+ +|num_antennas_log2 |number of antennas as a log2 (10 maps to 1024...) | ++-------------------------+--------------------------------------------------------------+ +|idft_log2 |iDFT size as a log2 | ++-------------------------+--------------------------------------------------------------+ +|dft_log2 |DFT size as a log2 | ++-------------------------+--------------------------------------------------------------+ +|cs_time_adjustment |adjustment of time position of all the cyclic shift output | ++-------------------------+--------------------------------------------------------------+ +|idft_shift |shift down of signal level post iDFT | ++-------------------------+--------------------------------------------------------------+ +|dft_shift |shift down of signal level post DFT | ++-------------------------+--------------------------------------------------------------+ +|ncs_reciprocal |inverse of max number of CS normalized to 15b (ie. 231 for 12)| ++-------------------------+--------------------------------------------------------------+ +|power_shift |shift down of level of power measurement when enabled | ++-------------------------+--------------------------------------------------------------+ +|fp16_exp_adjust |value added to FP16 exponent at conversion from INT16 | ++-------------------------+--------------------------------------------------------------+ + +The mbuf input ``base_input`` is mandatory for all BBDEV PMDs and is the +incoming data for the processing. Its size may not fit into an actual mbuf, but the +structure is used to pass iova address. +The mbuf output ``output`` is mandatory and is output of the FFT processing chain. +Each point is a complex number of 32bits : either as 2 INT16 or as 2 FP16 based when the option +supported. +The data layout is based on contiguous concatenation of output data first by cyclic shift then +by antenna. Sample code -----------
lib/bbdev/rte_bbdev.c +9 -1
@@ -24,7 +24,7 @@#define DEV_NAME "BBDEV"/* Number of supported operation types */ -#define BBDEV_OP_TYPE_COUNT 5 +#define BBDEV_OP_TYPE_COUNT 6/* BBDev library logging ID */ RTE_LOG_REGISTER_DEFAULT (bbdev_logtype,NOTICE );
@@ -852,6 +852,9 @@ struct rte_bbdev *case RTE_BBDEV_OP_LDPC_ENC : result =sizeof (struct rte_bbdev_enc_op );break ; +case RTE_BBDEV_OP_FFT : + result =sizeof (struct rte_bbdev_fft_op ); +break ;default :break ; }
@@ -875,6 +878,10 @@ struct rte_bbdev *struct rte_bbdev_enc_op *op = element;memset (op,0 , mempool->elt_size); op->mempool = mempool; + }else if (type ==RTE_BBDEV_OP_FFT ) { +struct rte_bbdev_fft_op *op = element; +memset (op,0 , mempool->elt_size); + op->mempool = mempool; } }
@@ -1125,6 +1132,7 @@ struct rte_mempool *"RTE_BBDEV_OP_TURBO_ENC" ,"RTE_BBDEV_OP_LDPC_DEC" ,"RTE_BBDEV_OP_LDPC_ENC" , + "RTE_BBDEV_OP_FFT", };if (op_type <BBDEV_OP_TYPE_COUNT )
lib/bbdev/rte_bbdev.h +76 -0
106 lines not on this page · raw message
lib/bbdev/rte_bbdev_op.h +149 -0
203 lines not on this page · raw message
lib/bbdev/version.map +4 -0
@@ -45,4 +45,8 @@ EXPERIMENTAL { # added in 22.11 rte_bbdev_device_status_str; + rte_bbdev_enqueue_fft_ops; + rte_bbdev_dequeue_fft_ops; + rte_bbdev_fft_op_alloc_bulk; + rte_bbdev_fft_op_free_bulk; };
Signature · 1 line
1.8.3.1
PATCH v8 6/7 bbdev: add queue related warning and status information
In reply to Nic ChautruFrom: Nicolas Chautru <[email protected]>
This allows to expose more information with regards to any queue related failure and warning which cannot be supported in existing API.
--- app/test-bbdev/test_bbdev_perf.c | 2 ++ lib/bbdev/rte_bbdev.c | 19 +++++++++++++++++++ lib/bbdev/rte_bbdev.h | 34 ++++++++++++++++++++++++++++++++++ lib/bbdev/version.map | 1 + 4 files changed, 56 insertions(+)
app/test-bbdev/test_bbdev_perf.c +2 -0
@@ -4360,6 +4360,8 @@ typedef int (test_case_function)(struct active_device *ad, stats->dequeued_count = q_stats->dequeued_count; stats->enqueue_err_count = q_stats->enqueue_err_count; stats->dequeue_err_count = q_stats->dequeue_err_count; + stats->enqueue_warning_count = q_stats->enqueue_warning_count; + stats->dequeue_warning_count = q_stats->dequeue_warning_count; stats->acc_offload_cycles = q_stats->acc_offload_cycles;return 0 ;
lib/bbdev/rte_bbdev.c +19 -0
@@ -721,6 +721,8 @@ struct rte_bbdev * stats->dequeued_count += q_stats->dequeued_count; stats->enqueue_err_count += q_stats->enqueue_err_count; stats->dequeue_err_count += q_stats->dequeue_err_count; + stats->enqueue_warn_count += q_stats->enqueue_warn_count; + stats->dequeue_warn_count += q_stats->dequeue_warn_count; }rte_bbdev_log_debug ("Got stats on %u" , dev->data->dev_id); }
@@ -1163,3 +1165,20 @@ struct rte_mempool *rte_bbdev_log (ERR ,"Invalid device status" );return NULL ; } + +const char * +rte_bbdev_enqueue_status_str (enum rte_bbdev_enqueue_status status) +{ +static const char *const enq_sta_string[] = { +"RTE_BBDEV_ENQ_STATUS_NONE" , +"RTE_BBDEV_ENQ_STATUS_QUEUE_FULL" , +"RTE_BBDEV_ENQ_STATUS_RING_FULL" , +"RTE_BBDEV_ENQ_STATUS_INVALID_OP" , + }; + +if (status <sizeof (enq_sta_string) /sizeof (char *)) +return enq_sta_string[status]; + +rte_bbdev_log (ERR ,"Invalid enqueue status" ); +return NULL ; +}
lib/bbdev/rte_bbdev.h +34 -0
@@ -224,6 +224,19 @@ struct rte_bbdev_queue_conf { rte_bbdev_queue_stop(uint16_t dev_id, uint16_t queue_id);/** +* Flags indicate the reason why a previous enqueue may not have +* consumed all requested operations +* In case of multiple reasons the latter supersedes a previous one +*/ +enum rte_bbdev_enqueue_status { +RTE_BBDEV_ENQ_STATUS_NONE ,/**< Nothing to report */ +RTE_BBDEV_ENQ_STATUS_QUEUE_FULL ,/**< Not enough room in queue */ +RTE_BBDEV_ENQ_STATUS_RING_FULL ,/**< Not enough room in ring */ +RTE_BBDEV_ENQ_STATUS_INVALID_OP ,/**< Operation was rejected as invalid */ +RTE_BBDEV_ENQ_STATUS_PADDED_MAX =6 ,/**< Maximum enq status number including padding */ +}; + +/** * Flags indicate the status of the device */ enum rte_bbdev_device_status {
@@ -246,6 +259,12 @@ struct rte_bbdev_stats {uint64_t enqueue_err_count;/** Total error count on operations dequeued */ uint64_t dequeue_err_count; +/** Total warning count on operations enqueued */ +uint64_t enqueue_warn_count; +/** Total warning count on operations dequeued */ +uint64_t dequeue_warn_count; +/** Total enqueue status count based on rte_bbdev_enqueue_status enum */ +uint64_t enqueue_status_count[RTE_BBDEV_ENQ_STATUS_PADDED_MAX ];/** CPU cycles consumed by the (HW/SW) accelerator device to offload * the enqueue request to its internal queues. * - For a HW device this is the cycles consumed in MMIO write
@@ -386,6 +405,7 @@ struct rte_bbdev_queue_data {void *queue_private;/**< Driver-specific per-queue data */ struct rte_bbdev_queue_conf conf;/**< Current configuration */ struct rte_bbdev_stats queue_stats;/**< Queue statistics */ +enum rte_bbdev_enqueue_status enqueue_status;/**< Enqueue status when op is rejected */ bool started;/**< Queue state */ };
@@ -938,6 +958,20 @@ typedef void (*rte_bbdev_cb_fn)(uint16_t dev_id,const char *rte_bbdev_device_status_str (enum rte_bbdev_device_status status); +/** +* Converts queue status from enum to string +* +* @param status +* Queue status as enum +* +* @returns +* Queue status as string or NULL if op_type is invalid +* +*/ +__rte_experimental +const char* +rte_bbdev_enqueue_status_str (enum rte_bbdev_enqueue_status status); + #ifdef __cplusplus }#endif
lib/bbdev/version.map +1 -0
@@ -45,6 +45,7 @@ EXPERIMENTAL { # added in 22.11 rte_bbdev_device_status_str; + rte_bbdev_enqueue_status_str; rte_bbdev_enqueue_fft_ops; rte_bbdev_dequeue_fft_ops; rte_bbdev_fft_op_alloc_bulk;
Signature · 1 line
1.8.3.1
PATCH v8 7/7 bbdev: remove unnecessary if-check
In reply to Nic ChautruFrom: Nicolas Chautru <[email protected]>
Code clean up due to if-check not required
--- lib/bbdev/rte_bbdev_op.h | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-)
lib/bbdev/rte_bbdev_op.h +4 -20
@@ -959,7 +959,6 @@ struct rte_mempool * struct rte_bbdev_enc_op **ops, uint16_t num_ops) {struct rte_bbdev_op_pool_private *priv; -int ret;/* Check type */ priv = (struct rte_bbdev_op_pool_private *)
@@ -969,11 +968,7 @@ struct rte_mempool *return -EINVAL ;/* Get elements */ - ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; - -return 0 ; +return rte_mempool_get_bulk (mempool, (void **)ops, num_ops); }/**
@@ -995,7 +990,6 @@ struct rte_mempool * struct rte_bbdev_dec_op **ops, uint16_t num_ops) {struct rte_bbdev_op_pool_private *priv; -int ret;/* Check type */ priv = (struct rte_bbdev_op_pool_private *)
@@ -1005,11 +999,7 @@ struct rte_mempool *return -EINVAL ;/* Get elements */ - ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; - -return 0 ; +return rte_mempool_get_bulk (mempool, (void **)ops, num_ops); }/**
@@ -1032,20 +1022,14 @@ struct rte_mempool * struct rte_bbdev_fft_op **ops, uint16_t num_ops) {struct rte_bbdev_op_pool_private *priv; -int ret;/* Check type */ - priv = (struct rte_bbdev_op_pool_private *) -rte_mempool_get_priv (mempool); + priv = (struct rte_bbdev_op_pool_private *)rte_mempool_get_priv (mempool);if (unlikely (priv->type !=RTE_BBDEV_OP_FFT ))return -EINVAL ;/* Get elements */ - ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; - -return 0 ; +return rte_mempool_get_bulk (mempool, (void **)ops, num_ops); }/**
Signature · 1 line
1.8.3.1
v9 cover bbdev changes for 22.11
In reply to Nicolas Chautruv9: removing code snippet from documentation in 5/7 requested by Akhil. Thanks.
v8: edit based on review by Akhil : typos, coding guidelines. No functional change. Thanks
v7: couple of typos in documentation spotted by Maxime. Thanks.
v6: added one comment in commit 2/7 suggested by Maxime.
v5: update base on review from Tom Rix. Number of typos reported and resolved,
removed the commit related to rw_lock for now, added a commit for
code clean up from review, resolved one rebase issue between 2 commits, used size of array for some bound check implementation. Thanks.
v4: update to the last 2 commits to include function to print the queue status and a fix to the rte_lock within the wrong structure
v3: update to device status info to also use padded size for the related array.
Adding also 2 additionals commits to allow the API struc to expose more information related to queues corner cases/warning as well as an optional rw lock. Hemant, Maxime, this is planned for DPDK 21.11 but would like review/ack early is possible to get this applied earlier and due to time off this summer. Thanks
Nic
Nicolas Chautru (7):
bbdev: allow operation type enum for growth
bbdev: add device status info
bbdev: add device info on queue topology drivers/baseband: update PMDs to expose queue per operation
bbdev: add new operation for FFT processing
bbdev: add queue related warning and status information
bbdev: remove unnecessary if-check
app/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 6 +- doc/guides/prog_guide/bbdev.rst | 103 ++++++++++++++ drivers/baseband/acc100/rte_acc100_pmd.c | 30 ++-- drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 9 ++ drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 9 ++ drivers/baseband/la12xx/bbdev_la12xx.c | 10 +- drivers/baseband/null/bbdev_null.c | 1 + drivers/baseband/turbo_sw/bbdev_turbo_software.c | 13 ++ examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 57 +++++++- lib/bbdev/rte_bbdev.h | 149 ++++++++++++++++++- lib/bbdev/rte_bbdev_op.h | 157 +++++++++++++++++++-- lib/bbdev/version.map | 12 ++ 14 files changed, 526 insertions(+), 34 deletions(-)
Signature · 1 line
1.8.3.1
PATCH v9 1/7 bbdev: allow operation type enum for growth
From: Nicolas Chautru <[email protected]>
Updating the enum for rte_bbdev_op_type
to allow to keep ABI compatible for enum insertion while adding padded maximum value for array need. Removing RTE_BBDEV_OP_TYPE_COUNT and instead exposing RTE_BBDEV_OP_TYPE_PADDED_MAX.
--- app/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 4 ++-- examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 8 +++++--- lib/bbdev/rte_bbdev_op.h | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-)
app/test-bbdev/test_bbdev.c +1 -1
@@ -521,7 +521,7 @@ struct bbdev_testsuite_params {rte_mempool_free (mp);TEST_ASSERT ((mp =rte_bbdev_op_pool_create ("Test_INV" , -RTE_BBDEV_OP_TYPE_COUNT , size, cache_size,0 )) ==NULL , +RTE_BBDEV_OP_TYPE_PADDED_MAX , size, cache_size,0 )) ==NULL ,"Failed test for rte_bbdev_op_pool_create: " "returned value is not NULL for invalid type" );
app/test-bbdev/test_bbdev_perf.c +2 -2
@@ -2428,13 +2428,13 @@ typedef int (test_case_function)(struct active_device *ad,/* Find capabilities */ const struct rte_bbdev_op_cap *cap = info.drv.capabilities; -for (i =0 ; i <RTE_BBDEV_OP_TYPE_COUNT ; i++) { +do {if (cap->type == test_vector.op_type) { capabilities = cap;break ; } cap++; - } + }while (cap->type !=RTE_BBDEV_OP_NONE );TEST_ASSERT_NOT_NULL (capabilities,"Couldn't find capabilities" );
examples/bbdev_app/main.c +1 -1
@@ -1041,7 +1041,7 @@ uint16_t bbdev_parse_number(const char *mask)void *sigret;struct app_config_params app_params = def_app_config;struct rte_mempool *ethdev_mbuf_mempool, *bbdev_mbuf_mempool; -struct rte_mempool *bbdev_op_pools[RTE_BBDEV_OP_TYPE_COUNT ]; +struct rte_mempool *bbdev_op_pools[RTE_BBDEV_OP_TYPE_PADDED_MAX ];struct lcore_conf lcore_conf[RTE_MAX_LCORE ] = { {0 } };struct lcore_statistics lcore_stats[RTE_MAX_LCORE ] = { {0 } };struct stats_lcore_params stats_lcore;
lib/bbdev/rte_bbdev.c +5 -3
@@ -23,6 +23,8 @@#define DEV_NAME "BBDEV" +/* Number of supported operation types */ +#define BBDEV_OP_TYPE_COUNT 5/* BBDev library logging ID */ RTE_LOG_REGISTER_DEFAULT (bbdev_logtype,NOTICE );
@@ -890,10 +892,10 @@ struct rte_mempool *return NULL ; } -if (type >=RTE_BBDEV_OP_TYPE_COUNT ) { +if (type >=BBDEV_OP_TYPE_COUNT ) {rte_bbdev_log (ERR ,"Invalid op type (%u), should be less than %u" , - type,RTE_BBDEV_OP_TYPE_COUNT ); + type,BBDEV_OP_TYPE_COUNT );return NULL ; }
@@ -1125,7 +1127,7 @@ struct rte_mempool * "RTE_BBDEV_OP_LDPC_ENC", }; -if (op_type <RTE_BBDEV_OP_TYPE_COUNT ) +if (op_type <BBDEV_OP_TYPE_COUNT )return op_types[op_type];rte_bbdev_log (ERR ,"Invalid operation type" );
lib/bbdev/rte_bbdev_op.h +1 -1
@@ -748,7 +748,7 @@ enum rte_bbdev_op_type {RTE_BBDEV_OP_TURBO_ENC ,/**< Turbo encode */ RTE_BBDEV_OP_LDPC_DEC ,/**< LDPC decode */ RTE_BBDEV_OP_LDPC_ENC ,/**< LDPC encode */ - RTE_BBDEV_OP_TYPE_COUNT, /**< Count of different op types */ + RTE_BBDEV_OP_TYPE_PADDED_MAX = 8, /**< Maximum op type number including padding */ };/** Bit indexes of possible errors reported through status field */
Signature · 1 line
1.8.3.1
PATCH v9 2/7 bbdev: add device status info
In reply to Nic ChautruFrom: Nicolas Chautru <[email protected]>
Added device status information, so that the PMD can
expose information related to the underlying accelerator device status. Minor order change in structure to fit into padding hole.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 1 + drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 1 + drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 1 + drivers/baseband/la12xx/bbdev_la12xx.c | 1 + drivers/baseband/null/bbdev_null.c | 1 + drivers/baseband/turbo_sw/bbdev_turbo_software.c | 1 + lib/bbdev/rte_bbdev.c | 22 ++++++++++++++ lib/bbdev/rte_bbdev.h | 35 ++++++++++++++++++++-- lib/bbdev/version.map | 7 +++++ 9 files changed, 68 insertions(+), 2 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +1 -0
@@ -1060,6 +1060,7 @@/* Read and save the populated config from ACC100 registers */ fetch_acc100_config (dev); + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* This isn't ideal because it reports the maximum number of queues but * does not provide info on how many can be uplink/downlink or different
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +1 -0
@@ -369,6 +369,7 @@ dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* Calculates number of queues assigned to device */ dev_info->max_num_queues =0 ;
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +1 -0
@@ -645,6 +645,7 @@ struct __rte_cache_aligned fpga_queue { dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* Calculates number of queues assigned to device */ dev_info->max_num_queues =0 ;
drivers/baseband/la12xx/bbdev_la12xx.c +1 -0
@@ -100,6 +100,7 @@ struct bbdev_la12xx_params { dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->min_alignment =64 ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/null/bbdev_null.c +1 -0
@@ -82,6 +82,7 @@ struct bbdev_queue {* here for code completeness. */ dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/turbo_sw/bbdev_turbo_software.c +1 -0
@@ -254,6 +254,7 @@ struct turbo_sw_queue { dev_info->min_alignment =64 ; dev_info->harq_buffer_size =0 ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u\n" , dev->data->dev_id); }
lib/bbdev/rte_bbdev.c +22 -0
@@ -1133,3 +1133,25 @@ struct rte_mempool *rte_bbdev_log (ERR ,"Invalid operation type" );return NULL ; } + +const char * +rte_bbdev_device_status_str (enum rte_bbdev_device_status status) +{ +static const char *const dev_sta_string[] = { +"RTE_BBDEV_DEV_NOSTATUS" , +"RTE_BBDEV_DEV_NOT_SUPPORTED" , +"RTE_BBDEV_DEV_RESET" , +"RTE_BBDEV_DEV_CONFIGURED" , +"RTE_BBDEV_DEV_ACTIVE" , +"RTE_BBDEV_DEV_FATAL_ERR" , +"RTE_BBDEV_DEV_RESTART_REQ" , +"RTE_BBDEV_DEV_RECONFIG_REQ" , +"RTE_BBDEV_DEV_CORRECT_ERR" , + }; + +if (status <sizeof (dev_sta_string) /sizeof (char *)) +return dev_sta_string[status]; + +rte_bbdev_log (ERR ,"Invalid device status" ); +return NULL ; +}
lib/bbdev/rte_bbdev.h +33 -2
@@ -223,6 +223,21 @@ struct rte_bbdev_queue_conf {int rte_bbdev_queue_stop (uint16_t dev_id,uint16_t queue_id); +/** +* Flags indicate the status of the device +*/ +enum rte_bbdev_device_status { +RTE_BBDEV_DEV_NOSTATUS ,/**< Nothing being reported */ +RTE_BBDEV_DEV_NOT_SUPPORTED ,/**< Device status is not supported on the PMD */ +RTE_BBDEV_DEV_RESET ,/**< Device in reset and un-configured state */ +RTE_BBDEV_DEV_CONFIGURED ,/**< Device is configured and ready to use */ +RTE_BBDEV_DEV_ACTIVE ,/**< Device is configured and VF is being used */ +RTE_BBDEV_DEV_FATAL_ERR ,/**< Device has hit a fatal uncorrectable error */ +RTE_BBDEV_DEV_RESTART_REQ ,/**< Device requires application to restart */ +RTE_BBDEV_DEV_RECONFIG_REQ ,/**< Device requires application to reconfigure queues */ +RTE_BBDEV_DEV_CORRECT_ERR ,/**< Warning of a correctable error event happened */ +}; +/** Device statistics. */ struct rte_bbdev_stats {uint64_t enqueued_count;/**< Count of all operations enqueued */
@@ -284,10 +299,12 @@ struct rte_bbdev_driver_info {uint8_t max_ul_queue_priority;/** Set if device supports per-queue interrupts */ bool queue_intr_supported; -/** Minimum alignment of buffers, in bytes */ -uint16_t min_alignment; +/** Device Status */ +enum rte_bbdev_device_status device_status;/** HARQ memory available in kB */ uint32_t harq_buffer_size; +/** Minimum alignment of buffers, in bytes */ +uint16_t min_alignment;/** Byte endianness (RTE_BIG_ENDIAN/RTE_LITTLE_ENDIAN) supported * for input/output data */
@@ -827,6 +844,20 @@ typedef void (*rte_bbdev_cb_fn)(uint16_t dev_id, rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op, void *data); +/** +* Converts device status from enum to string +* +* @param status +* Device status as enum +* +* @returns +* Operation type as string or NULL if op_type is invalid +* +*/ +__rte_experimental +const char* +rte_bbdev_device_status_str (enum rte_bbdev_device_status status); + #ifdef __cplusplus }#endif
lib/bbdev/version.map +7 -0
@@ -39,3 +39,10 @@ DPDK_22 { local: *; }; + +EXPERIMENTAL { + global: + + # added in 22.11 + rte_bbdev_device_status_str; +};
Signature · 1 line
1.8.3.1
PATCH v9 3/7 bbdev: add device info on queue topology
In reply to Nic ChautruFrom: Nicolas Chautru <[email protected]>
Adding more options in the API to expose the number of queues exposed and related priority.
--- lib/bbdev/rte_bbdev.h | 4 ++++ 1 file changed, 4 insertions(+)
lib/bbdev/rte_bbdev.h +4 -0
@@ -289,6 +289,10 @@ struct rte_bbdev_driver_info {/** Maximum number of queues supported by the device */ unsigned int max_num_queues; +/** Maximum number of queues supported per operation type */ +unsigned int num_queues[RTE_BBDEV_OP_TYPE_PADDED_MAX ]; +/** Priority level supported per operation type */ +unsigned int queue_priority[RTE_BBDEV_OP_TYPE_PADDED_MAX ];/** Queue size limit (queue size must also be power of 2) */ uint32_t queue_size_lim;/** Set if device off-loads operation to hardware */
Signature · 1 line
1.8.3.1
PATCH v9 4/7 drivers/baseband: update PMDs to expose queue per operation
In reply to Nic ChautruFrom: Nicolas Chautru <[email protected]>
Add support in existing bbdev PMDs for the explicit number of queues and priority for each operation type configured on the device.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 29 +++++++++++++--------- drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 8 ++++++ drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 8 ++++++ drivers/baseband/la12xx/bbdev_la12xx.c | 7 ++++++ drivers/baseband/turbo_sw/bbdev_turbo_software.c | 12 +++++++++ 5 files changed, 52 insertions(+), 12 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +17 -12
@@ -966,6 +966,7 @@ struct rte_bbdev_driver_info *dev_info) {struct acc100_device *d = dev->data->dev_private; +int i;static const struct rte_bbdev_op_cap bbdev_capabilities[] = { {
@@ -1062,19 +1063,23 @@fetch_acc100_config (dev); dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; -/* This isn't ideal because it reports the maximum number of queues but -* does not provide info on how many can be uplink/downlink or different -* priorities -*/ - dev_info->max_num_queues = - d->acc100_conf.q_dl_5g.num_aqs_per_groups * - d->acc100_conf.q_dl_5g.num_qgroups + - d->acc100_conf.q_ul_5g.num_aqs_per_groups * - d->acc100_conf.q_ul_5g.num_qgroups + - d->acc100_conf.q_dl_4g.num_aqs_per_groups * - d->acc100_conf.q_dl_4g.num_qgroups + - d->acc100_conf.q_ul_4g.num_aqs_per_groups * +/* Expose number of queues */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] = d->acc100_conf.q_ul_4g.num_aqs_per_groups * d->acc100_conf.q_ul_4g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] = d->acc100_conf.q_dl_4g.num_aqs_per_groups * + d->acc100_conf.q_dl_4g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] = d->acc100_conf.q_ul_5g.num_aqs_per_groups * + d->acc100_conf.q_ul_5g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] = d->acc100_conf.q_dl_5g.num_aqs_per_groups * + d->acc100_conf.q_dl_5g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_DEC ] = d->acc100_conf.q_ul_4g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_ENC ] = d->acc100_conf.q_dl_4g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] = d->acc100_conf.q_ul_5g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] = d->acc100_conf.q_dl_5g.num_qgroups; + dev_info->max_num_queues =0 ; +for (i =RTE_BBDEV_OP_TURBO_DEC ; i <=RTE_BBDEV_OP_LDPC_ENC ; i++) + dev_info->max_num_queues += dev_info->num_queues[i]; dev_info->queue_size_lim =ACC100_MAX_QUEUE_DEPTH ; dev_info->hardware_accelerated = true; dev_info->max_dl_queue_priority =
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +8 -0
@@ -379,6 +379,14 @@if (hw_q_id !=FPGA_INVALID_HW_QUEUE_ID ) dev_info->max_num_queues++; } +/* Expose number of queue per operation type */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] = dev_info->max_num_queues /2 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] =1 ; }/**
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +8 -0
@@ -655,6 +655,14 @@ struct __rte_cache_aligned fpga_queue {if (hw_q_id !=FPGA_INVALID_HW_QUEUE_ID ) dev_info->max_num_queues++; } +/* Expose number of queue per operation type */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] =0 ; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_ENC ] =1 ; }/**
drivers/baseband/la12xx/bbdev_la12xx.c +7 -0
@@ -102,6 +102,13 @@ struct bbdev_la12xx_params { dev_info->min_alignment =64 ; dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] =LA12XX_MAX_QUEUES /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] =LA12XX_MAX_QUEUES /2 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] =1 ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/turbo_sw/bbdev_turbo_software.c +12 -0
@@ -157,6 +157,8 @@ struct turbo_sw_queue { info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) { struct bbdev_private *internals = dev->data->dev_private; +const struct rte_bbdev_op_cap *op_cap; +int num_op_type =0 ;static const struct rte_bbdev_op_cap bbdev_capabilities[] = { #ifdef RTE_BBDEV_SDK_AVX2
@@ -256,6 +258,16 @@ struct turbo_sw_queue { dev_info->data_endianness =RTE_LITTLE_ENDIAN ; dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; + op_cap = bbdev_capabilities; +for (; op_cap->type !=RTE_BBDEV_OP_NONE ; ++op_cap) + num_op_type++; + op_cap = bbdev_capabilities; +if (num_op_type >0 ) { +int num_queue_per_type = dev_info->max_num_queues / num_op_type; +for (; op_cap->type !=RTE_BBDEV_OP_NONE ; ++op_cap) + dev_info->num_queues[op_cap->type] = num_queue_per_type; + } +rte_bbdev_log_debug ("got device info from %u\n" , dev->data->dev_id); }
Signature · 1 line
1.8.3.1
PATCH v9 5/7 bbdev: add new operation for FFT processing
In reply to Nic ChautruFrom: Nicolas Chautru <[email protected]>
Extension of bbdev operation to support FFT based operations.
--- doc/guides/prog_guide/bbdev.rst | 103 +++++++++++++++++++++++++++ lib/bbdev/rte_bbdev.c | 10 ++- lib/bbdev/rte_bbdev.h | 76 ++++++++++++++++++++ lib/bbdev/rte_bbdev_op.h | 149 ++++++++++++++++++++++++++++++++++++++++ lib/bbdev/version.map | 4 ++ 5 files changed, 341 insertions(+), 1 deletion(-)
doc/guides/prog_guide/bbdev.rst +103 -0
@@ -1118,6 +1118,109 @@ Figure :numref:`figure_turbo_tb_decode` above showing the Turbo decoding of CBs using BBDEV interface in TB-mode is also valid for LDPC decode. +BBDEV FFT Operation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This operation allows to run a combination of DFT and/or IDFT and/or time-domain windowing. +These can be used in a modular fashion (using bypass modes) or as a processing pipeline +which can be used for FFT-based baseband signal processing. +In more details it allows : +- to process the data first through an IDFT of adjustable size and padding; +- to perform the windowing as a programmable cyclic shift offset of the data followed by a +pointwise multiplication by a time domain window; +- to process the related data through a DFT of adjustable size and de-padding for each such cyclic +shift output. + +A flexible number of Rx antennas are being processed in parallel with the same configuration. +The API allows more generally for flexibility in what the PMD may support (capability flags) and +flexibility to adjust some of the parameters of the processing. + +The operation/capability flags that can be set for each FFT operation are given below. + + **NOTE:** The actual operation flags that may be used with a specific + BBDEV PMD are dependent on the driver capabilities as reported via + ``rte_bbdev_info_get()``, and may be a subset of those below. + ++--------------------------------------------------------------------+ +|Description of FFT capability flags | ++====================================================================+ +|RTE_BBDEV_FFT_WINDOWING | +| Set to enable/support windowing in time domain | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_CS_ADJUSTMENT | +| Set to enable/support the cyclic shift time offset adjustment | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_DFT_BYPASS | +| Set to bypass the DFT and use directly the IDFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_IDFT_BYPASS | +| Set to bypass the IDFT and use directly the DFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_WINDOWING_BYPASS | +| Set to bypass the time domain windowing as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_POWER_MEAS | +| Set to provide an optional power measurement of the DFT output | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_INPUT | +| Set if the input data shall use FP16 format instead of INT16 | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_OUTPUT | +| Set if the output data shall use FP16 format instead of INT16 | ++--------------------------------------------------------------------+ + +The FFT parameters are set out in the table below. + ++-------------------------+--------------------------------------------------------------+ +|Parameter |Description | ++=========================+==============================================================+ +|base_input |input data | ++-------------------------+--------------------------------------------------------------+ +|base_output |output data | ++-------------------------+--------------------------------------------------------------+ +|power_meas_output |optional output data with power measurement on DFT output | ++-------------------------+--------------------------------------------------------------+ +|op_flags |bitmask of all active operation capabilities | ++-------------------------+--------------------------------------------------------------+ +|input_sequence_size |size of the input sequence in 32-bits points per antenna | ++-------------------------+--------------------------------------------------------------+ +|input_leading_padding |number of points padded at the start of input data | ++-------------------------+--------------------------------------------------------------+ +|output_sequence_size |size of the output sequence per antenna and cyclic shift | ++-------------------------+--------------------------------------------------------------+ +|output_leading_depadding |number of points de-padded at the start of output data | ++-------------------------+--------------------------------------------------------------+ +|window_index |optional windowing profile index used for each cyclic shift | ++-------------------------+--------------------------------------------------------------+ +|cs_bitmap |bitmap of the cyclic shift output requested (LSB for index 0) | ++-------------------------+--------------------------------------------------------------+ +|num_antennas_log2 |number of antennas as a log2 (10 maps to 1024...) | ++-------------------------+--------------------------------------------------------------+ +|idft_log2 |iDFT size as a log2 | ++-------------------------+--------------------------------------------------------------+ +|dft_log2 |DFT size as a log2 | ++-------------------------+--------------------------------------------------------------+ +|cs_time_adjustment |adjustment of time position of all the cyclic shift output | ++-------------------------+--------------------------------------------------------------+ +|idft_shift |shift down of signal level post iDFT | ++-------------------------+--------------------------------------------------------------+ +|dft_shift |shift down of signal level post DFT | ++-------------------------+--------------------------------------------------------------+ +|ncs_reciprocal |inverse of max number of CS normalized to 15b (ie. 231 for 12)| ++-------------------------+--------------------------------------------------------------+ +|power_shift |shift down of level of power measurement when enabled | ++-------------------------+--------------------------------------------------------------+ +|fp16_exp_adjust |value added to FP16 exponent at conversion from INT16 | ++-------------------------+--------------------------------------------------------------+ + +The mbuf input ``base_input`` is mandatory for all BBDEV PMDs and is the +incoming data for the processing. Its size may not fit into an actual mbuf, but the +structure is used to pass iova address. +The mbuf output ``output`` is mandatory and is output of the FFT processing chain. +Each point is a complex number of 32bits : either as 2 INT16 or as 2 FP16 based when the option +supported. +The data layout is based on contiguous concatenation of output data first by cyclic shift then +by antenna. Sample code -----------
lib/bbdev/rte_bbdev.c +9 -1
@@ -24,7 +24,7 @@#define DEV_NAME "BBDEV"/* Number of supported operation types */ -#define BBDEV_OP_TYPE_COUNT 5 +#define BBDEV_OP_TYPE_COUNT 6/* BBDev library logging ID */ RTE_LOG_REGISTER_DEFAULT (bbdev_logtype,NOTICE );
@@ -852,6 +852,9 @@ struct rte_bbdev *case RTE_BBDEV_OP_LDPC_ENC : result =sizeof (struct rte_bbdev_enc_op );break ; +case RTE_BBDEV_OP_FFT : + result =sizeof (struct rte_bbdev_fft_op ); +break ;default :break ; }
@@ -875,6 +878,10 @@ struct rte_bbdev *struct rte_bbdev_enc_op *op = element;memset (op,0 , mempool->elt_size); op->mempool = mempool; + }else if (type ==RTE_BBDEV_OP_FFT ) { +struct rte_bbdev_fft_op *op = element; +memset (op,0 , mempool->elt_size); + op->mempool = mempool; } }
@@ -1125,6 +1132,7 @@ struct rte_mempool *"RTE_BBDEV_OP_TURBO_ENC" ,"RTE_BBDEV_OP_LDPC_DEC" ,"RTE_BBDEV_OP_LDPC_ENC" , + "RTE_BBDEV_OP_FFT", };if (op_type <BBDEV_OP_TYPE_COUNT )
lib/bbdev/rte_bbdev.h +76 -0
106 lines not on this page · raw message
lib/bbdev/rte_bbdev_op.h +149 -0
203 lines not on this page · raw message
lib/bbdev/version.map +4 -0
@@ -45,4 +45,8 @@ EXPERIMENTAL { # added in 22.11 rte_bbdev_device_status_str; + rte_bbdev_enqueue_fft_ops; + rte_bbdev_dequeue_fft_ops; + rte_bbdev_fft_op_alloc_bulk; + rte_bbdev_fft_op_free_bulk; };
Signature · 1 line
1.8.3.1
PATCH v9 6/7 bbdev: add queue related warning and status information
In reply to Nic ChautruFrom: Nicolas Chautru <[email protected]>
This allows to expose more information with regards to any queue related failure and warning which cannot be supported in existing API.
--- app/test-bbdev/test_bbdev_perf.c | 2 ++ lib/bbdev/rte_bbdev.c | 19 +++++++++++++++++++ lib/bbdev/rte_bbdev.h | 34 ++++++++++++++++++++++++++++++++++ lib/bbdev/version.map | 1 + 4 files changed, 56 insertions(+)
app/test-bbdev/test_bbdev_perf.c +2 -0
@@ -4360,6 +4360,8 @@ typedef int (test_case_function)(struct active_device *ad, stats->dequeued_count = q_stats->dequeued_count; stats->enqueue_err_count = q_stats->enqueue_err_count; stats->dequeue_err_count = q_stats->dequeue_err_count; + stats->enqueue_warning_count = q_stats->enqueue_warning_count; + stats->dequeue_warning_count = q_stats->dequeue_warning_count; stats->acc_offload_cycles = q_stats->acc_offload_cycles;return 0 ;
lib/bbdev/rte_bbdev.c +19 -0
@@ -721,6 +721,8 @@ struct rte_bbdev * stats->dequeued_count += q_stats->dequeued_count; stats->enqueue_err_count += q_stats->enqueue_err_count; stats->dequeue_err_count += q_stats->dequeue_err_count; + stats->enqueue_warn_count += q_stats->enqueue_warn_count; + stats->dequeue_warn_count += q_stats->dequeue_warn_count; }rte_bbdev_log_debug ("Got stats on %u" , dev->data->dev_id); }
@@ -1163,3 +1165,20 @@ struct rte_mempool *rte_bbdev_log (ERR ,"Invalid device status" );return NULL ; } + +const char * +rte_bbdev_enqueue_status_str (enum rte_bbdev_enqueue_status status) +{ +static const char *const enq_sta_string[] = { +"RTE_BBDEV_ENQ_STATUS_NONE" , +"RTE_BBDEV_ENQ_STATUS_QUEUE_FULL" , +"RTE_BBDEV_ENQ_STATUS_RING_FULL" , +"RTE_BBDEV_ENQ_STATUS_INVALID_OP" , + }; + +if (status <sizeof (enq_sta_string) /sizeof (char *)) +return enq_sta_string[status]; + +rte_bbdev_log (ERR ,"Invalid enqueue status" ); +return NULL ; +}
lib/bbdev/rte_bbdev.h +34 -0
@@ -224,6 +224,19 @@ struct rte_bbdev_queue_conf { rte_bbdev_queue_stop(uint16_t dev_id, uint16_t queue_id);/** +* Flags indicate the reason why a previous enqueue may not have +* consumed all requested operations +* In case of multiple reasons the latter supersedes a previous one +*/ +enum rte_bbdev_enqueue_status { +RTE_BBDEV_ENQ_STATUS_NONE ,/**< Nothing to report */ +RTE_BBDEV_ENQ_STATUS_QUEUE_FULL ,/**< Not enough room in queue */ +RTE_BBDEV_ENQ_STATUS_RING_FULL ,/**< Not enough room in ring */ +RTE_BBDEV_ENQ_STATUS_INVALID_OP ,/**< Operation was rejected as invalid */ +RTE_BBDEV_ENQ_STATUS_PADDED_MAX =6 ,/**< Maximum enq status number including padding */ +}; + +/** * Flags indicate the status of the device */ enum rte_bbdev_device_status {
@@ -246,6 +259,12 @@ struct rte_bbdev_stats {uint64_t enqueue_err_count;/** Total error count on operations dequeued */ uint64_t dequeue_err_count; +/** Total warning count on operations enqueued */ +uint64_t enqueue_warn_count; +/** Total warning count on operations dequeued */ +uint64_t dequeue_warn_count; +/** Total enqueue status count based on rte_bbdev_enqueue_status enum */ +uint64_t enqueue_status_count[RTE_BBDEV_ENQ_STATUS_PADDED_MAX ];/** CPU cycles consumed by the (HW/SW) accelerator device to offload * the enqueue request to its internal queues. * - For a HW device this is the cycles consumed in MMIO write
@@ -386,6 +405,7 @@ struct rte_bbdev_queue_data {void *queue_private;/**< Driver-specific per-queue data */ struct rte_bbdev_queue_conf conf;/**< Current configuration */ struct rte_bbdev_stats queue_stats;/**< Queue statistics */ +enum rte_bbdev_enqueue_status enqueue_status;/**< Enqueue status when op is rejected */ bool started;/**< Queue state */ };
@@ -938,6 +958,20 @@ typedef void (*rte_bbdev_cb_fn)(uint16_t dev_id,const char *rte_bbdev_device_status_str (enum rte_bbdev_device_status status); +/** +* Converts queue status from enum to string +* +* @param status +* Queue status as enum +* +* @returns +* Queue status as string or NULL if op_type is invalid +* +*/ +__rte_experimental +const char* +rte_bbdev_enqueue_status_str (enum rte_bbdev_enqueue_status status); + #ifdef __cplusplus }#endif
lib/bbdev/version.map +1 -0
@@ -45,6 +45,7 @@ EXPERIMENTAL { # added in 22.11 rte_bbdev_device_status_str; + rte_bbdev_enqueue_status_str; rte_bbdev_enqueue_fft_ops; rte_bbdev_dequeue_fft_ops; rte_bbdev_fft_op_alloc_bulk;
Signature · 1 line
1.8.3.1
PATCH v9 7/7 bbdev: remove unnecessary if-check
In reply to Nic ChautruFrom: Nicolas Chautru <[email protected]>
Code clean up due to if-check not required
--- lib/bbdev/rte_bbdev_op.h | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-)
lib/bbdev/rte_bbdev_op.h +4 -20
@@ -959,7 +959,6 @@ struct rte_mempool * struct rte_bbdev_enc_op **ops, uint16_t num_ops) {struct rte_bbdev_op_pool_private *priv; -int ret;/* Check type */ priv = (struct rte_bbdev_op_pool_private *)
@@ -969,11 +968,7 @@ struct rte_mempool *return -EINVAL ;/* Get elements */ - ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; - -return 0 ; +return rte_mempool_get_bulk (mempool, (void **)ops, num_ops); }/**
@@ -995,7 +990,6 @@ struct rte_mempool * struct rte_bbdev_dec_op **ops, uint16_t num_ops) {struct rte_bbdev_op_pool_private *priv; -int ret;/* Check type */ priv = (struct rte_bbdev_op_pool_private *)
@@ -1005,11 +999,7 @@ struct rte_mempool *return -EINVAL ;/* Get elements */ - ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; - -return 0 ; +return rte_mempool_get_bulk (mempool, (void **)ops, num_ops); }/**
@@ -1032,20 +1022,14 @@ struct rte_mempool * struct rte_bbdev_fft_op **ops, uint16_t num_ops) {struct rte_bbdev_op_pool_private *priv; -int ret;/* Check type */ - priv = (struct rte_bbdev_op_pool_private *) -rte_mempool_get_priv (mempool); + priv = (struct rte_bbdev_op_pool_private *)rte_mempool_get_priv (mempool);if (unlikely (priv->type !=RTE_BBDEV_OP_FFT ))return -EINVAL ;/* Get elements */ - ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; - -return 0 ; +return rte_mempool_get_bulk (mempool, (void **)ops, num_ops); }/**
Signature · 1 line
1.8.3.1
RE: [EXT] [PATCH v9 0/7] bbdev changes for 22.11
In reply to Nic ChautruQuoted 32 lines
v9: removing code snippet from documentation in 5/7 requested by Akhil. Thanks.
v8: edit based on review by Akhil : typos, coding guidelines. No functional change. Thanks
v7: couple of typos in documentation spotted by Maxime. Thanks.
v6: added one comment in commit 2/7 suggested by Maxime.
v5: update base on review from Tom Rix. Number of typos reported and resolved,
removed the commit related torw_lockfor now, added a commit for code clean up from review, resolved one rebase issue between 2 commits, used size of array for some bound check implementation. Thanks.
v4: update to the last 2 commits to include function to print the queue status and a fix to therte_lockwithin the wrong structure
v3: update to device status info to also use padded size for the related array. Adding also 2 additionals commits to allow the API struc to expose more information related to queues corner cases/warning as well as an optional rw lock.
Hemant, Maxime, this is planned for DPDK 21.11 but would like review/ack early is possible to get this applied earlier and due to time off this summer. Thanks
NicNicolas Chautru (7):
bbdev: allow operation type enum for growth
bbdev: add device status info
bbdev: add device info on queue topologydrivers/baseband: update PMDs to expose queue per operation
bbdev: add new operation for FFT processing
bbdev: add queue related warning and status information
bbdev: remove unnecessary if-check
Quoted 16 lines
app/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 6 +- doc/guides/prog_guide/bbdev.rst | 103 ++++++++++++++ drivers/baseband/acc100/rte_acc100_pmd.c | 30 ++-- drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 9 ++ drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 9 ++ drivers/baseband/la12xx/bbdev_la12xx.c | 10 +- drivers/baseband/null/bbdev_null.c | 1 + drivers/baseband/turbo_sw/bbdev_turbo_software.c | 13 ++ examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 57 +++++++- lib/bbdev/rte_bbdev.h | 149 ++++++++++++++++++- lib/bbdev/rte_bbdev_op.h | 157 +++++++++++++++++++-- lib/bbdev/version.map | 12 ++ 14 files changed, 526 insertions(+), 34 deletions(-)
Series Acked-by: Akhil Goyal <[email protected]>
Can you send a release notes update for the new features introduced in this series. I will squash it with the series.
RE: [EXT] [PATCH v9 0/7] bbdev changes for 22.11
Thanks Akhil.
I put the change to the release note here: https://patches.dpdk.org/project/dpdk/patch/[email protected]/
Quoted 68 lines
-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Thursday, September 22, 2022 11:18 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Richardson, Bruce <[email protected]>; [email protected]; [email protected]; Zhang, Mingshan <[email protected]>; [email protected]
Subject: RE: [EXT] [PATCH v9 0/7] bbdev changes for 22.11Quoted 6 lines
v9: removing code snippet from documentation in 5/7 requested by Akhil. Thanks.
v8: edit based on review by Akhil : typos, coding guidelines. No functional change. Thanks
v7: couple of typos in documentation spotted by Maxime. Thanks.
v6: added one comment in commit 2/7 suggested by Maxime.Quoted 8 lines
v5: update base on review from Tom Rix. Number of typos reported and resolved, removed the commit related to
rw_lockfor now, added a commit for code clean up from review, resolved one rebase issue between 2 commits, used size of array for some bound check implementation. Thanks.
v4: update to the last 2 commits to include function to print the queue status and a fix to therte_lockwithin the wrong structure
v3: update to device status info to also use padded size for the relatedarray.
Quoted 5 lines
Adding also 2 additionals commits to allow the API struc to expose more information related to queues corner cases/warning as well as an optional rw lock.
Hemant, Maxime, this is planned for DPDK 21.11 but would like review/ack early is possible to get this applied earlier and due to time offthis summer.
Quoted 13 lines
Thanks
NicNicolas Chautru (7):
bbdev: allow operation type enum for growth
bbdev: add device status info
bbdev: add device info on queue topologydrivers/baseband: update PMDs to expose queue per operation
bbdev: add new operation for FFT processing
bbdev: add queue related warning and status information
bbdev: remove unnecessary if-checkQuoted 16 lines
app/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 6 +- doc/guides/prog_guide/bbdev.rst | 103 ++++++++++++++ drivers/baseband/acc100/rte_acc100_pmd.c | 30 ++-- drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 9 ++ drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 9 ++ drivers/baseband/la12xx/bbdev_la12xx.c | 10 +- drivers/baseband/null/bbdev_null.c | 1 + drivers/baseband/turbo_sw/bbdev_turbo_software.c | 13 ++ examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 57 +++++++- lib/bbdev/rte_bbdev.h | 149 ++++++++++++++++++- lib/bbdev/rte_bbdev_op.h | 157 +++++++++++++++++++-- lib/bbdev/version.map | 12 ++ 14 files changed, 526 insertions(+), 34 deletions(-)Series Acked-by: Akhil Goyal <[email protected]>
Can you send a release notes update for the new features introduced in this series.
I will squash it with the series.
v10 cover bbdev changes for 22.11
In reply to Nicolas Chautruv10: replacing the _PADDED_MAX enum to _SIZE_MAX macro based on suggestion from Ferruh/Maxime/Akhil. Thanks
v9: removing code snippet from documentation in 5/7 requested by Akhil. Thanks.
v8: edit based on review by Akhil : typos, coding guidelines. No functional change. Thanks
v7: couple of typos in documentation spotted by Maxime. Thanks.
v6: added one comment in commit 2/7 suggested by Maxime.
v5: update base on review from Tom Rix. Number of typos reported and resolved,
removed the commit related to rw_lock for now, added a commit for
code clean up from review, resolved one rebase issue between 2 commits, used size of array for some bound check implementation. Thanks.
v4: update to the last 2 commits to include function to print the queue status and a fix to the rte_lock within the wrong structure
v3: update to device status info to also use padded size for the related array.
Adding also 2 additionals commits to allow the API struc to expose more information related to queues corner cases/warning as well as an optional rw lock. Hemant, Maxime, this is planned for DPDK 21.11 but would like review/ack early is possible to get this applied earlier and due to time off this summer. Thanks
Nic
Nicolas Chautru (7):
bbdev: allow operation type enum for growth
bbdev: add device status info
bbdev: add device info on queue topology drivers/baseband: update PMDs to expose queue per operation
bbdev: add new operation for FFT processing
bbdev: add queue related warning and status information
bbdev: remove unnecessary if-check
app/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 6 +- doc/guides/prog_guide/bbdev.rst | 103 +++++++++++ drivers/baseband/acc100/rte_acc100_pmd.c | 30 ++-- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 9 + drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 9 + drivers/baseband/la12xx/bbdev_la12xx.c | 10 +- drivers/baseband/null/bbdev_null.c | 1 + .../baseband/turbo_sw/bbdev_turbo_software.c | 13 ++ examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 57 +++++- lib/bbdev/rte_bbdev.h | 156 +++++++++++++++- lib/bbdev/rte_bbdev_op.h | 167 ++++++++++++++++-- lib/bbdev/version.map | 12 ++ 14 files changed, 542 insertions(+), 35 deletions(-)
Signature · 1 line
2.37.1
PATCH v10 1/7 bbdev: allow operation type enum for growth
Updating the enum for rte_bbdev_op_type
to allow to keep ABI compatible for enum insertion while adding padded maximum value for array need. Removing RTE_BBDEV_OP_TYPE_COUNT and instead exposing RTE_BBDEV_OP_TYPE_SIZE_MAX.
--- app/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 4 ++-- examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 8 +++++--- lib/bbdev/rte_bbdev_op.h | 12 ++++++++++-- 5 files changed, 19 insertions(+), 9 deletions(-)
app/test-bbdev/test_bbdev.c +1 -1
@@ -521,7 +521,7 @@ test_bbdev_op_pool(void)rte_mempool_free (mp);TEST_ASSERT ((mp =rte_bbdev_op_pool_create ("Test_INV" , -RTE_BBDEV_OP_TYPE_COUNT , size, cache_size,0 )) ==NULL , +RTE_BBDEV_OP_TYPE_SIZE_MAX , size, cache_size,0 )) ==NULL ,"Failed test for rte_bbdev_op_pool_create: " "returned value is not NULL for invalid type" );
app/test-bbdev/test_bbdev_perf.c +2 -2
@@ -2428,13 +2428,13 @@ run_test_case_on_device(test_case_function *test_case_func, uint8_t dev_id,/* Find capabilities */ const struct rte_bbdev_op_cap *cap = info.drv.capabilities; -for (i =0 ; i <RTE_BBDEV_OP_TYPE_COUNT ; i++) { +do {if (cap->type == test_vector.op_type) { capabilities = cap;break ; } cap++; - } + }while (cap->type !=RTE_BBDEV_OP_NONE );TEST_ASSERT_NOT_NULL (capabilities,"Couldn't find capabilities" );
examples/bbdev_app/main.c +1 -1
@@ -1041,7 +1041,7 @@ main(int argc, char **argv)void *sigret;struct app_config_params app_params = def_app_config;struct rte_mempool *ethdev_mbuf_mempool, *bbdev_mbuf_mempool; -struct rte_mempool *bbdev_op_pools[RTE_BBDEV_OP_TYPE_COUNT ]; +struct rte_mempool *bbdev_op_pools[RTE_BBDEV_OP_TYPE_SIZE_MAX ];struct lcore_conf lcore_conf[RTE_MAX_LCORE ] = { {0 } };struct lcore_statistics lcore_stats[RTE_MAX_LCORE ] = { {0 } };struct stats_lcore_params stats_lcore;
lib/bbdev/rte_bbdev.c +5 -3
@@ -23,6 +23,8 @@#define DEV_NAME "BBDEV" +/* Number of supported operation types */ +#define BBDEV_OP_TYPE_COUNT 5/* BBDev library logging ID */ RTE_LOG_REGISTER_DEFAULT (bbdev_logtype,NOTICE );
@@ -890,10 +892,10 @@ rte_bbdev_op_pool_create(const char *name, enum rte_bbdev_op_type type,return NULL ; } -if (type >=RTE_BBDEV_OP_TYPE_COUNT ) { +if (type >=BBDEV_OP_TYPE_COUNT ) {rte_bbdev_log (ERR ,"Invalid op type (%u), should be less than %u" , - type,RTE_BBDEV_OP_TYPE_COUNT ); + type,BBDEV_OP_TYPE_COUNT );return NULL ; }
@@ -1125,7 +1127,7 @@ rte_bbdev_op_type_str(enum rte_bbdev_op_type op_type) "RTE_BBDEV_OP_LDPC_ENC", }; -if (op_type <RTE_BBDEV_OP_TYPE_COUNT ) +if (op_type <BBDEV_OP_TYPE_COUNT )return op_types[op_type];rte_bbdev_log (ERR ,"Invalid operation type" );
lib/bbdev/rte_bbdev_op.h +10 -2
@@ -48,6 +48,12 @@ extern "C" {/* LDPC: Maximum number of Code Blocks in Transport Block.*/ #define RTE_BBDEV_LDPC_MAX_CODE_BLOCKS (256) +/* +* Maximum size to be used to manage the enum rte_bbdev_op_type including padding for future +* enum insertion +*/ +#define RTE_BBDEV_OP_TYPE_SIZE_MAX 8 +/** Flags for turbo decoder operation and capability structure */ enum rte_bbdev_op_td_flag_bitmasks {/** If sub block de-interleaving is to be performed. */
@@ -741,14 +747,16 @@ struct rte_bbdev_op_cap_ldpc_enc {uint16_t num_buffers_dst; }; -/** Different operation types supported by the device */ +/** Different operation types supported by the device +* The related macro RTE_BBDEV_OP_TYPE_SIZE_MAX can be used as an absolute maximum for +* notably sizing array while allowing for future enumeration insertion. +*/ enum rte_bbdev_op_type {RTE_BBDEV_OP_NONE ,/**< Dummy operation that does nothing */ RTE_BBDEV_OP_TURBO_DEC ,/**< Turbo decode */ RTE_BBDEV_OP_TURBO_ENC ,/**< Turbo encode */ RTE_BBDEV_OP_LDPC_DEC ,/**< LDPC decode */ RTE_BBDEV_OP_LDPC_ENC ,/**< LDPC encode */ -RTE_BBDEV_OP_TYPE_COUNT ,/**< Count of different op types */ };/** Bit indexes of possible errors reported through status field */
Signature · 1 line
2.37.1
PATCH v10 2/7 bbdev: add device status info
In reply to Nicolas ChautruAdded device status information, so that the PMD can
expose information related to the underlying accelerator device status. Minor order change in structure to fit into padding hole.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 1 + .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 1 + drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 1 + drivers/baseband/la12xx/bbdev_la12xx.c | 1 + drivers/baseband/null/bbdev_null.c | 1 + .../baseband/turbo_sw/bbdev_turbo_software.c | 1 + lib/bbdev/rte_bbdev.c | 22 ++++++++++++ lib/bbdev/rte_bbdev.h | 35 +++++++++++++++++-- lib/bbdev/version.map | 7 ++++ 9 files changed, 68 insertions(+), 2 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +1 -0
@@ -1060,6 +1060,7 @@ acc100_dev_info_get(struct rte_bbdev *dev,/* Read and save the populated config from ACC100 registers */ fetch_acc100_config (dev); + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* This isn't ideal because it reports the maximum number of queues but * does not provide info on how many can be uplink/downlink or different
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +1 -0
@@ -369,6 +369,7 @@ fpga_dev_info_get(struct rte_bbdev *dev, dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* Calculates number of queues assigned to device */ dev_info->max_num_queues =0 ;
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +1 -0
@@ -645,6 +645,7 @@ fpga_dev_info_get(struct rte_bbdev *dev, dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* Calculates number of queues assigned to device */ dev_info->max_num_queues =0 ;
drivers/baseband/la12xx/bbdev_la12xx.c +1 -0
@@ -100,6 +100,7 @@ la12xx_info_get(struct rte_bbdev *dev __rte_unused, dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->min_alignment =64 ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/null/bbdev_null.c +1 -0
@@ -82,6 +82,7 @@ info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info)* here for code completeness. */ dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/turbo_sw/bbdev_turbo_software.c +1 -0
@@ -254,6 +254,7 @@ info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) dev_info->min_alignment =64 ; dev_info->harq_buffer_size =0 ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u\n" , dev->data->dev_id); }
lib/bbdev/rte_bbdev.c +22 -0
@@ -1133,3 +1133,25 @@ rte_bbdev_op_type_str(enum rte_bbdev_op_type op_type)rte_bbdev_log (ERR ,"Invalid operation type" );return NULL ; } + +const char * +rte_bbdev_device_status_str (enum rte_bbdev_device_status status) +{ +static const char *const dev_sta_string[] = { +"RTE_BBDEV_DEV_NOSTATUS" , +"RTE_BBDEV_DEV_NOT_SUPPORTED" , +"RTE_BBDEV_DEV_RESET" , +"RTE_BBDEV_DEV_CONFIGURED" , +"RTE_BBDEV_DEV_ACTIVE" , +"RTE_BBDEV_DEV_FATAL_ERR" , +"RTE_BBDEV_DEV_RESTART_REQ" , +"RTE_BBDEV_DEV_RECONFIG_REQ" , +"RTE_BBDEV_DEV_CORRECT_ERR" , + }; + +if (status <sizeof (dev_sta_string) /sizeof (char *)) +return dev_sta_string[status]; + +rte_bbdev_log (ERR ,"Invalid device status" ); +return NULL ; +}
lib/bbdev/rte_bbdev.h +33 -2
@@ -223,6 +223,21 @@ rte_bbdev_queue_start(uint16_t dev_id, uint16_t queue_id);int rte_bbdev_queue_stop (uint16_t dev_id,uint16_t queue_id); +/** +* Flags indicate the status of the device +*/ +enum rte_bbdev_device_status { +RTE_BBDEV_DEV_NOSTATUS ,/**< Nothing being reported */ +RTE_BBDEV_DEV_NOT_SUPPORTED ,/**< Device status is not supported on the PMD */ +RTE_BBDEV_DEV_RESET ,/**< Device in reset and un-configured state */ +RTE_BBDEV_DEV_CONFIGURED ,/**< Device is configured and ready to use */ +RTE_BBDEV_DEV_ACTIVE ,/**< Device is configured and VF is being used */ +RTE_BBDEV_DEV_FATAL_ERR ,/**< Device has hit a fatal uncorrectable error */ +RTE_BBDEV_DEV_RESTART_REQ ,/**< Device requires application to restart */ +RTE_BBDEV_DEV_RECONFIG_REQ ,/**< Device requires application to reconfigure queues */ +RTE_BBDEV_DEV_CORRECT_ERR ,/**< Warning of a correctable error event happened */ +}; +/** Device statistics. */ struct rte_bbdev_stats {uint64_t enqueued_count;/**< Count of all operations enqueued */
@@ -284,10 +299,12 @@ struct rte_bbdev_driver_info {uint8_t max_ul_queue_priority;/** Set if device supports per-queue interrupts */ bool queue_intr_supported; -/** Minimum alignment of buffers, in bytes */ -uint16_t min_alignment; +/** Device Status */ +enum rte_bbdev_device_status device_status;/** HARQ memory available in kB */ uint32_t harq_buffer_size; +/** Minimum alignment of buffers, in bytes */ +uint16_t min_alignment;/** Byte endianness (RTE_BIG_ENDIAN/RTE_LITTLE_ENDIAN) supported * for input/output data */
@@ -827,6 +844,20 @@ int rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op, void *data); +/** +* Converts device status from enum to string +* +* @param status +* Device status as enum +* +* @returns +* Operation type as string or NULL if op_type is invalid +* +*/ +__rte_experimental +const char* +rte_bbdev_device_status_str (enum rte_bbdev_device_status status); + #ifdef __cplusplus }#endif
lib/bbdev/version.map +7 -0
@@ -39,3 +39,10 @@ DPDK_22 { local: *; }; + +EXPERIMENTAL { + global: + + # added in 22.11 + rte_bbdev_device_status_str; +};
Signature · 1 line
2.37.1
PATCH v10 3/7 bbdev: add device info on queue topology
In reply to Nicolas ChautruAdding more options in the API to expose the number of queues exposed and related priority.
--- lib/bbdev/rte_bbdev.h | 4 ++++ 1 file changed, 4 insertions(+)
lib/bbdev/rte_bbdev.h +4 -0
@@ -289,6 +289,10 @@ struct rte_bbdev_driver_info {/** Maximum number of queues supported by the device */ unsigned int max_num_queues; +/** Maximum number of queues supported per operation type */ +unsigned int num_queues[RTE_BBDEV_OP_TYPE_SIZE_MAX ]; +/** Priority level supported per operation type */ +unsigned int queue_priority[RTE_BBDEV_OP_TYPE_SIZE_MAX ];/** Queue size limit (queue size must also be power of 2) */ uint32_t queue_size_lim;/** Set if device off-loads operation to hardware */
Signature · 1 line
2.37.1
PATCH v10 4/7 drivers/baseband: update PMDs to expose queue per operation
In reply to Nicolas ChautruAdd support in existing bbdev PMDs for the explicit number of queues and priority for each operation type configured on the device.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 29 +++++++++++-------- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 8 +++++ drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 8 +++++ drivers/baseband/la12xx/bbdev_la12xx.c | 7 +++++ .../baseband/turbo_sw/bbdev_turbo_software.c | 12 ++++++++ 5 files changed, 52 insertions(+), 12 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +17 -12
@@ -966,6 +966,7 @@ acc100_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) {struct acc100_device *d = dev->data->dev_private; +int i;static const struct rte_bbdev_op_cap bbdev_capabilities[] = { {
@@ -1062,19 +1063,23 @@ acc100_dev_info_get(struct rte_bbdev *dev,fetch_acc100_config (dev); dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; -/* This isn't ideal because it reports the maximum number of queues but -* does not provide info on how many can be uplink/downlink or different -* priorities -*/ - dev_info->max_num_queues = - d->acc100_conf.q_dl_5g.num_aqs_per_groups * - d->acc100_conf.q_dl_5g.num_qgroups + - d->acc100_conf.q_ul_5g.num_aqs_per_groups * - d->acc100_conf.q_ul_5g.num_qgroups + - d->acc100_conf.q_dl_4g.num_aqs_per_groups * - d->acc100_conf.q_dl_4g.num_qgroups + - d->acc100_conf.q_ul_4g.num_aqs_per_groups * +/* Expose number of queues */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] = d->acc100_conf.q_ul_4g.num_aqs_per_groups * d->acc100_conf.q_ul_4g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] = d->acc100_conf.q_dl_4g.num_aqs_per_groups * + d->acc100_conf.q_dl_4g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] = d->acc100_conf.q_ul_5g.num_aqs_per_groups * + d->acc100_conf.q_ul_5g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] = d->acc100_conf.q_dl_5g.num_aqs_per_groups * + d->acc100_conf.q_dl_5g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_DEC ] = d->acc100_conf.q_ul_4g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_ENC ] = d->acc100_conf.q_dl_4g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] = d->acc100_conf.q_ul_5g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] = d->acc100_conf.q_dl_5g.num_qgroups; + dev_info->max_num_queues =0 ; +for (i =RTE_BBDEV_OP_TURBO_DEC ; i <=RTE_BBDEV_OP_LDPC_ENC ; i++) + dev_info->max_num_queues += dev_info->num_queues[i]; dev_info->queue_size_lim =ACC100_MAX_QUEUE_DEPTH ; dev_info->hardware_accelerated = true; dev_info->max_dl_queue_priority =
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +8 -0
@@ -379,6 +379,14 @@ fpga_dev_info_get(struct rte_bbdev *dev,if (hw_q_id !=FPGA_INVALID_HW_QUEUE_ID ) dev_info->max_num_queues++; } +/* Expose number of queue per operation type */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] = dev_info->max_num_queues /2 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] =1 ; }/**
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +8 -0
@@ -655,6 +655,14 @@ fpga_dev_info_get(struct rte_bbdev *dev,if (hw_q_id !=FPGA_INVALID_HW_QUEUE_ID ) dev_info->max_num_queues++; } +/* Expose number of queue per operation type */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] =0 ; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_ENC ] =1 ; }/**
drivers/baseband/la12xx/bbdev_la12xx.c +7 -0
@@ -102,6 +102,13 @@ la12xx_info_get(struct rte_bbdev *dev __rte_unused, dev_info->min_alignment =64 ; dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] =LA12XX_MAX_QUEUES /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] =LA12XX_MAX_QUEUES /2 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] =1 ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/turbo_sw/bbdev_turbo_software.c +12 -0
@@ -157,6 +157,8 @@ static void info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) { struct bbdev_private *internals = dev->data->dev_private; +const struct rte_bbdev_op_cap *op_cap; +int num_op_type =0 ;static const struct rte_bbdev_op_cap bbdev_capabilities[] = { #ifdef RTE_BBDEV_SDK_AVX2
@@ -256,6 +258,16 @@ info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) dev_info->data_endianness =RTE_LITTLE_ENDIAN ; dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; + op_cap = bbdev_capabilities; +for (; op_cap->type !=RTE_BBDEV_OP_NONE ; ++op_cap) + num_op_type++; + op_cap = bbdev_capabilities; +if (num_op_type >0 ) { +int num_queue_per_type = dev_info->max_num_queues / num_op_type; +for (; op_cap->type !=RTE_BBDEV_OP_NONE ; ++op_cap) + dev_info->num_queues[op_cap->type] = num_queue_per_type; + } +rte_bbdev_log_debug ("got device info from %u\n" , dev->data->dev_id); }
Signature · 1 line
2.37.1
PATCH v10 5/7 bbdev: add new operation for FFT processing
In reply to Nicolas ChautruExtension of bbdev operation to support FFT based operations.
--- doc/guides/prog_guide/bbdev.rst | 103 ++++++++++++++++++++++ lib/bbdev/rte_bbdev.c | 10 ++- lib/bbdev/rte_bbdev.h | 76 ++++++++++++++++ lib/bbdev/rte_bbdev_op.h | 149 ++++++++++++++++++++++++++++++++ lib/bbdev/version.map | 4 + 5 files changed, 341 insertions(+), 1 deletion(-)
doc/guides/prog_guide/bbdev.rst +103 -0
@@ -1118,6 +1118,109 @@ Figure :numref:`figure_turbo_tb_decode` above showing the Turbo decoding of CBs using BBDEV interface in TB-mode is also valid for LDPC decode. +BBDEV FFT Operation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This operation allows to run a combination of DFT and/or IDFT and/or time-domain windowing. +These can be used in a modular fashion (using bypass modes) or as a processing pipeline +which can be used for FFT-based baseband signal processing. +In more details it allows : +- to process the data first through an IDFT of adjustable size and padding; +- to perform the windowing as a programmable cyclic shift offset of the data followed by a +pointwise multiplication by a time domain window; +- to process the related data through a DFT of adjustable size and de-padding for each such cyclic +shift output. + +A flexible number of Rx antennas are being processed in parallel with the same configuration. +The API allows more generally for flexibility in what the PMD may support (capability flags) and +flexibility to adjust some of the parameters of the processing. + +The operation/capability flags that can be set for each FFT operation are given below. + + **NOTE:** The actual operation flags that may be used with a specific + BBDEV PMD are dependent on the driver capabilities as reported via + ``rte_bbdev_info_get()``, and may be a subset of those below. + ++--------------------------------------------------------------------+ +|Description of FFT capability flags | ++====================================================================+ +|RTE_BBDEV_FFT_WINDOWING | +| Set to enable/support windowing in time domain | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_CS_ADJUSTMENT | +| Set to enable/support the cyclic shift time offset adjustment | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_DFT_BYPASS | +| Set to bypass the DFT and use directly the IDFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_IDFT_BYPASS | +| Set to bypass the IDFT and use directly the DFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_WINDOWING_BYPASS | +| Set to bypass the time domain windowing as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_POWER_MEAS | +| Set to provide an optional power measurement of the DFT output | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_INPUT | +| Set if the input data shall use FP16 format instead of INT16 | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_OUTPUT | +| Set if the output data shall use FP16 format instead of INT16 | ++--------------------------------------------------------------------+ + +The FFT parameters are set out in the table below. + ++-------------------------+--------------------------------------------------------------+ +|Parameter |Description | ++=========================+==============================================================+ +|base_input |input data | ++-------------------------+--------------------------------------------------------------+ +|base_output |output data | ++-------------------------+--------------------------------------------------------------+ +|power_meas_output |optional output data with power measurement on DFT output | ++-------------------------+--------------------------------------------------------------+ +|op_flags |bitmask of all active operation capabilities | ++-------------------------+--------------------------------------------------------------+ +|input_sequence_size |size of the input sequence in 32-bits points per antenna | ++-------------------------+--------------------------------------------------------------+ +|input_leading_padding |number of points padded at the start of input data | ++-------------------------+--------------------------------------------------------------+ +|output_sequence_size |size of the output sequence per antenna and cyclic shift | ++-------------------------+--------------------------------------------------------------+ +|output_leading_depadding |number of points de-padded at the start of output data | ++-------------------------+--------------------------------------------------------------+ +|window_index |optional windowing profile index used for each cyclic shift | ++-------------------------+--------------------------------------------------------------+ +|cs_bitmap |bitmap of the cyclic shift output requested (LSB for index 0) | ++-------------------------+--------------------------------------------------------------+ +|num_antennas_log2 |number of antennas as a log2 (10 maps to 1024...) | ++-------------------------+--------------------------------------------------------------+ +|idft_log2 |iDFT size as a log2 | ++-------------------------+--------------------------------------------------------------+ +|dft_log2 |DFT size as a log2 | ++-------------------------+--------------------------------------------------------------+ +|cs_time_adjustment |adjustment of time position of all the cyclic shift output | ++-------------------------+--------------------------------------------------------------+ +|idft_shift |shift down of signal level post iDFT | ++-------------------------+--------------------------------------------------------------+ +|dft_shift |shift down of signal level post DFT | ++-------------------------+--------------------------------------------------------------+ +|ncs_reciprocal |inverse of max number of CS normalized to 15b (ie. 231 for 12)| ++-------------------------+--------------------------------------------------------------+ +|power_shift |shift down of level of power measurement when enabled | ++-------------------------+--------------------------------------------------------------+ +|fp16_exp_adjust |value added to FP16 exponent at conversion from INT16 | ++-------------------------+--------------------------------------------------------------+ + +The mbuf input ``base_input`` is mandatory for all BBDEV PMDs and is the +incoming data for the processing. Its size may not fit into an actual mbuf, but the +structure is used to pass iova address. +The mbuf output ``output`` is mandatory and is output of the FFT processing chain. +Each point is a complex number of 32bits : either as 2 INT16 or as 2 FP16 based when the option +supported. +The data layout is based on contiguous concatenation of output data first by cyclic shift then +by antenna. Sample code -----------
lib/bbdev/rte_bbdev.c +9 -1
@@ -24,7 +24,7 @@#define DEV_NAME "BBDEV"/* Number of supported operation types */ -#define BBDEV_OP_TYPE_COUNT 5 +#define BBDEV_OP_TYPE_COUNT 6/* BBDev library logging ID */ RTE_LOG_REGISTER_DEFAULT (bbdev_logtype,NOTICE );
@@ -852,6 +852,9 @@ get_bbdev_op_size(enum rte_bbdev_op_type type)case RTE_BBDEV_OP_LDPC_ENC : result =sizeof (struct rte_bbdev_enc_op );break ; +case RTE_BBDEV_OP_FFT : + result =sizeof (struct rte_bbdev_fft_op ); +break ;default :break ; }
@@ -875,6 +878,10 @@ bbdev_op_init(struct rte_mempool *mempool, void *arg, void *element,struct rte_bbdev_enc_op *op = element;memset (op,0 , mempool->elt_size); op->mempool = mempool; + }else if (type ==RTE_BBDEV_OP_FFT ) { +struct rte_bbdev_fft_op *op = element; +memset (op,0 , mempool->elt_size); + op->mempool = mempool; } }
@@ -1125,6 +1132,7 @@ rte_bbdev_op_type_str(enum rte_bbdev_op_type op_type)"RTE_BBDEV_OP_TURBO_ENC" ,"RTE_BBDEV_OP_LDPC_DEC" ,"RTE_BBDEV_OP_LDPC_ENC" , + "RTE_BBDEV_OP_FFT", };if (op_type <BBDEV_OP_TYPE_COUNT )
lib/bbdev/rte_bbdev.h +76 -0
106 lines not on this page · raw message
lib/bbdev/rte_bbdev_op.h +149 -0
203 lines not on this page · raw message
lib/bbdev/version.map +4 -0
@@ -45,4 +45,8 @@ EXPERIMENTAL { # added in 22.11 rte_bbdev_device_status_str; + rte_bbdev_enqueue_fft_ops; + rte_bbdev_dequeue_fft_ops; + rte_bbdev_fft_op_alloc_bulk; + rte_bbdev_fft_op_free_bulk; };
Signature · 1 line
2.37.1
PATCH v10 6/7 bbdev: add queue related warning and status information
In reply to Nicolas ChautruThis allows to expose more information with regards to any queue related failure and warning which cannot be supported in existing API.
--- app/test-bbdev/test_bbdev_perf.c | 2 ++ lib/bbdev/rte_bbdev.c | 19 +++++++++++++++ lib/bbdev/rte_bbdev.h | 41 ++++++++++++++++++++++++++++++++ lib/bbdev/version.map | 1 + 4 files changed, 63 insertions(+)
app/test-bbdev/test_bbdev_perf.c +2 -0
@@ -4360,6 +4360,8 @@ get_bbdev_queue_stats(uint16_t dev_id, uint16_t queue_id, stats->dequeued_count = q_stats->dequeued_count; stats->enqueue_err_count = q_stats->enqueue_err_count; stats->dequeue_err_count = q_stats->dequeue_err_count; + stats->enqueue_warning_count = q_stats->enqueue_warning_count; + stats->dequeue_warning_count = q_stats->dequeue_warning_count; stats->acc_offload_cycles = q_stats->acc_offload_cycles;return 0 ;
lib/bbdev/rte_bbdev.c +19 -0
@@ -721,6 +721,8 @@ get_stats_from_queues(struct rte_bbdev *dev, struct rte_bbdev_stats *stats) stats->dequeued_count += q_stats->dequeued_count; stats->enqueue_err_count += q_stats->enqueue_err_count; stats->dequeue_err_count += q_stats->dequeue_err_count; + stats->enqueue_warn_count += q_stats->enqueue_warn_count; + stats->dequeue_warn_count += q_stats->dequeue_warn_count; }rte_bbdev_log_debug ("Got stats on %u" , dev->data->dev_id); }
@@ -1163,3 +1165,20 @@ rte_bbdev_device_status_str(enum rte_bbdev_device_status status)rte_bbdev_log (ERR ,"Invalid device status" );return NULL ; } + +const char * +rte_bbdev_enqueue_status_str (enum rte_bbdev_enqueue_status status) +{ +static const char *const enq_sta_string[] = { +"RTE_BBDEV_ENQ_STATUS_NONE" , +"RTE_BBDEV_ENQ_STATUS_QUEUE_FULL" , +"RTE_BBDEV_ENQ_STATUS_RING_FULL" , +"RTE_BBDEV_ENQ_STATUS_INVALID_OP" , + }; + +if (status <sizeof (enq_sta_string) /sizeof (char *)) +return enq_sta_string[status]; + +rte_bbdev_log (ERR ,"Invalid enqueue status" ); +return NULL ; +}
lib/bbdev/rte_bbdev.h +41 -0
71 lines not on this page · raw message
lib/bbdev/version.map +1 -0
@@ -45,6 +45,7 @@ EXPERIMENTAL { # added in 22.11 rte_bbdev_device_status_str; + rte_bbdev_enqueue_status_str; rte_bbdev_enqueue_fft_ops; rte_bbdev_dequeue_fft_ops; rte_bbdev_fft_op_alloc_bulk;
Signature · 1 line
2.37.1
Re: [PATCH v10 6/7] bbdev: add queue related warning and status information
Looking at this patch because I have been alerted about the ABI compat handling. I see some details that should have been caught in earlier reviews.
30/09/2022 20:46, Nicolas Chautru:
Quoted 2 lines
+/*
+ * Maximum size to be used to manage the enumrte_bbdev_enqueue_statusincluding padding for future
This line is long.
It is always better to split lines logically,
for instance here, before "including".
Quoted 1 line
+ * enum insertion
It could be made clear that the real enum size is smaller or equal.
Quoted 2 lines
+ */
+#defineRTE_BBDEV_ENQ_STATUS_SIZE_MAX6
[...]
lib/bbdev/rte_bbdev.h rte_bbdev_queue_start(uint16_t dev_id, uint16_t queue_id); · line 244
Quoted 6 lines
lib/bbdev/rte_bbdev.h +6
-0+enum rte_bbdev_enqueue_status { +RTE_BBDEV_ENQ_STATUS_NONE ,/**< Nothing to report */ +RTE_BBDEV_ENQ_STATUS_QUEUE_FULL ,/**< Not enough room in queue */ +RTE_BBDEV_ENQ_STATUS_RING_FULL ,/**< Not enough room in ring */ +RTE_BBDEV_ENQ_STATUS_INVALID_OP ,/**< Operation was rejected as invalid */ +};
A comment is missing at the end of the enum to remind updating the MAX.
But the big question is why do we need this "MAX" value?
The guideline is to avoid using such MAX value for long term compatibility.
[...]
Quoted 2 lines
+/**
+ * Converts queue status from enum to string
Should be imperative form: "Convert".
A dot is missing at the end of the sentence.
Quoted 6 lines
+ *
+ * @param status
+ * Queue status as enum
+ *
+ * @returns
+ * Queue status as string or NULL ifop_typeis invalid
It is not aligned with above parameter. Choose an indentation format and keep it consistent.
[...]
lib/bbdev/version.map EXPERIMENTAL { · line 50
Quoted 5 lines
lib/bbdev/version.map +1
-0# added in 22.11 rte_bbdev_device_status_str; + rte_bbdev_enqueue_status_str; rte_bbdev_enqueue_fft_ops; rte_bbdev_dequeue_fft_ops;
It is not alphabetical order.
RE: [PATCH v10 6/7] bbdev: add queue related warning and status information
Hi Thomas,
I will update all your comments below today, thanks.
The one where we need your confirmation is specifically this comment from your, I believe we discussed but good to make sure we are all aligned:
Quoted 2 lines
But the big question is why do we need this "MAX" value?
The guideline is to avoid using such MAX value for long term compatibility.
This is not a _MAX enum but a _SIZE_MAX for array related to that enum. Note that the actual max value of the enum exists but is used a private macro.
The distinction is that the application cannot make any assumptions on what is the maximum enum value (ie. we don't want enum with MAX value, that is not future proof has captured in doc).
But the application can make some assumption on the sizing of array based on such an enum. The difference being the padding which allows for the enum growth without breaking ABI or application.
The previous name was _PADDED_MAX to make it clear this not a max enum but a padded value. Then more recenrtly the consensus in the community was to change this to _SIZE_MAX to be arguably more explicit this is to be used for array size. The comments I believe also make it clear this is not a MAX enum.
Does that make sense and do you agree this is best consensus so far to move forward?
Thanks Thomas,
Nic
Quoted 74 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Monday, October 3, 2022 1:29 AM
To: Chautru, Nicolas <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Richardson, Bruce <[email protected]>; [email protected]; [email protected]; Zhang, Mingshan <[email protected]>; [email protected]
Subject: Re: [PATCH v10 6/7] bbdev: add queue related warning and status informationLooking at this patch because I have been alerted about the ABI compat handling.
I see some details that should have been caught in earlier reviews.30/09/2022 20:46, Nicolas Chautru:
Review
Quoted 3 lines
(quoted diff) +3
-0+/* + * Maximum size to be used to manage the enum +rte_bbdev_enqueue_status including padding for futureThis line is long.
It is always better to split lines logically, for instance here, before "including".Quoted 1 line
+ * enum insertion
It could be made clear that the real enum size is smaller or equal.
Quoted 2 lines
+ */
+#defineRTE_BBDEV_ENQ_STATUS_SIZE_MAX6[...]
lib/bbdev/rte_bbdev.h rte_bbdev_queue_start(uint16_t dev_id, uint16_t queue_id);
Quoted 3 lines
lib/bbdev/rte_bbdev.h +3
-0+enum rte_bbdev_enqueue_status { +RTE_BBDEV_ENQ_STATUS_NONE ,/**< Nothing to report */ +RTE_BBDEV_ENQ_STATUS_QUEUE_FULL ,/**< Not enough room in queue */
Review
Quoted 1 line
(quoted diff) +1
-0+ RTE_BBDEV_ENQ_STATUS_RING_FULL, /**< Not enough room inring */
Review
Quoted 1 line
(quoted diff) +1
-0+ RTE_BBDEV_ENQ_STATUS_INVALID_OP, /**< Operation wasrejected as invalid */
Quoted 1 line
+};
A comment is missing at the end of the enum to remind updating the MAX.
But the big question is why do we need this "MAX" value?
The guideline is to avoid using such MAX value for long term compatibility.[...]
Quoted 2 lines
+/**
+ * Converts queue status from enum to stringShould be imperative form: "Convert".
A dot is missing at the end of the sentence.Quoted 6 lines
+ *
+ * @param status
+ * Queue status as enum
+ *
+ * @returns
+ * Queue status as string or NULL ifop_typeis invalidIt is not aligned with above parameter. Choose an indentation format and keep it consistent.
[...]
lib/bbdev/version.map EXPERIMENTAL { · line 50
Quoted 5 lines
lib/bbdev/version.map +1
-0# added in 22.11 rte_bbdev_device_status_str; + rte_bbdev_enqueue_status_str; rte_bbdev_enqueue_fft_ops; rte_bbdev_dequeue_fft_ops;It is not alphabetical order.
Re: [PATCH v10 6/7] bbdev: add queue related warning and status information
03/10/2022 18:39, Chautru, Nicolas:
Quoted 3 lines
Hi Thomas,
I will update all your comments below today, thanks.
Please do a self review of other patches (I reviewed only this one), I suspect there are a lot of other details to improve in other places.
Quoted 1 line
The one where we need your confirmation is specifically this comment from your, I believe we discussed but good to make sure we are all aligned:
Yes let's be clear.
Quoted 9 lines
Quoted 2 lines
But the big question is why do we need this "MAX" value?
The guideline is to avoid using such MAX value for long term compatibility.This is not a
_MAXenum but a_SIZE_MAXfor array related to that enum. Note that the actual max value of the enum exists but is used a private macro.
The distinction is that the application cannot make any assumptions on what is the maximum enum value (ie. we don't want enum with MAX value, that is not future proof has captured in doc).
But the application can make some assumption on the sizing of array based on such an enum. The difference being the padding which allows for the enum growth without breaking ABI or application.
The previous name was_PADDED_MAXto make it clear this not a max enum but a padded value. Then more recenrtly the consensus in the community was to change this to_SIZE_MAXto be arguably more explicit this is to be used for array size. The comments I believe also make it clear this is not a MAX enum.Does that make sense and do you agree this is best consensus so far to move forward?
It makes a lot of sense to me because this is what I proposed 2 or 3 years ago to the techboard when we approached different general solutions. But it has been said that it is not ideal for 2 reasons I think:
- there is a compatibility breakage when we reach the maximum
- there is no assumption on how the padding is filled
That's why the preferred way should be to avoid having any maximum value. For instance, array allocation and iteration could be done in the API.
Anyway I'm fine with your solution for now.
PATCH v10 7/7 bbdev: remove unnecessary if-check
In reply to Nicolas ChautruCode clean up due to if-check not required
--- lib/bbdev/rte_bbdev_op.h | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-)
lib/bbdev/rte_bbdev_op.h +4 -20
@@ -967,7 +967,6 @@ rte_bbdev_enc_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_enc_op **ops, uint16_t num_ops) {struct rte_bbdev_op_pool_private *priv; -int ret;/* Check type */ priv = (struct rte_bbdev_op_pool_private *)
@@ -977,11 +976,7 @@ rte_bbdev_enc_op_alloc_bulk(struct rte_mempool *mempool,return -EINVAL ;/* Get elements */ - ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; - -return 0 ; +return rte_mempool_get_bulk (mempool, (void **)ops, num_ops); }/**
@@ -1003,7 +998,6 @@ rte_bbdev_dec_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_dec_op **ops, uint16_t num_ops) {struct rte_bbdev_op_pool_private *priv; -int ret;/* Check type */ priv = (struct rte_bbdev_op_pool_private *)
@@ -1013,11 +1007,7 @@ rte_bbdev_dec_op_alloc_bulk(struct rte_mempool *mempool,return -EINVAL ;/* Get elements */ - ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; - -return 0 ; +return rte_mempool_get_bulk (mempool, (void **)ops, num_ops); }/**
@@ -1040,20 +1030,14 @@ rte_bbdev_fft_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_fft_op **ops, uint16_t num_ops) {struct rte_bbdev_op_pool_private *priv; -int ret;/* Check type */ - priv = (struct rte_bbdev_op_pool_private *) -rte_mempool_get_priv (mempool); + priv = (struct rte_bbdev_op_pool_private *)rte_mempool_get_priv (mempool);if (unlikely (priv->type !=RTE_BBDEV_OP_FFT ))return -EINVAL ;/* Get elements */ - ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; - -return 0 ; +return rte_mempool_get_bulk (mempool, (void **)ops, num_ops); }/**
Signature · 1 line
2.37.1
Akhil Goyal
AppliedRE: [EXT] [PATCH v10 0/7] bbdev changes for 22.11
In reply to Nicolas ChautruQuoted 2 lines
v10: replacing the
_PADDED_MAXenum to_SIZE_MAXmacro based on suggestion from Ferruh/Maxime/Akhil. Thanks
Since we have a consensus.
Series Acked-by: Akhil Goyal <[email protected]>
Applied to dpdk-next-crypto
Added release notes and removed deprecation notices.
Please fix the documentation as recommended as a separate patch.
Thanks
Quoted 50 lines
v9: removing code snippet from documentation in 5/7 requested by Akhil. Thanks.
v8: edit based on review by Akhil : typos, coding guidelines. No functional change. Thanks
v7: couple of typos in documentation spotted by Maxime. Thanks.
v6: added one comment in commit 2/7 suggested by Maxime.
v5: update base on review from Tom Rix. Number of typos reported and resolved,
removed the commit related torw_lockfor now, added a commit for code clean up from review, resolved one rebase issue between 2 commits, used size of array for some bound check implementation. Thanks.
v4: update to the last 2 commits to include function to print the queue status and a fix to therte_lockwithin the wrong structure
v3: update to device status info to also use padded size for the related array. Adding also 2 additionals commits to allow the API struc to expose more information related to queues corner cases/warning as well as an optional rw lock.
Hemant, Maxime, this is planned for DPDK 21.11 but would like review/ack early is possible to get this applied earlier and due to time off this summer. Thanks
NicNicolas Chautru (7):
bbdev: allow operation type enum for growth
bbdev: add device status info
bbdev: add device info on queue topologydrivers/baseband: update PMDs to expose queue per operation
bbdev: add new operation for FFT processing
bbdev: add queue related warning and status information
bbdev: remove unnecessary if-checkapp/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 6 +- doc/guides/prog_guide/bbdev.rst | 103 +++++++++++ drivers/baseband/acc100/rte_acc100_pmd.c | 30 ++-- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 9 + drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 9 + drivers/baseband/la12xx/bbdev_la12xx.c | 10 +- drivers/baseband/null/bbdev_null.c | 1 + .../baseband/turbo_sw/bbdev_turbo_software.c | 13 ++ examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 57 +++++- lib/bbdev/rte_bbdev.h | 156 +++++++++++++++- lib/bbdev/rte_bbdev_op.h | 167 ++++++++++++++++-- lib/bbdev/version.map | 12 ++ 14 files changed, 542 insertions(+), 35 deletions(-)--
2.37.1
v11 cover bbdev changes for 22.11
In reply to Nicolas ChautruHi Akhil, Thomas,
v11: updated based on Thomas review notably on comments through the serie and ordering. Thanks. I have also updated rel_notes and deprecation through the serie this time.
v10: replacing the _PADDED_MAX enum to _SIZE_MAX macro based on suggestion from Ferruh/Maxime/Akhil. Thanks
v9: removing code snippet from documentation in 5/7 requested by Akhil. Thanks.
v8: edit based on review by Akhil : typos, coding guidelines. No functional change. Thanks
v7: couple of typos in documentation spotted by Maxime. Thanks.
v6: added one comment in commit 2/7 suggested by Maxime.
v5: update base on review from Tom Rix. Number of typos reported and resolved,
removed the commit related to rw_lock for now, added a commit for
code clean up from review, resolved one rebase issue between 2 commits, used size of array for some bound check implementation. Thanks.
v4: update to the last 2 commits to include function to print the queue status and a fix to the rte_lock within the wrong structure
v3: update to device status info to also use padded size for the related array.
Adding also 2 additionals commits to allow the API struc to expose more information related to queues corner cases/warning as well as an optional rw lock. Hemant, Maxime, this is planned for DPDK 21.11 but would like review/ack early is possible to get this applied earlier and due to time off this summer. Thanks
Nic
Nicolas Chautru (7):
bbdev: allow operation type enum for growth
bbdev: add device status info
bbdev: add device info on queue topology drivers/baseband: update PMDs to expose queue per operation
bbdev: add new operation for FFT processing
bbdev: add queue related warning and status information
bbdev: remove unnecessary if-check
app/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 6 +- doc/guides/prog_guide/bbdev.rst | 103 +++++++++++ doc/guides/rel_notes/deprecation.rst | 13 -- doc/guides/rel_notes/release_22_11.rst | 14 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 30 ++-- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 9 + drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 9 + drivers/baseband/la12xx/bbdev_la12xx.c | 10 +- drivers/baseband/null/bbdev_null.c | 1 + .../baseband/turbo_sw/bbdev_turbo_software.c | 13 ++ examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 57 +++++- lib/bbdev/rte_bbdev.h | 158 +++++++++++++++- lib/bbdev/rte_bbdev_op.h | 169 ++++++++++++++++-- lib/bbdev/version.map | 12 ++ 16 files changed, 560 insertions(+), 48 deletions(-)
Signature · 1 line
2.37.1
PATCH v11 1/7 bbdev: allow operation type enum for growth
Updating the enum for rte_bbdev_op_type
to allow to keep ABI compatible for enum insertion while adding padded maximum value for array need. Removing RTE_BBDEV_OP_TYPE_COUNT and instead exposing RTE_BBDEV_OP_TYPE_SIZE_MAX.
--- app/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 4 ++-- doc/guides/rel_notes/deprecation.rst | 5 +---- doc/guides/rel_notes/release_22_11.rst | 3 +++ examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 8 +++++--- lib/bbdev/rte_bbdev_op.h | 14 ++++++++++++-- 7 files changed, 25 insertions(+), 13 deletions(-)
app/test-bbdev/test_bbdev.c +1 -1
@@ -521,7 +521,7 @@ test_bbdev_op_pool(void)rte_mempool_free (mp);TEST_ASSERT ((mp =rte_bbdev_op_pool_create ("Test_INV" , -RTE_BBDEV_OP_TYPE_COUNT , size, cache_size,0 )) ==NULL , +RTE_BBDEV_OP_TYPE_SIZE_MAX , size, cache_size,0 )) ==NULL ,"Failed test for rte_bbdev_op_pool_create: " "returned value is not NULL for invalid type" );
app/test-bbdev/test_bbdev_perf.c +2 -2
@@ -2429,13 +2429,13 @@ run_test_case_on_device(test_case_function *test_case_func, uint8_t dev_id,/* Find capabilities */ const struct rte_bbdev_op_cap *cap = info.drv.capabilities; -for (i =0 ; i <RTE_BBDEV_OP_TYPE_COUNT ; i++) { +do {if (cap->type == test_vector.op_type) { capabilities = cap;break ; } cap++; - } + }while (cap->type !=RTE_BBDEV_OP_NONE );TEST_ASSERT_NOT_NULL (capabilities,"Couldn't find capabilities" );
doc/guides/rel_notes/deprecation.rst +1 -4
@@ -120,10 +120,7 @@ Deprecation Notices ``RTE_ETH_EVENT_IPSEC_SA_BYTE_HARD_EXPIRY`` and ``RTE_ETH_EVENT_IPSEC_SA_PKT_HARD_EXPIRY`` in DPDK 22.11. -* bbdev: ``RTE_BBDEV_OP_TYPE_COUNT`` terminating the ``rte_bbdev_op_type`` - enum will be deprecated and instead use fixed array size when required - to allow for future enum extension. - Will extend API to support new operation type ``RTE_BBDEV_OP_FFT`` as per +* bbdev: Will extend API to support new operation type ``RTE_BBDEV_OP_FFT`` as per this `RFC <https://patches.dpdk.org/project/dpdk/list/?series=22111>`__. New members will be added in ``rte_bbdev_driver_info`` to expose PMD queue topology inspired by
doc/guides/rel_notes/release_22_11.rst +3 -0
@@ -317,6 +317,9 @@ ABI Changes * eventdev: Added ``weight`` and ``affinity`` fields to ``rte_event_queue_conf`` structure. +* bbdev: enum ``rte_bbdev_op_type`` was affected to remove ``RTE_BBDEV_OP_TYPE_COUNT`` + and to allow for futureproof enum insertion a padded ``RTE_BBDEV_OP_TYPE_SIZE_MAX`` + macro is added. Known Issues ------------
examples/bbdev_app/main.c +1 -1
@@ -1041,7 +1041,7 @@ main(int argc, char **argv)void *sigret;struct app_config_params app_params = def_app_config;struct rte_mempool *ethdev_mbuf_mempool, *bbdev_mbuf_mempool; -struct rte_mempool *bbdev_op_pools[RTE_BBDEV_OP_TYPE_COUNT ]; +struct rte_mempool *bbdev_op_pools[RTE_BBDEV_OP_TYPE_SIZE_MAX ];struct lcore_conf lcore_conf[RTE_MAX_LCORE ] = { {0 } };struct lcore_statistics lcore_stats[RTE_MAX_LCORE ] = { {0 } };struct stats_lcore_params stats_lcore;
lib/bbdev/rte_bbdev.c +5 -3
@@ -23,6 +23,8 @@#define DEV_NAME "BBDEV" +/* Number of supported operation types */ +#define BBDEV_OP_TYPE_COUNT 5/* BBDev library logging ID */ RTE_LOG_REGISTER_DEFAULT (bbdev_logtype,NOTICE );
@@ -890,10 +892,10 @@ rte_bbdev_op_pool_create(const char *name, enum rte_bbdev_op_type type,return NULL ; } -if (type >=RTE_BBDEV_OP_TYPE_COUNT ) { +if (type >=BBDEV_OP_TYPE_COUNT ) {rte_bbdev_log (ERR ,"Invalid op type (%u), should be less than %u" , - type,RTE_BBDEV_OP_TYPE_COUNT ); + type,BBDEV_OP_TYPE_COUNT );return NULL ; }
@@ -1125,7 +1127,7 @@ rte_bbdev_op_type_str(enum rte_bbdev_op_type op_type) "RTE_BBDEV_OP_LDPC_ENC", }; -if (op_type <RTE_BBDEV_OP_TYPE_COUNT ) +if (op_type <BBDEV_OP_TYPE_COUNT )return op_types[op_type];rte_bbdev_log (ERR ,"Invalid operation type" );
lib/bbdev/rte_bbdev_op.h +12 -2
@@ -48,6 +48,13 @@ extern "C" {/* LDPC: Maximum number of Code Blocks in Transport Block.*/ #define RTE_BBDEV_LDPC_MAX_CODE_BLOCKS (256) +/* +* Maximum size to be used to manage the enum rte_bbdev_op_type +* including padding for future enum insertion. +* The enum values must be explicitly kept smaller or equal to this padded maximum size. +*/ +#define RTE_BBDEV_OP_TYPE_SIZE_MAX 8 +/** Flags for turbo decoder operation and capability structure */ enum rte_bbdev_op_td_flag_bitmasks {/** If sub block de-interleaving is to be performed. */
@@ -741,14 +748,17 @@ struct rte_bbdev_op_cap_ldpc_enc {uint16_t num_buffers_dst; }; -/** Different operation types supported by the device */ +/** Different operation types supported by the device +* The related macro RTE_BBDEV_OP_TYPE_SIZE_MAX can be used as an absolute maximum for +* notably sizing array while allowing for future enumeration insertion. +*/ enum rte_bbdev_op_type {RTE_BBDEV_OP_NONE ,/**< Dummy operation that does nothing */ RTE_BBDEV_OP_TURBO_DEC ,/**< Turbo decode */ RTE_BBDEV_OP_TURBO_ENC ,/**< Turbo encode */ RTE_BBDEV_OP_LDPC_DEC ,/**< LDPC decode */ RTE_BBDEV_OP_LDPC_ENC ,/**< LDPC encode */ -RTE_BBDEV_OP_TYPE_COUNT ,/**< Count of different op types */ +/* Note: RTE_BBDEV_OP_TYPE_SIZE_MAX must be larger or equal to maximum enum value */ };/** Bit indexes of possible errors reported through status field */
Signature · 1 line
2.37.1
PATCH v11 2/7 bbdev: add device status info
In reply to Nicolas ChautruAdded device status information, so that the PMD can
expose information related to the underlying accelerator device status. Minor order change in structure to fit into padding hole.
--- doc/guides/rel_notes/deprecation.rst | 3 -- doc/guides/rel_notes/release_22_11.rst | 3 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 1 + .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 1 + drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 1 + drivers/baseband/la12xx/bbdev_la12xx.c | 1 + drivers/baseband/null/bbdev_null.c | 1 + .../baseband/turbo_sw/bbdev_turbo_software.c | 1 + lib/bbdev/rte_bbdev.c | 22 ++++++++++++ lib/bbdev/rte_bbdev.h | 35 +++++++++++++++++-- lib/bbdev/rte_bbdev_op.h | 2 +- lib/bbdev/version.map | 7 ++++ 12 files changed, 72 insertions(+), 6 deletions(-)
doc/guides/rel_notes/deprecation.rst +0 -3
@@ -125,9 +125,6 @@ Deprecation Notices New members will be added in ``rte_bbdev_driver_info`` to expose PMD queue topology inspired by this `RFC <https://patches.dpdk.org/project/dpdk/list/?series=22076>`__. - New member will be added in ``rte_bbdev_driver_info`` to expose - the device status as per - this `RFC <https://patches.dpdk.org/project/dpdk/list/?series=23367>`__. This should be updated in DPDK 22.11. * cryptodev: Hide structures ``rte_cryptodev_sym_session`` and
doc/guides/rel_notes/release_22_11.rst +3 -0
@@ -321,6 +321,9 @@ ABI Changes and to allow for futureproof enum insertion a padded ``RTE_BBDEV_OP_TYPE_SIZE_MAX`` macro is added. +* bbdev: Structure ``rte_bbdev_driver_info`` was updated to add new parameters + for device status using ``rte_bbdev_device_status``. + Known Issues ------------
drivers/baseband/acc100/rte_acc100_pmd.c +1 -0
@@ -1061,6 +1061,7 @@ acc100_dev_info_get(struct rte_bbdev *dev,/* Read and save the populated config from ACC100 registers */ fetch_acc100_config (dev); + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* This isn't ideal because it reports the maximum number of queues but * does not provide info on how many can be uplink/downlink or different
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +1 -0
@@ -369,6 +369,7 @@ fpga_dev_info_get(struct rte_bbdev *dev, dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* Calculates number of queues assigned to device */ dev_info->max_num_queues =0 ;
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +1 -0
@@ -645,6 +645,7 @@ fpga_dev_info_get(struct rte_bbdev *dev, dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* Calculates number of queues assigned to device */ dev_info->max_num_queues =0 ;
drivers/baseband/la12xx/bbdev_la12xx.c +1 -0
@@ -101,6 +101,7 @@ la12xx_info_get(struct rte_bbdev *dev __rte_unused, dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->min_alignment =64 ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/null/bbdev_null.c +1 -0
@@ -83,6 +83,7 @@ info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info)* here for code completeness. */ dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/turbo_sw/bbdev_turbo_software.c +1 -0
@@ -255,6 +255,7 @@ info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) dev_info->min_alignment =64 ; dev_info->harq_buffer_size =0 ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u\n" , dev->data->dev_id); }
lib/bbdev/rte_bbdev.c +22 -0
@@ -1133,3 +1133,25 @@ rte_bbdev_op_type_str(enum rte_bbdev_op_type op_type)rte_bbdev_log (ERR ,"Invalid operation type" );return NULL ; } + +const char * +rte_bbdev_device_status_str (enum rte_bbdev_device_status status) +{ +static const char *const dev_sta_string[] = { +"RTE_BBDEV_DEV_NOSTATUS" , +"RTE_BBDEV_DEV_NOT_SUPPORTED" , +"RTE_BBDEV_DEV_RESET" , +"RTE_BBDEV_DEV_CONFIGURED" , +"RTE_BBDEV_DEV_ACTIVE" , +"RTE_BBDEV_DEV_FATAL_ERR" , +"RTE_BBDEV_DEV_RESTART_REQ" , +"RTE_BBDEV_DEV_RECONFIG_REQ" , +"RTE_BBDEV_DEV_CORRECT_ERR" , + }; + +if (status <sizeof (dev_sta_string) /sizeof (char *)) +return dev_sta_string[status]; + +rte_bbdev_log (ERR ,"Invalid device status" ); +return NULL ; +}
lib/bbdev/rte_bbdev.h +33 -2
@@ -223,6 +223,21 @@ rte_bbdev_queue_start(uint16_t dev_id, uint16_t queue_id);int rte_bbdev_queue_stop (uint16_t dev_id,uint16_t queue_id); +/** +* Flags indicate the status of the device +*/ +enum rte_bbdev_device_status { +RTE_BBDEV_DEV_NOSTATUS ,/**< Nothing being reported */ +RTE_BBDEV_DEV_NOT_SUPPORTED ,/**< Device status is not supported on the PMD */ +RTE_BBDEV_DEV_RESET ,/**< Device in reset and un-configured state */ +RTE_BBDEV_DEV_CONFIGURED ,/**< Device is configured and ready to use */ +RTE_BBDEV_DEV_ACTIVE ,/**< Device is configured and VF is being used */ +RTE_BBDEV_DEV_FATAL_ERR ,/**< Device has hit a fatal uncorrectable error */ +RTE_BBDEV_DEV_RESTART_REQ ,/**< Device requires application to restart */ +RTE_BBDEV_DEV_RECONFIG_REQ ,/**< Device requires application to reconfigure queues */ +RTE_BBDEV_DEV_CORRECT_ERR ,/**< Warning of a correctable error event happened */ +}; +/** Device statistics. */ struct rte_bbdev_stats {uint64_t enqueued_count;/**< Count of all operations enqueued */
@@ -284,10 +299,12 @@ struct rte_bbdev_driver_info {uint8_t max_ul_queue_priority;/** Set if device supports per-queue interrupts */ bool queue_intr_supported; -/** Minimum alignment of buffers, in bytes */ -uint16_t min_alignment; +/** Device Status */ +enum rte_bbdev_device_status device_status;/** HARQ memory available in kB */ uint32_t harq_buffer_size; +/** Minimum alignment of buffers, in bytes */ +uint16_t min_alignment;/** Byte endianness (RTE_BIG_ENDIAN/RTE_LITTLE_ENDIAN) supported * for input/output data */
@@ -827,6 +844,20 @@ int rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op, void *data); +/** +* Convert device status from enum to string. +* +* @param status +* Device status as enum. +* +* @returns +* Operation type as string or NULL if op_type is invalid. +* +*/ +__rte_experimental +const char* +rte_bbdev_device_status_str (enum rte_bbdev_device_status status); + #ifdef __cplusplus }#endif
lib/bbdev/rte_bbdev_op.h +1 -1
@@ -748,7 +748,7 @@ struct rte_bbdev_op_cap_ldpc_enc {uint16_t num_buffers_dst; }; -/** Different operation types supported by the device +/** Different operation types supported by the device. * The related macro RTE_BBDEV_OP_TYPE_SIZE_MAX can be used as an absolute maximum for * notably sizing array while allowing for future enumeration insertion. */
lib/bbdev/version.map +7 -0
@@ -39,3 +39,10 @@ DPDK_23 { local: *; }; + +EXPERIMENTAL { + global: + + # added in 22.11 + rte_bbdev_device_status_str; +};
Signature · 1 line
2.37.1
PATCH v11 3/7 bbdev: add device info on queue topology
In reply to Nicolas ChautruAdding more options in the API to expose the number of queues exposed and related priority.
--- doc/guides/rel_notes/deprecation.rst | 3 --- doc/guides/rel_notes/release_22_11.rst | 2 +- lib/bbdev/rte_bbdev.h | 4 ++++ 3 files changed, 5 insertions(+), 4 deletions(-)
doc/guides/rel_notes/deprecation.rst +0 -3
@@ -122,9 +122,6 @@ Deprecation Notices * bbdev: Will extend API to support new operation type ``RTE_BBDEV_OP_FFT`` as per this `RFC <https://patches.dpdk.org/project/dpdk/list/?series=22111>`__. - New members will be added in ``rte_bbdev_driver_info`` to expose - PMD queue topology inspired by - this `RFC <https://patches.dpdk.org/project/dpdk/list/?series=22076>`__. This should be updated in DPDK 22.11. * cryptodev: Hide structures ``rte_cryptodev_sym_session`` and
doc/guides/rel_notes/release_22_11.rst +1 -1
@@ -322,7 +322,7 @@ ABI Changes macro is added. * bbdev: Structure ``rte_bbdev_driver_info`` was updated to add new parameters - for device status using ``rte_bbdev_device_status``. + for queue topology, device status using ``rte_bbdev_device_status``. Known Issues ------------
lib/bbdev/rte_bbdev.h +4 -0
@@ -289,6 +289,10 @@ struct rte_bbdev_driver_info {/** Maximum number of queues supported by the device */ unsigned int max_num_queues; +/** Maximum number of queues supported per operation type */ +unsigned int num_queues[RTE_BBDEV_OP_TYPE_SIZE_MAX ]; +/** Priority level supported per operation type */ +unsigned int queue_priority[RTE_BBDEV_OP_TYPE_SIZE_MAX ];/** Queue size limit (queue size must also be power of 2) */ uint32_t queue_size_lim;/** Set if device off-loads operation to hardware */
Signature · 1 line
2.37.1
PATCH v11 4/7 drivers/baseband: update PMDs to expose queue per operation
In reply to Nicolas ChautruAdd support in existing bbdev PMDs for the explicit number of queues and priority for each operation type configured on the device.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 29 +++++++++++-------- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 8 +++++ drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 8 +++++ drivers/baseband/la12xx/bbdev_la12xx.c | 7 +++++ .../baseband/turbo_sw/bbdev_turbo_software.c | 12 ++++++++ 5 files changed, 52 insertions(+), 12 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +17 -12
@@ -967,6 +967,7 @@ acc100_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) {struct acc100_device *d = dev->data->dev_private; +int i;static const struct rte_bbdev_op_cap bbdev_capabilities[] = { {
@@ -1063,19 +1064,23 @@ acc100_dev_info_get(struct rte_bbdev *dev,fetch_acc100_config (dev); dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; -/* This isn't ideal because it reports the maximum number of queues but -* does not provide info on how many can be uplink/downlink or different -* priorities -*/ - dev_info->max_num_queues = - d->acc100_conf.q_dl_5g.num_aqs_per_groups * - d->acc100_conf.q_dl_5g.num_qgroups + - d->acc100_conf.q_ul_5g.num_aqs_per_groups * - d->acc100_conf.q_ul_5g.num_qgroups + - d->acc100_conf.q_dl_4g.num_aqs_per_groups * - d->acc100_conf.q_dl_4g.num_qgroups + - d->acc100_conf.q_ul_4g.num_aqs_per_groups * +/* Expose number of queues */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] = d->acc100_conf.q_ul_4g.num_aqs_per_groups * d->acc100_conf.q_ul_4g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] = d->acc100_conf.q_dl_4g.num_aqs_per_groups * + d->acc100_conf.q_dl_4g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] = d->acc100_conf.q_ul_5g.num_aqs_per_groups * + d->acc100_conf.q_ul_5g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] = d->acc100_conf.q_dl_5g.num_aqs_per_groups * + d->acc100_conf.q_dl_5g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_DEC ] = d->acc100_conf.q_ul_4g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_ENC ] = d->acc100_conf.q_dl_4g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] = d->acc100_conf.q_ul_5g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] = d->acc100_conf.q_dl_5g.num_qgroups; + dev_info->max_num_queues =0 ; +for (i =RTE_BBDEV_OP_TURBO_DEC ; i <=RTE_BBDEV_OP_LDPC_ENC ; i++) + dev_info->max_num_queues += dev_info->num_queues[i]; dev_info->queue_size_lim =ACC100_MAX_QUEUE_DEPTH ; dev_info->hardware_accelerated = true; dev_info->max_dl_queue_priority =
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +8 -0
@@ -379,6 +379,14 @@ fpga_dev_info_get(struct rte_bbdev *dev,if (hw_q_id !=FPGA_INVALID_HW_QUEUE_ID ) dev_info->max_num_queues++; } +/* Expose number of queue per operation type */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] = dev_info->max_num_queues /2 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] =1 ; }/**
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +8 -0
@@ -655,6 +655,14 @@ fpga_dev_info_get(struct rte_bbdev *dev,if (hw_q_id !=FPGA_INVALID_HW_QUEUE_ID ) dev_info->max_num_queues++; } +/* Expose number of queue per operation type */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] =0 ; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_ENC ] =1 ; }/**
drivers/baseband/la12xx/bbdev_la12xx.c +7 -0
@@ -103,6 +103,13 @@ la12xx_info_get(struct rte_bbdev *dev __rte_unused, dev_info->min_alignment =64 ; dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] =LA12XX_MAX_QUEUES /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] =LA12XX_MAX_QUEUES /2 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] =1 ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/turbo_sw/bbdev_turbo_software.c +12 -0
@@ -158,6 +158,8 @@ static void info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) { struct bbdev_private *internals = dev->data->dev_private; +const struct rte_bbdev_op_cap *op_cap; +int num_op_type =0 ;static const struct rte_bbdev_op_cap bbdev_capabilities[] = { #ifdef RTE_BBDEV_SDK_AVX2
@@ -257,6 +259,16 @@ info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) dev_info->data_endianness =RTE_LITTLE_ENDIAN ; dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; + op_cap = bbdev_capabilities; +for (; op_cap->type !=RTE_BBDEV_OP_NONE ; ++op_cap) + num_op_type++; + op_cap = bbdev_capabilities; +if (num_op_type >0 ) { +int num_queue_per_type = dev_info->max_num_queues / num_op_type; +for (; op_cap->type !=RTE_BBDEV_OP_NONE ; ++op_cap) + dev_info->num_queues[op_cap->type] = num_queue_per_type; + } +rte_bbdev_log_debug ("got device info from %u\n" , dev->data->dev_id); }
Signature · 1 line
2.37.1
PATCH v11 5/7 bbdev: add new operation for FFT processing
In reply to Nicolas ChautruExtension of bbdev operation to support FFT based operations.
--- doc/guides/prog_guide/bbdev.rst | 103 +++++++++++++++++ doc/guides/rel_notes/deprecation.rst | 4 - doc/guides/rel_notes/release_22_11.rst | 5 + lib/bbdev/rte_bbdev.c | 10 +- lib/bbdev/rte_bbdev.h | 76 +++++++++++++ lib/bbdev/rte_bbdev_op.h | 149 +++++++++++++++++++++++++ lib/bbdev/version.map | 4 + 7 files changed, 346 insertions(+), 5 deletions(-)
doc/guides/prog_guide/bbdev.rst +103 -0
@@ -1118,6 +1118,109 @@ Figure :numref:`figure_turbo_tb_decode` above showing the Turbo decoding of CBs using BBDEV interface in TB-mode is also valid for LDPC decode. +BBDEV FFT Operation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This operation allows to run a combination of DFT and/or IDFT and/or time-domain windowing. +These can be used in a modular fashion (using bypass modes) or as a processing pipeline +which can be used for FFT-based baseband signal processing. +In more details it allows : +- to process the data first through an IDFT of adjustable size and padding; +- to perform the windowing as a programmable cyclic shift offset of the data followed by a +pointwise multiplication by a time domain window; +- to process the related data through a DFT of adjustable size and de-padding for each such cyclic +shift output. + +A flexible number of Rx antennas are being processed in parallel with the same configuration. +The API allows more generally for flexibility in what the PMD may support (capability flags) and +flexibility to adjust some of the parameters of the processing. + +The operation/capability flags that can be set for each FFT operation are given below. + + **NOTE:** The actual operation flags that may be used with a specific + BBDEV PMD are dependent on the driver capabilities as reported via + ``rte_bbdev_info_get()``, and may be a subset of those below. + ++--------------------------------------------------------------------+ +|Description of FFT capability flags | ++====================================================================+ +|RTE_BBDEV_FFT_WINDOWING | +| Set to enable/support windowing in time domain | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_CS_ADJUSTMENT | +| Set to enable/support the cyclic shift time offset adjustment | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_DFT_BYPASS | +| Set to bypass the DFT and use directly the IDFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_IDFT_BYPASS | +| Set to bypass the IDFT and use directly the DFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_WINDOWING_BYPASS | +| Set to bypass the time domain windowing as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_POWER_MEAS | +| Set to provide an optional power measurement of the DFT output | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_INPUT | +| Set if the input data shall use FP16 format instead of INT16 | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_OUTPUT | +| Set if the output data shall use FP16 format instead of INT16 | ++--------------------------------------------------------------------+ + +The FFT parameters are set out in the table below. + ++-------------------------+--------------------------------------------------------------+ +|Parameter |Description | ++=========================+==============================================================+ +|base_input |input data | ++-------------------------+--------------------------------------------------------------+ +|base_output |output data | ++-------------------------+--------------------------------------------------------------+ +|power_meas_output |optional output data with power measurement on DFT output | ++-------------------------+--------------------------------------------------------------+ +|op_flags |bitmask of all active operation capabilities | ++-------------------------+--------------------------------------------------------------+ +|input_sequence_size |size of the input sequence in 32-bits points per antenna | ++-------------------------+--------------------------------------------------------------+ +|input_leading_padding |number of points padded at the start of input data | ++-------------------------+--------------------------------------------------------------+ +|output_sequence_size |size of the output sequence per antenna and cyclic shift | ++-------------------------+--------------------------------------------------------------+ +|output_leading_depadding |number of points de-padded at the start of output data | ++-------------------------+--------------------------------------------------------------+ +|window_index |optional windowing profile index used for each cyclic shift | ++-------------------------+--------------------------------------------------------------+ +|cs_bitmap |bitmap of the cyclic shift output requested (LSB for index 0) | ++-------------------------+--------------------------------------------------------------+ +|num_antennas_log2 |number of antennas as a log2 (10 maps to 1024...) | ++-------------------------+--------------------------------------------------------------+ +|idft_log2 |iDFT size as a log2 | ++-------------------------+--------------------------------------------------------------+ +|dft_log2 |DFT size as a log2 | ++-------------------------+--------------------------------------------------------------+ +|cs_time_adjustment |adjustment of time position of all the cyclic shift output | ++-------------------------+--------------------------------------------------------------+ +|idft_shift |shift down of signal level post iDFT | ++-------------------------+--------------------------------------------------------------+ +|dft_shift |shift down of signal level post DFT | ++-------------------------+--------------------------------------------------------------+ +|ncs_reciprocal |inverse of max number of CS normalized to 15b (ie. 231 for 12)| ++-------------------------+--------------------------------------------------------------+ +|power_shift |shift down of level of power measurement when enabled | ++-------------------------+--------------------------------------------------------------+ +|fp16_exp_adjust |value added to FP16 exponent at conversion from INT16 | ++-------------------------+--------------------------------------------------------------+ + +The mbuf input ``base_input`` is mandatory for all BBDEV PMDs and is the +incoming data for the processing. Its size may not fit into an actual mbuf, but the +structure is used to pass iova address. +The mbuf output ``output`` is mandatory and is output of the FFT processing chain. +Each point is a complex number of 32bits : either as 2 INT16 or as 2 FP16 based when the option +supported. +The data layout is based on contiguous concatenation of output data first by cyclic shift then +by antenna. Sample code -----------
doc/guides/rel_notes/deprecation.rst +0 -4
@@ -120,10 +120,6 @@ Deprecation Notices ``RTE_ETH_EVENT_IPSEC_SA_BYTE_HARD_EXPIRY`` and ``RTE_ETH_EVENT_IPSEC_SA_PKT_HARD_EXPIRY`` in DPDK 22.11. -* bbdev: Will extend API to support new operation type ``RTE_BBDEV_OP_FFT`` as per - this `RFC <https://patches.dpdk.org/project/dpdk/list/?series=22111>`__. - This should be updated in DPDK 22.11. - * cryptodev: Hide structures ``rte_cryptodev_sym_session`` and ``rte_cryptodev_asym_session`` to remove unnecessary indirection between session and the private data of session. An opaque pointer can be exposed
doc/guides/rel_notes/release_22_11.rst +5 -0
@@ -102,6 +102,11 @@ New Features * Added AES-CCM support in lookaside protocol (IPsec) for CN9K & CN10K. * Added AES & DES DOCSIS algorithm support in lookaside crypto for CN9K. +* **Added new operation for FFT processing in bbdev.** + + Added a new operation type in bbdev for FFT processing with new functions + ``rte_bbdev_enqueue_fft_ops`` and ``rte_bbdev_dequeue_fft_ops`` and related structures. + * **Added eventdev adapter instance get API.** * Added ``rte_event_eth_rx_adapter_instance_get`` to get Rx adapter
lib/bbdev/rte_bbdev.c +9 -1
@@ -24,7 +24,7 @@#define DEV_NAME "BBDEV"/* Number of supported operation types */ -#define BBDEV_OP_TYPE_COUNT 5 +#define BBDEV_OP_TYPE_COUNT 6/* BBDev library logging ID */ RTE_LOG_REGISTER_DEFAULT (bbdev_logtype,NOTICE );
@@ -852,6 +852,9 @@ get_bbdev_op_size(enum rte_bbdev_op_type type)case RTE_BBDEV_OP_LDPC_ENC : result =sizeof (struct rte_bbdev_enc_op );break ; +case RTE_BBDEV_OP_FFT : + result =sizeof (struct rte_bbdev_fft_op ); +break ;default :break ; }
@@ -875,6 +878,10 @@ bbdev_op_init(struct rte_mempool *mempool, void *arg, void *element,struct rte_bbdev_enc_op *op = element;memset (op,0 , mempool->elt_size); op->mempool = mempool; + }else if (type ==RTE_BBDEV_OP_FFT ) { +struct rte_bbdev_fft_op *op = element; +memset (op,0 , mempool->elt_size); + op->mempool = mempool; } }
@@ -1125,6 +1132,7 @@ rte_bbdev_op_type_str(enum rte_bbdev_op_type op_type)"RTE_BBDEV_OP_TURBO_ENC" ,"RTE_BBDEV_OP_LDPC_DEC" ,"RTE_BBDEV_OP_LDPC_ENC" , + "RTE_BBDEV_OP_FFT", };if (op_type <BBDEV_OP_TYPE_COUNT )
lib/bbdev/rte_bbdev.h +76 -0
106 lines not on this page · raw message
lib/bbdev/rte_bbdev_op.h +149 -0
203 lines not on this page · raw message
lib/bbdev/version.map +4 -0
@@ -44,5 +44,9 @@ EXPERIMENTAL { global: # added in 22.11 + rte_bbdev_dequeue_fft_ops; rte_bbdev_device_status_str; + rte_bbdev_enqueue_fft_ops; + rte_bbdev_fft_op_alloc_bulk; + rte_bbdev_fft_op_free_bulk; };
Signature · 1 line
2.37.1
PATCH v11 6/7 bbdev: add queue related warning and status information
In reply to Nicolas ChautruThis allows to expose more information with regards to any queue related failure and warning which cannot be supported in existing API.
--- app/test-bbdev/test_bbdev_perf.c | 2 ++ doc/guides/rel_notes/release_22_11.rst | 3 ++ lib/bbdev/rte_bbdev.c | 19 ++++++++++++ lib/bbdev/rte_bbdev.h | 43 ++++++++++++++++++++++++++ lib/bbdev/version.map | 1 + 5 files changed, 68 insertions(+)
app/test-bbdev/test_bbdev_perf.c +2 -0
@@ -4361,6 +4361,8 @@ get_bbdev_queue_stats(uint16_t dev_id, uint16_t queue_id, stats->dequeued_count = q_stats->dequeued_count; stats->enqueue_err_count = q_stats->enqueue_err_count; stats->dequeue_err_count = q_stats->dequeue_err_count; + stats->enqueue_warning_count = q_stats->enqueue_warning_count; + stats->dequeue_warning_count = q_stats->dequeue_warning_count; stats->acc_offload_cycles = q_stats->acc_offload_cycles;return 0 ;
doc/guides/rel_notes/release_22_11.rst +3 -0
@@ -329,6 +329,9 @@ ABI Changes * bbdev: Structure ``rte_bbdev_driver_info`` was updated to add new parameters for queue topology, device status using ``rte_bbdev_device_status``. +* bbdev: Structure ``rte_bbdev_queue_data`` was updated to add new parameter + for enqueue status using ``rte_bbdev_enqueue_status``. + Known Issues ------------
lib/bbdev/rte_bbdev.c +19 -0
@@ -721,6 +721,8 @@ get_stats_from_queues(struct rte_bbdev *dev, struct rte_bbdev_stats *stats) stats->dequeued_count += q_stats->dequeued_count; stats->enqueue_err_count += q_stats->enqueue_err_count; stats->dequeue_err_count += q_stats->dequeue_err_count; + stats->enqueue_warn_count += q_stats->enqueue_warn_count; + stats->dequeue_warn_count += q_stats->dequeue_warn_count; }rte_bbdev_log_debug ("Got stats on %u" , dev->data->dev_id); }
@@ -1163,3 +1165,20 @@ rte_bbdev_device_status_str(enum rte_bbdev_device_status status)rte_bbdev_log (ERR ,"Invalid device status" );return NULL ; } + +const char * +rte_bbdev_enqueue_status_str (enum rte_bbdev_enqueue_status status) +{ +static const char *const enq_sta_string[] = { +"RTE_BBDEV_ENQ_STATUS_NONE" , +"RTE_BBDEV_ENQ_STATUS_QUEUE_FULL" , +"RTE_BBDEV_ENQ_STATUS_RING_FULL" , +"RTE_BBDEV_ENQ_STATUS_INVALID_OP" , + }; + +if (status <sizeof (enq_sta_string) /sizeof (char *)) +return enq_sta_string[status]; + +rte_bbdev_log (ERR ,"Invalid enqueue status" ); +return NULL ; +}
lib/bbdev/rte_bbdev.h +43 -0
73 lines not on this page · raw message
lib/bbdev/version.map +1 -0
@@ -47,6 +47,7 @@ EXPERIMENTAL { rte_bbdev_dequeue_fft_ops; rte_bbdev_device_status_str; rte_bbdev_enqueue_fft_ops; + rte_bbdev_enqueue_status_str; rte_bbdev_fft_op_alloc_bulk; rte_bbdev_fft_op_free_bulk; };
Signature · 1 line
2.37.1
PATCH v11 7/7 bbdev: remove unnecessary if-check
In reply to Nicolas ChautruCode clean up due to if-check not required
--- lib/bbdev/rte_bbdev_op.h | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-)
lib/bbdev/rte_bbdev_op.h +4 -20
@@ -969,7 +969,6 @@ rte_bbdev_enc_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_enc_op **ops, uint16_t num_ops) {struct rte_bbdev_op_pool_private *priv; -int ret;/* Check type */ priv = (struct rte_bbdev_op_pool_private *)
@@ -979,11 +978,7 @@ rte_bbdev_enc_op_alloc_bulk(struct rte_mempool *mempool,return -EINVAL ;/* Get elements */ - ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; - -return 0 ; +return rte_mempool_get_bulk (mempool, (void **)ops, num_ops); }/**
@@ -1005,7 +1000,6 @@ rte_bbdev_dec_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_dec_op **ops, uint16_t num_ops) {struct rte_bbdev_op_pool_private *priv; -int ret;/* Check type */ priv = (struct rte_bbdev_op_pool_private *)
@@ -1015,11 +1009,7 @@ rte_bbdev_dec_op_alloc_bulk(struct rte_mempool *mempool,return -EINVAL ;/* Get elements */ - ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; - -return 0 ; +return rte_mempool_get_bulk (mempool, (void **)ops, num_ops); }/**
@@ -1042,20 +1032,14 @@ rte_bbdev_fft_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_fft_op **ops, uint16_t num_ops) {struct rte_bbdev_op_pool_private *priv; -int ret;/* Check type */ - priv = (struct rte_bbdev_op_pool_private *) -rte_mempool_get_priv (mempool); + priv = (struct rte_bbdev_op_pool_private *)rte_mempool_get_priv (mempool);if (unlikely (priv->type !=RTE_BBDEV_OP_FFT ))return -EINVAL ;/* Get elements */ - ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; - -return 0 ; +return rte_mempool_get_bulk (mempool, (void **)ops, num_ops); }/**
Signature · 1 line
2.37.1
v12 cover bbdev changes for 22.11
In reply to Nicolas ChautruHi Akhil, Thomas,
v12: minor change to fix misaligned comment on patch 6 raised by Thomas. Thanks.
v11: updated based on Thomas review notably on comments through the serie and ordering. Thanks. I have also updated rel_notes and deprecation through the serie this time.
v10: replacing the _PADDED_MAX enum to _SIZE_MAX macro based on suggestion from Ferruh/Maxime/Akhil. Thanks
v9: removing code snippet from documentation in 5/7 requested by Akhil. Thanks.
v8: edit based on review by Akhil : typos, coding guidelines. No functional change. Thanks
v7: couple of typos in documentation spotted by Maxime. Thanks.
v6: added one comment in commit 2/7 suggested by Maxime.
v5: update base on review from Tom Rix. Number of typos reported and resolved,
removed the commit related to rw_lock for now, added a commit for
code clean up from review, resolved one rebase issue between 2 commits, used size of array for some bound check implementation. Thanks.
v4: update to the last 2 commits to include function to print the queue status and a fix to the rte_lock within the wrong structure
v3: update to device status info to also use padded size for the related array.
Adding also 2 additionals commits to allow the API struc to expose more information related to queues corner cases/warning as well as an optional rw lock. Hemant, Maxime, this is planned for DPDK 21.11 but would like review/ack early is possible to get this applied earlier and due to time off this summer. Thanks
Nic
Nicolas Chautru (7):
bbdev: allow operation type enum for growth
bbdev: add device status info
bbdev: add device info on queue topology drivers/baseband: update PMDs to expose queue per operation
bbdev: add new operation for FFT processing
bbdev: add queue related warning and status information
bbdev: remove unnecessary if-check
app/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 6 +- doc/guides/prog_guide/bbdev.rst | 103 +++++++++++ doc/guides/rel_notes/deprecation.rst | 13 -- doc/guides/rel_notes/release_22_11.rst | 14 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 30 ++-- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 9 + drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 9 + drivers/baseband/la12xx/bbdev_la12xx.c | 10 +- drivers/baseband/null/bbdev_null.c | 1 + .../baseband/turbo_sw/bbdev_turbo_software.c | 13 ++ examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 57 +++++- lib/bbdev/rte_bbdev.h | 158 +++++++++++++++- lib/bbdev/rte_bbdev_op.h | 169 ++++++++++++++++-- lib/bbdev/version.map | 12 ++ 16 files changed, 560 insertions(+), 48 deletions(-)
Signature · 1 line
2.37.1
PATCH v12 1/7 bbdev: allow operation type enum for growth
Updating the enum for rte_bbdev_op_type
to allow to keep ABI compatible for enum insertion while adding padded maximum value for array need. Removing RTE_BBDEV_OP_TYPE_COUNT and instead exposing RTE_BBDEV_OP_TYPE_SIZE_MAX.
--- app/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 4 ++-- doc/guides/rel_notes/deprecation.rst | 5 +---- doc/guides/rel_notes/release_22_11.rst | 3 +++ examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 8 +++++--- lib/bbdev/rte_bbdev_op.h | 14 ++++++++++++-- 7 files changed, 25 insertions(+), 13 deletions(-)
app/test-bbdev/test_bbdev.c +1 -1
@@ -521,7 +521,7 @@ test_bbdev_op_pool(void)rte_mempool_free (mp);TEST_ASSERT ((mp =rte_bbdev_op_pool_create ("Test_INV" , -RTE_BBDEV_OP_TYPE_COUNT , size, cache_size,0 )) ==NULL , +RTE_BBDEV_OP_TYPE_SIZE_MAX , size, cache_size,0 )) ==NULL ,"Failed test for rte_bbdev_op_pool_create: " "returned value is not NULL for invalid type" );
app/test-bbdev/test_bbdev_perf.c +2 -2
@@ -2429,13 +2429,13 @@ run_test_case_on_device(test_case_function *test_case_func, uint8_t dev_id,/* Find capabilities */ const struct rte_bbdev_op_cap *cap = info.drv.capabilities; -for (i =0 ; i <RTE_BBDEV_OP_TYPE_COUNT ; i++) { +do {if (cap->type == test_vector.op_type) { capabilities = cap;break ; } cap++; - } + }while (cap->type !=RTE_BBDEV_OP_NONE );TEST_ASSERT_NOT_NULL (capabilities,"Couldn't find capabilities" );
doc/guides/rel_notes/deprecation.rst +1 -4
@@ -120,10 +120,7 @@ Deprecation Notices ``RTE_ETH_EVENT_IPSEC_SA_BYTE_HARD_EXPIRY`` and ``RTE_ETH_EVENT_IPSEC_SA_PKT_HARD_EXPIRY`` in DPDK 22.11. -* bbdev: ``RTE_BBDEV_OP_TYPE_COUNT`` terminating the ``rte_bbdev_op_type`` - enum will be deprecated and instead use fixed array size when required - to allow for future enum extension. - Will extend API to support new operation type ``RTE_BBDEV_OP_FFT`` as per +* bbdev: Will extend API to support new operation type ``RTE_BBDEV_OP_FFT`` as per this `RFC <https://patches.dpdk.org/project/dpdk/list/?series=22111>`__. New members will be added in ``rte_bbdev_driver_info`` to expose PMD queue topology inspired by
doc/guides/rel_notes/release_22_11.rst +3 -0
@@ -317,6 +317,9 @@ ABI Changes * eventdev: Added ``weight`` and ``affinity`` fields to ``rte_event_queue_conf`` structure. +* bbdev: enum ``rte_bbdev_op_type`` was affected to remove ``RTE_BBDEV_OP_TYPE_COUNT`` + and to allow for futureproof enum insertion a padded ``RTE_BBDEV_OP_TYPE_SIZE_MAX`` + macro is added. Known Issues ------------
examples/bbdev_app/main.c +1 -1
@@ -1041,7 +1041,7 @@ main(int argc, char **argv)void *sigret;struct app_config_params app_params = def_app_config;struct rte_mempool *ethdev_mbuf_mempool, *bbdev_mbuf_mempool; -struct rte_mempool *bbdev_op_pools[RTE_BBDEV_OP_TYPE_COUNT ]; +struct rte_mempool *bbdev_op_pools[RTE_BBDEV_OP_TYPE_SIZE_MAX ];struct lcore_conf lcore_conf[RTE_MAX_LCORE ] = { {0 } };struct lcore_statistics lcore_stats[RTE_MAX_LCORE ] = { {0 } };struct stats_lcore_params stats_lcore;
lib/bbdev/rte_bbdev.c +5 -3
@@ -23,6 +23,8 @@#define DEV_NAME "BBDEV" +/* Number of supported operation types */ +#define BBDEV_OP_TYPE_COUNT 5/* BBDev library logging ID */ RTE_LOG_REGISTER_DEFAULT (bbdev_logtype,NOTICE );
@@ -890,10 +892,10 @@ rte_bbdev_op_pool_create(const char *name, enum rte_bbdev_op_type type,return NULL ; } -if (type >=RTE_BBDEV_OP_TYPE_COUNT ) { +if (type >=BBDEV_OP_TYPE_COUNT ) {rte_bbdev_log (ERR ,"Invalid op type (%u), should be less than %u" , - type,RTE_BBDEV_OP_TYPE_COUNT ); + type,BBDEV_OP_TYPE_COUNT );return NULL ; }
@@ -1125,7 +1127,7 @@ rte_bbdev_op_type_str(enum rte_bbdev_op_type op_type) "RTE_BBDEV_OP_LDPC_ENC", }; -if (op_type <RTE_BBDEV_OP_TYPE_COUNT ) +if (op_type <BBDEV_OP_TYPE_COUNT )return op_types[op_type];rte_bbdev_log (ERR ,"Invalid operation type" );
lib/bbdev/rte_bbdev_op.h +12 -2
@@ -48,6 +48,13 @@ extern "C" {/* LDPC: Maximum number of Code Blocks in Transport Block.*/ #define RTE_BBDEV_LDPC_MAX_CODE_BLOCKS (256) +/* +* Maximum size to be used to manage the enum rte_bbdev_op_type +* including padding for future enum insertion. +* The enum values must be explicitly kept smaller or equal to this padded maximum size. +*/ +#define RTE_BBDEV_OP_TYPE_SIZE_MAX 8 +/** Flags for turbo decoder operation and capability structure */ enum rte_bbdev_op_td_flag_bitmasks {/** If sub block de-interleaving is to be performed. */
@@ -741,14 +748,17 @@ struct rte_bbdev_op_cap_ldpc_enc {uint16_t num_buffers_dst; }; -/** Different operation types supported by the device */ +/** Different operation types supported by the device +* The related macro RTE_BBDEV_OP_TYPE_SIZE_MAX can be used as an absolute maximum for +* notably sizing array while allowing for future enumeration insertion. +*/ enum rte_bbdev_op_type {RTE_BBDEV_OP_NONE ,/**< Dummy operation that does nothing */ RTE_BBDEV_OP_TURBO_DEC ,/**< Turbo decode */ RTE_BBDEV_OP_TURBO_ENC ,/**< Turbo encode */ RTE_BBDEV_OP_LDPC_DEC ,/**< LDPC decode */ RTE_BBDEV_OP_LDPC_ENC ,/**< LDPC encode */ -RTE_BBDEV_OP_TYPE_COUNT ,/**< Count of different op types */ +/* Note: RTE_BBDEV_OP_TYPE_SIZE_MAX must be larger or equal to maximum enum value */ };/** Bit indexes of possible errors reported through status field */
Signature · 1 line
2.37.1
PATCH v12 2/7 bbdev: add device status info
In reply to Nicolas ChautruAdded device status information, so that the PMD can
expose information related to the underlying accelerator device status. Minor order change in structure to fit into padding hole.
--- doc/guides/rel_notes/deprecation.rst | 3 -- doc/guides/rel_notes/release_22_11.rst | 3 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 1 + .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 1 + drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 1 + drivers/baseband/la12xx/bbdev_la12xx.c | 1 + drivers/baseband/null/bbdev_null.c | 1 + .../baseband/turbo_sw/bbdev_turbo_software.c | 1 + lib/bbdev/rte_bbdev.c | 22 ++++++++++++ lib/bbdev/rte_bbdev.h | 35 +++++++++++++++++-- lib/bbdev/rte_bbdev_op.h | 2 +- lib/bbdev/version.map | 7 ++++ 12 files changed, 72 insertions(+), 6 deletions(-)
doc/guides/rel_notes/deprecation.rst +0 -3
@@ -125,9 +125,6 @@ Deprecation Notices New members will be added in ``rte_bbdev_driver_info`` to expose PMD queue topology inspired by this `RFC <https://patches.dpdk.org/project/dpdk/list/?series=22076>`__. - New member will be added in ``rte_bbdev_driver_info`` to expose - the device status as per - this `RFC <https://patches.dpdk.org/project/dpdk/list/?series=23367>`__. This should be updated in DPDK 22.11. * cryptodev: Hide structures ``rte_cryptodev_sym_session`` and
doc/guides/rel_notes/release_22_11.rst +3 -0
@@ -321,6 +321,9 @@ ABI Changes and to allow for futureproof enum insertion a padded ``RTE_BBDEV_OP_TYPE_SIZE_MAX`` macro is added. +* bbdev: Structure ``rte_bbdev_driver_info`` was updated to add new parameters + for device status using ``rte_bbdev_device_status``. + Known Issues ------------
drivers/baseband/acc100/rte_acc100_pmd.c +1 -0
@@ -1061,6 +1061,7 @@ acc100_dev_info_get(struct rte_bbdev *dev,/* Read and save the populated config from ACC100 registers */ fetch_acc100_config (dev); + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* This isn't ideal because it reports the maximum number of queues but * does not provide info on how many can be uplink/downlink or different
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +1 -0
@@ -369,6 +369,7 @@ fpga_dev_info_get(struct rte_bbdev *dev, dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* Calculates number of queues assigned to device */ dev_info->max_num_queues =0 ;
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +1 -0
@@ -645,6 +645,7 @@ fpga_dev_info_get(struct rte_bbdev *dev, dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;/* Calculates number of queues assigned to device */ dev_info->max_num_queues =0 ;
drivers/baseband/la12xx/bbdev_la12xx.c +1 -0
@@ -101,6 +101,7 @@ la12xx_info_get(struct rte_bbdev *dev __rte_unused, dev_info->capabilities = bbdev_capabilities; dev_info->cpu_flag_reqs =NULL ; dev_info->min_alignment =64 ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/null/bbdev_null.c +1 -0
@@ -83,6 +83,7 @@ info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info)* here for code completeness. */ dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/turbo_sw/bbdev_turbo_software.c +1 -0
@@ -255,6 +255,7 @@ info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) dev_info->min_alignment =64 ; dev_info->harq_buffer_size =0 ; dev_info->data_endianness =RTE_LITTLE_ENDIAN ; + dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ;rte_bbdev_log_debug ("got device info from %u\n" , dev->data->dev_id); }
lib/bbdev/rte_bbdev.c +22 -0
@@ -1133,3 +1133,25 @@ rte_bbdev_op_type_str(enum rte_bbdev_op_type op_type)rte_bbdev_log (ERR ,"Invalid operation type" );return NULL ; } + +const char * +rte_bbdev_device_status_str (enum rte_bbdev_device_status status) +{ +static const char *const dev_sta_string[] = { +"RTE_BBDEV_DEV_NOSTATUS" , +"RTE_BBDEV_DEV_NOT_SUPPORTED" , +"RTE_BBDEV_DEV_RESET" , +"RTE_BBDEV_DEV_CONFIGURED" , +"RTE_BBDEV_DEV_ACTIVE" , +"RTE_BBDEV_DEV_FATAL_ERR" , +"RTE_BBDEV_DEV_RESTART_REQ" , +"RTE_BBDEV_DEV_RECONFIG_REQ" , +"RTE_BBDEV_DEV_CORRECT_ERR" , + }; + +if (status <sizeof (dev_sta_string) /sizeof (char *)) +return dev_sta_string[status]; + +rte_bbdev_log (ERR ,"Invalid device status" ); +return NULL ; +}
lib/bbdev/rte_bbdev.h +33 -2
@@ -223,6 +223,21 @@ rte_bbdev_queue_start(uint16_t dev_id, uint16_t queue_id);int rte_bbdev_queue_stop (uint16_t dev_id,uint16_t queue_id); +/** +* Flags indicate the status of the device +*/ +enum rte_bbdev_device_status { +RTE_BBDEV_DEV_NOSTATUS ,/**< Nothing being reported */ +RTE_BBDEV_DEV_NOT_SUPPORTED ,/**< Device status is not supported on the PMD */ +RTE_BBDEV_DEV_RESET ,/**< Device in reset and un-configured state */ +RTE_BBDEV_DEV_CONFIGURED ,/**< Device is configured and ready to use */ +RTE_BBDEV_DEV_ACTIVE ,/**< Device is configured and VF is being used */ +RTE_BBDEV_DEV_FATAL_ERR ,/**< Device has hit a fatal uncorrectable error */ +RTE_BBDEV_DEV_RESTART_REQ ,/**< Device requires application to restart */ +RTE_BBDEV_DEV_RECONFIG_REQ ,/**< Device requires application to reconfigure queues */ +RTE_BBDEV_DEV_CORRECT_ERR ,/**< Warning of a correctable error event happened */ +}; +/** Device statistics. */ struct rte_bbdev_stats {uint64_t enqueued_count;/**< Count of all operations enqueued */
@@ -284,10 +299,12 @@ struct rte_bbdev_driver_info {uint8_t max_ul_queue_priority;/** Set if device supports per-queue interrupts */ bool queue_intr_supported; -/** Minimum alignment of buffers, in bytes */ -uint16_t min_alignment; +/** Device Status */ +enum rte_bbdev_device_status device_status;/** HARQ memory available in kB */ uint32_t harq_buffer_size; +/** Minimum alignment of buffers, in bytes */ +uint16_t min_alignment;/** Byte endianness (RTE_BIG_ENDIAN/RTE_LITTLE_ENDIAN) supported * for input/output data */
@@ -827,6 +844,20 @@ int rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op, void *data); +/** +* Convert device status from enum to string. +* +* @param status +* Device status as enum. +* +* @returns +* Operation type as string or NULL if op_type is invalid. +* +*/ +__rte_experimental +const char* +rte_bbdev_device_status_str (enum rte_bbdev_device_status status); + #ifdef __cplusplus }#endif
lib/bbdev/rte_bbdev_op.h +1 -1
@@ -748,7 +748,7 @@ struct rte_bbdev_op_cap_ldpc_enc {uint16_t num_buffers_dst; }; -/** Different operation types supported by the device +/** Different operation types supported by the device. * The related macro RTE_BBDEV_OP_TYPE_SIZE_MAX can be used as an absolute maximum for * notably sizing array while allowing for future enumeration insertion. */
lib/bbdev/version.map +7 -0
@@ -39,3 +39,10 @@ DPDK_23 { local: *; }; + +EXPERIMENTAL { + global: + + # added in 22.11 + rte_bbdev_device_status_str; +};
Signature · 1 line
2.37.1
Re: [PATCH v12 2/7] bbdev: add device status info
Quoted 7 lines · Nicolas Chautru
Added device status information, so that the PMD can
expose information related to the underlying accelerator device status. Minor order change in structure to fit into padding hole.Signed-off-by Nicolas Chautru <[email protected]>Acked-by Mingshan Zhang <[email protected]>Acked-by Hemant Agrawal <[email protected]>
Quoted 14 lines
--- doc/guides/rel_notes/deprecation.rst | 3 -- doc/guides/rel_notes/release_22_11.rst | 3 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 1 + .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 1 + drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 1 + drivers/baseband/la12xx/bbdev_la12xx.c | 1 + drivers/baseband/null/bbdev_null.c | 1 + .../baseband/turbo_sw/bbdev_turbo_software.c | 1 + lib/bbdev/rte_bbdev.c | 22 ++++++++++++ lib/bbdev/rte_bbdev.h | 35 +++++++++++++++++-- lib/bbdev/rte_bbdev_op.h | 2 +- lib/bbdev/version.map | 7 ++++ 12 files changed, 72 insertions(+), 6 deletions(-)
Thanks,
Maxime
PATCH v12 3/7 bbdev: add device info on queue topology
In reply to Nicolas ChautruAdding more options in the API to expose the number of queues exposed and related priority.
--- doc/guides/rel_notes/deprecation.rst | 3 --- doc/guides/rel_notes/release_22_11.rst | 2 +- lib/bbdev/rte_bbdev.h | 6 +++++- 3 files changed, 6 insertions(+), 5 deletions(-)
doc/guides/rel_notes/deprecation.rst +0 -3
@@ -122,9 +122,6 @@ Deprecation Notices * bbdev: Will extend API to support new operation type ``RTE_BBDEV_OP_FFT`` as per this `RFC <https://patches.dpdk.org/project/dpdk/list/?series=22111>`__. - New members will be added in ``rte_bbdev_driver_info`` to expose - PMD queue topology inspired by - this `RFC <https://patches.dpdk.org/project/dpdk/list/?series=22076>`__. This should be updated in DPDK 22.11. * cryptodev: Hide structures ``rte_cryptodev_sym_session`` and
doc/guides/rel_notes/release_22_11.rst +1 -1
@@ -322,7 +322,7 @@ ABI Changes macro is added. * bbdev: Structure ``rte_bbdev_driver_info`` was updated to add new parameters - for device status using ``rte_bbdev_device_status``. + for queue topology, device status using ``rte_bbdev_device_status``. Known Issues ------------
lib/bbdev/rte_bbdev.h +5 -1
@@ -289,6 +289,10 @@ struct rte_bbdev_driver_info {/** Maximum number of queues supported by the device */ unsigned int max_num_queues; +/** Maximum number of queues supported per operation type */ +unsigned int num_queues[RTE_BBDEV_OP_TYPE_SIZE_MAX ]; +/** Priority level supported per operation type */ +unsigned int queue_priority[RTE_BBDEV_OP_TYPE_SIZE_MAX ];/** Queue size limit (queue size must also be power of 2) */ uint32_t queue_size_lim;/** Set if device off-loads operation to hardware */
@@ -851,7 +855,7 @@ rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op,* Device status as enum. * * @returns -* Operation type as string or NULL if op_type is invalid. +* Device status as string or NULL if invalid. * */ __rte_experimental
Signature · 1 line
2.37.1
PATCH v12 4/7 drivers/baseband: update PMDs to expose queue per operation
In reply to Nicolas ChautruAdd support in existing bbdev PMDs for the explicit number of queues and priority for each operation type configured on the device.
--- drivers/baseband/acc100/rte_acc100_pmd.c | 29 +++++++++++-------- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 8 +++++ drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 8 +++++ drivers/baseband/la12xx/bbdev_la12xx.c | 7 +++++ .../baseband/turbo_sw/bbdev_turbo_software.c | 12 ++++++++ 5 files changed, 52 insertions(+), 12 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +17 -12
@@ -967,6 +967,7 @@ acc100_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) {struct acc100_device *d = dev->data->dev_private; +int i;static const struct rte_bbdev_op_cap bbdev_capabilities[] = { {
@@ -1063,19 +1064,23 @@ acc100_dev_info_get(struct rte_bbdev *dev,fetch_acc100_config (dev); dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; -/* This isn't ideal because it reports the maximum number of queues but -* does not provide info on how many can be uplink/downlink or different -* priorities -*/ - dev_info->max_num_queues = - d->acc100_conf.q_dl_5g.num_aqs_per_groups * - d->acc100_conf.q_dl_5g.num_qgroups + - d->acc100_conf.q_ul_5g.num_aqs_per_groups * - d->acc100_conf.q_ul_5g.num_qgroups + - d->acc100_conf.q_dl_4g.num_aqs_per_groups * - d->acc100_conf.q_dl_4g.num_qgroups + - d->acc100_conf.q_ul_4g.num_aqs_per_groups * +/* Expose number of queues */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] = d->acc100_conf.q_ul_4g.num_aqs_per_groups * d->acc100_conf.q_ul_4g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] = d->acc100_conf.q_dl_4g.num_aqs_per_groups * + d->acc100_conf.q_dl_4g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] = d->acc100_conf.q_ul_5g.num_aqs_per_groups * + d->acc100_conf.q_ul_5g.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] = d->acc100_conf.q_dl_5g.num_aqs_per_groups * + d->acc100_conf.q_dl_5g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_DEC ] = d->acc100_conf.q_ul_4g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_ENC ] = d->acc100_conf.q_dl_4g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] = d->acc100_conf.q_ul_5g.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] = d->acc100_conf.q_dl_5g.num_qgroups; + dev_info->max_num_queues =0 ; +for (i =RTE_BBDEV_OP_TURBO_DEC ; i <=RTE_BBDEV_OP_LDPC_ENC ; i++) + dev_info->max_num_queues += dev_info->num_queues[i]; dev_info->queue_size_lim =ACC100_MAX_QUEUE_DEPTH ; dev_info->hardware_accelerated = true; dev_info->max_dl_queue_priority =
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +8 -0
@@ -379,6 +379,14 @@ fpga_dev_info_get(struct rte_bbdev *dev,if (hw_q_id !=FPGA_INVALID_HW_QUEUE_ID ) dev_info->max_num_queues++; } +/* Expose number of queue per operation type */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] = dev_info->max_num_queues /2 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] =1 ; }/**
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +8 -0
@@ -655,6 +655,14 @@ fpga_dev_info_get(struct rte_bbdev *dev,if (hw_q_id !=FPGA_INVALID_HW_QUEUE_ID ) dev_info->max_num_queues++; } +/* Expose number of queue per operation type */ + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] = dev_info->max_num_queues /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] =0 ; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_TURBO_ENC ] =1 ; }/**
drivers/baseband/la12xx/bbdev_la12xx.c +7 -0
@@ -103,6 +103,13 @@ la12xx_info_get(struct rte_bbdev *dev __rte_unused, dev_info->min_alignment =64 ; dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; + dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_DEC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_TURBO_ENC ] =0 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_DEC ] =LA12XX_MAX_QUEUES /2 ; + dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC ] =LA12XX_MAX_QUEUES /2 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] =1 ; + dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] =1 ;rte_bbdev_log_debug ("got device info from %u" , dev->data->dev_id); }
drivers/baseband/turbo_sw/bbdev_turbo_software.c +12 -0
@@ -158,6 +158,8 @@ static void info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) { struct bbdev_private *internals = dev->data->dev_private; +const struct rte_bbdev_op_cap *op_cap; +int num_op_type =0 ;static const struct rte_bbdev_op_cap bbdev_capabilities[] = { #ifdef RTE_BBDEV_SDK_AVX2
@@ -257,6 +259,16 @@ info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) dev_info->data_endianness =RTE_LITTLE_ENDIAN ; dev_info->device_status =RTE_BBDEV_DEV_NOT_SUPPORTED ; + op_cap = bbdev_capabilities; +for (; op_cap->type !=RTE_BBDEV_OP_NONE ; ++op_cap) + num_op_type++; + op_cap = bbdev_capabilities; +if (num_op_type >0 ) { +int num_queue_per_type = dev_info->max_num_queues / num_op_type; +for (; op_cap->type !=RTE_BBDEV_OP_NONE ; ++op_cap) + dev_info->num_queues[op_cap->type] = num_queue_per_type; + } +rte_bbdev_log_debug ("got device info from %u\n" , dev->data->dev_id); }
Signature · 1 line
2.37.1
PATCH v12 5/7 bbdev: add new operation for FFT processing
In reply to Nicolas ChautruExtension of bbdev operation to support FFT based operations.
--- doc/guides/prog_guide/bbdev.rst | 103 +++++++++++++++++ doc/guides/rel_notes/deprecation.rst | 4 - doc/guides/rel_notes/release_22_11.rst | 5 + lib/bbdev/rte_bbdev.c | 10 +- lib/bbdev/rte_bbdev.h | 76 +++++++++++++ lib/bbdev/rte_bbdev_op.h | 149 +++++++++++++++++++++++++ lib/bbdev/version.map | 4 + 7 files changed, 346 insertions(+), 5 deletions(-)
doc/guides/prog_guide/bbdev.rst +103 -0
@@ -1118,6 +1118,109 @@ Figure :numref:`figure_turbo_tb_decode` above showing the Turbo decoding of CBs using BBDEV interface in TB-mode is also valid for LDPC decode. +BBDEV FFT Operation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This operation allows to run a combination of DFT and/or IDFT and/or time-domain windowing. +These can be used in a modular fashion (using bypass modes) or as a processing pipeline +which can be used for FFT-based baseband signal processing. +In more details it allows : +- to process the data first through an IDFT of adjustable size and padding; +- to perform the windowing as a programmable cyclic shift offset of the data followed by a +pointwise multiplication by a time domain window; +- to process the related data through a DFT of adjustable size and de-padding for each such cyclic +shift output. + +A flexible number of Rx antennas are being processed in parallel with the same configuration. +The API allows more generally for flexibility in what the PMD may support (capability flags) and +flexibility to adjust some of the parameters of the processing. + +The operation/capability flags that can be set for each FFT operation are given below. + + **NOTE:** The actual operation flags that may be used with a specific + BBDEV PMD are dependent on the driver capabilities as reported via + ``rte_bbdev_info_get()``, and may be a subset of those below. + ++--------------------------------------------------------------------+ +|Description of FFT capability flags | ++====================================================================+ +|RTE_BBDEV_FFT_WINDOWING | +| Set to enable/support windowing in time domain | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_CS_ADJUSTMENT | +| Set to enable/support the cyclic shift time offset adjustment | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_DFT_BYPASS | +| Set to bypass the DFT and use directly the IDFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_IDFT_BYPASS | +| Set to bypass the IDFT and use directly the DFT as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_WINDOWING_BYPASS | +| Set to bypass the time domain windowing as an option | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_POWER_MEAS | +| Set to provide an optional power measurement of the DFT output | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_INPUT | +| Set if the input data shall use FP16 format instead of INT16 | ++--------------------------------------------------------------------+ +|RTE_BBDEV_FFT_FP16_OUTPUT | +| Set if the output data shall use FP16 format instead of INT16 | ++--------------------------------------------------------------------+ + +The FFT parameters are set out in the table below. + ++-------------------------+--------------------------------------------------------------+ +|Parameter |Description | ++=========================+==============================================================+ +|base_input |input data | ++-------------------------+--------------------------------------------------------------+ +|base_output |output data | ++-------------------------+--------------------------------------------------------------+ +|power_meas_output |optional output data with power measurement on DFT output | ++-------------------------+--------------------------------------------------------------+ +|op_flags |bitmask of all active operation capabilities | ++-------------------------+--------------------------------------------------------------+ +|input_sequence_size |size of the input sequence in 32-bits points per antenna | ++-------------------------+--------------------------------------------------------------+ +|input_leading_padding |number of points padded at the start of input data | ++-------------------------+--------------------------------------------------------------+ +|output_sequence_size |size of the output sequence per antenna and cyclic shift | ++-------------------------+--------------------------------------------------------------+ +|output_leading_depadding |number of points de-padded at the start of output data | ++-------------------------+--------------------------------------------------------------+ +|window_index |optional windowing profile index used for each cyclic shift | ++-------------------------+--------------------------------------------------------------+ +|cs_bitmap |bitmap of the cyclic shift output requested (LSB for index 0) | ++-------------------------+--------------------------------------------------------------+ +|num_antennas_log2 |number of antennas as a log2 (10 maps to 1024...) | ++-------------------------+--------------------------------------------------------------+ +|idft_log2 |iDFT size as a log2 | ++-------------------------+--------------------------------------------------------------+ +|dft_log2 |DFT size as a log2 | ++-------------------------+--------------------------------------------------------------+ +|cs_time_adjustment |adjustment of time position of all the cyclic shift output | ++-------------------------+--------------------------------------------------------------+ +|idft_shift |shift down of signal level post iDFT | ++-------------------------+--------------------------------------------------------------+ +|dft_shift |shift down of signal level post DFT | ++-------------------------+--------------------------------------------------------------+ +|ncs_reciprocal |inverse of max number of CS normalized to 15b (ie. 231 for 12)| ++-------------------------+--------------------------------------------------------------+ +|power_shift |shift down of level of power measurement when enabled | ++-------------------------+--------------------------------------------------------------+ +|fp16_exp_adjust |value added to FP16 exponent at conversion from INT16 | ++-------------------------+--------------------------------------------------------------+ + +The mbuf input ``base_input`` is mandatory for all BBDEV PMDs and is the +incoming data for the processing. Its size may not fit into an actual mbuf, but the +structure is used to pass iova address. +The mbuf output ``output`` is mandatory and is output of the FFT processing chain. +Each point is a complex number of 32bits : either as 2 INT16 or as 2 FP16 based when the option +supported. +The data layout is based on contiguous concatenation of output data first by cyclic shift then +by antenna. Sample code -----------
doc/guides/rel_notes/deprecation.rst +0 -4
@@ -120,10 +120,6 @@ Deprecation Notices ``RTE_ETH_EVENT_IPSEC_SA_BYTE_HARD_EXPIRY`` and ``RTE_ETH_EVENT_IPSEC_SA_PKT_HARD_EXPIRY`` in DPDK 22.11. -* bbdev: Will extend API to support new operation type ``RTE_BBDEV_OP_FFT`` as per - this `RFC <https://patches.dpdk.org/project/dpdk/list/?series=22111>`__. - This should be updated in DPDK 22.11. - * cryptodev: Hide structures ``rte_cryptodev_sym_session`` and ``rte_cryptodev_asym_session`` to remove unnecessary indirection between session and the private data of session. An opaque pointer can be exposed
doc/guides/rel_notes/release_22_11.rst +5 -0
@@ -102,6 +102,11 @@ New Features * Added AES-CCM support in lookaside protocol (IPsec) for CN9K & CN10K. * Added AES & DES DOCSIS algorithm support in lookaside crypto for CN9K. +* **Added new operation for FFT processing in bbdev.** + + Added a new operation type in bbdev for FFT processing with new functions + ``rte_bbdev_enqueue_fft_ops`` and ``rte_bbdev_dequeue_fft_ops`` and related structures. + * **Added eventdev adapter instance get API.** * Added ``rte_event_eth_rx_adapter_instance_get`` to get Rx adapter
lib/bbdev/rte_bbdev.c +9 -1
@@ -24,7 +24,7 @@#define DEV_NAME "BBDEV"/* Number of supported operation types */ -#define BBDEV_OP_TYPE_COUNT 5 +#define BBDEV_OP_TYPE_COUNT 6/* BBDev library logging ID */ RTE_LOG_REGISTER_DEFAULT (bbdev_logtype,NOTICE );
@@ -852,6 +852,9 @@ get_bbdev_op_size(enum rte_bbdev_op_type type)case RTE_BBDEV_OP_LDPC_ENC : result =sizeof (struct rte_bbdev_enc_op );break ; +case RTE_BBDEV_OP_FFT : + result =sizeof (struct rte_bbdev_fft_op ); +break ;default :break ; }
@@ -875,6 +878,10 @@ bbdev_op_init(struct rte_mempool *mempool, void *arg, void *element,struct rte_bbdev_enc_op *op = element;memset (op,0 , mempool->elt_size); op->mempool = mempool; + }else if (type ==RTE_BBDEV_OP_FFT ) { +struct rte_bbdev_fft_op *op = element; +memset (op,0 , mempool->elt_size); + op->mempool = mempool; } }
@@ -1125,6 +1132,7 @@ rte_bbdev_op_type_str(enum rte_bbdev_op_type op_type)"RTE_BBDEV_OP_TURBO_ENC" ,"RTE_BBDEV_OP_LDPC_DEC" ,"RTE_BBDEV_OP_LDPC_ENC" , + "RTE_BBDEV_OP_FFT", };if (op_type <BBDEV_OP_TYPE_COUNT )
lib/bbdev/rte_bbdev.h +76 -0
106 lines not on this page · raw message
lib/bbdev/rte_bbdev_op.h +149 -0
203 lines not on this page · raw message
lib/bbdev/version.map +4 -0
@@ -44,5 +44,9 @@ EXPERIMENTAL { global: # added in 22.11 + rte_bbdev_dequeue_fft_ops; rte_bbdev_device_status_str; + rte_bbdev_enqueue_fft_ops; + rte_bbdev_fft_op_alloc_bulk; + rte_bbdev_fft_op_free_bulk; };
Signature · 1 line
2.37.1
PATCH v12 6/7 bbdev: add queue related warning and status information
In reply to Nicolas ChautruThis allows to expose more information with regards to any queue related failure and warning which cannot be supported in existing API.
--- app/test-bbdev/test_bbdev_perf.c | 2 ++ doc/guides/rel_notes/release_22_11.rst | 3 ++ lib/bbdev/rte_bbdev.c | 19 ++++++++++++ lib/bbdev/rte_bbdev.h | 43 ++++++++++++++++++++++++++ lib/bbdev/version.map | 1 + 5 files changed, 68 insertions(+)
app/test-bbdev/test_bbdev_perf.c +2 -0
@@ -4361,6 +4361,8 @@ get_bbdev_queue_stats(uint16_t dev_id, uint16_t queue_id, stats->dequeued_count = q_stats->dequeued_count; stats->enqueue_err_count = q_stats->enqueue_err_count; stats->dequeue_err_count = q_stats->dequeue_err_count; + stats->enqueue_warning_count = q_stats->enqueue_warning_count; + stats->dequeue_warning_count = q_stats->dequeue_warning_count; stats->acc_offload_cycles = q_stats->acc_offload_cycles;return 0 ;
doc/guides/rel_notes/release_22_11.rst +3 -0
@@ -329,6 +329,9 @@ ABI Changes * bbdev: Structure ``rte_bbdev_driver_info`` was updated to add new parameters for queue topology, device status using ``rte_bbdev_device_status``. +* bbdev: Structure ``rte_bbdev_queue_data`` was updated to add new parameter + for enqueue status using ``rte_bbdev_enqueue_status``. + Known Issues ------------
lib/bbdev/rte_bbdev.c +19 -0
@@ -721,6 +721,8 @@ get_stats_from_queues(struct rte_bbdev *dev, struct rte_bbdev_stats *stats) stats->dequeued_count += q_stats->dequeued_count; stats->enqueue_err_count += q_stats->enqueue_err_count; stats->dequeue_err_count += q_stats->dequeue_err_count; + stats->enqueue_warn_count += q_stats->enqueue_warn_count; + stats->dequeue_warn_count += q_stats->dequeue_warn_count; }rte_bbdev_log_debug ("Got stats on %u" , dev->data->dev_id); }
@@ -1163,3 +1165,20 @@ rte_bbdev_device_status_str(enum rte_bbdev_device_status status)rte_bbdev_log (ERR ,"Invalid device status" );return NULL ; } + +const char * +rte_bbdev_enqueue_status_str (enum rte_bbdev_enqueue_status status) +{ +static const char *const enq_sta_string[] = { +"RTE_BBDEV_ENQ_STATUS_NONE" , +"RTE_BBDEV_ENQ_STATUS_QUEUE_FULL" , +"RTE_BBDEV_ENQ_STATUS_RING_FULL" , +"RTE_BBDEV_ENQ_STATUS_INVALID_OP" , + }; + +if (status <sizeof (enq_sta_string) /sizeof (char *)) +return enq_sta_string[status]; + +rte_bbdev_log (ERR ,"Invalid enqueue status" ); +return NULL ; +}
lib/bbdev/rte_bbdev.h +43 -0
73 lines not on this page · raw message
lib/bbdev/version.map +1 -0
@@ -47,6 +47,7 @@ EXPERIMENTAL { rte_bbdev_dequeue_fft_ops; rte_bbdev_device_status_str; rte_bbdev_enqueue_fft_ops; + rte_bbdev_enqueue_status_str; rte_bbdev_fft_op_alloc_bulk; rte_bbdev_fft_op_free_bulk; };
Signature · 1 line
2.37.1
PATCH v12 7/7 bbdev: remove unnecessary if-check
In reply to Nicolas ChautruCode clean up due to if-check not required
--- lib/bbdev/rte_bbdev_op.h | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-)
lib/bbdev/rte_bbdev_op.h +4 -20
@@ -969,7 +969,6 @@ rte_bbdev_enc_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_enc_op **ops, uint16_t num_ops) {struct rte_bbdev_op_pool_private *priv; -int ret;/* Check type */ priv = (struct rte_bbdev_op_pool_private *)
@@ -979,11 +978,7 @@ rte_bbdev_enc_op_alloc_bulk(struct rte_mempool *mempool,return -EINVAL ;/* Get elements */ - ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; - -return 0 ; +return rte_mempool_get_bulk (mempool, (void **)ops, num_ops); }/**
@@ -1005,7 +1000,6 @@ rte_bbdev_dec_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_dec_op **ops, uint16_t num_ops) {struct rte_bbdev_op_pool_private *priv; -int ret;/* Check type */ priv = (struct rte_bbdev_op_pool_private *)
@@ -1015,11 +1009,7 @@ rte_bbdev_dec_op_alloc_bulk(struct rte_mempool *mempool,return -EINVAL ;/* Get elements */ - ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; - -return 0 ; +return rte_mempool_get_bulk (mempool, (void **)ops, num_ops); }/**
@@ -1042,20 +1032,14 @@ rte_bbdev_fft_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_fft_op **ops, uint16_t num_ops) {struct rte_bbdev_op_pool_private *priv; -int ret;/* Check type */ - priv = (struct rte_bbdev_op_pool_private *) -rte_mempool_get_priv (mempool); + priv = (struct rte_bbdev_op_pool_private *)rte_mempool_get_priv (mempool);if (unlikely (priv->type !=RTE_BBDEV_OP_FFT ))return -EINVAL ;/* Get elements */ - ret =rte_mempool_get_bulk (mempool, (void **)ops, num_ops); -if (unlikely (ret <0 )) -return ret; - -return 0 ; +return rte_mempool_get_bulk (mempool, (void **)ops, num_ops); }/**
Signature · 1 line
2.37.1
RE: [EXT] [PATCH v12 0/7] bbdev changes for 22.11
In reply to Nicolas ChautruQuoted 49 lines
Hi Akhil, Thomas,
v12: minor change to fix misaligned comment on patch 6 raised by Thomas. Thanks.
v11: updated based on Thomas review notably on comments through the serie and ordering. Thanks. I have also updatedrel_notesand deprecation through the serie this time.
v10: replacing the_PADDED_MAXenum to_SIZE_MAXmacro based on suggestion from Ferruh/Maxime/Akhil. Thanks
v9: removing code snippet from documentation in 5/7 requested by Akhil. Thanks.
v8: edit based on review by Akhil : typos, coding guidelines. No functional change. Thanks
v7: couple of typos in documentation spotted by Maxime. Thanks.
v6: added one comment in commit 2/7 suggested by Maxime.
v5: update base on review from Tom Rix. Number of typos reported and resolved,
removed the commit related torw_lockfor now, added a commit for code clean up from review, resolved one rebase issue between 2 commits, used size of array for some bound check implementation. Thanks.
v4: update to the last 2 commits to include function to print the queue status and a fix to therte_lockwithin the wrong structure
v3: update to device status info to also use padded size for the related array. Adding also 2 additionals commits to allow the API struc to expose more information related to queues corner cases/warning as well as an optional rw lock.
Hemant, Maxime, this is planned for DPDK 21.11 but would like review/ack early is possible to get this applied earlier and due to time off this summer. Thanks
NicNicolas Chautru (7):
bbdev: allow operation type enum for growth
bbdev: add device status info
bbdev: add device info on queue topologydrivers/baseband: update PMDs to expose queue per operation
bbdev: add new operation for FFT processing
bbdev: add queue related warning and status information
bbdev: remove unnecessary if-checkapp/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 6 +- doc/guides/prog_guide/bbdev.rst | 103 +++++++++++ doc/guides/rel_notes/deprecation.rst | 13 -- doc/guides/rel_notes/release_22_11.rst | 14 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 30 ++-- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 9 + drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 9 + drivers/baseband/la12xx/bbdev_la12xx.c | 10 +-
Quoted 9 lines
drivers/baseband/null/bbdev_null.c | 1 + .../baseband/turbo_sw/bbdev_turbo_software.c | 13 ++ examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 57 +++++- lib/bbdev/rte_bbdev.h | 158 +++++++++++++++- lib/bbdev/rte_bbdev_op.h | 169 ++++++++++++++++-- lib/bbdev/version.map | 12 ++ 16 files changed, 560 insertions(+), 48 deletions(-)
Hi Nicolas,
There were many formatting issues in this patch. This has been a practice in whole of bbdev. Please take a diff of what is applied on the tree and what was submitted to take care of the formatting in future patches and please plan to fix the rest of bbdev documentation (API + prog_guide).
Series applied to dpdk-next-crypto
Thanks.
RE: [EXT] [PATCH v12 0/7] bbdev changes for 22.11
Thanks Akhil,
A couple of things I miss in term of guidelines for my benefit and that I don't see in documentation:
- May I ask what rule we should use for documentation line breaking? I am unclear of the reason for some of the changes you made whose origin version looked legit to me. Were you trying to fit into 80 chars (not always the case) or was this to split the sentence by phrase as opposed to breaking simply just before 100 chars? Can you clarify the recommendation? I see in the doc it suggests 80 chars but unsure whether this is because this was not updated when moving to 100 chars.
- Do we really need a dot at the end of every text in a comment even when not an actual sentence? I don't personally see the point nor do I believe this is followed in much of DPDK existing code (it depends at best), nor was this case in the file where new structure was added (keeping consistency). Is that really a recommendation for DPDK guideline for all new code to add a dot at the end of all text?
Thanks for kindly clarifying, I can then update the other serie based on such guidelines.
Thanks for the other formatting issues and commit message changes.
Nic
Quoted 82 lines
-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Thursday, October 6, 2022 10:32 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Richardson, Bruce <[email protected]>; [email protected]; [email protected]; Zhang, Mingshan <[email protected]>; [email protected]
Subject: RE: [EXT] [PATCH v12 0/7] bbdev changes for 22.11Quoted 15 lines
Hi Akhil, Thomas,
v12: minor change to fix misaligned comment on patch 6 raised by Thomas. Thanks.
v11: updated based on Thomas review notably on comments through the serie and ordering. Thanks. I have also updatedrel_notesand deprecation through the serie this time.
v10: replacing the_PADDED_MAXenum to_SIZE_MAXmacro based on suggestion from Ferruh/Maxime/Akhil. Thanks
v9: removing code snippet from documentation in 5/7 requested by Akhil. Thanks.
v8: edit based on review by Akhil : typos, coding guidelines. No functional change. Thanks
v7: couple of typos in documentation spotted by Maxime. Thanks.
v6: added one comment in commit 2/7 suggested by Maxime.Quoted 8 lines
v5: update base on review from Tom Rix. Number of typos reported and resolved, removed the commit related to
rw_lockfor now, added a commit for code clean up from review, resolved one rebase issue between 2 commits, used size of array for some bound check implementation. Thanks.
v4: update to the last 2 commits to include function to print the queue status and a fix to therte_lockwithin the wrong structure
v3: update to device status info to also use padded size for the relatedarray.
Quoted 5 lines
Adding also 2 additionals commits to allow the API struc to expose more information related to queues corner cases/warning as well as an optional rw lock.
Hemant, Maxime, this is planned for DPDK 21.11 but would like review/ack early is possible to get this applied earlier and due to time offthis summer.
Quoted 21 lines
Thanks
NicNicolas Chautru (7):
bbdev: allow operation type enum for growth
bbdev: add device status info
bbdev: add device info on queue topologydrivers/baseband: update PMDs to expose queue per operation
bbdev: add new operation for FFT processing
bbdev: add queue related warning and status information
bbdev: remove unnecessary if-checkapp/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 6 +- doc/guides/prog_guide/bbdev.rst | 103 +++++++++++ doc/guides/rel_notes/deprecation.rst | 13 -- doc/guides/rel_notes/release_22_11.rst | 14 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 30 ++-- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 9 + drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 9 + drivers/baseband/la12xx/bbdev_la12xx.c | 10 +-Quoted 9 lines
drivers/baseband/null/bbdev_null.c | 1 + .../baseband/turbo_sw/bbdev_turbo_software.c | 13 ++ examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 57 +++++- lib/bbdev/rte_bbdev.h | 158 +++++++++++++++- lib/bbdev/rte_bbdev_op.h | 169 ++++++++++++++++-- lib/bbdev/version.map | 12 ++ 16 files changed, 560 insertions(+), 48 deletions(-)Hi Nicolas,
There were many formatting issues in this patch. This has been a practice in whole of bbdev.
Please take a diff of what is applied on the tree and what was submitted to take care of the formatting in future patches and please plan to fix the rest of bbdev documentation (API +prog_guide).Series applied to dpdk-next-crypto
Thanks.
RE: [EXT] [PATCH v12 0/7] bbdev changes for 22.11
Quoted 11 lines
Thanks Akhil,
A couple of things I miss in term of guidelines for my benefit and that I don't see in documentation:
- May I ask what rule we should use for documentation line breaking? I am unclear of the reason for some of the changes you made whose origin version looked legit to me. Were you trying to fit into 80 chars (not always the case) or was this to split the sentence by phrase as opposed to breaking simply just before 100 chars? Can you clarify the recommendation? I see in the doc it suggests 80 chars but unsure whether this is because this was not updated when moving to 100 chars.
The guideline for is for 80 characters, but if the sentence is going to be split across two Lines, we should break at logical points. This improves readability.
Quoted 6 lines
- Do we really need a dot at the end of every text in a comment even when not an actual sentence? I don't personally see the point nor do I believe this is followed in much of DPDK existing code (it depends at best), nor was this case in the file where new structure was added (keeping consistency). Is that really a recommendation for DPDK guideline for all new code to add a dot at the end of all text?
Dots should be added for each of the comment wherever we have a sentence. They may be skipped for a couple of words.
Quoted 90 lines
Thanks for kindly clarifying, I can then update the other serie based on such guidelines.
Thanks for the other formatting issues and commit message changes.
Nic
Quoted 82 lines
-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Thursday, October 6, 2022 10:32 AM
To: Chautru, Nicolas <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Richardson, Bruce <[email protected]>; [email protected]; [email protected]; Zhang, Mingshan <[email protected]>; [email protected]
Subject: RE: [EXT] [PATCH v12 0/7] bbdev changes for 22.11Quoted 15 lines
Hi Akhil, Thomas,
v12: minor change to fix misaligned comment on patch 6 raised by Thomas. Thanks.
v11: updated based on Thomas review notably on comments through the serie and ordering. Thanks. I have also updatedrel_notesand deprecation through the serie this time.
v10: replacing the_PADDED_MAXenum to_SIZE_MAXmacro based on suggestion from Ferruh/Maxime/Akhil. Thanks
v9: removing code snippet from documentation in 5/7 requested by Akhil. Thanks.
v8: edit based on review by Akhil : typos, coding guidelines. No functional change. Thanks
v7: couple of typos in documentation spotted by Maxime. Thanks.
v6: added one comment in commit 2/7 suggested by Maxime.Quoted 8 lines
v5: update base on review from Tom Rix. Number of typos reported and resolved, removed the commit related to
rw_lockfor now, added a commit for code clean up from review, resolved one rebase issue between 2 commits, used size of array for some bound check implementation. Thanks.
v4: update to the last 2 commits to include function to print the queue status and a fix to therte_lockwithin the wrong structure
v3: update to device status info to also use padded size for the relatedarray.
Quoted 5 lines
Adding also 2 additionals commits to allow the API struc to expose more information related to queues corner cases/warning as well as an optional rw lock.
Hemant, Maxime, this is planned for DPDK 21.11 but would like review/ack early is possible to get this applied earlier and due to time offthis summer.
Quoted 21 lines
Thanks
NicNicolas Chautru (7):
bbdev: allow operation type enum for growth
bbdev: add device status info
bbdev: add device info on queue topologydrivers/baseband: update PMDs to expose queue per operation
bbdev: add new operation for FFT processing
bbdev: add queue related warning and status information
bbdev: remove unnecessary if-checkapp/test-bbdev/test_bbdev.c | 2 +- app/test-bbdev/test_bbdev_perf.c | 6 +- doc/guides/prog_guide/bbdev.rst | 103 +++++++++++ doc/guides/rel_notes/deprecation.rst | 13 -- doc/guides/rel_notes/release_22_11.rst | 14 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 30 ++-- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 9 + drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 9 + drivers/baseband/la12xx/bbdev_la12xx.c | 10 +-Quoted 9 lines
drivers/baseband/null/bbdev_null.c | 1 + .../baseband/turbo_sw/bbdev_turbo_software.c | 13 ++ examples/bbdev_app/main.c | 2 +- lib/bbdev/rte_bbdev.c | 57 +++++- lib/bbdev/rte_bbdev.h | 158 +++++++++++++++- lib/bbdev/rte_bbdev_op.h | 169 ++++++++++++++++-- lib/bbdev/version.map | 12 ++ 16 files changed, 560 insertions(+), 48 deletions(-)Hi Nicolas,
There were many formatting issues in this patch. This has been a practice in whole of bbdev.
Please take a diff of what is applied on the tree and what was submitted to take care of the formatting in future patches and please plan to fix the rest of bbdev documentation (API +prog_guide).Series applied to dpdk-next-crypto
Thanks.
Re: [EXT] [PATCH v12 0/7] bbdev changes for 22.11
In reply to Akhil Goyal06/10/2022 19:31, Akhil Goyal:
Quoted 5 lines
There were many formatting issues in this patch. This has been a practice in whole of bbdev. Please take a diff of what is applied on the tree and what was submitted to take care of the formatting in future patches and please plan to fix the rest of bbdev documentation (API +
prog_guide).Series applied to dpdk-next-crypto
Please could you check this build issue?
https://bugs.dpdk.org/show_bug.cgi?id=1095
Ideally I'd like to see it fixed today, thanks.
RE: [EXT] [PATCH v12 0/7] bbdev changes for 22.11
Hi Thomas, Akhil,
I put a fix here :
https://patches.dpdk.org/project/dpdk/patch/[email protected]/
I did not reproduce that issue on gcc or recent clang, only with clang 3.4.2 on Centos7.
Thanks
Nic
Quoted 25 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Monday, October 10, 2022 12:36 AM
To: Chautru, Nicolas <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Richardson, Bruce <[email protected]>; [email protected]; [email protected]; Zhang, Mingshan <[email protected]>; [email protected]; Akhil Goyal <[email protected]>; [email protected]
Subject: Re: [EXT] [PATCH v12 0/7] bbdev changes for 22.1106/10/2022 19:31, Akhil Goyal:
Quoted 1 line
There were many formatting issues in this patch. This has been a practice in
whole of bbdev.
Quoted 2 lines
Please take a diff of what is applied on the tree and what was submitted to take care of the formatting in future patches and please plan
to fix the rest of bbdev documentation (API +
prog_guide).Quoted 2 lines
Series applied to dpdk-next-crypto
Please could you check this build issue?
https://bugs.dpdk.org/show_bug.cgi?id=1095Ideally I'd like to see it fixed today, thanks.
Hi Hemant,
Could you review this serie, this is targeting 22.11 release. Let me know if unclear. Thanks
Nic
Quoted 39 lines
-----Original Message-----
From: Chautru, Nicolas <[email protected]>
Sent: Tuesday, March 8, 2022 4:23 PM
To: [email protected]; [email protected]
Cc: [email protected]; [email protected]; Zhang, Mingshan <[email protected]>; Chautru, Nicolas <[email protected]>
Subject: [PATCH v1 0/2] bbdev: add device info on queue topologyAddressing an historical concern that the device info struct only imperfectly captured what queues are available on the device (number of operation and priority). This ended up being an iterative process for application to find each queue could be configured.
ie. the gap was captured as technical debt previously in comments /* This isn't ideal because it reports the maximum number of queues but
* does not provide info on how many can be uplink/downlink or different
* priorities
*/This is now being exposed explictly based on the what the device actually supports using the existing
info_getapiNote: did not update the release yet notes since it will go in next release
Nicolas Chautru (2):
bbdev: add device info on queue topologydrivers/baseband: update PMDs to expose queue per operationdrivers/baseband/acc100/rte_acc100_pmd.c | 29 +++++++++++++------ --- drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 8 ++++++ drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 8 ++++++ drivers/baseband/la12xx/bbdev_la12xx.c | 8 +++++- lib/bbdev/rte_bbdev.h | 4 +++ 5 files changed, 44 insertions(+), 13 deletions(-)--
1.8.3.1