VRB2 bbdev PMD introduction
v5 cover VRB2 bbdev PMD introduction
v5: missed a line in v4 patch 2/12.
change to 9/12 with suggested refactor.
Thanks
v4: updates based on Maxime's suggestions:
- FFT windowing exposure tweaked to show number of windows as well in capacity to be more generic and future-proof.
- few code refactor notably to avoid code duplication
- cosmetic and doc update
Thanks
v3: updates based on v2 review:
- split into smaller incremental commits
- FFT windowing exposed through a more generic structure
- refactor using wrapper functions to manage device variants
- removed custom dump function
- consider the request unsupport SO option as an error instead of fall-back.
- cosmetic and doc update.
Thanks
v2: doc, comments and commit-log updates.
This serie includes changes to the VRB BBDEV PMD for 23.11.
This allows the VRB unified driver to support the new VRB2 implementation variant on GNR-D.
This also include minor change to the dev_info to expose FFT version flexibility to expose information to the application on what windows LUT is configured dynamically on the device.
Nicolas Chautru (12):
bbdev: add FFT window width member in driver info baseband/acc: add FFT window width in the VRB PMD baseband/acc: remove the 4G SO capability for VRB1 baseband/acc: allocate FCW memory separately baseband/acc: add support for MLD operation baseband/acc: refactor to allow unified driver extension baseband/acc: adding VRB2 device variant baseband/acc: add FEC capabilities for the VRB2 variant baseband/acc: add FFT support to VRB2 variant baseband/acc: add MLD support in VRB2 variant baseband/acc: add support for VRB2 engine error detection baseband/acc: add configure helper for VRB2
doc/guides/bbdevs/features/vrb2.ini | 14 + doc/guides/bbdevs/index.rst | 1 + doc/guides/bbdevs/vrb1.rst | 4 - doc/guides/bbdevs/vrb2.rst | 206 ++++ doc/guides/rel_notes/release_23_11.rst | 3 + drivers/baseband/acc/acc100_pmd.h | 2 + drivers/baseband/acc/acc_common.h | 186 ++- drivers/baseband/acc/rte_acc100_pmd.c | 6 +- drivers/baseband/acc/rte_vrb_pmd.c | 1571 +++++++++++++++++++++--- drivers/baseband/acc/vrb1_pf_enum.h | 17 +- drivers/baseband/acc/vrb2_pf_enum.h | 124 ++ drivers/baseband/acc/vrb2_vf_enum.h | 121 ++ drivers/baseband/acc/vrb_cfg.h | 16 + drivers/baseband/acc/vrb_pmd.h | 173 ++- lib/bbdev/rte_bbdev.h | 2 + lib/bbdev/rte_bbdev_op.h | 2 + 16 files changed, 2259 insertions(+), 189 deletions(-) create mode 100644 doc/guides/bbdevs/features/vrb2.ini create mode 100644 doc/guides/bbdevs/vrb2.rst create mode 100644 drivers/baseband/acc/vrb2_pf_enum.h create mode 100644 drivers/baseband/acc/vrb2_vf_enum.h
Signature · 1 line
2.34.1
PATCH v5 1/12 bbdev: add FFT window width member in driver info
This exposes the width of each windowing shape being configured on the device. This allows to distinguish different version of the flexible pointwise windowing applied to the FFT and expose this platform configuration to the application.
This also add the total number of windows supported in the capability.
The SRS processing chain
(https://doc.dpdk.org/guides/prog_guide/bbdev.html#bbdev-fft-operation)
includes a pointwise multiplication by time window whose shape width needs to be exposed, notably for accurate SNR estimate. Using that mechanism user application can retrieve information related to what has been dynamically programmed on any bbdev device supporting FFT windowing operation.
--- lib/bbdev/rte_bbdev.h | 2 ++ lib/bbdev/rte_bbdev_op.h | 2 ++ 2 files changed, 4 insertions(+)
lib/bbdev/rte_bbdev.h +2 -0
@@ -349,6 +349,8 @@ struct rte_bbdev_driver_info {const struct rte_bbdev_op_cap *capabilities;/** Device cpu_flag requirements */ const enum rte_cpu_flag_t *cpu_flag_reqs; +/** FFT windowing width for 2048 FFT - size defined in capability. */ +uint16_t *fft_window_width; };/** Macro used at end of bbdev PMD list */
lib/bbdev/rte_bbdev_op.h +2 -0
@@ -905,6 +905,8 @@ struct rte_bbdev_op_cap_fft {uint16_t num_buffers_src;/** Num output code block buffers. */ uint16_t num_buffers_dst; +/** Number of FFT windows supported. */ +uint16_t fft_windows_num; };/** List of the capabilities for the MLD */
Signature · 1 line
2.34.1
Re: [PATCH v5 01/12] bbdev: add FFT window width member in driver info
Quoted 38 lines · Nicolas Chautru
This exposes the width of each windowing shape being configured on the device. This allows to distinguish different version of the flexible pointwise windowing applied to the FFT and expose this platform configuration to the application.
This also add the total number of windows supported in the capability.The SRS processing chain
(https://doc.dpdk.org/guides/prog_guide/bbdev.html#bbdev-fft-operation)
includes a pointwise multiplication by time window whose shape width needs to be exposed, notably for accurate SNR estimate. Using that mechanism user application can retrieve information related to what has been dynamically programmed on any bbdev device supporting FFT windowing operation.Signed-off-by Nicolas Chautru <[email protected]>--- lib/bbdev/rte_bbdev.h | 2 ++ lib/bbdev/rte_bbdev_op.h | 2 ++ 2 files changed, 4 insertions(+)lib/bbdev/rte_bbdev.h +2
-0@@ -349,6 +349,8 @@ struct rte_bbdev_driver_info {const struct rte_bbdev_op_cap *capabilities;/** Device cpu_flag requirements */ const enum rte_cpu_flag_t *cpu_flag_reqs; +/** FFT windowing width for 2048 FFT - size defined in capability. */ +uint16_t *fft_window_width; };/** Macro used at end of bbdev PMD list */ lib/bbdev/rte_bbdev_op.h +0
-0
lib/bbdev/rte_bbdev_op.h struct rte_bbdev_op_cap_fft { · line 912
Quoted 8 lines
lib/bbdev/rte_bbdev_op.h +2
-0@@ -905,6 +905,8 @@ struct rte_bbdev_op_cap_fft {uint16_t num_buffers_src;/** Num output code block buffers. */ uint16_t num_buffers_dst; +/** Number of FFT windows supported. */ +uint16_t fft_windows_num; };/** List of the capabilities for the MLD */
I am Ok to move forwards with this, even if I would have liked feedback from Hemant.
However, I think you need to add some documentation around it, as what is in the commit message is important and won't be visible to the end- user.
Thanks,
Maxime
RE: [PATCH v5 01/12] bbdev: add FFT window width member in driver info
Hi Maxime,
Quoted 57 lines
-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: Friday, October 6, 2023 12:54 AM
To: Chautru, Nicolas <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; Vargas, Hernan <[email protected]>
Subject: Re: [PATCH v5 01/12] bbdev: add FFT window width member in driver infoQuoted 45 lines · Nicolas Chautru
This exposes the width of each windowing shape being configured on the device. This allows to distinguish different version of the flexible pointwise windowing applied to the FFT and expose this platform configuration to the application.
This also add the total number of windows supported in the capability.The SRS processing chain
(https://doc.dpdk.org/guides/prog_guide/bbdev.html#bbdev-fft-operation
) includes a pointwise multiplication by time window whose shape width needs to be exposed, notably for accurate SNR estimate. Using that mechanism user application can retrieve information related to what has been dynamically programmed on any bbdev device supporting FFT windowing operation.Signed-off-by Nicolas Chautru <[email protected]>--- lib/bbdev/rte_bbdev.h | 2 ++ lib/bbdev/rte_bbdev_op.h | 2 ++ 2 files changed, 4 insertions(+)lib/bbdev/rte_bbdev.h index renamed from lib/bbdev/rte_bbdev.h +0
-0
2985c9f42b..d12e2e7fbc100644lib/bbdev/rte_bbdev.h +2
-0@@ -349,6 +349,8 @@ struct rte_bbdev_driver_info {const struct rte_bbdev_op_cap *capabilities;/** Device cpu_flag requirements */ const enum rte_cpu_flag_t *cpu_flag_reqs; +/** FFT windowing width for 2048 FFT - size defined in capability. */ +uint16_t *fft_window_width; }; /** Macro used at end of bbdev PMD list */ diff --git
a/lib/bbdev/rte_bbdev_op.hb/lib/bbdev/rte_bbdev_op.hindex693baa8386..369ac331bf100644lib/bbdev/rte_bbdev_op.h +2
-0@@ -905,6 +905,8 @@ struct rte_bbdev_op_cap_fft {uint16_t num_buffers_src;/** Num output code block buffers. */ uint16_t num_buffers_dst; +/** Number of FFT windows supported. */ +uint16_t fft_windows_num; };
Quoted 7 lines
lib/bbdev/rte_bbdev_op.h struct rte_bbdev_op_cap_fft { · line 912
Quoted 1 line
lib/bbdev/rte_bbdev_op.h +0
-0/** List of the capabilities for the MLD */ I am Ok to move forwards with this, even if I would have liked feedback from Hemant.
However, I think you need to add some documentation around it, as what is in the commit message is important and won't be visible to the end- user.
Can we extend the documentation in incremental serie? There other things that could arguably be exposed more clearly, not just this one but more generally on device enumeration which is currently limited (pretty much everything from info_get).
Quoted 3 lines
Thanks,
Maxime
Maxime Coquelin
Reviewed-byRe: [PATCH v5 01/12] bbdev: add FFT window width member in driver info
Quoted 64 lines · Nicolas
Hi Maxime,
Quoted 62 lines
-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: Friday, October 6, 2023 12:54 AM
To: Chautru, Nicolas <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; Vargas, Hernan <[email protected]>
Subject: Re: [PATCH v5 01/12] bbdev: add FFT window width member in driver infoQuoted 38 lines · Nicolas Chautru
This exposes the width of each windowing shape being configured on the device. This allows to distinguish different version of the flexible pointwise windowing applied to the FFT and expose this platform configuration to the application.
This also add the total number of windows supported in the capability.The SRS processing chain
(https://doc.dpdk.org/guides/prog_guide/bbdev.html#bbdev-fft-operation
) includes a pointwise multiplication by time window whose shape width needs to be exposed, notably for accurate SNR estimate. Using that mechanism user application can retrieve information related to what has been dynamically programmed on any bbdev device supporting FFT windowing operation.Signed-off-by Nicolas Chautru <[email protected]>--- lib/bbdev/rte_bbdev.h | 2 ++ lib/bbdev/rte_bbdev_op.h | 2 ++ 2 files changed, 4 insertions(+)lib/bbdev/rte_bbdev.h index renamed from lib/bbdev/rte_bbdev.h +0
-0
2985c9f42b..d12e2e7fbc100644lib/bbdev/rte_bbdev.h +2
-0@@ -349,6 +349,8 @@ struct rte_bbdev_driver_info {const struct rte_bbdev_op_cap *capabilities;/** Device cpu_flag requirements */ const enum rte_cpu_flag_t *cpu_flag_reqs; +/** FFT windowing width for 2048 FFT - size defined in capability. */ +uint16_t *fft_window_width; }; /** Macro used at end of bbdev PMD list */ diff --git
a/lib/bbdev/rte_bbdev_op.hb/lib/bbdev/rte_bbdev_op.hindex693baa8386..369ac331bf100644lib/bbdev/rte_bbdev_op.h struct rte_bbdev_op_cap_fft { · line 912
Quoted 8 lines
lib/bbdev/rte_bbdev_op.h +2
-0@@ -905,6 +905,8 @@ struct rte_bbdev_op_cap_fft {uint16_t num_buffers_src;/** Num output code block buffers. */ uint16_t num_buffers_dst; +/** Number of FFT windows supported. */ +uint16_t fft_windows_num; };/** List of the capabilities for the MLD */ I am Ok to move forwards with this, even if I would have liked feedback from Hemant.
Quoted 4 lines
Quoted 2 lines
However, I think you need to add some documentation around it, as what is in the commit message is important and won't be visible to the end- user.
Can we extend the documentation in incremental serie? There other things that could arguably be exposed more clearly, not just this one but more generally on device enumeration which is currently limited (pretty much everything from
info_get).
Ok, as you take the action to do it in a further series:
Thanks,
Maxime
Quoted 5 lines
Quoted 4 lines
Thanks,
Maxime
PATCH v5 2/12 baseband/acc: add FFT window width in the VRB PMD
In reply to Nicolas ChautruThis allows to expose the FFT window width being introduced in previous commit based on what is configured dynamically on the device platform.
--- drivers/baseband/acc/acc_common.h | 6 +++++ drivers/baseband/acc/rte_vrb_pmd.c | 41 +++++++++++++++++++++++++----- 2 files changed, 41 insertions(+), 6 deletions(-)
drivers/baseband/acc/acc_common.h +6 -0
@@ -131,6 +131,8 @@#define ACC_LIM_31 20/* 0.31 */ #define ACC_MAX_E (128 * 1024 - 2) +#define ACC_MAX_FFT_WIN 16 +/* Helper macro for logging */ #define rte_acc_log (level, fmt, ...) \ rte_log(RTE_LOG_ ## level, RTE_LOG_NOTICE, fmt "\n", \
@@ -512,6 +514,8 @@ struct acc_deq_intr_details {enum {ACC_VF2PF_STATUS_REQUEST =1 ,ACC_VF2PF_USING_VF =2 , +ACC_VF2PF_LUT_VER_REQUEST =3 , +ACC_VF2PF_FFT_WIN_REQUEST =4 , };
@@ -558,6 +562,8 @@ struct acc_device {queue_offset_fun_t queue_offset;/* Device specific queue offset */ uint16_t num_qgroups;uint16_t num_aqs; +uint16_t fft_window_width[ACC_MAX_FFT_WIN ];/* FFT windowing size. */ + };/* Structure associated with each queue. */
drivers/baseband/acc/rte_vrb_pmd.c +35 -6
71 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH v5 02/12] baseband/acc: add FFT window width in the VRB PMD
Quoted 33 lines · Nicolas Chautru
This allows to expose the FFT window width being introduced in previous commit based on what is configured dynamically on the device platform.
Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc/acc_common.h | 6 +++++ drivers/baseband/acc/rte_vrb_pmd.c | 41 +++++++++++++++++++++++++----- 2 files changed, 41 insertions(+), 6 deletions(-)drivers/baseband/acc/acc_common.h +4
-0@@ -131,6 +131,8 @@#define ACC_LIM_31 20/* 0.31 */ #define ACC_MAX_E (128 * 1024 - 2) +#define ACC_MAX_FFT_WIN 16 +/* Helper macro for logging */ #define rte_acc_log (level, fmt, ...) \ rte_log(RTE_LOG_ ## level, RTE_LOG_NOTICE, fmt "\n", \@@ -512,6 +514,8 @@ struct acc_deq_intr_details {enum {ACC_VF2PF_STATUS_REQUEST =1 ,ACC_VF2PF_USING_VF =2 , +ACC_VF2PF_LUT_VER_REQUEST =3 , +ACC_VF2PF_FFT_WIN_REQUEST =4 , };
drivers/baseband/acc/acc_common.h struct acc_device { · line 566
Quoted 5 lines
drivers/baseband/acc/acc_common.h +2
-0@@ -558,6 +562,8 @@ struct acc_device {queue_offset_fun_t queue_offset;/* Device specific queue offset */ uint16_t num_qgroups;uint16_t num_aqs; +uint16_t fft_window_width[ACC_MAX_FFT_WIN ];/* FFT windowing size. */ +
Remove new line.
Quoted 76 lines
drivers/baseband/acc/acc_common.h +0
-0};/* Structure associated with each queue. */ drivers/baseband/acc/rte_vrb_pmd.c +34
-6@@ -183,6 +183,37 @@ vrb_check_device_enable(struct rte_bbdev *dev)return false; } +static inline void +vrb_vf2pf (struct acc_device *d,unsigned int payload) +{ +acc_reg_write (d, d->reg_addr->vf2pf_doorbell, payload); +} + +/* Request device FFT windowing information. */ +static inline void +vrb_device_fft_win (struct rte_bbdev *dev) +{ +struct acc_device *d = dev->data->dev_private; +uint32_t reg, time_out =0 , win; + +if (d->pf_device) +return ; + +/* Check from the device the first time. */ +if (d->fft_window_width[0 ] ==0 ) { +for (win =0 ; win <ACC_MAX_FFT_WIN ; win++) { +vrb_vf2pf (d,ACC_VF2PF_FFT_WIN_REQUEST | win); + reg =acc_reg_read (d, d->reg_addr->pf2vf_doorbell); +while ((time_out <ACC_STATUS_TO ) && (reg ==RTE_BBDEV_DEV_NOSTATUS )) { +usleep (ACC_STATUS_WAIT );/*< Wait or VF->PF->VF Comms. */ + reg =acc_reg_read (d, d->reg_addr->pf2vf_doorbell); + time_out++; + } + d->fft_window_width[win] = reg; + } + } +} +/* Fetch configuration enabled for the PF/VF using MMIO Read (slow). */ static inline void fetch_acc_config (struct rte_bbdev *dev)@@ -206,6 +237,8 @@ fetch_acc_config(struct rte_bbdev *dev)return ; } +vrb_device_fft_win (dev); + d->ddr_size =0 ;/* Single VF Bundle by VF. */ @@ -271,12 +304,6 @@ fetch_acc_config(struct rte_bbdev *dev) acc_conf->q_fft.aq_depth_log2); } -static inline void -vrb_vf2pf (struct acc_device *d,unsigned int payload) -{ -acc_reg_write (d, d->reg_addr->vf2pf_doorbell, payload); -} -/* Request device status information. */ static inline uint32_t vrb_device_status (struct rte_bbdev *dev)@@ -1085,6 +1112,7 @@ vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, .num_buffers_dst = RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, + .fft_windows_num = ACC_MAX_FFT_WIN, } },RTE_BBDEV_END_OF_CAPABILITIES_LIST ()
drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) · line 1134
Quoted 7 lines
drivers/baseband/acc/rte_vrb_pmd.c +1
-0@@ -1100,6 +1128,7 @@ vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info)fetch_acc_config (dev);/* Check the status of device. */ dev_info->device_status =vrb_device_status (dev); + dev_info->fft_window_width = d->fft_window_width;/* Exposed number of queues. */ dev_info->num_queues[RTE_BBDEV_OP_NONE ] =0 ;
With new line removed:
Reviewed-by; Maxime Coquelin <[email protected]>
Thanks,
Maxime
Maxime Coquelin
Reviewed-byRe: [PATCH v5 02/12] baseband/acc: add FFT window width in the VRB PMD
Quoted 126 lines · Maxime Coquelin
Quoted 30 lines · Nicolas Chautru
This allows to expose the FFT window width being introduced in previous commit based on what is configured dynamically on the device platform.
Signed-off-by Nicolas Chautru <[email protected]>---
drivers/baseband/acc/acc_common.h | 6 +++++drivers/baseband/acc/rte_vrb_pmd.c| 41 +++++++++++++++++++++++++-----2 files changed, 41 insertions(+), 6 deletions(-)drivers/baseband/acc/acc_common.h +4
-0@@ -131,6 +131,8 @@ #define ACC_LIM_31 20 /* 0.31 */ #define ACC_MAX_E (128 * 1024 - 2) +#define ACC_MAX_FFT_WIN 16 + /* Helper macro for logging */ #define rte_acc_log(level, fmt, ...) \ rte_log(RTE_LOG_ ## level, RTE_LOG_NOTICE, fmt "\n", \@@ -512,6 +514,8 @@ struct acc_deq_intr_details { enum { ACC_VF2PF_STATUS_REQUEST = 1, ACC_VF2PF_USING_VF = 2, + ACC_VF2PF_LUT_VER_REQUEST = 3, + ACC_VF2PF_FFT_WIN_REQUEST = 4, };@@ -558,6 +562,8 @@ struct acc_device {Quoted 6 lines
queue_offset_fun_tqueue_offset; /* Device specific queue offset */uint16_tnum_qgroups;
uint16_tnum_aqs;
+uint16_tfft_window_width[ACC_MAX_FFT_WIN]; /* FFT windowing size. */
+Remove new line.
Quoted 74 lines
};
/* Structure associated with each queue. */drivers/baseband/acc/rte_vrb_pmd.c +23
-0@@ -183,6 +183,37 @@ vrb_check_device_enable(struct rte_bbdev *dev) return false; } +static inline void +vrb_vf2pf (struct acc_device *d,unsigned int payload) +{ + acc_reg_write(d, d->reg_addr->vf2pf_doorbell, payload); +} + +/* Request device FFT windowing information. */ +static inline void +vrb_device_fft_win (struct rte_bbdev *dev) +{ + struct acc_device *d = dev->data->dev_private; + uint32_t reg, time_out = 0, win; + + if (d->pf_device) + return; + + /* Check from the device the first time. */ + if (d->fft_window_width[0] == 0) { + for (win = 0; win < ACC_MAX_FFT_WIN; win++) { + vrb_vf2pf(d, ACC_VF2PF_FFT_WIN_REQUEST | win); + reg = acc_reg_read(d, d->reg_addr->pf2vf_doorbell); + while ((time_out < ACC_STATUS_TO) && (reg ==RTE_BBDEV_DEV_NOSTATUS )) { + usleep(ACC_STATUS_WAIT); /*< Wait or VF->PF->VFComms. */
+ reg =acc_reg_read(d, d->reg_addr->pf2vf_doorbell); + time_out++;
+ }
+ d->fft_window_width[win] = reg;
+ }
+ }drivers/baseband/acc/rte_vrb_pmd.c +2
-0+} +/* Fetch configuration enabled for the PF/VF using MMIO Read (slow). */ static inline void
fetch_acc_config(struct rte_bbdev *dev)drivers/baseband/acc/rte_vrb_pmd.c +2
-6@@ -206,6 +237,8 @@ fetch_acc_config(struct rte_bbdev *dev) return; } + vrb_device_fft_win(dev); + d->ddr_size = 0; /* Single VF Bundle by VF. */@@ -271,12 +304,6 @@ fetch_acc_config(struct rte_bbdev *dev) acc_conf->q_fft.aq_depth_log2); } -static inline void -vrb_vf2pf (struct acc_device *d,unsigned int payload) -{ - acc_reg_write(d, d->reg_addr->vf2pf_doorbell, payload); -} - /* Request device status information. */static inline
uint32_t
vrb_device_status(struct rte_bbdev *dev)drivers/baseband/acc/rte_vrb_pmd.c +0
-0@@ -1085,6 +1112,7 @@ vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,.num_buffers_dst =
RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, + .fft_windows_num =ACC_MAX_FFT_WIN, }
},RTE_BBDEV_END_OF_CAPABILITIES_LIST()drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1134
Quoted 7 lines
drivers/baseband/acc/rte_vrb_pmd.c +1
-0@@ -1100,6 +1128,7 @@ vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) fetch_acc_config(dev); /* Check the status of device. */ dev_info->device_status = vrb_device_status(dev); + dev_info->fft_window_width = d->fft_window_width; /* Exposed number of queues. */ dev_info->num_queues[RTE_BBDEV_OP_NONE] = 0;With new line removed:
Quoted 1 line
Reviewed-by; Maxime Coquelin <[email protected]>
With typo fixed to make patchwork happy:
Quoted 4 lines
Thanks,
Maxime
PATCH v5 3/12 baseband/acc: remove the 4G SO capability for VRB1
In reply to Nicolas ChautruThis removes the specific capability and support of LTE Decoder Soft Output option on the VRB1 PMD.
This is triggered as a vendor decision to defeature the related optional capability so that to avoid theoretical risk of race conditions impacting the device reliability. That optional APP LLR output is not impacting the actual decoder hard output.
--- doc/guides/bbdevs/vrb1.rst | 4 ---- drivers/baseband/acc/rte_vrb_pmd.c | 10 ++++++---- 2 files changed, 6 insertions(+), 8 deletions(-)
doc/guides/bbdevs/vrb1.rst +0 -4
@@ -71,11 +71,7 @@ The Intel vRAN Boost v1.0 PMD supports the following bbdev capabilities: - ``RTE_BBDEV_TURBO_EARLY_TERMINATION``: set early termination feature. - ``RTE_BBDEV_TURBO_DEC_SCATTER_GATHER``: supports scatter-gather for input/output data. - ``RTE_BBDEV_TURBO_HALF_ITERATION_EVEN``: set half iteration granularity. - - ``RTE_BBDEV_TURBO_SOFT_OUTPUT``: set the APP LLR soft output. - - ``RTE_BBDEV_TURBO_EQUALIZER``: set the turbo equalizer feature. - - ``RTE_BBDEV_TURBO_SOFT_OUT_SATURATE``: set the soft output saturation. - ``RTE_BBDEV_TURBO_CONTINUE_CRC_MATCH``: set to run an extra odd iteration after CRC match. - - ``RTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT``: set if negative APP LLR output supported. - ``RTE_BBDEV_TURBO_MAP_DEC``: supports flexible parallel MAP engine decoding. * For the FFT operation:
drivers/baseband/acc/rte_vrb_pmd.c +6 -4
@@ -1024,15 +1024,11 @@ vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info)RTE_BBDEV_TURBO_SUBBLOCK_DEINTERLEAVE |RTE_BBDEV_TURBO_CRC_TYPE_24B |RTE_BBDEV_TURBO_DEC_CRC_24B_DROP | -RTE_BBDEV_TURBO_EQUALIZER | -RTE_BBDEV_TURBO_SOFT_OUT_SATURATE |RTE_BBDEV_TURBO_HALF_ITERATION_EVEN |RTE_BBDEV_TURBO_CONTINUE_CRC_MATCH | -RTE_BBDEV_TURBO_SOFT_OUTPUT |RTE_BBDEV_TURBO_EARLY_TERMINATION |RTE_BBDEV_TURBO_DEC_INTERRUPTS |RTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN | -RTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT |RTE_BBDEV_TURBO_MAP_DEC |RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP | RTE_BBDEV_TURBO_DEC_SCATTER_GATHER,
@@ -1982,6 +1978,12 @@ enqueue_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,struct rte_mbuf *input, *h_output_head, *h_output, *s_output_head, *s_output; +if ((q->d->device_variant ==VRB1_VARIANT ) && + (check_bit (op->turbo_dec.op_flags,RTE_BBDEV_TURBO_SOFT_OUTPUT ))) { +/* SO not supported for VRB1. */ +return -EPERM ; + } + desc =acc_desc (q, total_enqueued_cbs);vrb_fcw_td_fill (op, &desc->req.fcw_td);
Signature · 1 line
2.34.1
PATCH v5 4/12 baseband/acc: allocate FCW memory separately
In reply to Nicolas ChautruThis allows more flexibility to the FCW size for the unified driver. No actual functional change.
--- drivers/baseband/acc/acc_common.h | 4 +++- drivers/baseband/acc/rte_vrb_pmd.c | 25 ++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-)
drivers/baseband/acc/acc_common.h +3 -1
@@ -101,6 +101,7 @@#define ACC_NUM_QGRPS_PER_WORD 8#define ACC_MAX_NUM_QGRPS 32#define ACC_RING_SIZE_GRANULARITY 64 +#define ACC_MAX_FCW_SIZE 128/* Constants from K0 computation from 3GPP 38.212 Table 5.4.2.1-2 */ #define ACC_N_ZC_1 66/* N = 66 Zc for BG 1 */
@@ -587,13 +588,14 @@ struct __rte_cache_aligned acc_queue {uint32_t aq_enqueued;/* Count how many "batches" have been enqueued */ uint32_t aq_dequeued;/* Count how many "batches" have been dequeued */ uint32_t irq_enable;/* Enable ops dequeue interrupts if set to 1 */ -struct rte_mempool *fcw_mempool;/* FCW mempool */ enum rte_bbdev_op_type op_type;/* Type of this Queue: TE or TD */ /* Internal Buffers for loopback input */ uint8_t *lb_in;uint8_t *lb_out; +uint8_t *fcw_ring;rte_iova_t lb_in_addr_iova;rte_iova_t lb_out_addr_iova; +rte_iova_t fcw_ring_addr_iova;int8_t *derm_buffer;/* interim buffer for de-rm in SDK */ struct acc_device *d; };
drivers/baseband/acc/rte_vrb_pmd.c +24 -1
@@ -889,6 +889,25 @@ vrb_queue_setup(struct rte_bbdev *dev, uint16_t queue_id, goto free_companion_ring_addr; } + q->fcw_ring =rte_zmalloc_socket (dev->device->driver->name, +ACC_MAX_FCW_SIZE * d->sw_ring_max_depth, +RTE_CACHE_LINE_SIZE , conf->socket); +if (q->fcw_ring ==NULL ) { +rte_bbdev_log (ERR ,"Failed to allocate fcw_ring memory" ); + ret = -ENOMEM ; + goto free_companion_ring_addr; + } + q->fcw_ring_addr_iova =rte_malloc_virt2iova (q->fcw_ring); + +/* For FFT we need to store the FCW separately */ +if (conf->op_type ==RTE_BBDEV_OP_FFT ) { +for (desc_idx =0 ; desc_idx < d->sw_ring_max_depth; desc_idx++) { + desc = q->ring_addr + desc_idx; + desc->req.data_ptrs[0 ].address = q->fcw_ring_addr_iova + + desc_idx *ACC_MAX_FCW_SIZE ; + } + } + q->qgrp_id = (q_idx >>VRB1_GRP_ID_SHIFT ) &0xF ; q->vf_id = (q_idx >>VRB1_VF_ID_SHIFT ) &0x3F ; q->aq_id = q_idx &0xF ;
@@ -1000,6 +1019,7 @@ vrb_queue_release(struct rte_bbdev *dev, uint16_t q_id)if (q !=NULL ) {/* Mark the Queue as un-assigned. */ d->q_assigned_bit_map[q->qgrp_id] &= (~0ULL - (1 << (uint64_t ) q->aq_id)); +rte_free (q->fcw_ring);rte_free (q->companion_ring_addr);rte_free (q->lb_in);rte_free (q->lb_out);
@@ -3234,7 +3254,10 @@ vrb_enqueue_fft_one_op(struct acc_queue *q, struct rte_bbdev_fft_op *op, output = op->fft.base_output.data; in_offset = op->fft.base_input.offset; out_offset = op->fft.base_output.offset; - fcw = &desc->req.fcw_fft; + + fcw = (struct acc_fcw_fft *) (q->fcw_ring + + ((q->sw_ring_head + total_enqueued_cbs) & q->sw_ring_wrap_mask) + *ACC_MAX_FCW_SIZE );vrb1_fcw_fft_fill (op, fcw);vrb1_dma_desc_fft_fill (op, &desc->req, input, output, &in_offset, &out_offset);
Signature · 1 line
2.34.1
PATCH v5 5/12 baseband/acc: add support for MLD operation
In reply to Nicolas ChautruThere is no functionality related to the MLD operation but allows the unified PMD to support the operation being added moving forward.
--- drivers/baseband/acc/acc_common.h | 1 + drivers/baseband/acc/rte_vrb_pmd.c | 39 ++++++++++++++++++++++++------ drivers/baseband/acc/vrb_pmd.h | 12 +++++++++ 3 files changed, 45 insertions(+), 7 deletions(-)
drivers/baseband/acc/acc_common.h +1 -0
@@ -87,6 +87,7 @@#define ACC_FCW_LE_BLEN 32#define ACC_FCW_LD_BLEN 36#define ACC_FCW_FFT_BLEN 28 +#define ACC_FCW_MLDTS_BLEN 32#define ACC_5GUL_SIZE_0 16#define ACC_5GUL_SIZE_1 40#define ACC_5GUL_OFFSET_0 36
drivers/baseband/acc/rte_vrb_pmd.c +32 -7
@@ -37,7 +37,7 @@ vrb1_queue_offset(bool pf_device, uint8_t vf_id, uint8_t qgrp_id, uint16_t aq_idreturn ((qgrp_id <<7 ) + (aq_id <<3 ) + VRB1_VfQmgrIngressAq); } -enum {UL_4G =0 ,UL_5G ,DL_4G ,DL_5G ,FFT ,NUM_ACC }; +enum {UL_4G =0 ,UL_5G ,DL_4G ,DL_5G ,FFT ,MLD ,NUM_ACC };/* Return the accelerator enum for a Queue Group Index. */ static inline int
@@ -53,6 +53,7 @@ accFromQgid(int qg_idx, const struct rte_acc_conf *acc_conf) NumQGroupsPerFn[DL_4G ] = acc_conf->q_dl_4g.num_qgroups; NumQGroupsPerFn[DL_5G ] = acc_conf->q_dl_5g.num_qgroups; NumQGroupsPerFn[FFT ] = acc_conf->q_fft.num_qgroups; + NumQGroupsPerFn[MLD ] = acc_conf->q_mld.num_qgroups;for (acc =UL_4G ; acc <NUM_ACC ; acc++)for (qgIdx =0 ; qgIdx < NumQGroupsPerFn[acc]; qgIdx++) accQg[qgIndex++] = acc;
@@ -83,6 +84,9 @@ qtopFromAcc(struct rte_acc_queue_topology **qtop, int acc_enum, struct rte_acc_ccase FFT : p_qtop = &(acc_conf->q_fft);break ; +case MLD : + p_qtop = &(acc_conf->q_mld); +break ;default :/* NOTREACHED. */ rte_bbdev_log (ERR ,"Unexpected error evaluating %s using %d" , __func__, acc_enum);
@@ -139,6 +143,9 @@ initQTop(struct rte_acc_conf *acc_conf) acc_conf->q_fft.num_aqs_per_groups =0 ; acc_conf->q_fft.num_qgroups =0 ; acc_conf->q_fft.first_qgroup_index =-1 ; + acc_conf->q_mld.num_aqs_per_groups =0 ; + acc_conf->q_mld.num_qgroups =0 ; + acc_conf->q_mld.first_qgroup_index =-1 ; } static inline void
@@ -283,7 +290,7 @@ fetch_acc_config(struct rte_bbdev *dev) } rte_bbdev_log_debug( - "%s Config LLR SIGN IN/OUT %s %s QG %u %u %u %u %u AQ %u %u %u %u %u Len %u %u %u %u %u\n", + "%s Config LLR SIGN IN/OUT %s %s QG %u %u %u %u %u %u AQ %u %u %u %u %u %u Len %u %u %u %u %u %u\n", (d->pf_device) ? "PF" : "VF", (acc_conf->input_pos_llr_1_bit) ? "POS" : "NEG", (acc_conf->output_pos_llr_1_bit) ? "POS" : "NEG",
@@ -292,16 +299,19 @@ fetch_acc_config(struct rte_bbdev *dev) acc_conf->q_ul_5g.num_qgroups, acc_conf->q_dl_5g.num_qgroups, acc_conf->q_fft.num_qgroups, + acc_conf->q_mld.num_qgroups, acc_conf->q_ul_4g.num_aqs_per_groups, acc_conf->q_dl_4g.num_aqs_per_groups, acc_conf->q_ul_5g.num_aqs_per_groups, acc_conf->q_dl_5g.num_aqs_per_groups, acc_conf->q_fft.num_aqs_per_groups, + acc_conf->q_mld.num_aqs_per_groups, acc_conf->q_ul_4g.aq_depth_log2, acc_conf->q_dl_4g.aq_depth_log2, acc_conf->q_ul_5g.aq_depth_log2, acc_conf->q_dl_5g.aq_depth_log2, - acc_conf->q_fft.aq_depth_log2); + acc_conf->q_fft.aq_depth_log2, + acc_conf->q_mld.aq_depth_log2); }/* Request device status information. */
@@ -338,7 +348,7 @@ vrb_check_ir(struct acc_device *acc_dev)while (ring_data->valid) {if ((ring_data->int_nb <ACC_PF_INT_DMA_DL_DESC_IRQ ) || ( - ring_data->int_nb >ACC_PF_INT_DMA_DL5G_DESC_IRQ )) { + ring_data->int_nb >ACC_PF_INT_DMA_MLD_DESC_IRQ )) {rte_bbdev_log (WARNING ,"InfoRing: ITR:%d Info:0x%x" , ring_data->int_nb, ring_data->detailed_info);/* Initialize Info Ring entry and move forward. */
@@ -372,6 +382,7 @@ vrb_dev_interrupt_handler(void *cb_arg)case ACC_PF_INT_DMA_FFT_DESC_IRQ :case ACC_PF_INT_DMA_UL5G_DESC_IRQ :case ACC_PF_INT_DMA_DL5G_DESC_IRQ : +case ACC_PF_INT_DMA_MLD_DESC_IRQ : deq_intr_det.queue_id =get_queue_id_from_ring_info ( dev->data, *ring_data);if (deq_intr_det.queue_id ==UINT16_MAX ) {
@@ -399,6 +410,7 @@ vrb_dev_interrupt_handler(void *cb_arg)case ACC_VF_INT_DMA_FFT_DESC_IRQ :case ACC_VF_INT_DMA_UL5G_DESC_IRQ :case ACC_VF_INT_DMA_DL5G_DESC_IRQ : +case ACC_VF_INT_DMA_MLD_DESC_IRQ :/* VFs are not aware of their vf_id - it's set to 0. */ ring_data->vf_id =0 ; deq_intr_det.queue_id = get_queue_id_from_ring_info(
@@ -747,7 +759,7 @@ vrb_find_free_queue_idx(struct rte_bbdev *dev, const struct rte_bbdev_queue_conf *conf) {struct acc_device *d = dev->data->dev_private; -int op_2_acc[6 ] = {0 ,UL_4G ,DL_4G ,UL_5G ,DL_5G ,FFT }; +int op_2_acc[7 ] = {0 ,UL_4G ,DL_4G ,UL_5G ,DL_5G ,FFT ,MLD };int acc = op_2_acc[conf->op_type];struct rte_acc_queue_topology *qtop =NULL ;uint16_t group_idx;
@@ -810,7 +822,8 @@ vrb_queue_setup(struct rte_bbdev *dev, uint16_t queue_id,int fcw_len = (conf->op_type ==RTE_BBDEV_OP_LDPC_ENC ?ACC_FCW_LE_BLEN : (conf->op_type ==RTE_BBDEV_OP_TURBO_DEC ?ACC_FCW_TD_BLEN : (conf->op_type ==RTE_BBDEV_OP_LDPC_DEC ? -ACC_FCW_LD_BLEN :ACC_FCW_FFT_BLEN ))); +ACC_FCW_LD_BLEN : (conf->op_type ==RTE_BBDEV_OP_FFT ? +ACC_FCW_FFT_BLEN :ACC_FCW_MLDTS_BLEN ))));for (desc_idx =0 ; desc_idx < d->sw_ring_max_depth; desc_idx++) { desc = q->ring_addr + desc_idx;
@@ -922,6 +935,8 @@ vrb_queue_setup(struct rte_bbdev *dev, uint16_t queue_id, q->aq_depth = (1 << d->acc_conf.q_dl_5g.aq_depth_log2); else if (conf->op_type == RTE_BBDEV_OP_FFT) q->aq_depth = (1 << d->acc_conf.q_fft.aq_depth_log2); + else if (conf->op_type == RTE_BBDEV_OP_MLDTS) + q->aq_depth = (1 << d->acc_conf.q_mld.aq_depth_log2); q->mmio_reg_enqueue =RTE_PTR_ADD (d->mmio_base, d->queue_offset (d->pf_device, q->vf_id, q->qgrp_id, q->aq_id));
@@ -978,6 +993,13 @@ vrb_print_op(struct rte_bbdev_dec_op *op, enum rte_bbdev_op_type op_type, op_dl->ldpc_enc.n_filler, op_dl->ldpc_enc.cb_params.e, op_dl->ldpc_enc.op_flags, op_dl->ldpc_enc.rv_index ); + }else if (op_type ==RTE_BBDEV_OP_MLDTS ) { +struct rte_bbdev_mldts_op *op_mldts = (struct rte_bbdev_mldts_op *) op; +rte_bbdev_log (INFO ," Op MLD %d RBs %d NL %d Rp %d %d %x\n" , + index, + op_mldts->mldts.num_rbs, op_mldts->mldts.num_layers, + op_mldts->mldts.r_rep, + op_mldts->mldts.c_rep, op_mldts->mldts.op_flags); } }
@@ -1158,13 +1180,16 @@ vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) d->acc_conf.q_dl_5g.num_qgroups; dev_info->num_queues[RTE_BBDEV_OP_FFT ] = d->acc_conf.q_fft.num_aqs_per_groups * d->acc_conf.q_fft.num_qgroups; + dev_info->num_queues[RTE_BBDEV_OP_MLDTS ] = d->acc_conf.q_mld.num_aqs_per_groups * + d->acc_conf.q_mld.num_qgroups; dev_info->queue_priority[RTE_BBDEV_OP_TURBO_DEC ] = d->acc_conf.q_ul_4g.num_qgroups; dev_info->queue_priority[RTE_BBDEV_OP_TURBO_ENC ] = d->acc_conf.q_dl_4g.num_qgroups; dev_info->queue_priority[RTE_BBDEV_OP_LDPC_DEC ] = d->acc_conf.q_ul_5g.num_qgroups; dev_info->queue_priority[RTE_BBDEV_OP_LDPC_ENC ] = d->acc_conf.q_dl_5g.num_qgroups; dev_info->queue_priority[RTE_BBDEV_OP_FFT ] = d->acc_conf.q_fft.num_qgroups; + dev_info->queue_priority[RTE_BBDEV_OP_MLDTS ] = d->acc_conf.q_mld.num_qgroups; dev_info->max_num_queues =0 ; -for (i =RTE_BBDEV_OP_NONE ; i <=RTE_BBDEV_OP_FFT ; i++) +for (i =RTE_BBDEV_OP_NONE ; i <=RTE_BBDEV_OP_MLDTS ; i++) dev_info->max_num_queues += dev_info->num_queues[i]; dev_info->queue_size_lim =ACC_MAX_QUEUE_DEPTH ; dev_info->hardware_accelerated = true;
drivers/baseband/acc/vrb_pmd.h +12 -0
@@ -101,6 +101,8 @@ struct acc_registry_addr {unsigned int dma_ring_ul4g_lo;unsigned int dma_ring_fft_hi;unsigned int dma_ring_fft_lo; +unsigned int dma_ring_mld_hi; +unsigned int dma_ring_mld_lo;unsigned int ring_size;unsigned int info_ring_hi;unsigned int info_ring_lo;
@@ -116,6 +118,8 @@ struct acc_registry_addr {unsigned int tail_ptrs_ul4g_lo;unsigned int tail_ptrs_fft_hi;unsigned int tail_ptrs_fft_lo; +unsigned int tail_ptrs_mld_hi; +unsigned int tail_ptrs_mld_lo;unsigned int depth_log0_offset;unsigned int depth_log1_offset;unsigned int qman_group_func;
@@ -140,6 +144,8 @@ static const struct acc_registry_addr vrb1_pf_reg_addr = { .dma_ring_ul4g_lo = VRB1_PfDmaFec4GulDescBaseLoRegVf, .dma_ring_fft_hi = VRB1_PfDmaFftDescBaseHiRegVf, .dma_ring_fft_lo = VRB1_PfDmaFftDescBaseLoRegVf, + .dma_ring_mld_hi = 0, + .dma_ring_mld_lo = 0, .ring_size = VRB1_PfQmgrRingSizeVf, .info_ring_hi = VRB1_PfHiInfoRingBaseHiRegPf, .info_ring_lo = VRB1_PfHiInfoRingBaseLoRegPf,
@@ -155,6 +161,8 @@ static const struct acc_registry_addr vrb1_pf_reg_addr = { .tail_ptrs_ul4g_lo = VRB1_PfDmaFec4GulRespPtrLoRegVf, .tail_ptrs_fft_hi = VRB1_PfDmaFftRespPtrHiRegVf, .tail_ptrs_fft_lo = VRB1_PfDmaFftRespPtrLoRegVf, + .tail_ptrs_mld_hi = 0, + .tail_ptrs_mld_lo = 0, .depth_log0_offset = VRB1_PfQmgrGrpDepthLog20Vf, .depth_log1_offset = VRB1_PfQmgrGrpDepthLog21Vf, .qman_group_func = VRB1_PfQmgrGrpFunction0,
@@ -179,6 +187,8 @@ static const struct acc_registry_addr vrb1_vf_reg_addr = { .dma_ring_ul4g_lo = VRB1_VfDmaFec4GulDescBaseLoRegVf, .dma_ring_fft_hi = VRB1_VfDmaFftDescBaseHiRegVf, .dma_ring_fft_lo = VRB1_VfDmaFftDescBaseLoRegVf, + .dma_ring_mld_hi = 0, + .dma_ring_mld_lo = 0, .ring_size = VRB1_VfQmgrRingSizeVf, .info_ring_hi = VRB1_VfHiInfoRingBaseHiVf, .info_ring_lo = VRB1_VfHiInfoRingBaseLoVf,
@@ -194,6 +204,8 @@ static const struct acc_registry_addr vrb1_vf_reg_addr = { .tail_ptrs_ul4g_lo = VRB1_VfDmaFec4GulRespPtrLoRegVf, .tail_ptrs_fft_hi = VRB1_VfDmaFftRespPtrHiRegVf, .tail_ptrs_fft_lo = VRB1_VfDmaFftRespPtrLoRegVf, + .tail_ptrs_mld_hi = 0, + .tail_ptrs_mld_lo = 0, .depth_log0_offset = VRB1_VfQmgrGrpDepthLog20Vf, .depth_log1_offset = VRB1_VfQmgrGrpDepthLog21Vf, .qman_group_func = VRB1_VfQmgrGrpFunction0Vf,
Signature · 1 line
2.34.1
PATCH v5 6/12 baseband/acc: refactor to allow unified driver extension
In reply to Nicolas ChautruAdding a few functions and common code prior to
extending the VRB driver.
--- drivers/baseband/acc/acc_common.h | 175 ++++++++++++++++++++++++++--- drivers/baseband/acc/rte_vrb_pmd.c | 58 +++++----- 2 files changed, 190 insertions(+), 43 deletions(-)
drivers/baseband/acc/acc_common.h +160 -15
@@ -18,6 +18,7 @@#define ACC_DMA_BLKID_OUT_HARQ 3#define ACC_DMA_BLKID_IN_HARQ 3#define ACC_DMA_BLKID_IN_MLD_R 3 +#define ACC_DMA_BLKID_DEWIN_IN 3/* Values used in filling in decode FCWs */ #define ACC_FCW_TD_VER 1
@@ -103,6 +104,9 @@#define ACC_MAX_NUM_QGRPS 32#define ACC_RING_SIZE_GRANULARITY 64#define ACC_MAX_FCW_SIZE 128 +#define ACC_IQ_SIZE 4 + +#define ACC_FCW_FFT_BLEN_3 28/* Constants from K0 computation from 3GPP 38.212 Table 5.4.2.1-2 */ #define ACC_N_ZC_1 66/* N = 66 Zc for BG 1 */
@@ -132,6 +136,17 @@#define ACC_LIM_21 14/* 0.21 */ #define ACC_LIM_31 20/* 0.31 */ #define ACC_MAX_E (128 * 1024 - 2) +#define ACC_MAX_CS 12 + +#define ACC100_VARIANT 0 +#define VRB1_VARIANT 2 +#define VRB2_VARIANT 3 + +/* Queue Index Hierarchy */ +#define VRB1_GRP_ID_SHIFT 10 +#define VRB1_VF_ID_SHIFT 4 +#define VRB2_GRP_ID_SHIFT 12 +#define VRB2_VF_ID_SHIFT 6#define ACC_MAX_FFT_WIN 16
@@ -334,6 +349,37 @@ struct __rte_packed acc_fcw_fft { res:19 ; }; +/* FFT Frame Control Word. */ +struct __rte_packed acc_fcw_fft_3 { + uint32_t in_frame_size:16, + leading_pad_size:16; + uint32_t out_frame_size:16, + leading_depad_size:16; +uint32_t cs_window_sel; + uint32_t cs_window_sel2:16, + cs_enable_bmap:16; + uint32_t num_antennas:8, + idft_size:8, + dft_size:8, + cs_offset:8; + uint32_t idft_shift:8, + dft_shift:8, + cs_multiplier:16; + uint32_t bypass:2, + fp16_in:1, + fp16_out:1, + exp_adj:4, + power_shift:4, + power_en:1, + enable_dewin:1, + freq_resample_mode:2, + depad_output_size:16; +uint16_t cs_theta_0[ACC_MAX_CS ]; +uint32_t cs_theta_d[ACC_MAX_CS ]; +int8_t cs_time_offset[ACC_MAX_CS ]; +}; + +/* MLD-TS Frame Control Word */ struct __rte_packed acc_fcw_mldts { uint32_t fcw_version:4,
@@ -475,14 +521,14 @@ union acc_info_ring_data { uint16_t valid: 1; };struct { -uint32_t aq_id_3:6 ; -uint32_t qg_id_3:5 ; -uint32_t vf_id_3:6 ; -uint32_t int_nb_3:6 ; -uint32_t msi_0_3:1 ; -uint32_t vf2pf_3:6 ; -uint32_t loop_3:1 ; -uint32_t valid_3:1 ; +uint32_t aq_id_vrb2:6 ; +uint32_t qg_id_vrb2:5 ; +uint32_t vf_id_vrb2:6 ; +uint32_t int_nb_vrb2:6 ; +uint32_t msi_0_vrb2:1 ; +uint32_t vf2pf_vrb2:6 ; +uint32_t loop_vrb2:1 ; +uint32_t valid_vrb2:1 ; }; } __rte_packed;
@@ -764,22 +810,114 @@ alloc_sw_rings_min_mem(struct rte_bbdev *dev, struct acc_device *d,free_base_addresses (base_addrs, i); } +/* Wrapper to provide VF index from ring data. */ +static inline uint16_t +vf_from_ring (const union acc_info_ring_data ring_data,uint16_t device_variant) +{ +if (device_variant ==VRB2_VARIANT ) +return ring_data.vf_id_vrb2; +else +return ring_data.vf_id; +} + +/* Wrapper to provide QG index from ring data. */ +static inline uint16_t +qg_from_ring (const union acc_info_ring_data ring_data,uint16_t device_variant) +{ +if (device_variant ==VRB2_VARIANT ) +return ring_data.qg_id_vrb2; +else +return ring_data.qg_id; +} + +/* Wrapper to provide AQ index from ring data. */ +static inline uint16_t +aq_from_ring (const union acc_info_ring_data ring_data,uint16_t device_variant) +{ +if (device_variant ==VRB2_VARIANT ) +return ring_data.aq_id_vrb2; +else +return ring_data.aq_id; +} + +/* Wrapper to provide int index from ring data. */ +static inline uint16_t +int_from_ring (const union acc_info_ring_data ring_data,uint16_t device_variant) +{ +if (device_variant ==VRB2_VARIANT ) +return ring_data.int_nb_vrb2; +else +return ring_data.int_nb; +} + +/* Wrapper to provide queue index from group and aq index. */ +static inline int +queue_index (uint16_t group_idx,uint16_t aq_idx,uint16_t device_variant) +{ +if (device_variant ==VRB2_VARIANT ) +return (group_idx <<VRB2_GRP_ID_SHIFT ) + aq_idx; +else +return (group_idx <<VRB1_GRP_ID_SHIFT ) + aq_idx; +} + +/* Wrapper to provide queue group from queue index. */ +static inline int +qg_from_q (uint32_t q_idx,uint16_t device_variant) +{ +if (device_variant ==VRB2_VARIANT ) +return (q_idx >>VRB2_GRP_ID_SHIFT ) &0x1F ; +else +return (q_idx >>VRB1_GRP_ID_SHIFT ) &0xF ; +} + +/* Wrapper to provide vf from queue index. */ +static inline int32_t +vf_from_q (uint32_t q_idx,uint16_t device_variant) +{ +if (device_variant ==VRB2_VARIANT ) +return (q_idx >>VRB2_VF_ID_SHIFT ) &0x3F ; +else +return (q_idx >>VRB1_VF_ID_SHIFT ) &0x3F ; +} + +/* Wrapper to provide aq index from queue index. */ +static inline int32_t +aq_from_q (uint32_t q_idx,uint16_t device_variant) +{ +if (device_variant ==VRB2_VARIANT ) +return q_idx &0x3F ; +else +return q_idx &0xF ; +} + +/* Wrapper to set VF index in ring data. */ +static inline int32_t +set_vf_in_ring (volatile union acc_info_ring_data *ring_data, +uint16_t device_variant,uint16_t value) +{ +if (device_variant ==VRB2_VARIANT ) +return ring_data->vf_id_vrb2 = value; +else +return ring_data->vf_id = value; +} +/* * Find queue_id of a device queue based on details from the Info Ring. * If a queue isn't found UINT16_MAX is returned. */ static inline uint16_t -get_queue_id_from_ring_info (struct rte_bbdev_data *data, -const union acc_info_ring_data ring_data) +get_queue_id_from_ring_info (struct rte_bbdev_data *data,const union acc_info_ring_data ring_data) {uint16_t queue_id; +struct acc_queue *acc_q; +struct acc_device *d = data->dev_private;for (queue_id =0 ; queue_id < data->num_queues; ++queue_id) { -struct acc_queue *acc_q = - data->queues[queue_id].queue_private; -if (acc_q !=NULL && acc_q->aq_id == ring_data.aq_id && - acc_q->qgrp_id == ring_data.qg_id && - acc_q->vf_id == ring_data.vf_id) + acc_q = data->queues[queue_id].queue_private; + +if (acc_q !=NULL && acc_q->aq_id ==aq_from_ring (ring_data, d->device_variant) && + acc_q->qgrp_id ==qg_from_ring (ring_data, d->device_variant) && + acc_q->vf_id ==vf_from_ring (ring_data, d->device_variant))return queue_id; }
@@ -1441,4 +1579,11 @@ get_num_cbs_in_tb_ldpc_enc(struct rte_bbdev_op_ldpc_enc *ldpc_enc) return cbs_in_tb; } +static inline void +acc_reg_fast_write (struct acc_device *d,uint32_t offset,uint32_t value) +{ +void *reg_addr =RTE_PTR_ADD (d->mmio_base, offset); +mmio_write (reg_addr, value); +} +#endif /* _ACC_COMMON_H_ */
drivers/baseband/acc/rte_vrb_pmd.c +30 -28
156 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH v5 06/12] baseband/acc: refactor to allow unified driver extension
Quoted 9 lines · Nicolas Chautru
Adding a few functions and common code prior to
extending the VRB driver.Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc/acc_common.h | 175 ++++++++++++++++++++++++++--- drivers/baseband/acc/rte_vrb_pmd.c | 58 +++++----- 2 files changed, 190 insertions(+), 43 deletions(-)
Maxime
PATCH v5 7/12 baseband/acc: adding VRB2 device variant
In reply to Nicolas ChautruNo functionality exposed only device enumeration and configuration.
--- doc/guides/bbdevs/features/vrb2.ini | 14 ++ doc/guides/bbdevs/index.rst | 1 + doc/guides/bbdevs/vrb2.rst | 206 +++++++++++++++++++++++++ doc/guides/rel_notes/release_23_11.rst | 3 + drivers/baseband/acc/rte_vrb_pmd.c | 156 +++++++++++++++---- drivers/baseband/acc/vrb2_pf_enum.h | 124 +++++++++++++++ drivers/baseband/acc/vrb2_vf_enum.h | 121 +++++++++++++++ drivers/baseband/acc/vrb_pmd.h | 161 ++++++++++++++++++- 8 files changed, 751 insertions(+), 35 deletions(-) create mode 100644 doc/guides/bbdevs/features/vrb2.ini create mode 100644 doc/guides/bbdevs/vrb2.rst create mode 100644 drivers/baseband/acc/vrb2_pf_enum.h create mode 100644 drivers/baseband/acc/vrb2_vf_enum.h
doc/guides/bbdevs/features/vrb2.ini new file +14 -0
@@ -0,0 +1,14 @@ +; +; Supported features of the 'Intel vRAN Boost v2' baseband driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Turbo Decoder (4G) = Y +Turbo Encoder (4G) = Y +LDPC Decoder (5G) = Y +LDPC Encoder (5G) = Y +LLR/HARQ Compression = Y +FFT/SRS = Y +External DDR Access = N +HW Accelerated = Y
doc/guides/bbdevs/index.rst +1 -0
@@ -15,4 +15,5 @@ Baseband Device Drivers fpga_5gnr_fec acc100 vrb1 + vrb2 la12xx
doc/guides/bbdevs/vrb2.rst new file +206 -0
206 lines not on this page · raw message
doc/guides/rel_notes/release_23_11.rst +3 -0
@@ -78,6 +78,9 @@ New Features * build: Optional libraries can now be selected with the new ``enable_libs`` build option similarly to the existing ``enable_drivers`` build option. +* **Updated Intel vRAN Boost bbdev PMD.** + + Added support for the new Intel vRAN Boost v2 device variant (GNR-D) within the unified driver. Removed Items -------------
drivers/baseband/acc/rte_vrb_pmd.c +127 -29
232 lines not on this page · raw message
drivers/baseband/acc/vrb2_pf_enum.h new file +124 -0
124 lines not on this page · raw message
drivers/baseband/acc/vrb2_vf_enum.h new file +121 -0
121 lines not on this page · raw message
drivers/baseband/acc/vrb_pmd.h +155 -6
198 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v5 8/12 baseband/acc: add FEC capabilities for the VRB2 variant
In reply to Nicolas ChautruNew implementation for some of the FEC features
specific to the VRB2 variant.
--- drivers/baseband/acc/rte_vrb_pmd.c | 370 +++++++++++++++++++++++++---- 1 file changed, 328 insertions(+), 42 deletions(-)
drivers/baseband/acc/rte_vrb_pmd.c +328 -42
@@ -1235,6 +1235,94 @@ vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) };static const struct rte_bbdev_op_cap vrb2_bbdev_capabilities[] = { + { + .type =RTE_BBDEV_OP_TURBO_DEC , + .cap.turbo_dec = { + .capability_flags = +RTE_BBDEV_TURBO_SUBBLOCK_DEINTERLEAVE | +RTE_BBDEV_TURBO_CRC_TYPE_24B | +RTE_BBDEV_TURBO_DEC_CRC_24B_DROP | +RTE_BBDEV_TURBO_EQUALIZER | +RTE_BBDEV_TURBO_SOFT_OUT_SATURATE | +RTE_BBDEV_TURBO_HALF_ITERATION_EVEN | +RTE_BBDEV_TURBO_CONTINUE_CRC_MATCH | +RTE_BBDEV_TURBO_SOFT_OUTPUT | +RTE_BBDEV_TURBO_EARLY_TERMINATION | +RTE_BBDEV_TURBO_DEC_INTERRUPTS | +RTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN | +RTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT | +RTE_BBDEV_TURBO_MAP_DEC | +RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP | +RTE_BBDEV_TURBO_DEC_SCATTER_GATHER , + .max_llr_modulus =INT8_MAX , + .num_buffers_src = +RTE_BBDEV_TURBO_MAX_CODE_BLOCKS , + .num_buffers_hard_out = +RTE_BBDEV_TURBO_MAX_CODE_BLOCKS , + .num_buffers_soft_out = +RTE_BBDEV_TURBO_MAX_CODE_BLOCKS , + } + }, + { + .type =RTE_BBDEV_OP_TURBO_ENC , + .cap.turbo_enc = { + .capability_flags = +RTE_BBDEV_TURBO_CRC_24B_ATTACH | +RTE_BBDEV_TURBO_RV_INDEX_BYPASS | +RTE_BBDEV_TURBO_RATE_MATCH | +RTE_BBDEV_TURBO_ENC_INTERRUPTS | +RTE_BBDEV_TURBO_ENC_SCATTER_GATHER , + .num_buffers_src = +RTE_BBDEV_TURBO_MAX_CODE_BLOCKS , + .num_buffers_dst = +RTE_BBDEV_TURBO_MAX_CODE_BLOCKS , + } + }, + { + .type =RTE_BBDEV_OP_LDPC_ENC , + .cap.ldpc_enc = { + .capability_flags = +RTE_BBDEV_LDPC_RATE_MATCH | +RTE_BBDEV_LDPC_CRC_24B_ATTACH | +RTE_BBDEV_LDPC_INTERLEAVER_BYPASS | +RTE_BBDEV_LDPC_ENC_INTERRUPTS | +RTE_BBDEV_LDPC_ENC_SCATTER_GATHER | +RTE_BBDEV_LDPC_ENC_CONCATENATION , + .num_buffers_src = +RTE_BBDEV_LDPC_MAX_CODE_BLOCKS , + .num_buffers_dst = +RTE_BBDEV_LDPC_MAX_CODE_BLOCKS , + } + }, + { + .type =RTE_BBDEV_OP_LDPC_DEC , + .cap.ldpc_dec = { + .capability_flags = +RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK | +RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP | +RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK | +RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK | +RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE | +RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE | +RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE | +RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS | +RTE_BBDEV_LDPC_DEC_SCATTER_GATHER | +RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION | +RTE_BBDEV_LDPC_HARQ_4BIT_COMPRESSION | +RTE_BBDEV_LDPC_LLR_COMPRESSION | +RTE_BBDEV_LDPC_SOFT_OUT_ENABLE | +RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS | +RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS | +RTE_BBDEV_LDPC_DEC_INTERRUPTS , + .llr_size =8 , + .llr_decimals =2 , + .num_buffers_src = +RTE_BBDEV_LDPC_MAX_CODE_BLOCKS , + .num_buffers_hard_out = +RTE_BBDEV_LDPC_MAX_CODE_BLOCKS , + .num_buffers_soft_out =0 , + } + },RTE_BBDEV_END_OF_CAPABILITIES_LIST () };
@@ -1419,8 +1507,8 @@ vrb_fcw_td_fill(const struct rte_bbdev_dec_op *op, struct acc_fcw_td *fcw)/* Fill in a frame control word for LDPC decoding. */ static inline void -vrb1_fcw_ld_fill (struct rte_bbdev_dec_op *op,struct acc_fcw_ld *fcw, -union acc_harq_layout_data *harq_layout) +vrb_fcw_ld_fill (struct rte_bbdev_dec_op *op,struct acc_fcw_ld *fcw, +union acc_harq_layout_data *harq_layout,uint16_t device_variant) {uint16_t harq_out_length, harq_in_length, ncb_p, k0_p, parity_offset;uint32_t harq_index;
@@ -1466,18 +1554,26 @@ vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw, fcw->bypass_intlv =1 ; fcw->qm =2 ; } - fcw->hcin_decomp_mode =check_bit (op->ldpc_dec.op_flags, -RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); - fcw->hcout_comp_mode =check_bit (op->ldpc_dec.op_flags, -RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); +if (check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION )) { + fcw->hcin_decomp_mode =1 ; + fcw->hcout_comp_mode =1 ; + }else if (check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_HARQ_4BIT_COMPRESSION )) { + fcw->hcin_decomp_mode =4 ; + fcw->hcout_comp_mode =4 ; + }else { + fcw->hcin_decomp_mode =0 ; + fcw->hcout_comp_mode =0 ; + } + fcw->llr_pack_mode =check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_LLR_COMPRESSION ); harq_index =hq_index (op->ldpc_dec.harq_combined_output.offset); -if (fcw->hcin_en >0 ) { harq_in_length = op->ldpc_dec.harq_combined_input.length; -if (fcw->hcin_decomp_mode >0 ) +if (fcw->hcin_decomp_mode ==1 ) harq_in_length = harq_in_length *8 /6 ; +else if (fcw->hcin_decomp_mode ==4 ) + harq_in_length = harq_in_length *2 ; harq_in_length =RTE_MIN (harq_in_length, op->ldpc_dec.n_cb - op->ldpc_dec.n_filler); harq_in_length =RTE_ALIGN_CEIL (harq_in_length,64 );
@@ -1491,20 +1587,27 @@ vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw, } fcw->itmax = op->ldpc_dec.iter_max; - fcw->itstop =check_bit (op->ldpc_dec.op_flags, -RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE ); + fcw->itstop =check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE ); fcw->cnu_algo =ACC_ALGO_MSA ; fcw->synd_precoder = fcw->itstop; + +if (device_variant !=VRB1_VARIANT ) { + fcw->so_it = op->ldpc_dec.iter_max; + fcw->so_en =check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_SOFT_OUT_ENABLE ); + fcw->so_bypass_intlv =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS ); + fcw->so_bypass_rm =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS ); + fcw->minsum_offset =1 ; + fcw->dec_llrclip =2 ; + } +/* -* These are all implicitly set: +* These are all implicitly set * fcw->synd_post = 0; -* fcw->so_en = 0; -* fcw->so_bypass_rm = 0; -* fcw->so_bypass_intlv = 0; * fcw->dec_convllr = 0; * fcw->hcout_convllr = 0; * fcw->hcout_size1 = 0; -* fcw->so_it = 0; * fcw->hcout_offset = 0; * fcw->negstop_th = 0; * fcw->negstop_it = 0;
@@ -1515,7 +1618,8 @@ vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw,if (fcw->hcout_en >0 ) { parity_offset = (op->ldpc_dec.basegraph ==1 ?20 :8 ) * op->ldpc_dec.z_c - op->ldpc_dec.n_filler; - k0_p = (fcw->k0 > parity_offset) ? fcw->k0 - op->ldpc_dec.n_filler : fcw->k0; + k0_p = (fcw->k0 > parity_offset) ? + fcw->k0 - op->ldpc_dec.n_filler : fcw->k0; ncb_p = fcw->ncb - op->ldpc_dec.n_filler; l = k0_p + fcw->rm_e; harq_out_length = (uint16_t ) fcw->hcin_size0;
@@ -1658,19 +1762,28 @@ vrb_dma_desc_td_fill(struct rte_bbdev_dec_op *op, }static inline int -vrb1_dma_desc_ld_fill (struct rte_bbdev_dec_op *op, +vrb_dma_desc_ld_fill (struct rte_bbdev_dec_op *op,struct acc_dma_req_desc *desc,struct rte_mbuf **input,struct rte_mbuf *h_output,uint32_t *in_offset,uint32_t *h_out_offset,uint32_t *h_out_length,uint32_t *mbuf_total_left, -uint32_t *seg_total_left,struct acc_fcw_ld *fcw) +uint32_t *seg_total_left,struct acc_fcw_ld *fcw,uint16_t device_variant) {struct rte_bbdev_op_ldpc_dec *dec = &op->ldpc_dec;int next_triplet =1 ;/* FCW already done. */ uint32_t input_length;uint16_t output_length, crc24_overlap =0 ;uint16_t sys_cols,K , h_p_size, h_np_size; -bool h_comp =check_bit (dec->op_flags,RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); + +if (device_variant ==VRB1_VARIANT ) { +if (check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_HARQ_4BIT_COMPRESSION ) || +check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_SOFT_OUT_ENABLE )) { +rte_bbdev_log (ERR , +"VRB1 does not support the requested capabilities %x" , + op->ldpc_dec.op_flags); +return -1 ; + } + }acc_header_init (desc);
@@ -1711,8 +1824,10 @@ vrb1_dma_desc_ld_fill(struct rte_bbdev_dec_op *op,return -1 ; } h_p_size = fcw->hcin_size0 + fcw->hcin_size1; -if (h_comp) +if (fcw->hcin_decomp_mode ==1 ) h_p_size = (h_p_size *3 +3 ) /4 ; +else if (fcw->hcin_decomp_mode ==4 ) + h_p_size = h_p_size /2 ;if (op->ldpc_dec.harq_combined_input.data ==0 ) {rte_bbdev_log (ERR ,"HARQ input is not defined" );return -1 ;
@@ -1735,21 +1850,36 @@ vrb1_dma_desc_ld_fill(struct rte_bbdev_dec_op *op, *h_out_offset, output_length >>3 , next_triplet, ACC_DMA_BLKID_OUT_HARD); -if (check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE )) { +if (check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_SOFT_OUT_ENABLE )) { +if (op->ldpc_dec.soft_output.data ==0 ) { +rte_bbdev_log (ERR ,"Soft output is not defined" ); +return -1 ; + } + dec->soft_output.length = fcw->rm_e; +acc_dma_fill_blk_type (desc, dec->soft_output.data, dec->soft_output.offset, + fcw->rm_e, next_triplet,ACC_DMA_BLKID_OUT_SOFT ); + next_triplet++; + } + +if (check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE )) {if (op->ldpc_dec.harq_combined_output.data ==0 ) {rte_bbdev_log (ERR ,"HARQ output is not defined" );return -1 ; } -/* Pruned size of the HARQ. */ +/* Pruned size of the HARQ */ h_p_size = fcw->hcout_size0 + fcw->hcout_size1; -/* Non-Pruned size of the HARQ. */ +/* Non-Pruned size of the HARQ */ h_np_size = fcw->hcout_offset >0 ? fcw->hcout_offset + fcw->hcout_size1 : h_p_size; -if (h_comp) { +if (fcw->hcin_decomp_mode ==1 ) { h_np_size = (h_np_size *3 +3 ) /4 ; h_p_size = (h_p_size *3 +3 ) /4 ; + }else if (fcw->hcin_decomp_mode ==4 ) { + h_np_size = h_np_size /2 ; + h_p_size = h_p_size /2 ; } dec->harq_combined_output.length = h_np_size; acc_dma_fill_blk_type(
@@ -1877,6 +2007,7 @@ enqueue_ldpc_enc_n_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op **ops,/** This could be done at polling. */ acc_header_init (&desc->req); desc->req.numCBs = num; + desc->req.dltb =0 ; in_length_in_bytes = ops[0 ]->ldpc_enc.input.data->data_len; out_length = (enc->cb_params.e +7 ) >>3 ;
@@ -2102,6 +2233,104 @@ vrb1_enqueue_ldpc_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *opreturn return_descs; } +/* Fill in a frame control word for LDPC encoding. */ +static inline void +vrb2_fcw_letb_fill (const struct rte_bbdev_enc_op *op,struct acc_fcw_le *fcw) +{ + fcw->qm = op->ldpc_enc.q_m; + fcw->nfiller = op->ldpc_enc.n_filler; + fcw->BG = (op->ldpc_enc.basegraph -1 ); + fcw->Zc = op->ldpc_enc.z_c; + fcw->ncb = op->ldpc_enc.n_cb; + fcw->k0 =get_k0 (fcw->ncb, fcw->Zc, op->ldpc_enc.basegraph, + op->ldpc_enc.rv_index); + fcw->rm_e = op->ldpc_enc.tb_params.ea; + fcw->rm_e_b = op->ldpc_enc.tb_params.eb; + fcw->crc_select =check_bit (op->ldpc_enc.op_flags, +RTE_BBDEV_LDPC_CRC_24B_ATTACH ); + fcw->bypass_intlv =0 ; +if (op->ldpc_enc.tb_params.c >1 ) { + fcw->mcb_count =0 ; + fcw->C = op->ldpc_enc.tb_params.c; + fcw->Cab = op->ldpc_enc.tb_params.cab; + }else { + fcw->mcb_count =1 ; + fcw->C =0 ; + } +} + +/* Enqueue one encode operations for device in TB mode. +* returns the number of descs used. +*/ +static inline int +vrb2_enqueue_ldpc_enc_one_op_tb (struct acc_queue *q,struct rte_bbdev_enc_op *op, +uint16_t enq_descs) +{ +union acc_dma_desc *desc =NULL ; +uint32_t in_offset, out_offset, out_length, seg_total_left; +struct rte_mbuf *input, *output_head, *output; +struct rte_bbdev_op_ldpc_enc *enc = &op->ldpc_enc; +int next_triplet =1 ;/* FCW already done. */ +uint32_t in_length_in_bytes; +uint16_t K , in_length_in_bits; + + desc =acc_desc (q, enq_descs); +vrb2_fcw_letb_fill (op, &desc->req.fcw_le); + + input = enc->input.data; + output_head = output = enc->output.data; + in_offset = enc->input.offset; + out_offset = enc->output.offset; + seg_total_left =rte_pktmbuf_data_len (enc->input.data) - in_offset; + +acc_header_init (&desc->req); +K = (enc->basegraph ==1 ?22 :10 ) * enc->z_c; + in_length_in_bits =K - enc->n_filler; +if ((enc->op_flags &RTE_BBDEV_LDPC_CRC_24A_ATTACH ) || + (enc->op_flags &RTE_BBDEV_LDPC_CRC_24B_ATTACH )) + in_length_in_bits -=24 ; + in_length_in_bytes = (in_length_in_bits >>3 ) * enc->tb_params.c; + + next_triplet =acc_dma_fill_blk_type_in (&desc->req, &input, &in_offset, + in_length_in_bytes, &seg_total_left, next_triplet, +check_bit (enc->op_flags,RTE_BBDEV_LDPC_ENC_SCATTER_GATHER )); +if (unlikely (next_triplet <0 )) { +rte_bbdev_log (ERR , +"Mismatch between data to process and mbuf data length in bbdev_op: %p" , + op); +return -1 ; + } + desc->req.data_ptrs[next_triplet -1 ].last =1 ; + desc->req.m2dlen = next_triplet; + +/* Set output length */ +/* Integer round up division by 8 */ + out_length = (enc->tb_params.ea * enc->tb_params.cab + + enc->tb_params.eb * (enc->tb_params.c - enc->tb_params.cab) +7 ) >>3 ; + + next_triplet =acc_dma_fill_blk_type (&desc->req, output, out_offset, + out_length, next_triplet,ACC_DMA_BLKID_OUT_ENC ); + enc->output.length = out_length; + out_offset += out_length; + desc->req.data_ptrs[next_triplet -1 ].last =1 ; + desc->req.data_ptrs[next_triplet -1 ].dma_ext =0 ; + desc->req.d2mlen = next_triplet - desc->req.m2dlen; + desc->req.numCBs = enc->tb_params.c; +if (desc->req.numCBs >1 ) + desc->req.dltb =1 ; + desc->req.op_addr = op; + +if (out_length <ACC_MAX_E_MBUF ) +mbuf_append (output_head, output, out_length); + +#ifdef RTE_LIBRTE_BBDEV_DEBUG +rte_memdump (stderr,"FCW" , &desc->req.fcw_le,sizeof (desc->req.fcw_le)); +rte_memdump (stderr,"Req Desc." , desc,sizeof (*desc)); +#endif +/* One CB (one op) was successfully prepared to enqueue */ +return 1 ; +} +/** Enqueue one decode operations for device in CB mode. */ static inline int enqueue_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
@@ -2206,7 +2435,7 @@ vrb_enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,struct acc_fcw_ld *fcw;uint32_t seg_total_left; fcw = &desc->req.fcw_ld; - q->d->fcw_ld_fill (op, fcw, harq_layout); +vrb_fcw_ld_fill (op, fcw, harq_layout, q->d->device_variant);/* Special handling when using mbuf or not. */ if (check_bit(op->ldpc_dec.op_flags,
@@ -2215,10 +2444,10 @@ vrb_enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,else seg_total_left = fcw->rm_e; - ret =vrb1_dma_desc_ld_fill (op, &desc->req, &input, h_output, + ret =vrb_dma_desc_ld_fill (op, &desc->req, &input, h_output, &in_offset, &h_out_offset, &h_out_length, &mbuf_total_left, - &seg_total_left, fcw); + &seg_total_left, fcw, q->d->device_variant);if (unlikely (ret <0 ))return ret; }
@@ -2275,7 +2504,8 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, desc_first = desc; fcw_offset = (desc_idx <<8 ) +ACC_DESC_FCW_OFFSET ; harq_layout = q->d->harq_layout; - q->d->fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout); + +vrb_fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout, q->d->device_variant); input = op->ldpc_dec.input.data; h_output_head = h_output = op->ldpc_dec.hard_output.data;
@@ -2307,12 +2537,11 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, desc->req.data_ptrs[0 ].blen =ACC_FCW_LD_BLEN ;rte_memcpy (&desc->req.fcw_ld, &desc_first->req.fcw_ld,ACC_FCW_LD_BLEN ); desc->req.fcw_ld.tb_trailer_size = (c - r -1 ) * trail_len; - - ret =vrb1_dma_desc_ld_fill (op, &desc->req, &input, + ret =vrb_dma_desc_ld_fill (op, &desc->req, &input, h_output, &in_offset, &h_out_offset, &h_out_length, &mbuf_total_left, &seg_total_left, - &desc->req.fcw_ld); + &desc->req.fcw_ld, q->d->device_variant);if (unlikely (ret <0 ))return ret;
@@ -2576,14 +2805,22 @@ vrb_enqueue_ldpc_enc_tb(struct rte_bbdev_queue_data *q_data,int descs_used;for (i =0 ; i < num; ++i) { - cbs_in_tb =get_num_cbs_in_tb_ldpc_enc (&ops[i]->ldpc_enc); -/* Check if there are available space for further processing. */ -if (unlikely ((avail - cbs_in_tb <0 ) || (cbs_in_tb ==0 ))) { -acc_enqueue_ring_full (q_data); -break ; +if (q->d->device_variant ==VRB1_VARIANT ) { + cbs_in_tb =get_num_cbs_in_tb_ldpc_enc (&ops[i]->ldpc_enc); +/* Check if there are available space for further processing. */ +if (unlikely ((avail - cbs_in_tb <0 ) || (cbs_in_tb ==0 ))) { +acc_enqueue_ring_full (q_data); +break ; + } + descs_used =vrb1_enqueue_ldpc_enc_one_op_tb (q, ops[i], + enqueued_descs, cbs_in_tb); + }else { +if (unlikely (avail <1 )) { +acc_enqueue_ring_full (q_data); +break ; + } + descs_used =vrb2_enqueue_ldpc_enc_one_op_tb (q, ops[i], enqueued_descs); } - - descs_used =vrb1_enqueue_ldpc_enc_one_op_tb (q, ops[i], enqueued_descs, cbs_in_tb);if (descs_used <0 ) {acc_enqueue_invalid (q_data);break ;
@@ -2865,6 +3102,51 @@ vrb_dequeue_enc_one_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,return desc->req.numCBs; } +/* Dequeue one LDPC encode operations from VRB2 device in TB mode. */ +static inline int +vrb2_dequeue_ldpc_enc_one_op_tb (struct acc_queue *q,struct rte_bbdev_enc_op **ref_op, +uint16_t *dequeued_ops,uint32_t *aq_dequeued, +uint16_t *dequeued_descs) +{ +union acc_dma_desc *desc, atom_desc; +union acc_dma_rsp_desc rsp; +struct rte_bbdev_enc_op *op; + + desc =acc_desc_tail (q, *dequeued_descs); + atom_desc.atom_hdr =__atomic_load_n ((uint64_t *)desc, __ATOMIC_RELAXED); + +/* Check fdone bit. */ +if (!(atom_desc.rsp.val &ACC_FDONE )) +return -1 ; + + rsp.val = atom_desc.rsp.val; +rte_bbdev_log_debug ("Resp. desc %p: %x" , desc, rsp.val); + +/* Dequeue. */ + op = desc->req.op_addr; + +/* Clearing status, it will be set based on response. */ + op->status =0 ; + op->status |= rsp.input_err <<RTE_BBDEV_DATA_ERROR ; + op->status |= rsp.dma_err <<RTE_BBDEV_DRV_ERROR ; + op->status |= rsp.fcw_err <<RTE_BBDEV_DRV_ERROR ; + op->status |= rsp.engine_hung <<RTE_BBDEV_ENGINE_ERROR ; + +if (desc->req.last_desc_in_batch) { + (*aq_dequeued)++; + desc->req.last_desc_in_batch =0 ; + } + desc->rsp.val =ACC_DMA_DESC_TYPE ; + desc->rsp.add_info_0 =0 ;/* Reserved bits. */ + desc->rsp.add_info_1 =0 ;/* Reserved bits. */ + +/* One op was successfully dequeued */ + ref_op[0 ] = op; + (*dequeued_descs)++; + (*dequeued_ops)++; +return 1 ; +} +/* Dequeue one LDPC encode operations from device in TB mode. * That operation may cover multiple descriptors. */
@@ -3189,9 +3471,14 @@ vrb_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,for (i =0 ; i < avail; i++) {if (cbm ==RTE_BBDEV_TRANSPORT_BLOCK ) - ret =vrb_dequeue_enc_one_op_tb (q, &ops[dequeued_ops], - &dequeued_ops, &aq_dequeued, - &dequeued_descs, num); +if (q->d->device_variant ==VRB1_VARIANT ) + ret =vrb_dequeue_enc_one_op_tb (q, &ops[dequeued_ops], + &dequeued_ops, &aq_dequeued, + &dequeued_descs, num); +else + ret =vrb2_dequeue_ldpc_enc_one_op_tb (q, &ops[dequeued_ops], + &dequeued_ops, &aq_dequeued, + &dequeued_descs);else ret = vrb_dequeue_enc_one_op_cb(q, &ops[dequeued_ops], &dequeued_ops, &aq_dequeued,
@@ -3526,7 +3813,6 @@ vrb_bbdev_init(struct rte_bbdev *dev, struct rte_pci_driver *drv) (pci_dev->id.device_id == RTE_VRB1_VF_DEVICE_ID)) { d->device_variant =VRB1_VARIANT ; d->queue_offset = vrb1_queue_offset; - d->fcw_ld_fill = vrb1_fcw_ld_fill; d->num_qgroups =VRB1_NUM_QGRPS ; d->num_aqs =VRB1_NUM_AQS ;if (d->pf_device)
Signature · 1 line
2.34.1
Re: [PATCH v5 08/12] baseband/acc: add FEC capabilities for the VRB2 variant
Quoted 161 lines · Nicolas Chautru
New implementation for some of the FEC features
specific to the VRB2 variant.Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc/rte_vrb_pmd.c | 370 +++++++++++++++++++++++++---- 1 file changed, 328 insertions(+), 42 deletions(-)drivers/baseband/acc/rte_vrb_pmd.c +106
-10@@ -1235,6 +1235,94 @@ vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) };static const struct rte_bbdev_op_cap vrb2_bbdev_capabilities[] = { + { + .type =RTE_BBDEV_OP_TURBO_DEC , + .cap.turbo_dec = { + .capability_flags = +RTE_BBDEV_TURBO_SUBBLOCK_DEINTERLEAVE | +RTE_BBDEV_TURBO_CRC_TYPE_24B | +RTE_BBDEV_TURBO_DEC_CRC_24B_DROP | +RTE_BBDEV_TURBO_EQUALIZER | +RTE_BBDEV_TURBO_SOFT_OUT_SATURATE | +RTE_BBDEV_TURBO_HALF_ITERATION_EVEN | +RTE_BBDEV_TURBO_CONTINUE_CRC_MATCH | +RTE_BBDEV_TURBO_SOFT_OUTPUT | +RTE_BBDEV_TURBO_EARLY_TERMINATION | +RTE_BBDEV_TURBO_DEC_INTERRUPTS | +RTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN | +RTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT | +RTE_BBDEV_TURBO_MAP_DEC | +RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP | +RTE_BBDEV_TURBO_DEC_SCATTER_GATHER , + .max_llr_modulus =INT8_MAX , + .num_buffers_src = +RTE_BBDEV_TURBO_MAX_CODE_BLOCKS , + .num_buffers_hard_out = +RTE_BBDEV_TURBO_MAX_CODE_BLOCKS , + .num_buffers_soft_out = +RTE_BBDEV_TURBO_MAX_CODE_BLOCKS , + } + }, + { + .type =RTE_BBDEV_OP_TURBO_ENC , + .cap.turbo_enc = { + .capability_flags = +RTE_BBDEV_TURBO_CRC_24B_ATTACH | +RTE_BBDEV_TURBO_RV_INDEX_BYPASS | +RTE_BBDEV_TURBO_RATE_MATCH | +RTE_BBDEV_TURBO_ENC_INTERRUPTS | +RTE_BBDEV_TURBO_ENC_SCATTER_GATHER , + .num_buffers_src = +RTE_BBDEV_TURBO_MAX_CODE_BLOCKS , + .num_buffers_dst = +RTE_BBDEV_TURBO_MAX_CODE_BLOCKS , + } + }, + { + .type =RTE_BBDEV_OP_LDPC_ENC , + .cap.ldpc_enc = { + .capability_flags = +RTE_BBDEV_LDPC_RATE_MATCH | +RTE_BBDEV_LDPC_CRC_24B_ATTACH | +RTE_BBDEV_LDPC_INTERLEAVER_BYPASS | +RTE_BBDEV_LDPC_ENC_INTERRUPTS | +RTE_BBDEV_LDPC_ENC_SCATTER_GATHER | +RTE_BBDEV_LDPC_ENC_CONCATENATION , + .num_buffers_src = +RTE_BBDEV_LDPC_MAX_CODE_BLOCKS , + .num_buffers_dst = +RTE_BBDEV_LDPC_MAX_CODE_BLOCKS , + } + }, + { + .type =RTE_BBDEV_OP_LDPC_DEC , + .cap.ldpc_dec = { + .capability_flags = +RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK | +RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP | +RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK | +RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK | +RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE | +RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE | +RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE | +RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS | +RTE_BBDEV_LDPC_DEC_SCATTER_GATHER | +RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION | +RTE_BBDEV_LDPC_HARQ_4BIT_COMPRESSION | +RTE_BBDEV_LDPC_LLR_COMPRESSION | +RTE_BBDEV_LDPC_SOFT_OUT_ENABLE | +RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS | +RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS | +RTE_BBDEV_LDPC_DEC_INTERRUPTS , + .llr_size =8 , + .llr_decimals =2 , + .num_buffers_src = +RTE_BBDEV_LDPC_MAX_CODE_BLOCKS , + .num_buffers_hard_out = +RTE_BBDEV_LDPC_MAX_CODE_BLOCKS , + .num_buffers_soft_out =0 , + } + },RTE_BBDEV_END_OF_CAPABILITIES_LIST () };@@ -1419,8 +1507,8 @@ vrb_fcw_td_fill(const struct rte_bbdev_dec_op *op, struct acc_fcw_td *fcw)/* Fill in a frame control word for LDPC decoding. */ static inline void -vrb1_fcw_ld_fill (struct rte_bbdev_dec_op *op,struct acc_fcw_ld *fcw, -union acc_harq_layout_data *harq_layout) +vrb_fcw_ld_fill (struct rte_bbdev_dec_op *op,struct acc_fcw_ld *fcw, +union acc_harq_layout_data *harq_layout,uint16_t device_variant) {uint16_t harq_out_length, harq_in_length, ncb_p, k0_p, parity_offset;uint32_t harq_index;@@ -1466,18 +1554,26 @@ vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw, fcw->bypass_intlv =1 ; fcw->qm =2 ; } - fcw->hcin_decomp_mode =check_bit (op->ldpc_dec.op_flags, -RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); - fcw->hcout_comp_mode =check_bit (op->ldpc_dec.op_flags, -RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); +if (check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION )) { + fcw->hcin_decomp_mode =1 ; + fcw->hcout_comp_mode =1 ; + }else if (check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_HARQ_4BIT_COMPRESSION )) { + fcw->hcin_decomp_mode =4 ; + fcw->hcout_comp_mode =4 ; + }else { + fcw->hcin_decomp_mode =0 ; + fcw->hcout_comp_mode =0 ; + } + fcw->llr_pack_mode =check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_LLR_COMPRESSION ); harq_index =hq_index (op->ldpc_dec.harq_combined_output.offset); -if (fcw->hcin_en >0 ) { harq_in_length = op->ldpc_dec.harq_combined_input.length; -if (fcw->hcin_decomp_mode >0 ) +if (fcw->hcin_decomp_mode ==1 ) harq_in_length = harq_in_length *8 /6 ; +else if (fcw->hcin_decomp_mode ==4 ) + harq_in_length = harq_in_length *2 ; harq_in_length =RTE_MIN (harq_in_length, op->ldpc_dec.n_cb - op->ldpc_dec.n_filler); harq_in_length =RTE_ALIGN_CEIL (harq_in_length,64 );@@ -1491,20 +1587,27 @@ vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw, } fcw->itmax = op->ldpc_dec.iter_max; - fcw->itstop =check_bit (op->ldpc_dec.op_flags, -RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE ); + fcw->itstop =check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE ); fcw->cnu_algo =ACC_ALGO_MSA ; fcw->synd_precoder = fcw->itstop; +
drivers/baseband/acc/rte_vrb_pmd.c vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw, · line 1603
Quoted 10 lines
drivers/baseband/acc/rte_vrb_pmd.c +10
-0+if (device_variant !=VRB1_VARIANT ) { + fcw->so_it = op->ldpc_dec.iter_max; + fcw->so_en =check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_SOFT_OUT_ENABLE ); + fcw->so_bypass_intlv =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS ); + fcw->so_bypass_rm =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS ); + fcw->minsum_offset =1 ; + fcw->dec_llrclip =2 ; + }
We should be able to rely on the capabilities instead of the variant:
if (check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_SOFT_OUT_ENABLE)) {
fcw->so_it = op->ldpc_dec.iter_max;
fcw->so_en = true;
fcw->so_bypass_intlv = check_bit(op->ldpc_dec.op_flags,
RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS);
fcw->so_bypass_rm = check_bit(op->ldpc_dec.op_flags,
RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS);
}For minsum & llrclip I don't know what they are referring to, could you provide more information?
Quoted 371 lines
drivers/baseband/acc/rte_vrb_pmd.c +212
-31+/* -* These are all implicitly set: +* These are all implicitly set * fcw->synd_post = 0; -* fcw->so_en = 0; -* fcw->so_bypass_rm = 0; -* fcw->so_bypass_intlv = 0; * fcw->dec_convllr = 0; * fcw->hcout_convllr = 0; * fcw->hcout_size1 = 0; -* fcw->so_it = 0; * fcw->hcout_offset = 0; * fcw->negstop_th = 0; * fcw->negstop_it = 0; @@ -1515,7 +1618,8 @@ vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw,if (fcw->hcout_en >0 ) { parity_offset = (op->ldpc_dec.basegraph ==1 ?20 :8 ) * op->ldpc_dec.z_c - op->ldpc_dec.n_filler; - k0_p = (fcw->k0 > parity_offset) ? fcw->k0 - op->ldpc_dec.n_filler : fcw->k0; + k0_p = (fcw->k0 > parity_offset) ? + fcw->k0 - op->ldpc_dec.n_filler : fcw->k0; ncb_p = fcw->ncb - op->ldpc_dec.n_filler; l = k0_p + fcw->rm_e; harq_out_length = (uint16_t ) fcw->hcin_size0;@@ -1658,19 +1762,28 @@ vrb_dma_desc_td_fill(struct rte_bbdev_dec_op *op, }static inline int -vrb1_dma_desc_ld_fill (struct rte_bbdev_dec_op *op, +vrb_dma_desc_ld_fill (struct rte_bbdev_dec_op *op,struct acc_dma_req_desc *desc,struct rte_mbuf **input,struct rte_mbuf *h_output,uint32_t *in_offset,uint32_t *h_out_offset,uint32_t *h_out_length,uint32_t *mbuf_total_left, -uint32_t *seg_total_left,struct acc_fcw_ld *fcw) +uint32_t *seg_total_left,struct acc_fcw_ld *fcw,uint16_t device_variant) {struct rte_bbdev_op_ldpc_dec *dec = &op->ldpc_dec;int next_triplet =1 ;/* FCW already done. */ uint32_t input_length;uint16_t output_length, crc24_overlap =0 ;uint16_t sys_cols,K , h_p_size, h_np_size; -bool h_comp =check_bit (dec->op_flags,RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); + +if (device_variant ==VRB1_VARIANT ) { +if (check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_HARQ_4BIT_COMPRESSION ) || +check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_SOFT_OUT_ENABLE )) { +rte_bbdev_log (ERR , +"VRB1 does not support the requested capabilities %x" , + op->ldpc_dec.op_flags); +return -1 ; + } + }acc_header_init (desc);@@ -1711,8 +1824,10 @@ vrb1_dma_desc_ld_fill(struct rte_bbdev_dec_op *op,return -1 ; } h_p_size = fcw->hcin_size0 + fcw->hcin_size1; -if (h_comp) +if (fcw->hcin_decomp_mode ==1 ) h_p_size = (h_p_size *3 +3 ) /4 ; +else if (fcw->hcin_decomp_mode ==4 ) + h_p_size = h_p_size /2 ;if (op->ldpc_dec.harq_combined_input.data ==0 ) {rte_bbdev_log (ERR ,"HARQ input is not defined" );return -1 ;@@ -1735,21 +1850,36 @@ vrb1_dma_desc_ld_fill(struct rte_bbdev_dec_op *op, *h_out_offset, output_length >>3 , next_triplet, ACC_DMA_BLKID_OUT_HARD); -if (check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE )) { +if (check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_SOFT_OUT_ENABLE )) { +if (op->ldpc_dec.soft_output.data ==0 ) { +rte_bbdev_log (ERR ,"Soft output is not defined" ); +return -1 ; + } + dec->soft_output.length = fcw->rm_e; +acc_dma_fill_blk_type (desc, dec->soft_output.data, dec->soft_output.offset, + fcw->rm_e, next_triplet,ACC_DMA_BLKID_OUT_SOFT ); + next_triplet++; + } + +if (check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE )) {if (op->ldpc_dec.harq_combined_output.data ==0 ) {rte_bbdev_log (ERR ,"HARQ output is not defined" );return -1 ; } -/* Pruned size of the HARQ. */ +/* Pruned size of the HARQ */ h_p_size = fcw->hcout_size0 + fcw->hcout_size1; -/* Non-Pruned size of the HARQ. */ +/* Non-Pruned size of the HARQ */ h_np_size = fcw->hcout_offset >0 ? fcw->hcout_offset + fcw->hcout_size1 : h_p_size; -if (h_comp) { +if (fcw->hcin_decomp_mode ==1 ) { h_np_size = (h_np_size *3 +3 ) /4 ; h_p_size = (h_p_size *3 +3 ) /4 ; + }else if (fcw->hcin_decomp_mode ==4 ) { + h_np_size = h_np_size /2 ; + h_p_size = h_p_size /2 ; } dec->harq_combined_output.length = h_np_size; acc_dma_fill_blk_type(@@ -1877,6 +2007,7 @@ enqueue_ldpc_enc_n_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op **ops,/** This could be done at polling. */ acc_header_init (&desc->req); desc->req.numCBs = num; + desc->req.dltb =0 ; in_length_in_bytes = ops[0 ]->ldpc_enc.input.data->data_len; out_length = (enc->cb_params.e +7 ) >>3 ;@@ -2102,6 +2233,104 @@ vrb1_enqueue_ldpc_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *opreturn return_descs; } +/* Fill in a frame control word for LDPC encoding. */ +static inline void +vrb2_fcw_letb_fill (const struct rte_bbdev_enc_op *op,struct acc_fcw_le *fcw) +{ + fcw->qm = op->ldpc_enc.q_m; + fcw->nfiller = op->ldpc_enc.n_filler; + fcw->BG = (op->ldpc_enc.basegraph -1 ); + fcw->Zc = op->ldpc_enc.z_c; + fcw->ncb = op->ldpc_enc.n_cb; + fcw->k0 =get_k0 (fcw->ncb, fcw->Zc, op->ldpc_enc.basegraph, + op->ldpc_enc.rv_index); + fcw->rm_e = op->ldpc_enc.tb_params.ea; + fcw->rm_e_b = op->ldpc_enc.tb_params.eb; + fcw->crc_select =check_bit (op->ldpc_enc.op_flags, +RTE_BBDEV_LDPC_CRC_24B_ATTACH ); + fcw->bypass_intlv =0 ; +if (op->ldpc_enc.tb_params.c >1 ) { + fcw->mcb_count =0 ; + fcw->C = op->ldpc_enc.tb_params.c; + fcw->Cab = op->ldpc_enc.tb_params.cab; + }else { + fcw->mcb_count =1 ; + fcw->C =0 ; + } +} + +/* Enqueue one encode operations for device in TB mode. +* returns the number of descs used. +*/ +static inline int +vrb2_enqueue_ldpc_enc_one_op_tb (struct acc_queue *q,struct rte_bbdev_enc_op *op, +uint16_t enq_descs) +{ +union acc_dma_desc *desc =NULL ; +uint32_t in_offset, out_offset, out_length, seg_total_left; +struct rte_mbuf *input, *output_head, *output; +struct rte_bbdev_op_ldpc_enc *enc = &op->ldpc_enc; +int next_triplet =1 ;/* FCW already done. */ +uint32_t in_length_in_bytes; +uint16_t K , in_length_in_bits; + + desc =acc_desc (q, enq_descs); +vrb2_fcw_letb_fill (op, &desc->req.fcw_le); + + input = enc->input.data; + output_head = output = enc->output.data; + in_offset = enc->input.offset; + out_offset = enc->output.offset; + seg_total_left =rte_pktmbuf_data_len (enc->input.data) - in_offset; + +acc_header_init (&desc->req); +K = (enc->basegraph ==1 ?22 :10 ) * enc->z_c; + in_length_in_bits =K - enc->n_filler; +if ((enc->op_flags &RTE_BBDEV_LDPC_CRC_24A_ATTACH ) || + (enc->op_flags &RTE_BBDEV_LDPC_CRC_24B_ATTACH )) + in_length_in_bits -=24 ; + in_length_in_bytes = (in_length_in_bits >>3 ) * enc->tb_params.c; + + next_triplet =acc_dma_fill_blk_type_in (&desc->req, &input, &in_offset, + in_length_in_bytes, &seg_total_left, next_triplet, +check_bit (enc->op_flags,RTE_BBDEV_LDPC_ENC_SCATTER_GATHER )); +if (unlikely (next_triplet <0 )) { +rte_bbdev_log (ERR , +"Mismatch between data to process and mbuf data length in bbdev_op: %p" , + op); +return -1 ; + } + desc->req.data_ptrs[next_triplet -1 ].last =1 ; + desc->req.m2dlen = next_triplet; + +/* Set output length */ +/* Integer round up division by 8 */ + out_length = (enc->tb_params.ea * enc->tb_params.cab + + enc->tb_params.eb * (enc->tb_params.c - enc->tb_params.cab) +7 ) >>3 ; + + next_triplet =acc_dma_fill_blk_type (&desc->req, output, out_offset, + out_length, next_triplet,ACC_DMA_BLKID_OUT_ENC ); + enc->output.length = out_length; + out_offset += out_length; + desc->req.data_ptrs[next_triplet -1 ].last =1 ; + desc->req.data_ptrs[next_triplet -1 ].dma_ext =0 ; + desc->req.d2mlen = next_triplet - desc->req.m2dlen; + desc->req.numCBs = enc->tb_params.c; +if (desc->req.numCBs >1 ) + desc->req.dltb =1 ; + desc->req.op_addr = op; + +if (out_length <ACC_MAX_E_MBUF ) +mbuf_append (output_head, output, out_length); + +#ifdef RTE_LIBRTE_BBDEV_DEBUG +rte_memdump (stderr,"FCW" , &desc->req.fcw_le,sizeof (desc->req.fcw_le)); +rte_memdump (stderr,"Req Desc." , desc,sizeof (*desc)); +#endif +/* One CB (one op) was successfully prepared to enqueue */ +return 1 ; +} +/** Enqueue one decode operations for device in CB mode. */ static inline int enqueue_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,@@ -2206,7 +2435,7 @@ vrb_enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,struct acc_fcw_ld *fcw;uint32_t seg_total_left; fcw = &desc->req.fcw_ld; - q->d->fcw_ld_fill (op, fcw, harq_layout); +vrb_fcw_ld_fill (op, fcw, harq_layout, q->d->device_variant);/* Special handling when using mbuf or not. */ if (check_bit(op->ldpc_dec.op_flags,@@ -2215,10 +2444,10 @@ vrb_enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,else seg_total_left = fcw->rm_e; - ret =vrb1_dma_desc_ld_fill (op, &desc->req, &input, h_output, + ret =vrb_dma_desc_ld_fill (op, &desc->req, &input, h_output, &in_offset, &h_out_offset, &h_out_length, &mbuf_total_left, - &seg_total_left, fcw); + &seg_total_left, fcw, q->d->device_variant);if (unlikely (ret <0 ))return ret; }@@ -2275,7 +2504,8 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, desc_first = desc; fcw_offset = (desc_idx <<8 ) +ACC_DESC_FCW_OFFSET ; harq_layout = q->d->harq_layout; - q->d->fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout); + +vrb_fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout, q->d->device_variant); input = op->ldpc_dec.input.data; h_output_head = h_output = op->ldpc_dec.hard_output.data;@@ -2307,12 +2537,11 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, desc->req.data_ptrs[0 ].blen =ACC_FCW_LD_BLEN ;rte_memcpy (&desc->req.fcw_ld, &desc_first->req.fcw_ld,ACC_FCW_LD_BLEN ); desc->req.fcw_ld.tb_trailer_size = (c - r -1 ) * trail_len; - - ret =vrb1_dma_desc_ld_fill (op, &desc->req, &input, + ret =vrb_dma_desc_ld_fill (op, &desc->req, &input, h_output, &in_offset, &h_out_offset, &h_out_length, &mbuf_total_left, &seg_total_left, - &desc->req.fcw_ld); + &desc->req.fcw_ld, q->d->device_variant);if (unlikely (ret <0 ))return ret;@@ -2576,14 +2805,22 @@ vrb_enqueue_ldpc_enc_tb(struct rte_bbdev_queue_data *q_data,int descs_used;for (i =0 ; i < num; ++i) { - cbs_in_tb =get_num_cbs_in_tb_ldpc_enc (&ops[i]->ldpc_enc); -/* Check if there are available space for further processing. */ -if (unlikely ((avail - cbs_in_tb <0 ) || (cbs_in_tb ==0 ))) { -acc_enqueue_ring_full (q_data); -break ; +if (q->d->device_variant ==VRB1_VARIANT ) { + cbs_in_tb =get_num_cbs_in_tb_ldpc_enc (&ops[i]->ldpc_enc); +/* Check if there are available space for further processing. */ +if (unlikely ((avail - cbs_in_tb <0 ) || (cbs_in_tb ==0 ))) { +acc_enqueue_ring_full (q_data); +break ; + } + descs_used =vrb1_enqueue_ldpc_enc_one_op_tb (q, ops[i], + enqueued_descs, cbs_in_tb); + }else { +if (unlikely (avail <1 )) { +acc_enqueue_ring_full (q_data); +break ; + } + descs_used =vrb2_enqueue_ldpc_enc_one_op_tb (q, ops[i], enqueued_descs); } - - descs_used =vrb1_enqueue_ldpc_enc_one_op_tb (q, ops[i], enqueued_descs, cbs_in_tb);if (descs_used <0 ) {acc_enqueue_invalid (q_data);break ;@@ -2865,6 +3102,51 @@ vrb_dequeue_enc_one_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,return desc->req.numCBs; } +/* Dequeue one LDPC encode operations from VRB2 device in TB mode. */ +static inline int +vrb2_dequeue_ldpc_enc_one_op_tb (struct acc_queue *q,struct rte_bbdev_enc_op **ref_op, +uint16_t *dequeued_ops,uint32_t *aq_dequeued, +uint16_t *dequeued_descs) +{ +union acc_dma_desc *desc, atom_desc; +union acc_dma_rsp_desc rsp; +struct rte_bbdev_enc_op *op; + + desc =acc_desc_tail (q, *dequeued_descs); + atom_desc.atom_hdr =__atomic_load_n ((uint64_t *)desc, __ATOMIC_RELAXED); + +/* Check fdone bit. */ +if (!(atom_desc.rsp.val &ACC_FDONE )) +return -1 ; + + rsp.val = atom_desc.rsp.val; +rte_bbdev_log_debug ("Resp. desc %p: %x" , desc, rsp.val); + +/* Dequeue. */ + op = desc->req.op_addr; + +/* Clearing status, it will be set based on response. */ + op->status =0 ; + op->status |= rsp.input_err <<RTE_BBDEV_DATA_ERROR ; + op->status |= rsp.dma_err <<RTE_BBDEV_DRV_ERROR ; + op->status |= rsp.fcw_err <<RTE_BBDEV_DRV_ERROR ; + op->status |= rsp.engine_hung <<RTE_BBDEV_ENGINE_ERROR ; + +if (desc->req.last_desc_in_batch) { + (*aq_dequeued)++; + desc->req.last_desc_in_batch =0 ; + } + desc->rsp.val =ACC_DMA_DESC_TYPE ; + desc->rsp.add_info_0 =0 ;/* Reserved bits. */ + desc->rsp.add_info_1 =0 ;/* Reserved bits. */ + +/* One op was successfully dequeued */ + ref_op[0 ] = op; + (*dequeued_descs)++; + (*dequeued_ops)++; +return 1 ; +} +/* Dequeue one LDPC encode operations from device in TB mode. * That operation may cover multiple descriptors. */ @@ -3189,9 +3471,14 @@ vrb_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,for (i =0 ; i < avail; i++) {if (cbm ==RTE_BBDEV_TRANSPORT_BLOCK ) - ret =vrb_dequeue_enc_one_op_tb (q, &ops[dequeued_ops], - &dequeued_ops, &aq_dequeued, - &dequeued_descs, num); +if (q->d->device_variant ==VRB1_VARIANT ) + ret =vrb_dequeue_enc_one_op_tb (q, &ops[dequeued_ops], + &dequeued_ops, &aq_dequeued, + &dequeued_descs, num); +else + ret =vrb2_dequeue_ldpc_enc_one_op_tb (q, &ops[dequeued_ops], + &dequeued_ops, &aq_dequeued, + &dequeued_descs);else ret = vrb_dequeue_enc_one_op_cb(q, &ops[dequeued_ops], &dequeued_ops, &aq_dequeued,
drivers/baseband/acc/rte_vrb_pmd.c vrb_bbdev_init(struct rte_bbdev *dev, struct rte_pci_driver *drv) · line 3818
Quoted 7 lines
drivers/baseband/acc/rte_vrb_pmd.c +0
-1@@ -3526,7 +3813,6 @@ vrb_bbdev_init(struct rte_bbdev *dev, struct rte_pci_driver *drv) (pci_dev->id.device_id == RTE_VRB1_VF_DEVICE_ID)) { d->device_variant =VRB1_VARIANT ; d->queue_offset = vrb1_queue_offset; - d->fcw_ld_fill = vrb1_fcw_ld_fill; d->num_qgroups =VRB1_NUM_QGRPS ; d->num_aqs =VRB1_NUM_AQS ;if (d->pf_device)
Thanks,
Maxime
RE: [PATCH v5 08/12] baseband/acc: add FEC capabilities for the VRB2 variant
Hi Maxime,
Quoted 223 lines
-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: Friday, October 6, 2023 2:51 AM
To: Chautru, Nicolas <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; Vargas, Hernan <[email protected]>
Subject: Re: [PATCH v5 08/12] baseband/acc: add FEC capabilities for the VRB2 variantdrivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct
Quoted 14 lines · Nicolas Chautru
New implementation for some of the FEC features specific to the VRB2 variant.
Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc/rte_vrb_pmd.c | 370 +++++++++++++++++++++++++---- 1 file changed, 328 insertions(+), 42 deletions(-)drivers/baseband/acc/rte_vrb_pmd.c +0
-0@@ -1235,6 +1235,94 @@ vrb_dev_info_get(struct rte_bbdev *dev, struct
rte_bbdev_driver_info*dev_info)drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info)
Quoted 8 lines
drivers/baseband/acc/rte_vrb_pmd.c +5
-0};static const struct rte_bbdev_op_cap vrb2_bbdev_capabilities[] = { + { + .type =RTE_BBDEV_OP_TURBO_DEC , + .cap.turbo_dec = { + .capability_flags = +
RTE_BBDEV_TURBO_SUBBLOCK_DEINTERLEAVE|drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1244
Quoted 2 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-0+ RTE_BBDEV_TURBO_CRC_TYPE_24B | +RTE_BBDEV_TURBO_DEC_CRC_24B_DROP |drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1246
Quoted 2 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-0+ RTE_BBDEV_TURBO_EQUALIZER | +
RTE_BBDEV_TURBO_SOFT_OUT_SATURATE|drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1247
Quoted 1 line
drivers/baseband/acc/rte_vrb_pmd.c +1
-0+
RTE_BBDEV_TURBO_HALF_ITERATION_EVEN|drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1248
Quoted 1 line
drivers/baseband/acc/rte_vrb_pmd.c +1
-0+
RTE_BBDEV_TURBO_CONTINUE_CRC_MATCH|drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1250
Quoted 2 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-0+ RTE_BBDEV_TURBO_SOFT_OUTPUT | +
RTE_BBDEV_TURBO_EARLY_TERMINATION|drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1251
Quoted 1 line
drivers/baseband/acc/rte_vrb_pmd.c +1
-0+RTE_BBDEV_TURBO_DEC_INTERRUPTS |
drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1252
Quoted 1 line
drivers/baseband/acc/rte_vrb_pmd.c +1
-0+RTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN |drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1253
Quoted 1 line
drivers/baseband/acc/rte_vrb_pmd.c +1
-0+
RTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT|drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1255
Quoted 2 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-0+ RTE_BBDEV_TURBO_MAP_DEC | +RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP |drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1256
Quoted 1 line
drivers/baseband/acc/rte_vrb_pmd.c +1
-0+
RTE_BBDEV_TURBO_DEC_SCATTER_GATHER,drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info)
Quoted 3 lines
drivers/baseband/acc/rte_vrb_pmd.c +3
-0+ .max_llr_modulus = INT8_MAX, + .num_buffers_src = +
RTE_BBDEV_TURBO_MAX_CODE_BLOCKS,drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1261
Quoted 2 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-0+ .num_buffers_hard_out = +
RTE_BBDEV_TURBO_MAX_CODE_BLOCKS,drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1263
Quoted 2 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-0+ .num_buffers_soft_out = +
RTE_BBDEV_TURBO_MAX_CODE_BLOCKS,drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info)
Quoted 7 lines
drivers/baseband/acc/rte_vrb_pmd.c +7
-0+ } + }, + { + .type = RTE_BBDEV_OP_TURBO_ENC, + .cap.turbo_enc = { + .capability_flags = +
RTE_BBDEV_TURBO_CRC_24B_ATTACH|drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1271
Quoted 1 line
drivers/baseband/acc/rte_vrb_pmd.c +1
-0+
RTE_BBDEV_TURBO_RV_INDEX_BYPASS|drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1273
Quoted 2 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-0+RTE_BBDEV_TURBO_RATE_MATCH | +RTE_BBDEV_TURBO_ENC_INTERRUPTS |
drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1274
Quoted 1 line
drivers/baseband/acc/rte_vrb_pmd.c +1
-0+
RTE_BBDEV_TURBO_ENC_SCATTER_GATHER,drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1276
Quoted 2 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-0+ .num_buffers_src = +
RTE_BBDEV_TURBO_MAX_CODE_BLOCKS,drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1278
Quoted 2 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-0+ .num_buffers_dst = +
RTE_BBDEV_TURBO_MAX_CODE_BLOCKS,drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info)
Quoted 8 lines
drivers/baseband/acc/rte_vrb_pmd.c +8
-0+ } + }, + { + .type = RTE_BBDEV_OP_LDPC_ENC, + .cap.ldpc_enc = { + .capability_flags = +RTE_BBDEV_LDPC_RATE_MATCH | +RTE_BBDEV_LDPC_CRC_24B_ATTACH |
drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1287
Quoted 1 line
drivers/baseband/acc/rte_vrb_pmd.c +1
-0+
RTE_BBDEV_LDPC_INTERLEAVER_BYPASS|drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1289
Quoted 2 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-0+ RTE_BBDEV_LDPC_ENC_INTERRUPTS | +
RTE_BBDEV_LDPC_ENC_SCATTER_GATHER|drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1290
Quoted 1 line
drivers/baseband/acc/rte_vrb_pmd.c +1
-0+
RTE_BBDEV_LDPC_ENC_CONCATENATION,drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1292
Quoted 2 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-0+ .num_buffers_src = +
RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1294
Quoted 2 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-0+ .num_buffers_dst = +
RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info)
Quoted 11 lines
drivers/baseband/acc/rte_vrb_pmd.c +11
-0+ } + }, + { + .type = RTE_BBDEV_OP_LDPC_DEC, + .cap.ldpc_dec = { + .capability_flags = +RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK | +RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP | +RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK | +RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK | +RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE |
drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1306
Quoted 1 line
drivers/baseband/acc/rte_vrb_pmd.c +1
-0+
RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE|drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info)
Quoted 4 lines
drivers/baseband/acc/rte_vrb_pmd.c +4
-0+RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE | +RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS | +RTE_BBDEV_LDPC_DEC_SCATTER_GATHER | +RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION |
drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1311
Quoted 1 line
drivers/baseband/acc/rte_vrb_pmd.c +1
-0+RTE_BBDEV_LDPC_HARQ_4BIT_COMPRESSION |
drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info)
Quoted 4 lines
drivers/baseband/acc/rte_vrb_pmd.c +4
-0+RTE_BBDEV_LDPC_LLR_COMPRESSION | +RTE_BBDEV_LDPC_SOFT_OUT_ENABLE | + RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS | +
RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS|drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info)
Quoted 5 lines
drivers/baseband/acc/rte_vrb_pmd.c +5
-0+ RTE_BBDEV_LDPC_DEC_INTERRUPTS, + .llr_size = 8, + .llr_decimals = 2, + .num_buffers_src = +
RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,drivers/baseband/acc/rte_vrb_pmd.c vrb_dev_info_get(struct rte_bbdev *dev, struct · line 1322
Quoted 2 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-0+ .num_buffers_hard_out = +
RTE_BBDEV_LDPC_MAX_CODE_BLOCKS,Quoted 7 lines
drivers/baseband/acc/rte_vrb_pmd.c +3
-0+ .num_buffers_soft_out = 0, + } + }, RTE_BBDEV_END_OF_CAPABILITIES_LIST() };drivers/baseband/acc/rte_vrb_pmd.c vrb_fcw_td_fill(const struct rte_bbdev_dec_op · line 1512
Quoted 8 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-2@@ -1419,8 +1507,8 @@ vrb_fcw_td_fill(const struct rte_bbdev_dec_op *op, struct acc_fcw_td *fcw)/* Fill in a frame control word for LDPC decoding. */ static inline void -vrb1_fcw_ld_fill (struct rte_bbdev_dec_op *op,struct acc_fcw_ld *fcw, -union acc_harq_layout_data *harq_layout) +vrb_fcw_ld_fill (struct rte_bbdev_dec_op *op,struct acc_fcw_ld *fcw, + union acc_harq_layout_data *harq_layout, uint16_t
device_variant)drivers/baseband/acc/rte_vrb_pmd.c vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op,
Quoted 4 lines
drivers/baseband/acc/rte_vrb_pmd.c +0
-0{uint16_t harq_out_length, harq_in_length, ncb_p, k0_p, parity_offset;
uint32_tharq_index;drivers/baseband/acc/rte_vrb_pmd.c +0
-0@@ -1466,18 +1554,26 @@ vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op,struct
acc_fcw_ld*fcw,drivers/baseband/acc/rte_vrb_pmd.c vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw,
Quoted 8 lines
drivers/baseband/acc/rte_vrb_pmd.c +1
-4fcw->bypass_intlv =1 ; fcw->qm =2 ; } - fcw->hcin_decomp_mode =check_bit (op->ldpc_dec.op_flags, -RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); - fcw->hcout_comp_mode =check_bit (op->ldpc_dec.op_flags, -RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); + if (check_bit(op->ldpc_dec.op_flags,
RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION)) {drivers/baseband/acc/rte_vrb_pmd.c vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw,
Quoted 3 lines
drivers/baseband/acc/rte_vrb_pmd.c +3
-0+ fcw->hcin_decomp_mode =1 ; + fcw->hcout_comp_mode =1 ; + } else if (check_bit(op->ldpc_dec.op_flags,
RTE_BBDEV_LDPC_HARQ_4BIT_COMPRESSION)) {Quoted 11 lines
drivers/baseband/acc/rte_vrb_pmd.c +7
-1+ fcw->hcin_decomp_mode =4 ; + fcw->hcout_comp_mode =4 ; + }else { + fcw->hcin_decomp_mode =0 ; + fcw->hcout_comp_mode =0 ; + } + fcw->llr_pack_mode =check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_LLR_COMPRESSION ); harq_index =hq_index (op->ldpc_dec.harq_combined_output.offset); -drivers/baseband/acc/rte_vrb_pmd.c vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw,
Quoted 10 lines
drivers/baseband/acc/rte_vrb_pmd.c +3
-1if (fcw->hcin_en >0 ) { harq_in_length = op->ldpc_dec.harq_combined_input.length; -if (fcw->hcin_decomp_mode >0 ) +if (fcw->hcin_decomp_mode ==1 ) harq_in_length = harq_in_length *8 /6 ; +else if (fcw->hcin_decomp_mode ==4 ) + harq_in_length = harq_in_length *2 ; harq_in_length =RTE_MIN (harq_in_length, op->ldpc_dec.n_cb - op->ldpc_dec.n_filler); harq_in_length = RTE_ALIGN_CEIL(harq_in_length, 64); @@ -1491,20
Quoted 1 line
+1587,27 @@ vrb1_fcw_ld_fill(struct
rte_bbdev_dec_op*op, struct
acc_fcw_ld*fcw,drivers/baseband/acc/rte_vrb_pmd.c vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw,
Quoted 13 lines
} fcw->itmax = op->ldpc_dec.iter_max;drivers/baseband/acc/rte_vrb_pmd.c +6
-2- fcw->itstop =check_bit (op->ldpc_dec.op_flags, -RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE ); + fcw->itstop =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE ); fcw->cnu_algo =ACC_ALGO_MSA ; fcw->synd_precoder = fcw->itstop; + +if (device_variant !=VRB1_VARIANT ) { + fcw->so_it = op->ldpc_dec.iter_max; + fcw->so_en = check_bit(op->ldpc_dec.op_flags,
RTE_BBDEV_LDPC_SOFT_OUT_ENABLE);drivers/baseband/acc/rte_vrb_pmd.c vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw, · line 1604
Quoted 2 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-0+ fcw->so_bypass_intlv = check_bit(op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS);
Quoted 7 lines
drivers/baseband/acc/rte_vrb_pmd.c vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw, · line 1603
Quoted 5 lines
drivers/baseband/acc/rte_vrb_pmd.c +5
-0+ fcw->so_bypass_rm =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS ); + fcw->minsum_offset =1 ; + fcw->dec_llrclip =2 ; + }We should be able to rely on the capabilities instead of the variant:
Not really, that would be poor for maintainability. This is really related to the variant should not set these, regardless what happens to capabilies moving forward. That would be convoluted.
Quoted 11 lines
if (check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_SOFT_OUT_ENABLE)) {
fcw->so_it = op->ldpc_dec.iter_max;
fcw->so_en = true;
fcw->so_bypass_intlv = check_bit(op->ldpc_dec.op_flags,
RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS);
fcw->so_bypass_rm = check_bit(op->ldpc_dec.op_flags,
RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS);
}Quoted 2 lines
For minsum & llrclip I don't know what they are referring to, could you provide more information?
These are specific to the IP in the 2nd implementation.
Quoted 428 lines
drivers/baseband/acc/rte_vrb_pmd.c vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op,
Quoted 17 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-5+/* -* These are all implicitly set: +* These are all implicitly set * fcw->synd_post = 0; -* fcw->so_en = 0; -* fcw->so_bypass_rm = 0; -* fcw->so_bypass_intlv = 0; * fcw->dec_convllr = 0; * fcw->hcout_convllr = 0; * fcw->hcout_size1 = 0; -* fcw->so_it = 0; * fcw->hcout_offset = 0; * fcw->negstop_th = 0; * fcw->negstop_it = 0; @@ -1515,7 +1618,8 @@ vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op,struct
acc_fcw_ld*fcw,Quoted 10 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-1if (fcw->hcout_en >0 ) { parity_offset = (op->ldpc_dec.basegraph ==1 ?20 :8 ) * op->ldpc_dec.z_c - op->ldpc_dec.n_filler; - k0_p = (fcw->k0 > parity_offset) ? fcw->k0 - op- ldpc_dec.n_filler : fcw->k0; + k0_p = (fcw->k0 > parity_offset) ? + fcw->k0 - op->ldpc_dec.n_filler : fcw->k0; ncb_p = fcw->ncb - op->ldpc_dec.n_filler; l = k0_p + fcw->rm_e;
harq_out_length= (uint16_t)fcw->hcin_size0; @@ -1658,19+1762,28
Quoted 10 lines
@@ vrb_dma_desc_td_fill(struct
rte_bbdev_dec_op*op,
}static inline int
drivers/baseband/acc/rte_vrb_pmd.c +1
-1-vrb1_dma_desc_ld_fill(struct rte_bbdev_dec_op *op, +vrb_dma_desc_ld_fill(struct rte_bbdev_dec_op *op, struct acc_dma_req_desc *desc, struct rte_mbuf **input, struct rte_mbuf *h_output, uint32_t *in_offset, uint32_t *h_out_offset, uint32_t *h_out_length, uint32_t *mbuf_total_left,drivers/baseband/acc/rte_vrb_pmd.c vrb_dma_desc_td_fill(struct rte_bbdev_dec_op *op,
Quoted 10 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-2- uint32_t *seg_total_left, struct acc_fcw_ld *fcw) + uint32_t *seg_total_left, struct acc_fcw_ld *fcw, uint16_t +device_variant) { struct rte_bbdev_op_ldpc_dec *dec = &op->ldpc_dec;int next_triplet =1 ;/* FCW already done. */ uint32_t input_length;uint16_t output_length, crc24_overlap =0 ;uint16_t sys_cols,K , h_p_size, h_np_size; - bool h_comp = check_bit(dec->op_flags,
RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION);drivers/baseband/acc/rte_vrb_pmd.c vrb_dma_desc_td_fill(struct rte_bbdev_dec_op *op,
Quoted 3 lines
drivers/baseband/acc/rte_vrb_pmd.c +3
-0+ +if (device_variant ==VRB1_VARIANT ) { + if (check_bit(op->ldpc_dec.op_flags,
RTE_BBDEV_LDPC_HARQ_4BIT_COMPRESSION) ||drivers/baseband/acc/rte_vrb_pmd.c
Quoted 1 line
drivers/baseband/acc/rte_vrb_pmd.c +1
-0+ check_bit(op->ldpc_dec.op_flags,
RTE_BBDEV_LDPC_SOFT_OUT_ENABLE)) {drivers/baseband/acc/rte_vrb_pmd.c
Quoted 2 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-0+ rte_bbdev_log(ERR, + "VRB1 does not support the requestedcapabilities %x",
drivers/baseband/acc/rte_vrb_pmd.c vrb1_dma_desc_ld_fill(struct rte_bbdev_dec_op
Quoted 8 lines
drivers/baseband/acc/rte_vrb_pmd.c +4
-0+ op->ldpc_dec.op_flags); +return -1 ; + } + }acc_header_init (desc);@@ -1711,8 +1824,10 @@ vrb1_dma_desc_ld_fill(struct rte_bbdev_dec_op*op,
drivers/baseband/acc/rte_vrb_pmd.c vrb1_dma_desc_ld_fill(struct rte_bbdev_dec_op
Quoted 12 lines
drivers/baseband/acc/rte_vrb_pmd.c +3
-1return -1 ; } h_p_size = fcw->hcin_size0 + fcw->hcin_size1; -if (h_comp) +if (fcw->hcin_decomp_mode ==1 ) h_p_size = (h_p_size *3 +3 ) /4 ; +else if (fcw->hcin_decomp_mode ==4 ) + h_p_size = h_p_size /2 ;if (op->ldpc_dec.harq_combined_input.data ==0 ) {rte_bbdev_log (ERR ,"HARQ input is not defined" );return -1 ;@@ -1735,21 +1850,36 @@ vrb1_dma_desc_ld_fill(struct rte_bbdev_dec_op*op,
drivers/baseband/acc/rte_vrb_pmd.c vrb1_dma_desc_ld_fill(struct rte_bbdev_dec_op *op,
Quoted 4 lines
drivers/baseband/acc/rte_vrb_pmd.c +0
-1*h_out_offset, output_length >>3 , next_triplet, ACC_DMA_BLKID_OUT_HARD); - if (check_bit(op->ldpc_dec.op_flags,
RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE)) {drivers/baseband/acc/rte_vrb_pmd.c vrb1_dma_desc_ld_fill(struct rte_bbdev_dec_op *op, · line 1864
Quoted 1 line
drivers/baseband/acc/rte_vrb_pmd.c +1
-0+ if (check_bit(op->ldpc_dec.op_flags,
RTE_BBDEV_LDPC_SOFT_OUT_ENABLE)) {drivers/baseband/acc/rte_vrb_pmd.c vrb1_dma_desc_ld_fill(struct rte_bbdev_dec_op *op,
Quoted 8 lines
drivers/baseband/acc/rte_vrb_pmd.c +7
-0+if (op->ldpc_dec.soft_output.data ==0 ) { +rte_bbdev_log (ERR ,"Soft output is not defined" ); +return -1 ; + } + dec->soft_output.length = fcw->rm_e; + acc_dma_fill_blk_type(desc, dec->soft_output.data, dec- soft_output.offset, + fcw->rm_e, next_triplet,
ACC_DMA_BLKID_OUT_SOFT);drivers/baseband/acc/rte_vrb_pmd.c vrb1_dma_desc_ld_fill(struct rte_bbdev_dec_op *op,
Quoted 5 lines
drivers/baseband/acc/rte_vrb_pmd.c +5
-0+ next_triplet++; + } + + if (check_bit(op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE)) {drivers/baseband/acc/rte_vrb_pmd.c enqueue_ldpc_enc_n_op_cb(struct acc_queue *q,
Quoted 24 lines
drivers/baseband/acc/rte_vrb_pmd.c +6
-3if (op->ldpc_dec.harq_combined_output.data ==0 ) {rte_bbdev_log (ERR ,"HARQ output is not defined" );return -1 ; } -/* Pruned size of the HARQ. */ +/* Pruned size of the HARQ */ h_p_size = fcw->hcout_size0 + fcw->hcout_size1; -/* Non-Pruned size of the HARQ. */ +/* Non-Pruned size of the HARQ */ h_np_size = fcw->hcout_offset >0 ? fcw->hcout_offset + fcw->hcout_size1 : h_p_size; -if (h_comp) { +if (fcw->hcin_decomp_mode ==1 ) { h_np_size = (h_np_size *3 +3 ) /4 ; h_p_size = (h_p_size *3 +3 ) /4 ; + }else if (fcw->hcin_decomp_mode ==4 ) { + h_np_size = h_np_size /2 ; + h_p_size = h_p_size /2 ; } dec->harq_combined_output.length = h_np_size;acc_dma_fill_blk_type(
drivers/baseband/acc/rte_vrb_pmd.c +0
-0@@ -1877,6 +2007,7 @@ enqueue_ldpc_enc_n_op_cb(struct acc_queue *q,struct
rte_bbdev_enc_op**ops,Quoted 8 lines
drivers/baseband/acc/rte_vrb_pmd.c +1
-0/** This could be done at polling. */ acc_header_init (&desc->req); desc->req.numCBs = num; + desc->req.dltb =0 ; in_length_in_bytes = ops[0 ]->ldpc_enc.input.data->data_len; out_length = (enc->cb_params.e + 7) >> 3; @@ -2102,6 +2233,104 @@vrb1_enqueue_ldpc_enc_one_op_tb(struct
acc_queue*q, struct
rte_bbdev_enc_op*opQuoted 23 lines
return return_descs; }drivers/baseband/acc/rte_vrb_pmd.c +20
-0+/* Fill in a frame control word for LDPC encoding. */ static inline +void vrb2_fcw_letb_fill (const struct rte_bbdev_enc_op *op,struct +acc_fcw_le *fcw) { + fcw->qm = op->ldpc_enc.q_m; + fcw->nfiller = op->ldpc_enc.n_filler; + fcw->BG = (op->ldpc_enc.basegraph -1 ); + fcw->Zc = op->ldpc_enc.z_c; + fcw->ncb = op->ldpc_enc.n_cb; + fcw->k0 =get_k0 (fcw->ncb, fcw->Zc, op->ldpc_enc.basegraph, + op->ldpc_enc.rv_index); + fcw->rm_e = op->ldpc_enc.tb_params.ea; + fcw->rm_e_b = op->ldpc_enc.tb_params.eb; + fcw->crc_select =check_bit (op->ldpc_enc.op_flags, +RTE_BBDEV_LDPC_CRC_24B_ATTACH ); + fcw->bypass_intlv =0 ; +if (op->ldpc_enc.tb_params.c >1 ) { + fcw->mcb_count =0 ; + fcw->C = op->ldpc_enc.tb_params.c; + fcw->Cab = op->ldpc_enc.tb_params.cab; + }else {drivers/baseband/acc/rte_vrb_pmd.c vrb1_enqueue_ldpc_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op
Quoted 10 lines
drivers/baseband/acc/rte_vrb_pmd.c +10
-0+ fcw->mcb_count =1 ; + fcw->C =0 ; + } +} + +/* Enqueue one encode operations for device in TB mode. +* returns the number of descs used. +*/ +static inline int +vrb2_enqueue_ldpc_enc_one_op_tb(struct acc_queue *q, struct
rte_bbdev_enc_op*op,Quoted 14 lines
drivers/baseband/acc/rte_vrb_pmd.c +14
-0+ uint16_t enq_descs) +{ +union acc_dma_desc *desc =NULL ; +uint32_t in_offset, out_offset, out_length, seg_total_left; +struct rte_mbuf *input, *output_head, *output; +struct rte_bbdev_op_ldpc_enc *enc = &op->ldpc_enc; +int next_triplet =1 ;/* FCW already done. */ +uint32_t in_length_in_bytes; +uint16_t K , in_length_in_bits; + + desc =acc_desc (q, enq_descs); +vrb2_fcw_letb_fill (op, &desc->req.fcw_le); + + input = enc->input.data;drivers/baseband/acc/rte_vrb_pmd.c vrb1_enqueue_ldpc_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op
Quoted 10 lines
drivers/baseband/acc/rte_vrb_pmd.c +10
-0+ output_head = output = enc->output.data; + in_offset = enc->input.offset; + out_offset = enc->output.offset; + seg_total_left =rte_pktmbuf_data_len (enc->input.data) - in_offset; + +acc_header_init (&desc->req); +K = (enc->basegraph ==1 ?22 :10 ) * enc->z_c; + in_length_in_bits =K - enc->n_filler; + if ((enc->op_flags & RTE_BBDEV_LDPC_CRC_24A_ATTACH) || + (enc->op_flags &
RTE_BBDEV_LDPC_CRC_24B_ATTACH))drivers/baseband/acc/rte_vrb_pmd.c vrb1_enqueue_ldpc_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op
Quoted 6 lines
drivers/baseband/acc/rte_vrb_pmd.c +6
-0+ in_length_in_bits -=24 ; + in_length_in_bytes = (in_length_in_bits >>3 ) * enc->tb_params.c; + + next_triplet = acc_dma_fill_blk_type_in(&desc->req, &input, &in_offset, + in_length_in_bytes, &seg_total_left, next_triplet, + check_bit(enc->op_flags,
RTE_BBDEV_LDPC_ENC_SCATTER_GATHER));drivers/baseband/acc/rte_vrb_pmd.c vrb1_enqueue_ldpc_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op
Quoted 3 lines
drivers/baseband/acc/rte_vrb_pmd.c +3
-0+if (unlikely (next_triplet <0 )) { + rte_bbdev_log(ERR, + "Mismatch between data to process and mbufdata length in
bbdev_op: %p",Quoted 39 lines
drivers/baseband/acc/rte_vrb_pmd.c +10
-0+ op); +return -1 ; + } + desc->req.data_ptrs[next_triplet -1 ].last =1 ; + desc->req.m2dlen = next_triplet; + +/* Set output length */ +/* Integer round up division by 8 */ + out_length = (enc->tb_params.ea * enc->tb_params.cab + + enc->tb_params.eb * (enc->tb_params.c - enc-tb_params.cab) + 7)
+>> 3;drivers/baseband/acc/rte_vrb_pmd.c +18
-0+ + next_triplet =acc_dma_fill_blk_type (&desc->req, output, out_offset, + out_length, next_triplet,ACC_DMA_BLKID_OUT_ENC ); + enc->output.length = out_length; + out_offset += out_length; + desc->req.data_ptrs[next_triplet -1 ].last =1 ; + desc->req.data_ptrs[next_triplet -1 ].dma_ext =0 ; + desc->req.d2mlen = next_triplet - desc->req.m2dlen; + desc->req.numCBs = enc->tb_params.c; +if (desc->req.numCBs >1 ) + desc->req.dltb =1 ; + desc->req.op_addr = op; + +if (out_length <ACC_MAX_E_MBUF ) +mbuf_append (output_head, output, out_length); + +#ifdef RTE_LIBRTE_BBDEV_DEBUG + rte_memdump(stderr, "FCW", &desc->req.fcw_le, sizeof(desc-req.fcw_le));
drivers/baseband/acc/rte_vrb_pmd.c +5
-0+rte_memdump (stderr,"Req Desc." , desc,sizeof (*desc));#endif +/* One CB (one op) was successfully prepared to enqueue */ +return 1 ; +} +/** Enqueue one decode operations for device in CB mode. */ static inline int enqueue_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_opQuoted 1 line
*op, @@ -2206,7 +2435,7 @@ vrb_enqueue_ldpc_dec_one_op_cb(struct
acc_queue*q, structrte_bbdev_dec_op*op,drivers/baseband/acc/rte_vrb_pmd.c vrb_enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
Quoted 8 lines
struct acc_fcw_ld *fcw; uint32_t seg_total_left; fcw = &desc->req.fcw_ld;drivers/baseband/acc/rte_vrb_pmd.c +1
-1- q->d->fcw_ld_fill (op, fcw, harq_layout); +vrb_fcw_ld_fill (op, fcw, harq_layout, q->d->device_variant);/* Special handling when using mbuf or not. */ if (check_bit(op->ldpc_dec.op_flags, @@ -2215,10 +2444,10@@
Quoted 1 line
vrb_enqueue_ldpc_dec_one_op_cb(struct
acc_queue*q, struct
rte_bbdev_dec_op*op,drivers/baseband/acc/rte_vrb_pmd.c vrb_enqueue_ldpc_dec_one_op_tb(struct
Quoted 13 lines
else seg_total_left = fcw->rm_e;drivers/baseband/acc/rte_vrb_pmd.c +2
-2- ret =vrb1_dma_desc_ld_fill (op, &desc->req, &input, h_output, + ret =vrb_dma_desc_ld_fill (op, &desc->req, &input, h_output, &in_offset, &h_out_offset, &h_out_length, &mbuf_total_left, - &seg_total_left, fcw); + &seg_total_left, fcw, q->d->device_variant);if (unlikely (ret <0 ))return ret; }@@ -2275,7 +2504,8 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct
acc_queue*q, structrte_bbdev_dec_op*op,drivers/baseband/acc/rte_vrb_pmd.c vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
Quoted 11 lines
drivers/baseband/acc/rte_vrb_pmd.c +3
-2desc_first = desc; fcw_offset = (desc_idx <<8 ) +ACC_DESC_FCW_OFFSET ; harq_layout = q->d->harq_layout; - q->d->fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout); + +vrb_fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout, +q->d->device_variant); input = op->ldpc_dec.input.data; h_output_head = h_output = op->ldpc_dec.hard_output.data; @@ -2307,12 +2537,11 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue*q, struct
rte_bbdev_dec_op*op,Quoted 2 lines
desc->req.data_ptrs[0].blen = ACC_FCW_LD_BLEN; rte_memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld,
ACC_FCW_LD_BLEN);drivers/baseband/acc/rte_vrb_pmd.c vrb_enqueue_ldpc_enc_tb(struct
Quoted 13 lines
desc->req.fcw_ld.tb_trailer_size = (c - r - 1) * trail_len;drivers/baseband/acc/rte_vrb_pmd.c +2
-3- - ret =vrb1_dma_desc_ld_fill (op, &desc->req, &input, + ret =vrb_dma_desc_ld_fill (op, &desc->req, &input, h_output, &in_offset, &h_out_offset, &h_out_length, &mbuf_total_left, &seg_total_left, - &desc->req.fcw_ld); + &desc->req.fcw_ld, q->d->device_variant);if (unlikely (ret <0 ))return ret;@@ -2576,14 +2805,22 @@ vrb_enqueue_ldpc_enc_tb(struct
rte_bbdev_queue_data*q_data,drivers/baseband/acc/rte_vrb_pmd.c vrb_enqueue_ldpc_enc_tb(struct rte_bbdev_queue_data *q_data,
Quoted 12 lines
drivers/baseband/acc/rte_vrb_pmd.c +3
-5int descs_used;for (i =0 ; i < num; ++i) { - cbs_in_tb =get_num_cbs_in_tb_ldpc_enc (&ops[i]->ldpc_enc); -/* Check if there are available space for further processing. */ -if (unlikely ((avail - cbs_in_tb <0 ) || (cbs_in_tb ==0 ))) { -acc_enqueue_ring_full (q_data); -break ; +if (q->d->device_variant ==VRB1_VARIANT ) { + cbs_in_tb =get_num_cbs_in_tb_ldpc_enc (&ops[i]- ldpc_enc); +/* Check if there are available space for further processing. */
drivers/baseband/acc/rte_vrb_pmd.c vrb_enqueue_ldpc_enc_tb(struct rte_bbdev_queue_data *q_data,
Quoted 5 lines
drivers/baseband/acc/rte_vrb_pmd.c +5
-0+if (unlikely ((avail - cbs_in_tb <0 ) || (cbs_in_tb ==0 ))) { +acc_enqueue_ring_full (q_data); +break ; + } + descs_used = vrb1_enqueue_ldpc_enc_one_op_tb(q,ops[i],
drivers/baseband/acc/rte_vrb_pmd.c vrb_enqueue_ldpc_enc_tb(struct rte_bbdev_queue_data *q_data,
Quoted 7 lines
drivers/baseband/acc/rte_vrb_pmd.c +7
-0+ enqueued_descs, cbs_in_tb); + }else { +if (unlikely (avail <1 )) { +acc_enqueue_ring_full (q_data); +break ; + } + descs_used = vrb2_enqueue_ldpc_enc_one_op_tb(q,ops[i],
drivers/baseband/acc/rte_vrb_pmd.c vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw,
Quoted 4 lines
drivers/baseband/acc/rte_vrb_pmd.c +1
-2+enqueued_descs); } - - descs_used = vrb1_enqueue_ldpc_enc_one_op_tb(q, ops[i],
enqueued_descs,cbs_in_tb);drivers/baseband/acc/rte_vrb_pmd.c vrb_dequeue_enc_one_op_cb(struct acc_queue
Quoted 4 lines
drivers/baseband/acc/rte_vrb_pmd.c +0
-0if (descs_used <0 ) {acc_enqueue_invalid (q_data);break ;@@ -2865,6 +3102,51 @@ vrb_dequeue_enc_one_op_cb(struct acc_queue*q, struct
rte_bbdev_enc_op**ref_op,Quoted 53 lines
drivers/baseband/acc/rte_vrb_pmd.c +46
-0return desc->req.numCBs; } +/* Dequeue one LDPC encode operations from VRB2 device in TB mode. */ +static inline int vrb2_dequeue_ldpc_enc_one_op_tb (struct acc_queue +*q,struct rte_bbdev_enc_op **ref_op, +uint16_t *dequeued_ops,uint32_t *aq_dequeued, +uint16_t *dequeued_descs) +{ +union acc_dma_desc *desc, atom_desc; +union acc_dma_rsp_desc rsp; +struct rte_bbdev_enc_op *op; + + desc =acc_desc_tail (q, *dequeued_descs); + atom_desc.atom_hdr =__atomic_load_n ((uint64_t *)desc, +__ATOMIC_RELAXED); + +/* Check fdone bit. */ +if (!(atom_desc.rsp.val &ACC_FDONE )) +return -1 ; + + rsp.val = atom_desc.rsp.val; +rte_bbdev_log_debug ("Resp. desc %p: %x" , desc, rsp.val); + +/* Dequeue. */ + op = desc->req.op_addr; + +/* Clearing status, it will be set based on response. */ + op->status =0 ; + op->status |= rsp.input_err <<RTE_BBDEV_DATA_ERROR ; + op->status |= rsp.dma_err <<RTE_BBDEV_DRV_ERROR ; + op->status |= rsp.fcw_err <<RTE_BBDEV_DRV_ERROR ; + op->status |= rsp.engine_hung <<RTE_BBDEV_ENGINE_ERROR ; + +if (desc->req.last_desc_in_batch) { + (*aq_dequeued)++; + desc->req.last_desc_in_batch =0 ; + } + desc->rsp.val =ACC_DMA_DESC_TYPE ; + desc->rsp.add_info_0 =0 ;/* Reserved bits. */ + desc->rsp.add_info_1 =0 ;/* Reserved bits. */ + +/* One op was successfully dequeued */ + ref_op[0 ] = op; + (*dequeued_descs)++; + (*dequeued_ops)++; +return 1 ; +} +/* Dequeue one LDPC encode operations from device in TB mode. * That operation may cover multiple descriptors. */ drivers/baseband/acc/rte_vrb_pmd.c vrb_dequeue_ldpc_enc(struct · line 3193
Quoted 5 lines
drivers/baseband/acc/rte_vrb_pmd.c +0
-1@@ -3189,9 +3471,14 @@ vrb_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data, for (i = 0; i < avail; i++) {if (cbm ==RTE_BBDEV_TRANSPORT_BLOCK ) - ret = vrb_dequeue_enc_one_op_tb(q,&ops[dequeued_ops],
drivers/baseband/acc/rte_vrb_pmd.c vrb_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,
Quoted 4 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-2- &dequeued_ops, &aq_dequeued, - &dequeued_descs, num); +if (q->d->device_variant ==VRB1_VARIANT ) + ret = vrb_dequeue_enc_one_op_tb(q,&ops[dequeued_ops],
drivers/baseband/acc/rte_vrb_pmd.c vrb_dequeue_ldpc_enc(struct · line 3477
Quoted 1 line
drivers/baseband/acc/rte_vrb_pmd.c +1
-0+ &dequeued_ops,
&aq_dequeued,drivers/baseband/acc/rte_vrb_pmd.c vrb_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,
Quoted 3 lines
drivers/baseband/acc/rte_vrb_pmd.c +3
-0+ &dequeued_descs, num); + else + ret = vrb2_dequeue_ldpc_enc_one_op_tb(q,&ops[dequeued_ops],
drivers/baseband/acc/rte_vrb_pmd.c vrb_dequeue_ldpc_enc(struct · line 3481
Quoted 1 line
drivers/baseband/acc/rte_vrb_pmd.c +1
-0+ &dequeued_ops,
&aq_dequeued,drivers/baseband/acc/rte_vrb_pmd.c vrb_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,
Quoted 3 lines
drivers/baseband/acc/rte_vrb_pmd.c +1
-0+ &dequeued_descs); else ret = vrb_dequeue_enc_one_op_cb(q,&ops[dequeued_ops],
drivers/baseband/acc/rte_vrb_pmd.c vrb_bbdev_init(struct rte_bbdev *dev, struct
Quoted 2 lines
&dequeued_ops,&aq_dequeued,drivers/baseband/acc/rte_vrb_pmd.c +0
-0@@ -3526,7 +3813,6 @@ vrb_bbdev_init(struct rte_bbdev *dev, struct
rte_pci_driver*drv)drivers/baseband/acc/rte_vrb_pmd.c vrb_bbdev_init(struct rte_bbdev *dev, struct rte_pci_driver *drv) · line 3818
Quoted 7 lines
drivers/baseband/acc/rte_vrb_pmd.c +0
-1(pci_dev->id.device_id == RTE_VRB1_VF_DEVICE_ID)) { d->device_variant =VRB1_VARIANT ; d->queue_offset = vrb1_queue_offset; - d->fcw_ld_fill = vrb1_fcw_ld_fill; d->num_qgroups =VRB1_NUM_QGRPS ; d->num_aqs =VRB1_NUM_AQS ;if (d->pf_device)Thanks,
Maxime
Re: [PATCH v5 08/12] baseband/acc: add FEC capabilities for the VRB2 variant
In reply to Nicolas ChautruQuoted 542 lines · Nicolas Chautru
New implementation for some of the FEC features
specific to the VRB2 variant.Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc/rte_vrb_pmd.c | 370 +++++++++++++++++++++++++---- 1 file changed, 328 insertions(+), 42 deletions(-)drivers/baseband/acc/rte_vrb_pmd.c +328
-41@@ -1235,6 +1235,94 @@ vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) };static const struct rte_bbdev_op_cap vrb2_bbdev_capabilities[] = { + { + .type =RTE_BBDEV_OP_TURBO_DEC , + .cap.turbo_dec = { + .capability_flags = +RTE_BBDEV_TURBO_SUBBLOCK_DEINTERLEAVE | +RTE_BBDEV_TURBO_CRC_TYPE_24B | +RTE_BBDEV_TURBO_DEC_CRC_24B_DROP | +RTE_BBDEV_TURBO_EQUALIZER | +RTE_BBDEV_TURBO_SOFT_OUT_SATURATE | +RTE_BBDEV_TURBO_HALF_ITERATION_EVEN | +RTE_BBDEV_TURBO_CONTINUE_CRC_MATCH | +RTE_BBDEV_TURBO_SOFT_OUTPUT | +RTE_BBDEV_TURBO_EARLY_TERMINATION | +RTE_BBDEV_TURBO_DEC_INTERRUPTS | +RTE_BBDEV_TURBO_NEG_LLR_1_BIT_IN | +RTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT | +RTE_BBDEV_TURBO_MAP_DEC | +RTE_BBDEV_TURBO_DEC_TB_CRC_24B_KEEP | +RTE_BBDEV_TURBO_DEC_SCATTER_GATHER , + .max_llr_modulus =INT8_MAX , + .num_buffers_src = +RTE_BBDEV_TURBO_MAX_CODE_BLOCKS , + .num_buffers_hard_out = +RTE_BBDEV_TURBO_MAX_CODE_BLOCKS , + .num_buffers_soft_out = +RTE_BBDEV_TURBO_MAX_CODE_BLOCKS , + } + }, + { + .type =RTE_BBDEV_OP_TURBO_ENC , + .cap.turbo_enc = { + .capability_flags = +RTE_BBDEV_TURBO_CRC_24B_ATTACH | +RTE_BBDEV_TURBO_RV_INDEX_BYPASS | +RTE_BBDEV_TURBO_RATE_MATCH | +RTE_BBDEV_TURBO_ENC_INTERRUPTS | +RTE_BBDEV_TURBO_ENC_SCATTER_GATHER , + .num_buffers_src = +RTE_BBDEV_TURBO_MAX_CODE_BLOCKS , + .num_buffers_dst = +RTE_BBDEV_TURBO_MAX_CODE_BLOCKS , + } + }, + { + .type =RTE_BBDEV_OP_LDPC_ENC , + .cap.ldpc_enc = { + .capability_flags = +RTE_BBDEV_LDPC_RATE_MATCH | +RTE_BBDEV_LDPC_CRC_24B_ATTACH | +RTE_BBDEV_LDPC_INTERLEAVER_BYPASS | +RTE_BBDEV_LDPC_ENC_INTERRUPTS | +RTE_BBDEV_LDPC_ENC_SCATTER_GATHER | +RTE_BBDEV_LDPC_ENC_CONCATENATION , + .num_buffers_src = +RTE_BBDEV_LDPC_MAX_CODE_BLOCKS , + .num_buffers_dst = +RTE_BBDEV_LDPC_MAX_CODE_BLOCKS , + } + }, + { + .type =RTE_BBDEV_OP_LDPC_DEC , + .cap.ldpc_dec = { + .capability_flags = +RTE_BBDEV_LDPC_CRC_TYPE_24B_CHECK | +RTE_BBDEV_LDPC_CRC_TYPE_24B_DROP | +RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK | +RTE_BBDEV_LDPC_CRC_TYPE_16_CHECK | +RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE | +RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE | +RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE | +RTE_BBDEV_LDPC_DEINTERLEAVER_BYPASS | +RTE_BBDEV_LDPC_DEC_SCATTER_GATHER | +RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION | +RTE_BBDEV_LDPC_HARQ_4BIT_COMPRESSION | +RTE_BBDEV_LDPC_LLR_COMPRESSION | +RTE_BBDEV_LDPC_SOFT_OUT_ENABLE | +RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS | +RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS | +RTE_BBDEV_LDPC_DEC_INTERRUPTS , + .llr_size =8 , + .llr_decimals =2 , + .num_buffers_src = +RTE_BBDEV_LDPC_MAX_CODE_BLOCKS , + .num_buffers_hard_out = +RTE_BBDEV_LDPC_MAX_CODE_BLOCKS , + .num_buffers_soft_out =0 , + } + },RTE_BBDEV_END_OF_CAPABILITIES_LIST () };@@ -1419,8 +1507,8 @@ vrb_fcw_td_fill(const struct rte_bbdev_dec_op *op, struct acc_fcw_td *fcw)/* Fill in a frame control word for LDPC decoding. */ static inline void -vrb1_fcw_ld_fill (struct rte_bbdev_dec_op *op,struct acc_fcw_ld *fcw, -union acc_harq_layout_data *harq_layout) +vrb_fcw_ld_fill (struct rte_bbdev_dec_op *op,struct acc_fcw_ld *fcw, +union acc_harq_layout_data *harq_layout,uint16_t device_variant) {uint16_t harq_out_length, harq_in_length, ncb_p, k0_p, parity_offset;uint32_t harq_index;@@ -1466,18 +1554,26 @@ vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw, fcw->bypass_intlv =1 ; fcw->qm =2 ; } - fcw->hcin_decomp_mode =check_bit (op->ldpc_dec.op_flags, -RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); - fcw->hcout_comp_mode =check_bit (op->ldpc_dec.op_flags, -RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); +if (check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION )) { + fcw->hcin_decomp_mode =1 ; + fcw->hcout_comp_mode =1 ; + }else if (check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_HARQ_4BIT_COMPRESSION )) { + fcw->hcin_decomp_mode =4 ; + fcw->hcout_comp_mode =4 ; + }else { + fcw->hcin_decomp_mode =0 ; + fcw->hcout_comp_mode =0 ; + } + fcw->llr_pack_mode =check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_LLR_COMPRESSION ); harq_index =hq_index (op->ldpc_dec.harq_combined_output.offset); -if (fcw->hcin_en >0 ) { harq_in_length = op->ldpc_dec.harq_combined_input.length; -if (fcw->hcin_decomp_mode >0 ) +if (fcw->hcin_decomp_mode ==1 ) harq_in_length = harq_in_length *8 /6 ; +else if (fcw->hcin_decomp_mode ==4 ) + harq_in_length = harq_in_length *2 ; harq_in_length =RTE_MIN (harq_in_length, op->ldpc_dec.n_cb - op->ldpc_dec.n_filler); harq_in_length =RTE_ALIGN_CEIL (harq_in_length,64 );@@ -1491,20 +1587,27 @@ vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw, } fcw->itmax = op->ldpc_dec.iter_max; - fcw->itstop =check_bit (op->ldpc_dec.op_flags, -RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE ); + fcw->itstop =check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE ); fcw->cnu_algo =ACC_ALGO_MSA ; fcw->synd_precoder = fcw->itstop; + +if (device_variant !=VRB1_VARIANT ) { + fcw->so_it = op->ldpc_dec.iter_max; + fcw->so_en =check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_SOFT_OUT_ENABLE ); + fcw->so_bypass_intlv =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_SOFT_OUT_DEINTERLEAVER_BYPASS ); + fcw->so_bypass_rm =check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_SOFT_OUT_RM_BYPASS ); + fcw->minsum_offset =1 ; + fcw->dec_llrclip =2 ; + } +/* -* These are all implicitly set: +* These are all implicitly set * fcw->synd_post = 0; -* fcw->so_en = 0; -* fcw->so_bypass_rm = 0; -* fcw->so_bypass_intlv = 0; * fcw->dec_convllr = 0; * fcw->hcout_convllr = 0; * fcw->hcout_size1 = 0; -* fcw->so_it = 0; * fcw->hcout_offset = 0; * fcw->negstop_th = 0; * fcw->negstop_it = 0; @@ -1515,7 +1618,8 @@ vrb1_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw,if (fcw->hcout_en >0 ) { parity_offset = (op->ldpc_dec.basegraph ==1 ?20 :8 ) * op->ldpc_dec.z_c - op->ldpc_dec.n_filler; - k0_p = (fcw->k0 > parity_offset) ? fcw->k0 - op->ldpc_dec.n_filler : fcw->k0; + k0_p = (fcw->k0 > parity_offset) ? + fcw->k0 - op->ldpc_dec.n_filler : fcw->k0; ncb_p = fcw->ncb - op->ldpc_dec.n_filler; l = k0_p + fcw->rm_e; harq_out_length = (uint16_t ) fcw->hcin_size0;@@ -1658,19 +1762,28 @@ vrb_dma_desc_td_fill(struct rte_bbdev_dec_op *op, }static inline int -vrb1_dma_desc_ld_fill (struct rte_bbdev_dec_op *op, +vrb_dma_desc_ld_fill (struct rte_bbdev_dec_op *op,struct acc_dma_req_desc *desc,struct rte_mbuf **input,struct rte_mbuf *h_output,uint32_t *in_offset,uint32_t *h_out_offset,uint32_t *h_out_length,uint32_t *mbuf_total_left, -uint32_t *seg_total_left,struct acc_fcw_ld *fcw) +uint32_t *seg_total_left,struct acc_fcw_ld *fcw,uint16_t device_variant) {struct rte_bbdev_op_ldpc_dec *dec = &op->ldpc_dec;int next_triplet =1 ;/* FCW already done. */ uint32_t input_length;uint16_t output_length, crc24_overlap =0 ;uint16_t sys_cols,K , h_p_size, h_np_size; -bool h_comp =check_bit (dec->op_flags,RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION ); + +if (device_variant ==VRB1_VARIANT ) { +if (check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_HARQ_4BIT_COMPRESSION ) || +check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_SOFT_OUT_ENABLE )) { +rte_bbdev_log (ERR , +"VRB1 does not support the requested capabilities %x" , + op->ldpc_dec.op_flags); +return -1 ; + } + }acc_header_init (desc);@@ -1711,8 +1824,10 @@ vrb1_dma_desc_ld_fill(struct rte_bbdev_dec_op *op,return -1 ; } h_p_size = fcw->hcin_size0 + fcw->hcin_size1; -if (h_comp) +if (fcw->hcin_decomp_mode ==1 ) h_p_size = (h_p_size *3 +3 ) /4 ; +else if (fcw->hcin_decomp_mode ==4 ) + h_p_size = h_p_size /2 ;if (op->ldpc_dec.harq_combined_input.data ==0 ) {rte_bbdev_log (ERR ,"HARQ input is not defined" );return -1 ;@@ -1735,21 +1850,36 @@ vrb1_dma_desc_ld_fill(struct rte_bbdev_dec_op *op, *h_out_offset, output_length >>3 , next_triplet, ACC_DMA_BLKID_OUT_HARD); -if (check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE )) { +if (check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_SOFT_OUT_ENABLE )) { +if (op->ldpc_dec.soft_output.data ==0 ) { +rte_bbdev_log (ERR ,"Soft output is not defined" ); +return -1 ; + } + dec->soft_output.length = fcw->rm_e; +acc_dma_fill_blk_type (desc, dec->soft_output.data, dec->soft_output.offset, + fcw->rm_e, next_triplet,ACC_DMA_BLKID_OUT_SOFT ); + next_triplet++; + } + +if (check_bit (op->ldpc_dec.op_flags, +RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE )) {if (op->ldpc_dec.harq_combined_output.data ==0 ) {rte_bbdev_log (ERR ,"HARQ output is not defined" );return -1 ; } -/* Pruned size of the HARQ. */ +/* Pruned size of the HARQ */ h_p_size = fcw->hcout_size0 + fcw->hcout_size1; -/* Non-Pruned size of the HARQ. */ +/* Non-Pruned size of the HARQ */ h_np_size = fcw->hcout_offset >0 ? fcw->hcout_offset + fcw->hcout_size1 : h_p_size; -if (h_comp) { +if (fcw->hcin_decomp_mode ==1 ) { h_np_size = (h_np_size *3 +3 ) /4 ; h_p_size = (h_p_size *3 +3 ) /4 ; + }else if (fcw->hcin_decomp_mode ==4 ) { + h_np_size = h_np_size /2 ; + h_p_size = h_p_size /2 ; } dec->harq_combined_output.length = h_np_size; acc_dma_fill_blk_type(@@ -1877,6 +2007,7 @@ enqueue_ldpc_enc_n_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op **ops,/** This could be done at polling. */ acc_header_init (&desc->req); desc->req.numCBs = num; + desc->req.dltb =0 ; in_length_in_bytes = ops[0 ]->ldpc_enc.input.data->data_len; out_length = (enc->cb_params.e +7 ) >>3 ;@@ -2102,6 +2233,104 @@ vrb1_enqueue_ldpc_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *opreturn return_descs; } +/* Fill in a frame control word for LDPC encoding. */ +static inline void +vrb2_fcw_letb_fill (const struct rte_bbdev_enc_op *op,struct acc_fcw_le *fcw) +{ + fcw->qm = op->ldpc_enc.q_m; + fcw->nfiller = op->ldpc_enc.n_filler; + fcw->BG = (op->ldpc_enc.basegraph -1 ); + fcw->Zc = op->ldpc_enc.z_c; + fcw->ncb = op->ldpc_enc.n_cb; + fcw->k0 =get_k0 (fcw->ncb, fcw->Zc, op->ldpc_enc.basegraph, + op->ldpc_enc.rv_index); + fcw->rm_e = op->ldpc_enc.tb_params.ea; + fcw->rm_e_b = op->ldpc_enc.tb_params.eb; + fcw->crc_select =check_bit (op->ldpc_enc.op_flags, +RTE_BBDEV_LDPC_CRC_24B_ATTACH ); + fcw->bypass_intlv =0 ; +if (op->ldpc_enc.tb_params.c >1 ) { + fcw->mcb_count =0 ; + fcw->C = op->ldpc_enc.tb_params.c; + fcw->Cab = op->ldpc_enc.tb_params.cab; + }else { + fcw->mcb_count =1 ; + fcw->C =0 ; + } +} + +/* Enqueue one encode operations for device in TB mode. +* returns the number of descs used. +*/ +static inline int +vrb2_enqueue_ldpc_enc_one_op_tb (struct acc_queue *q,struct rte_bbdev_enc_op *op, +uint16_t enq_descs) +{ +union acc_dma_desc *desc =NULL ; +uint32_t in_offset, out_offset, out_length, seg_total_left; +struct rte_mbuf *input, *output_head, *output; +struct rte_bbdev_op_ldpc_enc *enc = &op->ldpc_enc; +int next_triplet =1 ;/* FCW already done. */ +uint32_t in_length_in_bytes; +uint16_t K , in_length_in_bits; + + desc =acc_desc (q, enq_descs); +vrb2_fcw_letb_fill (op, &desc->req.fcw_le); + + input = enc->input.data; + output_head = output = enc->output.data; + in_offset = enc->input.offset; + out_offset = enc->output.offset; + seg_total_left =rte_pktmbuf_data_len (enc->input.data) - in_offset; + +acc_header_init (&desc->req); +K = (enc->basegraph ==1 ?22 :10 ) * enc->z_c; + in_length_in_bits =K - enc->n_filler; +if ((enc->op_flags &RTE_BBDEV_LDPC_CRC_24A_ATTACH ) || + (enc->op_flags &RTE_BBDEV_LDPC_CRC_24B_ATTACH )) + in_length_in_bits -=24 ; + in_length_in_bytes = (in_length_in_bits >>3 ) * enc->tb_params.c; + + next_triplet =acc_dma_fill_blk_type_in (&desc->req, &input, &in_offset, + in_length_in_bytes, &seg_total_left, next_triplet, +check_bit (enc->op_flags,RTE_BBDEV_LDPC_ENC_SCATTER_GATHER )); +if (unlikely (next_triplet <0 )) { +rte_bbdev_log (ERR , +"Mismatch between data to process and mbuf data length in bbdev_op: %p" , + op); +return -1 ; + } + desc->req.data_ptrs[next_triplet -1 ].last =1 ; + desc->req.m2dlen = next_triplet; + +/* Set output length */ +/* Integer round up division by 8 */ + out_length = (enc->tb_params.ea * enc->tb_params.cab + + enc->tb_params.eb * (enc->tb_params.c - enc->tb_params.cab) +7 ) >>3 ; + + next_triplet =acc_dma_fill_blk_type (&desc->req, output, out_offset, + out_length, next_triplet,ACC_DMA_BLKID_OUT_ENC ); + enc->output.length = out_length; + out_offset += out_length; + desc->req.data_ptrs[next_triplet -1 ].last =1 ; + desc->req.data_ptrs[next_triplet -1 ].dma_ext =0 ; + desc->req.d2mlen = next_triplet - desc->req.m2dlen; + desc->req.numCBs = enc->tb_params.c; +if (desc->req.numCBs >1 ) + desc->req.dltb =1 ; + desc->req.op_addr = op; + +if (out_length <ACC_MAX_E_MBUF ) +mbuf_append (output_head, output, out_length); + +#ifdef RTE_LIBRTE_BBDEV_DEBUG +rte_memdump (stderr,"FCW" , &desc->req.fcw_le,sizeof (desc->req.fcw_le)); +rte_memdump (stderr,"Req Desc." , desc,sizeof (*desc)); +#endif +/* One CB (one op) was successfully prepared to enqueue */ +return 1 ; +} +/** Enqueue one decode operations for device in CB mode. */ static inline int enqueue_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,@@ -2206,7 +2435,7 @@ vrb_enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,struct acc_fcw_ld *fcw;uint32_t seg_total_left; fcw = &desc->req.fcw_ld; - q->d->fcw_ld_fill (op, fcw, harq_layout); +vrb_fcw_ld_fill (op, fcw, harq_layout, q->d->device_variant);/* Special handling when using mbuf or not. */ if (check_bit(op->ldpc_dec.op_flags,@@ -2215,10 +2444,10 @@ vrb_enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,else seg_total_left = fcw->rm_e; - ret =vrb1_dma_desc_ld_fill (op, &desc->req, &input, h_output, + ret =vrb_dma_desc_ld_fill (op, &desc->req, &input, h_output, &in_offset, &h_out_offset, &h_out_length, &mbuf_total_left, - &seg_total_left, fcw); + &seg_total_left, fcw, q->d->device_variant);if (unlikely (ret <0 ))return ret; }@@ -2275,7 +2504,8 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, desc_first = desc; fcw_offset = (desc_idx <<8 ) +ACC_DESC_FCW_OFFSET ; harq_layout = q->d->harq_layout; - q->d->fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout); + +vrb_fcw_ld_fill (op, &desc->req.fcw_ld, harq_layout, q->d->device_variant); input = op->ldpc_dec.input.data; h_output_head = h_output = op->ldpc_dec.hard_output.data;@@ -2307,12 +2537,11 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op, desc->req.data_ptrs[0 ].blen =ACC_FCW_LD_BLEN ;rte_memcpy (&desc->req.fcw_ld, &desc_first->req.fcw_ld,ACC_FCW_LD_BLEN ); desc->req.fcw_ld.tb_trailer_size = (c - r -1 ) * trail_len; - - ret =vrb1_dma_desc_ld_fill (op, &desc->req, &input, + ret =vrb_dma_desc_ld_fill (op, &desc->req, &input, h_output, &in_offset, &h_out_offset, &h_out_length, &mbuf_total_left, &seg_total_left, - &desc->req.fcw_ld); + &desc->req.fcw_ld, q->d->device_variant);if (unlikely (ret <0 ))return ret;@@ -2576,14 +2805,22 @@ vrb_enqueue_ldpc_enc_tb(struct rte_bbdev_queue_data *q_data,int descs_used;for (i =0 ; i < num; ++i) { - cbs_in_tb =get_num_cbs_in_tb_ldpc_enc (&ops[i]->ldpc_enc); -/* Check if there are available space for further processing. */ -if (unlikely ((avail - cbs_in_tb <0 ) || (cbs_in_tb ==0 ))) { -acc_enqueue_ring_full (q_data); -break ; +if (q->d->device_variant ==VRB1_VARIANT ) { + cbs_in_tb =get_num_cbs_in_tb_ldpc_enc (&ops[i]->ldpc_enc); +/* Check if there are available space for further processing. */ +if (unlikely ((avail - cbs_in_tb <0 ) || (cbs_in_tb ==0 ))) { +acc_enqueue_ring_full (q_data); +break ; + } + descs_used =vrb1_enqueue_ldpc_enc_one_op_tb (q, ops[i], + enqueued_descs, cbs_in_tb); + }else { +if (unlikely (avail <1 )) { +acc_enqueue_ring_full (q_data); +break ; + } + descs_used =vrb2_enqueue_ldpc_enc_one_op_tb (q, ops[i], enqueued_descs); } - - descs_used =vrb1_enqueue_ldpc_enc_one_op_tb (q, ops[i], enqueued_descs, cbs_in_tb);if (descs_used <0 ) {acc_enqueue_invalid (q_data);break ;@@ -2865,6 +3102,51 @@ vrb_dequeue_enc_one_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,return desc->req.numCBs; } +/* Dequeue one LDPC encode operations from VRB2 device in TB mode. */ +static inline int +vrb2_dequeue_ldpc_enc_one_op_tb (struct acc_queue *q,struct rte_bbdev_enc_op **ref_op, +uint16_t *dequeued_ops,uint32_t *aq_dequeued, +uint16_t *dequeued_descs) +{ +union acc_dma_desc *desc, atom_desc; +union acc_dma_rsp_desc rsp; +struct rte_bbdev_enc_op *op; + + desc =acc_desc_tail (q, *dequeued_descs); + atom_desc.atom_hdr =__atomic_load_n ((uint64_t *)desc, __ATOMIC_RELAXED); + +/* Check fdone bit. */ +if (!(atom_desc.rsp.val &ACC_FDONE )) +return -1 ; + + rsp.val = atom_desc.rsp.val; +rte_bbdev_log_debug ("Resp. desc %p: %x" , desc, rsp.val); + +/* Dequeue. */ + op = desc->req.op_addr; + +/* Clearing status, it will be set based on response. */ + op->status =0 ; + op->status |= rsp.input_err <<RTE_BBDEV_DATA_ERROR ; + op->status |= rsp.dma_err <<RTE_BBDEV_DRV_ERROR ; + op->status |= rsp.fcw_err <<RTE_BBDEV_DRV_ERROR ; + op->status |= rsp.engine_hung <<RTE_BBDEV_ENGINE_ERROR ; + +if (desc->req.last_desc_in_batch) { + (*aq_dequeued)++; + desc->req.last_desc_in_batch =0 ; + } + desc->rsp.val =ACC_DMA_DESC_TYPE ; + desc->rsp.add_info_0 =0 ;/* Reserved bits. */ + desc->rsp.add_info_1 =0 ;/* Reserved bits. */ + +/* One op was successfully dequeued */ + ref_op[0 ] = op; + (*dequeued_descs)++; + (*dequeued_ops)++; +return 1 ; +} +/* Dequeue one LDPC encode operations from device in TB mode. * That operation may cover multiple descriptors. */ @@ -3189,9 +3471,14 @@ vrb_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,for (i =0 ; i < avail; i++) {if (cbm ==RTE_BBDEV_TRANSPORT_BLOCK ) - ret =vrb_dequeue_enc_one_op_tb (q, &ops[dequeued_ops], - &dequeued_ops, &aq_dequeued, - &dequeued_descs, num); +if (q->d->device_variant ==VRB1_VARIANT ) + ret =vrb_dequeue_enc_one_op_tb (q, &ops[dequeued_ops], + &dequeued_ops, &aq_dequeued, + &dequeued_descs, num); +else + ret =vrb2_dequeue_ldpc_enc_one_op_tb (q, &ops[dequeued_ops], + &dequeued_ops, &aq_dequeued, + &dequeued_descs);else ret = vrb_dequeue_enc_one_op_cb(q, &ops[dequeued_ops], &dequeued_ops, &aq_dequeued,
drivers/baseband/acc/rte_vrb_pmd.c vrb_bbdev_init(struct rte_bbdev *dev, struct rte_pci_driver *drv) · line 3818
Quoted 7 lines
drivers/baseband/acc/rte_vrb_pmd.c +0
-1@@ -3526,7 +3813,6 @@ vrb_bbdev_init(struct rte_bbdev *dev, struct rte_pci_driver *drv) (pci_dev->id.device_id == RTE_VRB1_VF_DEVICE_ID)) { d->device_variant =VRB1_VARIANT ; d->queue_offset = vrb1_queue_offset; - d->fcw_ld_fill = vrb1_fcw_ld_fill; d->num_qgroups =VRB1_NUM_QGRPS ; d->num_aqs =VRB1_NUM_AQS ;if (d->pf_device)
PATCH v5 9/12 baseband/acc: add FFT support to VRB2 variant
In reply to Nicolas ChautruSupport for the FFT the processing specific to the VRB2 variant.
--- drivers/baseband/acc/rte_vrb_pmd.c | 146 +++++++++++++++++++++++------ 1 file changed, 119 insertions(+), 27 deletions(-)
drivers/baseband/acc/rte_vrb_pmd.c +119 -27
@@ -902,6 +902,9 @@ vrb_queue_setup(struct rte_bbdev *dev, uint16_t queue_id, ACC_FCW_LD_BLEN : (conf->op_type ==RTE_BBDEV_OP_FFT ? ACC_FCW_FFT_BLEN : ACC_FCW_MLDTS_BLEN)))); +if ((q->d->device_variant ==VRB2_VARIANT ) && (conf->op_type ==RTE_BBDEV_OP_FFT )) + fcw_len =ACC_FCW_FFT_BLEN_3 ; +for (desc_idx =0 ; desc_idx < d->sw_ring_max_depth; desc_idx++) { desc = q->ring_addr + desc_idx; desc->req.word0 =ACC_DMA_DESC_TYPE ;
@@ -1224,10 +1227,8 @@ vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info)RTE_BBDEV_FFT_DFT_BYPASS |RTE_BBDEV_FFT_IDFT_BYPASS | RTE_BBDEV_FFT_WINDOWING_BYPASS, - .num_buffers_src = - RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, - .num_buffers_dst = - RTE_BBDEV_LDPC_MAX_CODE_BLOCKS, + .num_buffers_src = 1, + .num_buffers_dst = 1, .fft_windows_num = ACC_MAX_FFT_WIN, } },
@@ -1323,6 +1324,23 @@ vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) .num_buffers_soft_out = 0, } }, + { + .type = RTE_BBDEV_OP_FFT, + .cap.fft = { + .capability_flags = +RTE_BBDEV_FFT_WINDOWING | +RTE_BBDEV_FFT_CS_ADJUSTMENT | +RTE_BBDEV_FFT_DFT_BYPASS | +RTE_BBDEV_FFT_IDFT_BYPASS | +RTE_BBDEV_FFT_FP16_INPUT | +RTE_BBDEV_FFT_FP16_OUTPUT | +RTE_BBDEV_FFT_POWER_MEAS | + RTE_BBDEV_FFT_WINDOWING_BYPASS, + .num_buffers_src = 1, + .num_buffers_dst = 1, + .fft_windows_num =ACC_MAX_FFT_WIN , + } + }, RTE_BBDEV_END_OF_CAPABILITIES_LIST() };
@@ -3608,62 +3626,136 @@ vrb1_fcw_fft_fill(struct rte_bbdev_fft_op *op, struct acc_fcw_fft *fcw) fcw->bypass =0 ; } +/* Fill in a frame control word for FFT processing. */ +static inline void +vrb2_fcw_fft_fill (struct rte_bbdev_fft_op *op,struct acc_fcw_fft_3 *fcw) +{ + fcw->in_frame_size = op->fft.input_sequence_size; + fcw->leading_pad_size = op->fft.input_leading_padding; + fcw->out_frame_size = op->fft.output_sequence_size; + fcw->leading_depad_size = op->fft.output_leading_depadding; + fcw->cs_window_sel = op->fft.window_index[0 ] + + (op->fft.window_index[1 ] <<8 ) + + (op->fft.window_index[2 ] <<16 ) + + (op->fft.window_index[3 ] <<24 ); + fcw->cs_window_sel2 = op->fft.window_index[4 ] + + (op->fft.window_index[5 ] <<8 ); + fcw->cs_enable_bmap = op->fft.cs_bitmap; + fcw->num_antennas = op->fft.num_antennas_log2; + fcw->idft_size = op->fft.idft_log2; + fcw->dft_size = op->fft.dft_log2; + fcw->cs_offset = op->fft.cs_time_adjustment; + fcw->idft_shift = op->fft.idft_shift; + fcw->dft_shift = op->fft.dft_shift; + fcw->cs_multiplier = op->fft.ncs_reciprocal; + fcw->power_shift = op->fft.power_shift; + fcw->exp_adj = op->fft.fp16_exp_adjust; + fcw->fp16_in =check_bit (op->fft.op_flags,RTE_BBDEV_FFT_FP16_INPUT ); + fcw->fp16_out =check_bit (op->fft.op_flags,RTE_BBDEV_FFT_FP16_OUTPUT ); + fcw->power_en =check_bit (op->fft.op_flags,RTE_BBDEV_FFT_POWER_MEAS ); +if (check_bit (op->fft.op_flags, +RTE_BBDEV_FFT_IDFT_BYPASS )) { +if (check_bit (op->fft.op_flags, +RTE_BBDEV_FFT_WINDOWING_BYPASS )) + fcw->bypass =2 ; +else + fcw->bypass =1 ; + }else if (check_bit (op->fft.op_flags, +RTE_BBDEV_FFT_DFT_BYPASS )) + fcw->bypass =3 ; +else + fcw->bypass =0 ; +} +static inline int -vrb1_dma_desc_fft_fill (struct rte_bbdev_fft_op *op, +vrb_dma_desc_fft_fill (struct rte_bbdev_fft_op *op,struct acc_dma_req_desc *desc, -struct rte_mbuf *input,struct rte_mbuf *output, -uint32_t *in_offset,uint32_t *out_offset) +struct rte_mbuf *input,struct rte_mbuf *output,struct rte_mbuf *win_input, +struct rte_mbuf *pwr,uint32_t *in_offset,uint32_t *out_offset, +uint32_t *win_offset,uint32_t *pwr_offset,uint16_t device_variant) { -/* FCW already done. */ +bool pwr_en =check_bit (op->fft.op_flags,RTE_BBDEV_FFT_POWER_MEAS ); +bool win_en =check_bit (op->fft.op_flags,RTE_BBDEV_FFT_DEWINDOWING ); +int num_cs =0 , i, bd_idx =1 ; + +if (device_variant ==VRB1_VARIANT ) { +/* Force unsupported descriptor format out. */ + pwr_en =0 ; + win_en =0 ; + } + +/* FCW already done */ acc_header_init (desc); - desc->data_ptrs[1 ].address =rte_pktmbuf_iova_offset (input, *in_offset); - desc->data_ptrs[1 ].blen = op->fft.input_sequence_size *4 ; - desc->data_ptrs[1 ].blkid =ACC_DMA_BLKID_IN ; - desc->data_ptrs[1 ].last =1 ; - desc->data_ptrs[1 ].dma_ext =0 ; - desc->data_ptrs[2 ].address =rte_pktmbuf_iova_offset (output, *out_offset); - desc->data_ptrs[2 ].blen = op->fft.output_sequence_size *4 ; - desc->data_ptrs[2 ].blkid =ACC_DMA_BLKID_OUT_HARD ; - desc->data_ptrs[2 ].last =1 ; - desc->data_ptrs[2 ].dma_ext =0 ; - desc->m2dlen =2 ; - desc->d2mlen =1 ; + +RTE_SET_USED (win_input); +RTE_SET_USED (win_offset); + + desc->data_ptrs[bd_idx].address =rte_pktmbuf_iova_offset (input, *in_offset); + desc->data_ptrs[bd_idx].blen = op->fft.input_sequence_size *ACC_IQ_SIZE ; + desc->data_ptrs[bd_idx].blkid =ACC_DMA_BLKID_IN ; + desc->data_ptrs[bd_idx].last =1 ; + desc->data_ptrs[bd_idx].dma_ext =0 ; + bd_idx++; + + desc->data_ptrs[bd_idx].address =rte_pktmbuf_iova_offset (output, *out_offset); + desc->data_ptrs[bd_idx].blen = op->fft.output_sequence_size *ACC_IQ_SIZE ; + desc->data_ptrs[bd_idx].blkid =ACC_DMA_BLKID_OUT_HARD ; + desc->data_ptrs[bd_idx].last = pwr_en ?0 :1 ; + desc->data_ptrs[bd_idx].dma_ext =0 ; + desc->m2dlen = win_en ?3 :2 ; + desc->d2mlen = pwr_en ?2 :1 ; desc->ib_ant_offset = op->fft.input_sequence_size; desc->num_ant = op->fft.num_antennas_log2 -3 ; -int num_cs =0 , i; -for (i =0 ; i <12 ; i++) + +for (i =0 ; i <RTE_BBDEV_MAX_CS ; i++)if (check_bit (op->fft.cs_bitmap,1 << i)) num_cs++; desc->num_cs = num_cs; + +if (pwr_en && pwr) { + bd_idx++; + desc->data_ptrs[bd_idx].address =rte_pktmbuf_iova_offset (pwr, *pwr_offset); + desc->data_ptrs[bd_idx].blen = num_cs * (1 << op->fft.num_antennas_log2) *4 ; + desc->data_ptrs[bd_idx].blkid =ACC_DMA_BLKID_OUT_SOFT ; + desc->data_ptrs[bd_idx].last =1 ; + desc->data_ptrs[bd_idx].dma_ext =0 ; + } desc->ob_cyc_offset = op->fft.output_sequence_size; desc->ob_ant_offset = op->fft.output_sequence_size * num_cs; desc->op_addr = op;return 0 ; } -/** Enqueue one FFT operation for device. */ static inline int vrb_enqueue_fft_one_op (struct acc_queue *q,struct rte_bbdev_fft_op *op,uint16_t total_enqueued_cbs) {union acc_dma_desc *desc; -struct rte_mbuf *input, *output; -uint32_t in_offset, out_offset; +struct rte_mbuf *input, *output, *pwr, *win; +uint32_t in_offset, out_offset, pwr_offset, win_offset;struct acc_fcw_fft *fcw; desc =acc_desc (q, total_enqueued_cbs); input = op->fft.base_input.data; output = op->fft.base_output.data; + pwr = op->fft.power_meas_output.data; + win = op->fft.dewindowing_input.data; in_offset = op->fft.base_input.offset; out_offset = op->fft.base_output.offset; + pwr_offset = op->fft.power_meas_output.offset; + win_offset = op->fft.dewindowing_input.offset; fcw = (struct acc_fcw_fft *) (q->fcw_ring + ((q->sw_ring_head + total_enqueued_cbs) & q->sw_ring_wrap_mask) *ACC_MAX_FCW_SIZE ); -vrb1_fcw_fft_fill (op, fcw); -vrb1_dma_desc_fft_fill (op, &desc->req, input, output, &in_offset, &out_offset); +if (q->d->device_variant ==VRB1_VARIANT ) +vrb1_fcw_fft_fill (op, fcw); +else +vrb2_fcw_fft_fill (op, (struct acc_fcw_fft_3 *) fcw); +vrb_dma_desc_fft_fill (op, &desc->req, input, output, win, pwr, + &in_offset, &out_offset, &win_offset, &pwr_offset, q->d->device_variant);#ifdef RTE_LIBRTE_BBDEV_DEBUG rte_memdump (stderr,"FCW" , &desc->req.fcw_fft,sizeof (desc->req.fcw_fft));
Signature · 1 line
2.34.1
Re: [PATCH v5 09/12] baseband/acc: add FFT support to VRB2 variant
Quoted 8 lines · Nicolas Chautru
Support for the FFT the processing specific to the VRB2 variant.
Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc/rte_vrb_pmd.c | 146 +++++++++++++++++++++++------ 1 file changed, 119 insertions(+), 27 deletions(-)
Maxime
PATCH v5 10/12 baseband/acc: add MLD support in VRB2 variant
In reply to Nicolas ChautruAdding the capability for the MLD-TS processing specific to the VRB2 variant.
--- drivers/baseband/acc/rte_vrb_pmd.c | 374 +++++++++++++++++++++++++++++ 1 file changed, 374 insertions(+)
drivers/baseband/acc/rte_vrb_pmd.c +374 -0
@@ -1341,6 +1341,17 @@ vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) .fft_windows_num = ACC_MAX_FFT_WIN, } }, + { + .type = RTE_BBDEV_OP_MLDTS, + .cap.mld = { + .capability_flags = + RTE_BBDEV_MLDTS_REP, + .num_buffers_src = + 1, + .num_buffers_dst = + 1, + } + },RTE_BBDEV_END_OF_CAPABILITIES_LIST () };
@@ -3878,6 +3889,367 @@ vrb_dequeue_fft(struct rte_bbdev_queue_data *q_data,return i; } +/* Fill in a frame control word for MLD-TS processing. */ +static inline void +vrb2_fcw_mldts_fill (struct rte_bbdev_mldts_op *op,struct acc_fcw_mldts *fcw) +{ + fcw->nrb = op->mldts.num_rbs; + fcw->NLayers = op->mldts.num_layers -1 ; + fcw->Qmod0 = (op->mldts.q_m[0 ] >>1 ) -1 ; + fcw->Qmod1 = (op->mldts.q_m[1 ] >>1 ) -1 ; + fcw->Qmod2 = (op->mldts.q_m[2 ] >>1 ) -1 ; + fcw->Qmod3 = (op->mldts.q_m[3 ] >>1 ) -1 ; +/* Mark some layers as disabled */ +if (op->mldts.num_layers ==2 ) { + fcw->Qmod2 =3 ; + fcw->Qmod3 =3 ; + } +if (op->mldts.num_layers ==3 ) + fcw->Qmod3 =3 ; + fcw->Rrep = op->mldts.r_rep; + fcw->Crep = op->mldts.c_rep; +} + +/* Fill in descriptor for one MLD-TS processing operation. */ +static inline int +vrb2_dma_desc_mldts_fill (struct rte_bbdev_mldts_op *op, +struct acc_dma_req_desc *desc, +struct rte_mbuf *input_q,struct rte_mbuf *input_r, +struct rte_mbuf *output, +uint32_t *in_offset,uint32_t *out_offset) +{ +uint16_t qsize_per_re[VRB2_MLD_LAY_SIZE ] = {8 ,12 ,16 };/* Layer 2 to 4. */ +uint16_t rsize_per_re[VRB2_MLD_LAY_SIZE ] = {14 ,26 ,42 }; +uint16_t sc_factor_per_rrep[VRB2_MLD_RREP_SIZE ] = {12 ,6 ,4 ,3 ,0 ,2 }; +uint16_t i, outsize_per_re =0 ; +uint32_t sc_num, r_num, q_size, r_size, out_size; + +/* Prevent out of range access. */ +if (op->mldts.r_rep >5 ) + op->mldts.r_rep =5 ; +if (op->mldts.num_layers <2 ) + op->mldts.num_layers =2 ; +if (op->mldts.num_layers >4 ) + op->mldts.num_layers =4 ; +for (i =0 ; i < op->mldts.num_layers; i++) + outsize_per_re += op->mldts.q_m[i]; + sc_num = op->mldts.num_rbs *RTE_BBDEV_SCPERRB * (op->mldts.c_rep +1 ); + r_num = op->mldts.num_rbs * sc_factor_per_rrep[op->mldts.r_rep]; + q_size = qsize_per_re[op->mldts.num_layers -2 ] * sc_num; + r_size = rsize_per_re[op->mldts.num_layers -2 ] * r_num; + out_size = sc_num * outsize_per_re; + +/* FCW already done. */ +acc_header_init (desc); + desc->data_ptrs[1 ].address =rte_pktmbuf_iova_offset (input_q, *in_offset); + desc->data_ptrs[1 ].blen = q_size; + desc->data_ptrs[1 ].blkid =ACC_DMA_BLKID_IN ; + desc->data_ptrs[1 ].last =0 ; + desc->data_ptrs[1 ].dma_ext =0 ; + desc->data_ptrs[2 ].address =rte_pktmbuf_iova_offset (input_r, *in_offset); + desc->data_ptrs[2 ].blen = r_size; + desc->data_ptrs[2 ].blkid =ACC_DMA_BLKID_IN_MLD_R ; + desc->data_ptrs[2 ].last =1 ; + desc->data_ptrs[2 ].dma_ext =0 ; + desc->data_ptrs[3 ].address =rte_pktmbuf_iova_offset (output, *out_offset); + desc->data_ptrs[3 ].blen = out_size; + desc->data_ptrs[3 ].blkid =ACC_DMA_BLKID_OUT_HARD ; + desc->data_ptrs[3 ].last =1 ; + desc->data_ptrs[3 ].dma_ext =0 ; + desc->m2dlen =3 ; + desc->d2mlen =1 ; + desc->op_addr = op; + desc->cbs_in_tb =1 ; + +return 0 ; +} + +/* Check whether the MLD operation can be processed as a single operation. */ +static inline bool +vrb2_check_mld_r_constraint (struct rte_bbdev_mldts_op *op) { +uint8_t layer_idx, rrep_idx; +uint16_t max_rb[VRB2_MLD_LAY_SIZE ][VRB2_MLD_RREP_SIZE ] = { + {188 ,275 ,275 ,275 ,0 ,275 }, + {101 ,202 ,275 ,275 ,0 ,275 }, + {62 ,124 ,186 ,248 ,0 ,275 } }; + +if (op->mldts.c_rep ==0 ) +return true; + + layer_idx =RTE_MIN (op->mldts.num_layers -VRB2_MLD_MIN_LAYER , +VRB2_MLD_MAX_LAYER -VRB2_MLD_MIN_LAYER ); + rrep_idx =RTE_MIN (op->mldts.r_rep,VRB2_MLD_MAX_RREP ); +rte_bbdev_log_debug ("RB %d index %d %d max %d\n" , op->mldts.num_rbs, layer_idx, rrep_idx, + max_rb[layer_idx][rrep_idx]); + +return (op->mldts.num_rbs <= max_rb[layer_idx][rrep_idx]); +} + +/** Enqueue MLDTS operation split across symbols. */ +static inline int +enqueue_mldts_split_op (struct acc_queue *q,struct rte_bbdev_mldts_op *op, +uint16_t total_enqueued_descs) +{ +uint16_t qsize_per_re[VRB2_MLD_LAY_SIZE ] = {8 ,12 ,16 };/* Layer 2 to 4. */ +uint16_t rsize_per_re[VRB2_MLD_LAY_SIZE ] = {14 ,26 ,42 }; +uint16_t sc_factor_per_rrep[VRB2_MLD_RREP_SIZE ] = {12 ,6 ,4 ,3 ,0 ,2 }; +uint32_t i, outsize_per_re =0 , sc_num, r_num, q_size, r_size, out_size, num_syms; +union acc_dma_desc *desc, *first_desc; +uint16_t desc_idx, symb; +struct rte_mbuf *input_q, *input_r, *output; +uint32_t in_offset, out_offset; +struct acc_fcw_mldts *fcw; + + desc_idx =acc_desc_idx (q, total_enqueued_descs); + first_desc = q->ring_addr + desc_idx; + input_q = op->mldts.qhy_input.data; + input_r = op->mldts.r_input.data; + output = op->mldts.output.data; + in_offset = op->mldts.qhy_input.offset; + out_offset = op->mldts.output.offset; + num_syms = op->mldts.c_rep +1 ; + fcw = &first_desc->req.fcw_mldts; +vrb2_fcw_mldts_fill (op, fcw); + fcw->Crep =0 ;/* C rep forced to zero. */ + +/* Prevent out of range access. */ +if (op->mldts.r_rep >5 ) + op->mldts.r_rep =5 ; +if (op->mldts.num_layers <2 ) + op->mldts.num_layers =2 ; +if (op->mldts.num_layers >4 ) + op->mldts.num_layers =4 ; + +for (i =0 ; i < op->mldts.num_layers; i++) + outsize_per_re += op->mldts.q_m[i]; + sc_num = op->mldts.num_rbs *RTE_BBDEV_SCPERRB ;/* C rep forced to zero. */ + r_num = op->mldts.num_rbs * sc_factor_per_rrep[op->mldts.r_rep]; + q_size = qsize_per_re[op->mldts.num_layers -2 ] * sc_num; + r_size = rsize_per_re[op->mldts.num_layers -2 ] * r_num; + out_size = sc_num * outsize_per_re; + +for (symb =0 ; symb < num_syms; symb++) { + desc_idx = ((q->sw_ring_head + total_enqueued_descs + symb) & q->sw_ring_wrap_mask); + desc = q->ring_addr + desc_idx; +acc_header_init (&desc->req); +if (symb ==0 ) + desc->req.cbs_in_tb = num_syms; +else +rte_memcpy (&desc->req.fcw_mldts, fcw,ACC_FCW_MLDTS_BLEN ); + desc->req.data_ptrs[1 ].address =rte_pktmbuf_iova_offset (input_q, in_offset); + desc->req.data_ptrs[1 ].blen = q_size; + in_offset += q_size; + desc->req.data_ptrs[1 ].blkid =ACC_DMA_BLKID_IN ; + desc->req.data_ptrs[1 ].last =0 ; + desc->req.data_ptrs[1 ].dma_ext =0 ; + desc->req.data_ptrs[2 ].address =rte_pktmbuf_iova_offset (input_r,0 ); + desc->req.data_ptrs[2 ].blen = r_size; + desc->req.data_ptrs[2 ].blkid =ACC_DMA_BLKID_IN_MLD_R ; + desc->req.data_ptrs[2 ].last =1 ; + desc->req.data_ptrs[2 ].dma_ext =0 ; + desc->req.data_ptrs[3 ].address =rte_pktmbuf_iova_offset (output, out_offset); + desc->req.data_ptrs[3 ].blen = out_size; + out_offset += out_size; + desc->req.data_ptrs[3 ].blkid =ACC_DMA_BLKID_OUT_HARD ; + desc->req.data_ptrs[3 ].last =1 ; + desc->req.data_ptrs[3 ].dma_ext =0 ; + desc->req.m2dlen =VRB2_MLD_M2DLEN ; + desc->req.d2mlen =1 ; + desc->req.op_addr = op; + +#ifdef RTE_LIBRTE_BBDEV_DEBUG +rte_memdump (stderr,"FCW" , &desc->req.fcw_mldts,sizeof (desc->req.fcw_mldts)); +rte_memdump (stderr,"Req Desc." , desc,sizeof (*desc)); +#endif + } + desc->req.sdone_enable =0 ; + +return num_syms; +} + +/** Enqueue one MLDTS operation. */ +static inline int +enqueue_mldts_one_op (struct acc_queue *q,struct rte_bbdev_mldts_op *op, +uint16_t total_enqueued_descs) +{ +union acc_dma_desc *desc; +struct rte_mbuf *input_q, *input_r, *output; +uint32_t in_offset, out_offset; +struct acc_fcw_mldts *fcw; + + desc =acc_desc (q, total_enqueued_descs); + input_q = op->mldts.qhy_input.data; + input_r = op->mldts.r_input.data; + output = op->mldts.output.data; + in_offset = op->mldts.qhy_input.offset; + out_offset = op->mldts.output.offset; + fcw = &desc->req.fcw_mldts; +vrb2_fcw_mldts_fill (op, fcw); +vrb2_dma_desc_mldts_fill (op, &desc->req, input_q, input_r, output, + &in_offset, &out_offset); +#ifdef RTE_LIBRTE_BBDEV_DEBUG +rte_memdump (stderr,"FCW" , &desc->req.fcw_mldts,sizeof (desc->req.fcw_mldts)); +rte_memdump (stderr,"Req Desc." , desc,sizeof (*desc)); +#endif +return 1 ; +} + +/* Enqueue MLDTS operations. */ +static uint16_t +vrb2_enqueue_mldts (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_mldts_op **ops,uint16_t num) +{ +int32_t aq_avail, avail; +struct acc_queue *q = q_data->queue_private; +uint16_t i, enqueued_descs =0 , descs_in_op; +int ret; +bool as_one_op; + + aq_avail =acc_aq_avail (q_data, num); +if (unlikely ((aq_avail <=0 ) || (num ==0 ))) +return 0 ; + avail =acc_ring_avail_enq (q); + +for (i =0 ; i < num; ++i) { + as_one_op =vrb2_check_mld_r_constraint (ops[i]); + descs_in_op = as_one_op ?1 : ops[i]->mldts.c_rep +1 ; + +/* Check if there are available space for further processing. */ +if (unlikely (avail < descs_in_op)) { +acc_enqueue_ring_full (q_data); +break ; + } + avail -= descs_in_op; + +if (as_one_op) + ret =enqueue_mldts_one_op (q, ops[i], enqueued_descs); +else + ret =enqueue_mldts_split_op (q, ops[i], enqueued_descs); + +if (ret <0 ) { +acc_enqueue_invalid (q_data); +break ; + } + + enqueued_descs += ret; + } + +if (unlikely (i ==0 )) +return 0 ;/* Nothing to enqueue. */ + +acc_dma_enqueue (q, enqueued_descs, &q_data->queue_stats); + +/* Update stats. */ + q_data->queue_stats.enqueued_count += i; + q_data->queue_stats.enqueue_err_count += num - i; +return i; +} + +/* +* Dequeue one MLDTS operation. +* This may have been split over multiple descriptors. +*/ +static inline int +dequeue_mldts_one_op (struct rte_bbdev_queue_data *q_data, +struct acc_queue *q,struct rte_bbdev_mldts_op **ref_op, +uint16_t dequeued_ops,uint32_t *aq_dequeued) +{ +union acc_dma_desc *desc, atom_desc, *last_desc; +union acc_dma_rsp_desc rsp; +struct rte_bbdev_mldts_op *op; +uint8_t descs_in_op, i; + + desc =acc_desc_tail (q, dequeued_ops); + atom_desc.atom_hdr =__atomic_load_n ((uint64_t *)desc, __ATOMIC_RELAXED); + +/* Check fdone bit. */ +if (!(atom_desc.rsp.val &ACC_FDONE )) +return -1 ; + + descs_in_op = desc->req.cbs_in_tb; +if (descs_in_op >1 ) { +/* Get last CB. */ + last_desc =acc_desc_tail (q, dequeued_ops + descs_in_op -1 ); +/* Check if last op is ready to dequeue by checking fdone bit. If not exit. */ + atom_desc.atom_hdr =__atomic_load_n ((uint64_t *)last_desc, __ATOMIC_RELAXED); +if (!(atom_desc.rsp.val &ACC_FDONE )) +return -1 ; +#ifdef RTE_LIBRTE_BBDEV_DEBUG +rte_memdump (stderr,"Last Resp" , &last_desc->rsp.val,sizeof (desc->rsp.val)); +#endif +/* Check each operation iteratively using fdone. */ +for (i =1 ; i < descs_in_op -1 ; i++) { + last_desc = q->ring_addr + ((q->sw_ring_tail + dequeued_ops + i) + & q->sw_ring_wrap_mask); + atom_desc.atom_hdr =__atomic_load_n ((uint64_t *)last_desc, + __ATOMIC_RELAXED); +if (!(atom_desc.rsp.val &ACC_FDONE )) +return -1 ; + } + } +#ifdef RTE_LIBRTE_BBDEV_DEBUG +rte_memdump (stderr,"Resp" , &desc->rsp.val,sizeof (desc->rsp.val)); +#endif +/* Dequeue. */ + op = desc->req.op_addr; + +/* Clearing status, it will be set based on response. */ + op->status =0 ; + +for (i =0 ; i < descs_in_op; i++) { + desc = q->ring_addr + ((q->sw_ring_tail + dequeued_ops + i) & q->sw_ring_wrap_mask); + atom_desc.atom_hdr =__atomic_load_n ((uint64_t *)desc, __ATOMIC_RELAXED); + rsp.val = atom_desc.rsp.val; + op->status |= rsp.input_err <<RTE_BBDEV_DATA_ERROR ; + op->status |= rsp.dma_err <<RTE_BBDEV_DRV_ERROR ; + op->status |= rsp.fcw_err <<RTE_BBDEV_DRV_ERROR ; + op->status |= rsp.engine_hung <<RTE_BBDEV_ENGINE_ERROR ; + } + +if (op->status !=0 ) + q_data->queue_stats.dequeue_err_count++; +if (op->status & (1 <<RTE_BBDEV_DRV_ERROR )) +vrb_check_ir (q->d); + +/* Check if this is the last desc in batch (Atomic Queue). */ +if (desc->req.last_desc_in_batch) { + (*aq_dequeued)++; + desc->req.last_desc_in_batch =0 ; + } + desc->rsp.val =ACC_DMA_DESC_TYPE ; + desc->rsp.add_info_0 =0 ; + *ref_op = op; + +return descs_in_op; +} + +/* Dequeue MLDTS operations from VRB2 device. */ +static uint16_t +vrb2_dequeue_mldts (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_mldts_op **ops,uint16_t num) +{ +struct acc_queue *q = q_data->queue_private; +uint16_t dequeue_num, i, dequeued_cbs =0 ; +uint32_t avail =acc_ring_avail_deq (q); +uint32_t aq_dequeued =0 ; +int ret; + + dequeue_num =RTE_MIN (avail, num); + +for (i =0 ; i < dequeue_num; ++i) { + ret =dequeue_mldts_one_op (q_data, q, &ops[i], dequeued_cbs, &aq_dequeued); +if (ret <=0 ) +break ; + dequeued_cbs += ret; + } + + q->aq_dequeued += aq_dequeued; + q->sw_ring_tail += dequeued_cbs; +/* Update enqueue stats. */ + q_data->queue_stats.dequeued_count += i; +return i; +} +/* Initialization Function */ static void vrb_bbdev_init (struct rte_bbdev *dev,struct rte_pci_driver *drv)
@@ -3896,6 +4268,8 @@ vrb_bbdev_init(struct rte_bbdev *dev, struct rte_pci_driver *drv) dev->dequeue_ldpc_dec_ops = vrb_dequeue_ldpc_dec; dev->enqueue_fft_ops = vrb_enqueue_fft; dev->dequeue_fft_ops = vrb_dequeue_fft; + dev->enqueue_mldts_ops = vrb2_enqueue_mldts; + dev->dequeue_mldts_ops = vrb2_dequeue_mldts; d->pf_device = !strcmp (drv->driver.name,RTE_STR (VRB_PF_DRIVER_NAME )); d->mmio_base = pci_dev->mem_resource[0 ].addr;
Signature · 1 line
2.34.1
Re: [PATCH v5 10/12] baseband/acc: add MLD support in VRB2 variant
Quoted 399 lines · Nicolas Chautru
Adding the capability for the MLD-TS processing specific to the VRB2 variant.
Signed-off-by Nicolas Chautru <[email protected]>--- drivers/baseband/acc/rte_vrb_pmd.c | 374 +++++++++++++++++++++++++++++ 1 file changed, 374 insertions(+)drivers/baseband/acc/rte_vrb_pmd.c +372
-0@@ -1341,6 +1341,17 @@ vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) .fft_windows_num = ACC_MAX_FFT_WIN, } }, + { + .type = RTE_BBDEV_OP_MLDTS, + .cap.mld = { + .capability_flags = + RTE_BBDEV_MLDTS_REP, + .num_buffers_src = + 1, + .num_buffers_dst = + 1, + } + },RTE_BBDEV_END_OF_CAPABILITIES_LIST () };@@ -3878,6 +3889,367 @@ vrb_dequeue_fft(struct rte_bbdev_queue_data *q_data,return i; } +/* Fill in a frame control word for MLD-TS processing. */ +static inline void +vrb2_fcw_mldts_fill (struct rte_bbdev_mldts_op *op,struct acc_fcw_mldts *fcw) +{ + fcw->nrb = op->mldts.num_rbs; + fcw->NLayers = op->mldts.num_layers -1 ; + fcw->Qmod0 = (op->mldts.q_m[0 ] >>1 ) -1 ; + fcw->Qmod1 = (op->mldts.q_m[1 ] >>1 ) -1 ; + fcw->Qmod2 = (op->mldts.q_m[2 ] >>1 ) -1 ; + fcw->Qmod3 = (op->mldts.q_m[3 ] >>1 ) -1 ; +/* Mark some layers as disabled */ +if (op->mldts.num_layers ==2 ) { + fcw->Qmod2 =3 ; + fcw->Qmod3 =3 ; + } +if (op->mldts.num_layers ==3 ) + fcw->Qmod3 =3 ; + fcw->Rrep = op->mldts.r_rep; + fcw->Crep = op->mldts.c_rep; +} + +/* Fill in descriptor for one MLD-TS processing operation. */ +static inline int +vrb2_dma_desc_mldts_fill (struct rte_bbdev_mldts_op *op, +struct acc_dma_req_desc *desc, +struct rte_mbuf *input_q,struct rte_mbuf *input_r, +struct rte_mbuf *output, +uint32_t *in_offset,uint32_t *out_offset) +{ +uint16_t qsize_per_re[VRB2_MLD_LAY_SIZE ] = {8 ,12 ,16 };/* Layer 2 to 4. */ +uint16_t rsize_per_re[VRB2_MLD_LAY_SIZE ] = {14 ,26 ,42 }; +uint16_t sc_factor_per_rrep[VRB2_MLD_RREP_SIZE ] = {12 ,6 ,4 ,3 ,0 ,2 }; +uint16_t i, outsize_per_re =0 ; +uint32_t sc_num, r_num, q_size, r_size, out_size; + +/* Prevent out of range access. */ +if (op->mldts.r_rep >5 ) + op->mldts.r_rep =5 ; +if (op->mldts.num_layers <2 ) + op->mldts.num_layers =2 ; +if (op->mldts.num_layers >4 ) + op->mldts.num_layers =4 ; +for (i =0 ; i < op->mldts.num_layers; i++) + outsize_per_re += op->mldts.q_m[i]; + sc_num = op->mldts.num_rbs *RTE_BBDEV_SCPERRB * (op->mldts.c_rep +1 ); + r_num = op->mldts.num_rbs * sc_factor_per_rrep[op->mldts.r_rep]; + q_size = qsize_per_re[op->mldts.num_layers -2 ] * sc_num; + r_size = rsize_per_re[op->mldts.num_layers -2 ] * r_num; + out_size = sc_num * outsize_per_re; + +/* FCW already done. */ +acc_header_init (desc); + desc->data_ptrs[1 ].address =rte_pktmbuf_iova_offset (input_q, *in_offset); + desc->data_ptrs[1 ].blen = q_size; + desc->data_ptrs[1 ].blkid =ACC_DMA_BLKID_IN ; + desc->data_ptrs[1 ].last =0 ; + desc->data_ptrs[1 ].dma_ext =0 ; + desc->data_ptrs[2 ].address =rte_pktmbuf_iova_offset (input_r, *in_offset); + desc->data_ptrs[2 ].blen = r_size; + desc->data_ptrs[2 ].blkid =ACC_DMA_BLKID_IN_MLD_R ; + desc->data_ptrs[2 ].last =1 ; + desc->data_ptrs[2 ].dma_ext =0 ; + desc->data_ptrs[3 ].address =rte_pktmbuf_iova_offset (output, *out_offset); + desc->data_ptrs[3 ].blen = out_size; + desc->data_ptrs[3 ].blkid =ACC_DMA_BLKID_OUT_HARD ; + desc->data_ptrs[3 ].last =1 ; + desc->data_ptrs[3 ].dma_ext =0 ; + desc->m2dlen =3 ; + desc->d2mlen =1 ; + desc->op_addr = op; + desc->cbs_in_tb =1 ; + +return 0 ; +} + +/* Check whether the MLD operation can be processed as a single operation. */ +static inline bool +vrb2_check_mld_r_constraint (struct rte_bbdev_mldts_op *op) { +uint8_t layer_idx, rrep_idx; +uint16_t max_rb[VRB2_MLD_LAY_SIZE ][VRB2_MLD_RREP_SIZE ] = { + {188 ,275 ,275 ,275 ,0 ,275 }, + {101 ,202 ,275 ,275 ,0 ,275 }, + {62 ,124 ,186 ,248 ,0 ,275 } }; + +if (op->mldts.c_rep ==0 ) +return true; + + layer_idx =RTE_MIN (op->mldts.num_layers -VRB2_MLD_MIN_LAYER , +VRB2_MLD_MAX_LAYER -VRB2_MLD_MIN_LAYER ); + rrep_idx =RTE_MIN (op->mldts.r_rep,VRB2_MLD_MAX_RREP ); +rte_bbdev_log_debug ("RB %d index %d %d max %d\n" , op->mldts.num_rbs, layer_idx, rrep_idx, + max_rb[layer_idx][rrep_idx]); + +return (op->mldts.num_rbs <= max_rb[layer_idx][rrep_idx]); +} + +/** Enqueue MLDTS operation split across symbols. */ +static inline int +enqueue_mldts_split_op (struct acc_queue *q,struct rte_bbdev_mldts_op *op, +uint16_t total_enqueued_descs) +{ +uint16_t qsize_per_re[VRB2_MLD_LAY_SIZE ] = {8 ,12 ,16 };/* Layer 2 to 4. */ +uint16_t rsize_per_re[VRB2_MLD_LAY_SIZE ] = {14 ,26 ,42 }; +uint16_t sc_factor_per_rrep[VRB2_MLD_RREP_SIZE ] = {12 ,6 ,4 ,3 ,0 ,2 }; +uint32_t i, outsize_per_re =0 , sc_num, r_num, q_size, r_size, out_size, num_syms; +union acc_dma_desc *desc, *first_desc; +uint16_t desc_idx, symb; +struct rte_mbuf *input_q, *input_r, *output; +uint32_t in_offset, out_offset; +struct acc_fcw_mldts *fcw; + + desc_idx =acc_desc_idx (q, total_enqueued_descs); + first_desc = q->ring_addr + desc_idx; + input_q = op->mldts.qhy_input.data; + input_r = op->mldts.r_input.data; + output = op->mldts.output.data; + in_offset = op->mldts.qhy_input.offset; + out_offset = op->mldts.output.offset; + num_syms = op->mldts.c_rep +1 ; + fcw = &first_desc->req.fcw_mldts; +vrb2_fcw_mldts_fill (op, fcw); + fcw->Crep =0 ;/* C rep forced to zero. */ + +/* Prevent out of range access. */ +if (op->mldts.r_rep >5 ) + op->mldts.r_rep =5 ; +if (op->mldts.num_layers <2 ) + op->mldts.num_layers =2 ; +if (op->mldts.num_layers >4 ) + op->mldts.num_layers =4 ; + +for (i =0 ; i < op->mldts.num_layers; i++) + outsize_per_re += op->mldts.q_m[i]; + sc_num = op->mldts.num_rbs *RTE_BBDEV_SCPERRB ;/* C rep forced to zero. */ + r_num = op->mldts.num_rbs * sc_factor_per_rrep[op->mldts.r_rep]; + q_size = qsize_per_re[op->mldts.num_layers -2 ] * sc_num; + r_size = rsize_per_re[op->mldts.num_layers -2 ] * r_num; + out_size = sc_num * outsize_per_re; + +for (symb =0 ; symb < num_syms; symb++) { + desc_idx = ((q->sw_ring_head + total_enqueued_descs + symb) & q->sw_ring_wrap_mask); + desc = q->ring_addr + desc_idx; +acc_header_init (&desc->req); +if (symb ==0 ) + desc->req.cbs_in_tb = num_syms; +else +rte_memcpy (&desc->req.fcw_mldts, fcw,ACC_FCW_MLDTS_BLEN ); + desc->req.data_ptrs[1 ].address =rte_pktmbuf_iova_offset (input_q, in_offset); + desc->req.data_ptrs[1 ].blen = q_size; + in_offset += q_size; + desc->req.data_ptrs[1 ].blkid =ACC_DMA_BLKID_IN ; + desc->req.data_ptrs[1 ].last =0 ; + desc->req.data_ptrs[1 ].dma_ext =0 ; + desc->req.data_ptrs[2 ].address =rte_pktmbuf_iova_offset (input_r,0 ); + desc->req.data_ptrs[2 ].blen = r_size; + desc->req.data_ptrs[2 ].blkid =ACC_DMA_BLKID_IN_MLD_R ; + desc->req.data_ptrs[2 ].last =1 ; + desc->req.data_ptrs[2 ].dma_ext =0 ; + desc->req.data_ptrs[3 ].address =rte_pktmbuf_iova_offset (output, out_offset); + desc->req.data_ptrs[3 ].blen = out_size; + out_offset += out_size; + desc->req.data_ptrs[3 ].blkid =ACC_DMA_BLKID_OUT_HARD ; + desc->req.data_ptrs[3 ].last =1 ; + desc->req.data_ptrs[3 ].dma_ext =0 ; + desc->req.m2dlen =VRB2_MLD_M2DLEN ; + desc->req.d2mlen =1 ; + desc->req.op_addr = op; + +#ifdef RTE_LIBRTE_BBDEV_DEBUG +rte_memdump (stderr,"FCW" , &desc->req.fcw_mldts,sizeof (desc->req.fcw_mldts)); +rte_memdump (stderr,"Req Desc." , desc,sizeof (*desc)); +#endif + } + desc->req.sdone_enable =0 ; + +return num_syms; +} + +/** Enqueue one MLDTS operation. */ +static inline int +enqueue_mldts_one_op (struct acc_queue *q,struct rte_bbdev_mldts_op *op, +uint16_t total_enqueued_descs) +{ +union acc_dma_desc *desc; +struct rte_mbuf *input_q, *input_r, *output; +uint32_t in_offset, out_offset; +struct acc_fcw_mldts *fcw; + + desc =acc_desc (q, total_enqueued_descs); + input_q = op->mldts.qhy_input.data; + input_r = op->mldts.r_input.data; + output = op->mldts.output.data; + in_offset = op->mldts.qhy_input.offset; + out_offset = op->mldts.output.offset; + fcw = &desc->req.fcw_mldts; +vrb2_fcw_mldts_fill (op, fcw); +vrb2_dma_desc_mldts_fill (op, &desc->req, input_q, input_r, output, + &in_offset, &out_offset); +#ifdef RTE_LIBRTE_BBDEV_DEBUG +rte_memdump (stderr,"FCW" , &desc->req.fcw_mldts,sizeof (desc->req.fcw_mldts)); +rte_memdump (stderr,"Req Desc." , desc,sizeof (*desc)); +#endif +return 1 ; +} + +/* Enqueue MLDTS operations. */ +static uint16_t +vrb2_enqueue_mldts (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_mldts_op **ops,uint16_t num) +{ +int32_t aq_avail, avail; +struct acc_queue *q = q_data->queue_private; +uint16_t i, enqueued_descs =0 , descs_in_op; +int ret; +bool as_one_op; + + aq_avail =acc_aq_avail (q_data, num); +if (unlikely ((aq_avail <=0 ) || (num ==0 ))) +return 0 ; + avail =acc_ring_avail_enq (q); + +for (i =0 ; i < num; ++i) { + as_one_op =vrb2_check_mld_r_constraint (ops[i]); + descs_in_op = as_one_op ?1 : ops[i]->mldts.c_rep +1 ; + +/* Check if there are available space for further processing. */ +if (unlikely (avail < descs_in_op)) { +acc_enqueue_ring_full (q_data); +break ; + } + avail -= descs_in_op; + +if (as_one_op) + ret =enqueue_mldts_one_op (q, ops[i], enqueued_descs); +else + ret =enqueue_mldts_split_op (q, ops[i], enqueued_descs); + +if (ret <0 ) { +acc_enqueue_invalid (q_data); +break ; + } + + enqueued_descs += ret; + } + +if (unlikely (i ==0 )) +return 0 ;/* Nothing to enqueue. */ + +acc_dma_enqueue (q, enqueued_descs, &q_data->queue_stats); + +/* Update stats. */ + q_data->queue_stats.enqueued_count += i; + q_data->queue_stats.enqueue_err_count += num - i; +return i; +} + +/* +* Dequeue one MLDTS operation. +* This may have been split over multiple descriptors. +*/ +static inline int +dequeue_mldts_one_op (struct rte_bbdev_queue_data *q_data, +struct acc_queue *q,struct rte_bbdev_mldts_op **ref_op, +uint16_t dequeued_ops,uint32_t *aq_dequeued) +{ +union acc_dma_desc *desc, atom_desc, *last_desc; +union acc_dma_rsp_desc rsp; +struct rte_bbdev_mldts_op *op; +uint8_t descs_in_op, i; + + desc =acc_desc_tail (q, dequeued_ops); + atom_desc.atom_hdr =__atomic_load_n ((uint64_t *)desc, __ATOMIC_RELAXED); + +/* Check fdone bit. */ +if (!(atom_desc.rsp.val &ACC_FDONE )) +return -1 ; + + descs_in_op = desc->req.cbs_in_tb; +if (descs_in_op >1 ) { +/* Get last CB. */ + last_desc =acc_desc_tail (q, dequeued_ops + descs_in_op -1 ); +/* Check if last op is ready to dequeue by checking fdone bit. If not exit. */ + atom_desc.atom_hdr =__atomic_load_n ((uint64_t *)last_desc, __ATOMIC_RELAXED); +if (!(atom_desc.rsp.val &ACC_FDONE )) +return -1 ; +#ifdef RTE_LIBRTE_BBDEV_DEBUG +rte_memdump (stderr,"Last Resp" , &last_desc->rsp.val,sizeof (desc->rsp.val)); +#endif +/* Check each operation iteratively using fdone. */ +for (i =1 ; i < descs_in_op -1 ; i++) { + last_desc = q->ring_addr + ((q->sw_ring_tail + dequeued_ops + i) + & q->sw_ring_wrap_mask); + atom_desc.atom_hdr =__atomic_load_n ((uint64_t *)last_desc, + __ATOMIC_RELAXED); +if (!(atom_desc.rsp.val &ACC_FDONE )) +return -1 ; + } + } +#ifdef RTE_LIBRTE_BBDEV_DEBUG +rte_memdump (stderr,"Resp" , &desc->rsp.val,sizeof (desc->rsp.val)); +#endif +/* Dequeue. */ + op = desc->req.op_addr; + +/* Clearing status, it will be set based on response. */ + op->status =0 ; + +for (i =0 ; i < descs_in_op; i++) { + desc = q->ring_addr + ((q->sw_ring_tail + dequeued_ops + i) & q->sw_ring_wrap_mask); + atom_desc.atom_hdr =__atomic_load_n ((uint64_t *)desc, __ATOMIC_RELAXED); + rsp.val = atom_desc.rsp.val; + op->status |= rsp.input_err <<RTE_BBDEV_DATA_ERROR ; + op->status |= rsp.dma_err <<RTE_BBDEV_DRV_ERROR ; + op->status |= rsp.fcw_err <<RTE_BBDEV_DRV_ERROR ; + op->status |= rsp.engine_hung <<RTE_BBDEV_ENGINE_ERROR ; + } + +if (op->status !=0 ) + q_data->queue_stats.dequeue_err_count++; +if (op->status & (1 <<RTE_BBDEV_DRV_ERROR )) +vrb_check_ir (q->d); + +/* Check if this is the last desc in batch (Atomic Queue). */ +if (desc->req.last_desc_in_batch) { + (*aq_dequeued)++; + desc->req.last_desc_in_batch =0 ; + } + desc->rsp.val =ACC_DMA_DESC_TYPE ; + desc->rsp.add_info_0 =0 ; + *ref_op = op; + +return descs_in_op; +} + +/* Dequeue MLDTS operations from VRB2 device. */ +static uint16_t +vrb2_dequeue_mldts (struct rte_bbdev_queue_data *q_data, +struct rte_bbdev_mldts_op **ops,uint16_t num) +{ +struct acc_queue *q = q_data->queue_private; +uint16_t dequeue_num, i, dequeued_cbs =0 ; +uint32_t avail =acc_ring_avail_deq (q); +uint32_t aq_dequeued =0 ; +int ret; + + dequeue_num =RTE_MIN (avail, num); + +for (i =0 ; i < dequeue_num; ++i) { + ret =dequeue_mldts_one_op (q_data, q, &ops[i], dequeued_cbs, &aq_dequeued); +if (ret <=0 ) +break ; + dequeued_cbs += ret; + } + + q->aq_dequeued += aq_dequeued; + q->sw_ring_tail += dequeued_cbs; +/* Update enqueue stats. */ + q_data->queue_stats.dequeued_count += i; +return i; +} +/* Initialization Function */ static void vrb_bbdev_init (struct rte_bbdev *dev,struct rte_pci_driver *drv)
drivers/baseband/acc/rte_vrb_pmd.c vrb_bbdev_init(struct rte_bbdev *dev, struct rte_pci_driver *drv) · line 4275
Quoted 8 lines
drivers/baseband/acc/rte_vrb_pmd.c +2
-0@@ -3896,6 +4268,8 @@ vrb_bbdev_init(struct rte_bbdev *dev, struct rte_pci_driver *drv) dev->dequeue_ldpc_dec_ops = vrb_dequeue_ldpc_dec; dev->enqueue_fft_ops = vrb_enqueue_fft; dev->dequeue_fft_ops = vrb_dequeue_fft; + dev->enqueue_mldts_ops = vrb2_enqueue_mldts; + dev->dequeue_mldts_ops = vrb2_dequeue_mldts; d->pf_device = !strcmp (drv->driver.name,RTE_STR (VRB_PF_DRIVER_NAME )); d->mmio_base = pci_dev->mem_resource[0 ].addr;
Thanks,
Maxime
PATCH v5 11/12 baseband/acc: add support for VRB2 engine error detection
In reply to Nicolas ChautruAdding missing incremental functionality for the VRB2 variant. Notably detection of engine error during the dequeue. Minor cosmetic edits.
--- drivers/baseband/acc/rte_vrb_pmd.c | 19 ++++++++++++------- drivers/baseband/acc/vrb1_pf_enum.h | 17 ++++++++++++----- 2 files changed, 24 insertions(+), 12 deletions(-)
drivers/baseband/acc/rte_vrb_pmd.c +12 -7
@@ -1501,6 +1501,7 @@ vrb_fcw_td_fill(const struct rte_bbdev_dec_op *op, struct acc_fcw_td *fcw) fcw->ea = op->turbo_dec.cb_params.e; fcw->eb = op->turbo_dec.cb_params.e; } +if (op->turbo_dec.rv_index ==0 ) fcw->k0_start_col =ACC_FCW_TD_RVIDX_0 ;else if (op->turbo_dec.rv_index ==1 )
@@ -2075,7 +2076,7 @@ enqueue_ldpc_enc_n_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op **ops,return num; } -/* Enqueue one encode operations for device for a partial TB +/* Enqueue one encode operations for VRB1 device for a partial TB * all codes blocks have same configuration multiplexed on the same descriptor. */ static inline void
@@ -2419,7 +2420,7 @@ enqueue_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,return 1 ; } -/** Enqueue one decode operations for device in CB mode */ +/** Enqueue one decode operations for device in CB mode. */ static inline int vrb_enqueue_ldpc_dec_one_op_cb (struct acc_queue *q,struct rte_bbdev_dec_op *op,uint16_t total_enqueued_cbs,bool same_op)
@@ -2983,7 +2984,6 @@ vrb_enqueue_ldpc_dec_cb(struct rte_bbdev_queue_data *q_data,break ; } avail -=1 ; - rte_bbdev_log(INFO, "Op %d %d %d %d %d %d %d %d %d %d %d %d\n", i, ops[i]->ldpc_dec.op_flags, ops[i]->ldpc_dec.rv_index, ops[i]->ldpc_dec.iter_max, ops[i]->ldpc_dec.iter_count,
@@ -3111,6 +3111,7 @@ vrb_dequeue_enc_one_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op, op->status |= ((rsp.input_err) ? (1 <<RTE_BBDEV_DATA_ERROR ) :0 ); op->status |= ((rsp.dma_err) ? (1 <<RTE_BBDEV_DRV_ERROR ) :0 ); op->status |= ((rsp.fcw_err) ? (1 <<RTE_BBDEV_DRV_ERROR ) :0 ); + op->status |= ((rsp.engine_hung) ? (1 <<RTE_BBDEV_ENGINE_ERROR ) :0 );if (desc->req.last_desc_in_batch) { (*aq_dequeued)++;
@@ -3226,6 +3227,7 @@ vrb_dequeue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op, op->status |= ((rsp.input_err) ? (1 <<RTE_BBDEV_DATA_ERROR ) :0 ); op->status |= ((rsp.dma_err) ? (1 <<RTE_BBDEV_DRV_ERROR ) :0 ); op->status |= ((rsp.fcw_err) ? (1 <<RTE_BBDEV_DRV_ERROR ) :0 ); + op->status |= ((rsp.engine_hung) ? (1 <<RTE_BBDEV_ENGINE_ERROR ) :0 );if (desc->req.last_desc_in_batch) { (*aq_dequeued)++;
@@ -3272,6 +3274,8 @@ vrb_dequeue_dec_one_op_cb(struct rte_bbdev_queue_data *q_data, op->status |= ((rsp.input_err) ? (1 <<RTE_BBDEV_DATA_ERROR ) :0 ); op->status |= ((rsp.dma_err) ? (1 <<RTE_BBDEV_DRV_ERROR ) :0 ); op->status |= ((rsp.fcw_err) ? (1 <<RTE_BBDEV_DRV_ERROR ) :0 ); + op->status |= rsp.engine_hung <<RTE_BBDEV_ENGINE_ERROR ; +if (op->status !=0 ) {/* These errors are not expected. */ q_data->queue_stats.dequeue_err_count++;
@@ -3325,6 +3329,7 @@ vrb_dequeue_ldpc_dec_one_op_cb(struct rte_bbdev_queue_data *q_data, op->status |= rsp.input_err <<RTE_BBDEV_DATA_ERROR ; op->status |= rsp.dma_err <<RTE_BBDEV_DRV_ERROR ; op->status |= rsp.fcw_err <<RTE_BBDEV_DRV_ERROR ; + op->status |= rsp.engine_hung <<RTE_BBDEV_ENGINE_ERROR ;if (op->status !=0 ) q_data->queue_stats.dequeue_err_count++;
@@ -3406,6 +3411,7 @@ vrb_dequeue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op **ref_op, op->status |= ((rsp.input_err) ? (1 <<RTE_BBDEV_DATA_ERROR ) :0 ); op->status |= ((rsp.dma_err) ? (1 <<RTE_BBDEV_DRV_ERROR ) :0 ); op->status |= ((rsp.fcw_err) ? (1 <<RTE_BBDEV_DRV_ERROR ) :0 ); + op->status |= ((rsp.engine_hung) ? (1 <<RTE_BBDEV_ENGINE_ERROR ) :0 );if (check_bit (op->ldpc_dec.op_flags,RTE_BBDEV_LDPC_CRC_TYPE_24A_CHECK )) tb_crc_check ^= desc->rsp.add_info_1;
@@ -3457,7 +3463,6 @@ vrb_dequeue_enc(struct rte_bbdev_queue_data *q_data,if (avail ==0 )return 0 ; op =acc_op_tail (q,0 ); - cbm = op->turbo_enc.code_block_mode;for (i =0 ; i < avail; i++) {
@@ -3768,9 +3773,8 @@ vrb_enqueue_fft_one_op(struct acc_queue *q, struct rte_bbdev_fft_op *op,vrb_dma_desc_fft_fill (op, &desc->req, input, output, win, pwr, &in_offset, &out_offset, &win_offset, &pwr_offset, q->d->device_variant);#ifdef RTE_LIBRTE_BBDEV_DEBUG -rte_memdump (stderr,"FCW" , &desc->req.fcw_fft, -sizeof (desc->req.fcw_fft)); -rte_memdump (stderr,"Req Desc." , desc,sizeof (*desc)); +rte_memdump (stderr,"FCW" , fcw,128 ); +rte_memdump (stderr,"Req Desc." , desc,128 );#endif return 1 ; }
@@ -3843,6 +3847,7 @@ vrb_dequeue_fft_one_op(struct rte_bbdev_queue_data *q_data, op->status |= rsp.input_err <<RTE_BBDEV_DATA_ERROR ; op->status |= rsp.dma_err <<RTE_BBDEV_DRV_ERROR ; op->status |= rsp.fcw_err <<RTE_BBDEV_DRV_ERROR ; + op->status |= rsp.engine_hung <<RTE_BBDEV_ENGINE_ERROR ;if (op->status !=0 ) q_data->queue_stats.dequeue_err_count++;
drivers/baseband/acc/vrb1_pf_enum.h +12 -5
@@ -98,11 +98,18 @@ enum {ACC_PF_INT_DMA_UL5G_DESC_IRQ =8 ,ACC_PF_INT_DMA_DL5G_DESC_IRQ =9 ,ACC_PF_INT_DMA_MLD_DESC_IRQ =10 , -ACC_PF_INT_ARAM_ECC_1BIT_ERR =11 , -ACC_PF_INT_PARITY_ERR =12 , -ACC_PF_INT_QMGR_ERR =13 , -ACC_PF_INT_INT_REQ_OVERFLOW =14 , - ACC_PF_INT_APB_TIMEOUT = 15, +ACC_PF_INT_ARAM_ACCESS_ERR =11 , +ACC_PF_INT_ARAM_ECC_1BIT_ERR =12 , +ACC_PF_INT_PARITY_ERR =13 , +ACC_PF_INT_QMGR_OVERFLOW =14 , +ACC_PF_INT_QMGR_ERR =15 , +ACC_PF_INT_ATS_ERR =22 , +ACC_PF_INT_ARAM_FUUL =23 , +ACC_PF_INT_EXTRA_READ =24 , +ACC_PF_INT_COMPLETION_TIMEOUT =25 , +ACC_PF_INT_CORE_HANG =26 , +ACC_PF_INT_DMA_HANG =28 , + ACC_PF_INT_DS_HANG = 27, };#endif /* VRB1_PF_ENUM_H */
Signature · 1 line
2.34.1
PATCH v5 12/12 baseband/acc: add configure helper for VRB2
In reply to Nicolas ChautruThis allows to configure the VRB2 device using a
companion configuration function within the DPDK
bbdev-test environment.
--- drivers/baseband/acc/acc100_pmd.h | 2 + drivers/baseband/acc/rte_acc100_pmd.c | 6 +- drivers/baseband/acc/rte_vrb_pmd.c | 321 ++++++++++++++++++++++++++ drivers/baseband/acc/vrb_cfg.h | 16 ++ 4 files changed, 344 insertions(+), 1 deletion(-)
drivers/baseband/acc/acc100_pmd.h +2 -0
@@ -34,6 +34,8 @@#define ACC100_VENDOR_ID (0x8086)#define ACC100_PF_DEVICE_ID (0x0d5c)#define ACC100_VF_DEVICE_ID (0x0d5d) +#define VRB1_PF_DEVICE_ID (0x57C0) +#define VRB2_PF_DEVICE_ID (0x57C2)/* Values used in writing to the registers */ #define ACC100_REG_IRQ_EN_ALL 0x1FF83FF/* Enable all interrupts */
drivers/baseband/acc/rte_acc100_pmd.c +5 -1
@@ -5187,6 +5187,10 @@ rte_acc_configure(const char *dev_name, struct rte_acc_conf *conf)return acc100_configure (dev_name, conf); else if (pci_dev->id.device_id == ACC101_PF_DEVICE_ID) return acc101_configure(dev_name, conf); - else + else if (pci_dev->id.device_id == VRB1_PF_DEVICE_ID) return vrb1_configure(dev_name, conf); + else if (pci_dev->id.device_id == VRB2_PF_DEVICE_ID) + return vrb2_configure(dev_name, conf); + +return -ENXIO ; }
drivers/baseband/acc/rte_vrb_pmd.c +321 -0
324 lines not on this page · raw message
drivers/baseband/acc/vrb_cfg.h +16 -0
@@ -29,4 +29,20 @@int vrb1_configure (const char *dev_name,struct rte_acc_conf *conf); +/** +* Configure a VRB2 device. +* +* @param dev_name +* The name of the device. This is the short form of PCI BDF, e.g. 00:01.0. +* It can also be retrieved for a bbdev device from the dev_name field in the +* rte_bbdev_info structure returned by rte_bbdev_info_get(). +* @param conf +* Configuration to apply to VRB2 HW. +* +* @return +* Zero on success, negative value on failure. +*/ +int +vrb2_configure (const char *dev_name,struct rte_acc_conf *conf); +#endif /* _VRB_CFG_H_ */
Signature · 1 line
2.34.1