From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Hernan Vargas <hernan.vargas@intel.com>,
dev@dpdk.org, gakhil@marvell.com, trix@redhat.com
Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com
Subject: Re: [PATCH v2 10/10] baseband/acc: cosmetic changes
Date: Tue, 8 Oct 2024 10:11:46 +0200 [thread overview]
Message-ID: <a2e43069-7846-4140-aefa-4e3bbcb55822@redhat.com> (raw)
In-Reply-To: <20241003204912.131319-11-hernan.vargas@intel.com>
On 10/3/24 22:49, Hernan Vargas wrote:
> Cosmetic code changes.
> No functional impact.
>
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
> drivers/baseband/acc/rte_acc100_pmd.c | 2 +-
> drivers/baseband/acc/rte_vrb_pmd.c | 62 +++++++++++++++++++--------
> 2 files changed, 44 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c
> index e3a523946448..c33e2758b100 100644
> --- a/drivers/baseband/acc/rte_acc100_pmd.c
> +++ b/drivers/baseband/acc/rte_acc100_pmd.c
> @@ -4199,7 +4199,7 @@ poweron_cleanup(struct rte_bbdev *bbdev, struct acc_device *d,
> acc_reg_write(d, HWPfQmgrIngressAq + 0x100, enq_req.val);
> usleep(ACC_LONG_WAIT * 100);
> if (desc->req.word0 != 2)
> - rte_bbdev_log(WARNING, "DMA Response %#"PRIx32, desc->req.word0);
> + rte_bbdev_log(WARNING, "DMA Response %#"PRIx32"", desc->req.word0);
> }
>
> /* Reset LDPC Cores */
> diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c
> index 5f7568a4b7ea..c8875447d3d0 100644
> --- a/drivers/baseband/acc/rte_vrb_pmd.c
> +++ b/drivers/baseband/acc/rte_vrb_pmd.c
> @@ -956,6 +956,9 @@ vrb_queue_setup(struct rte_bbdev *dev, uint16_t queue_id,
> struct acc_queue *q;
> int32_t q_idx;
> int ret;
> + union acc_dma_desc *desc = NULL;
> + unsigned int desc_idx, b_idx;
> + int fcw_len;
>
> if (d == NULL) {
> rte_bbdev_log(ERR, "Undefined device");
> @@ -982,16 +985,33 @@ vrb_queue_setup(struct rte_bbdev *dev, uint16_t queue_id,
> }
>
> /* Prepare the Ring with default descriptor format. */
> - union acc_dma_desc *desc = NULL;
> - unsigned int desc_idx, b_idx;
> - 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 : (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;
> + switch (conf->op_type) {
> + case RTE_BBDEV_OP_LDPC_ENC:
> + fcw_len = ACC_FCW_LE_BLEN;
> + break;
> + case RTE_BBDEV_OP_LDPC_DEC:
> + fcw_len = ACC_FCW_LD_BLEN;
> + break;
> + case RTE_BBDEV_OP_TURBO_DEC:
> + fcw_len = ACC_FCW_TD_BLEN;
> + break;
> + case RTE_BBDEV_OP_TURBO_ENC:
> + fcw_len = ACC_FCW_TE_BLEN;
> + break;
> + case RTE_BBDEV_OP_FFT:
> + fcw_len = ACC_FCW_FFT_BLEN;
> + if (q->d->device_variant == VRB2_VARIANT)
> + fcw_len = ACC_FCW_FFT_BLEN_3;
> + break;
> + case RTE_BBDEV_OP_MLDTS:
> + fcw_len = ACC_FCW_MLDTS_BLEN;
> + break;
> + default:
> + /* NOT REACHED. */
> + fcw_len = 0;
> + rte_bbdev_log(ERR, "Unexpected error in %s using type %d", __func__, conf->op_type);
> + break;
> + }
This part is useful as it makes the code clearer.
> for (desc_idx = 0; desc_idx < d->sw_ring_max_depth; desc_idx++) {
> desc = q->ring_addr + desc_idx;
> @@ -1757,8 +1777,7 @@ vrb_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;
> @@ -2000,16 +2019,15 @@ vrb_dma_desc_ld_fill(struct rte_bbdev_dec_op *op,
> next_triplet++;
> }
>
> - 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_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;
> @@ -2583,7 +2601,6 @@ vrb_enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
> seg_total_left = rte_pktmbuf_data_len(input) - in_offset;
> else
> seg_total_left = fcw->rm_e;
> -
> ret = vrb_dma_desc_ld_fill(op, &desc->req, &input, h_output,
> &in_offset, &h_out_offset,
> &h_out_length, &mbuf_total_left,
> @@ -2645,7 +2662,6 @@ 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;
> -
> vrb_fcw_ld_fill(op, &desc->req.fcw_ld, harq_layout, q->d->device_variant);
>
> input = op->ldpc_dec.input.data;
> @@ -2849,6 +2865,7 @@ vrb_enqueue_enc_cb(struct rte_bbdev_queue_data *q_data,
> acc_dma_enqueue(q, i, &q_data->queue_stats);
>
> acc_update_qstat_enqueue(q_data, i, num - i);
> +
> return i;
> }
>
> @@ -2956,6 +2973,7 @@ vrb_enqueue_ldpc_enc_tb(struct rte_bbdev_queue_data *q_data,
> }
> descs_used = vrb2_enqueue_ldpc_enc_one_op_tb(q, ops[i], enqueued_descs);
> }
> +
> if (descs_used < 0) {
> acc_enqueue_invalid(q_data);
> break;
> @@ -3062,6 +3080,7 @@ vrb_enqueue_ldpc_dec_tb(struct rte_bbdev_queue_data *q_data,
> acc_dma_enqueue(q, enqueued_cbs, &q_data->queue_stats);
>
> acc_update_qstat_enqueue(q_data, i, num - i);
> +
> return i;
> }
>
> @@ -3103,6 +3122,7 @@ vrb_enqueue_ldpc_dec_cb(struct rte_bbdev_queue_data *q_data,
> acc_dma_enqueue(q, i, &q_data->queue_stats);
>
> acc_update_qstat_enqueue(q_data, i, num - i);
> +
> return i;
> }
>
> @@ -3273,7 +3293,7 @@ vrb2_dequeue_ldpc_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op **r
> return 1;
> }
>
> -/* Dequeue one LDPC encode operations from device in TB mode.
> +/* Dequeue one encode operations from device in TB mode.
> * That operation may cover multiple descriptors.
> */
> static inline int
> @@ -3873,6 +3893,7 @@ vrb_enqueue_fft(struct rte_bbdev_queue_data *q_data,
> acc_dma_enqueue(q, i, &q_data->queue_stats);
>
> acc_update_qstat_enqueue(q_data, i, num - i);
> +
> return i;
> }
>
> @@ -3939,7 +3960,9 @@ vrb_dequeue_fft(struct rte_bbdev_queue_data *q_data,
>
> q->aq_dequeued += aq_dequeued;
> q->sw_ring_tail += dequeued_cbs;
> +
> acc_update_qstat_dequeue(q_data, i);
> +
> return i;
> }
>
> @@ -4194,6 +4217,7 @@ vrb2_enqueue_mldts(struct rte_bbdev_queue_data *q_data,
> acc_dma_enqueue(q, enqueued_descs, &q_data->queue_stats);
>
> acc_update_qstat_enqueue(q_data, i, num - i);
> +
> return i;
> }
>
All the new lines removal does not bring clarity, they could be skipped.
Regards,
Maxime
prev parent reply other threads:[~2024-10-08 8:11 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-03 20:49 [PATCH v2 00/10] acc baseband PMD fix and updates for 24.11 Hernan Vargas
2024-10-03 20:49 ` [PATCH v2 01/10] baseband/acc: fix access to deallocated mem Hernan Vargas
2024-10-03 20:49 ` [PATCH v2 02/10] baseband/acc: queue allocation refactor Hernan Vargas
2024-10-04 12:08 ` Maxime Coquelin
2024-10-04 18:19 ` Chautru, Nicolas
2024-10-07 9:31 ` Maxime Coquelin
2024-10-07 16:45 ` Chautru, Nicolas
2024-10-08 7:38 ` Maxime Coquelin
2024-10-03 20:49 ` [PATCH v2 03/10] baseband/acc: configure max queues per device Hernan Vargas
2024-10-08 7:43 ` Maxime Coquelin
2024-10-03 20:49 ` [PATCH v2 04/10] baseband/acc: future proof structure comparison Hernan Vargas
2024-10-08 7:49 ` Maxime Coquelin
2024-10-03 20:49 ` [PATCH v2 05/10] baseband/acc: enhance SW ring alignment Hernan Vargas
2024-10-08 7:51 ` Maxime Coquelin
2024-10-08 20:19 ` Chautru, Nicolas
2024-10-03 20:49 ` [PATCH v2 06/10] baseband/acc: remove soft output bypass Hernan Vargas
2024-10-08 8:00 ` Maxime Coquelin
2024-10-09 16:38 ` Chautru, Nicolas
2024-10-03 20:49 ` [PATCH v2 07/10] baseband/acc: algorithm tuning for LDPC decoder Hernan Vargas
2024-10-08 8:06 ` Maxime Coquelin
2024-10-03 20:49 ` [PATCH v2 08/10] baseband/acc: remove check on HARQ memory Hernan Vargas
2024-10-08 8:08 ` Maxime Coquelin
2024-10-08 15:38 ` Chautru, Nicolas
2024-10-03 20:49 ` [PATCH v2 09/10] baseband/acc: reset ring data valid bit Hernan Vargas
2024-10-08 8:08 ` Maxime Coquelin
2024-10-03 20:49 ` [PATCH v2 10/10] baseband/acc: cosmetic changes Hernan Vargas
2024-10-08 8:11 ` Maxime Coquelin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a2e43069-7846-4140-aefa-4e3bbcb55822@redhat.com \
--to=maxime.coquelin@redhat.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=hernan.vargas@intel.com \
--cc=nicolas.chautru@intel.com \
--cc=qi.z.zhang@intel.com \
--cc=trix@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).