From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 39C9A458AC; Fri, 30 Aug 2024 22:15:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A1F8642FB9; Fri, 30 Aug 2024 22:14:55 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by mails.dpdk.org (Postfix) with ESMTP id E01BC42F1F for ; Fri, 30 Aug 2024 22:14:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725048885; x=1756584885; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PH23/08wsKe5wRZYZnA0Pv5XlHyqPjFiXSeqJy/+sSQ=; b=KERPYVCJCWozpnDj3e4ro8yJ/T2xxRRK8GIah1Bd1iXNr9Um3ZSqVkkr /Fj+c2oh9ODYfrC1bx0VsmaYoZF5xSPhsRYIOMZJDdoboqYy0/ZRmR27J XYkiDTonsPzpM6aFTXQhcTn1IvCcElxVJk1zVY65JxSgrKnExf+eIf6m7 JrUV3utqejJdataf8AH2dCdtpdm/5nXtqDJ4ka87KklMPI7d8zNwBFvhL csb2zC3nz+xE5h4Ch8tvWfYJG7qtMUrX5kT0tDhjE/kt1tDUB64rR3X06 AgPuuigqFlYHZcS1OSbasE7ww9i2yasufh0Jl0BmNwNkPqvGw5hEFwMEj Q==; X-CSE-ConnectionGUID: pvV67HMnQjiL3q7O5RgpUg== X-CSE-MsgGUID: BtIh+42NQhabrrFkoAOc3Q== X-IronPort-AV: E=McAfee;i="6700,10204,11180"; a="23661212" X-IronPort-AV: E=Sophos;i="6.10,189,1719903600"; d="scan'208";a="23661212" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2024 13:14:44 -0700 X-CSE-ConnectionGUID: SDV9PYXpR66vki2inHFbQg== X-CSE-MsgGUID: ZMSvSSjySuqA57UDLIiICw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,189,1719903600"; d="scan'208";a="94731903" Received: from unknown (HELO csl-npg-qt0.la.intel.com) ([10.233.181.103]) by orviesa002.jf.intel.com with ESMTP; 30 Aug 2024 13:14:42 -0700 From: Hernan Vargas To: dev@dpdk.org, gakhil@marvell.com, trix@redhat.com, maxime.coquelin@redhat.com Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com, Hernan Vargas Subject: [PATCH v1 10/10] baseband/acc: cosmetic changes Date: Fri, 30 Aug 2024 13:09:52 -0700 Message-Id: <20240830200952.182685-11-hernan.vargas@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20240830200952.182685-1-hernan.vargas@intel.com> References: <20240830200952.182685-1-hernan.vargas@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Cosmetic code changes. No functional impact. Signed-off-by: Hernan Vargas --- drivers/baseband/acc/rte_acc100_pmd.c | 3 +- drivers/baseband/acc/rte_vrb_pmd.c | 72 ++++++++++++++++++--------- 2 files changed, 50 insertions(+), 25 deletions(-) diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c index 3501af2710fd..c33e2758b100 100644 --- a/drivers/baseband/acc/rte_acc100_pmd.c +++ b/drivers/baseband/acc/rte_acc100_pmd.c @@ -995,6 +995,7 @@ acc100_dev_info_get(struct rte_bbdev *dev, dev_info->num_queues[RTE_BBDEV_OP_LDPC_ENC] = d->acc_conf.q_dl_5g.num_aqs_per_groups * d->acc_conf.q_dl_5g.num_qgroups; dev_info->num_queues[RTE_BBDEV_OP_FFT] = 0; + dev_info->num_queues[RTE_BBDEV_OP_MLDTS] = 0; 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; @@ -4198,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 6353a27e69b2..aaad8570bc7e 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; + } for (desc_idx = 0; desc_idx < d->sw_ring_max_depth; desc_idx++) { desc = q->ring_addr + desc_idx; @@ -1490,7 +1510,6 @@ vrb_queue_intr_disable(struct rte_bbdev *dev, uint16_t queue_id) return 0; } - static int vrb_queue_ops_dump(struct rte_bbdev *dev, uint16_t queue_id, FILE *f) { @@ -1773,8 +1792,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; @@ -1874,7 +1892,7 @@ vrb_dma_desc_td_fill(struct rte_bbdev_dec_op *op, *h_out_length, next_triplet, ACC_DMA_BLKID_OUT_HARD); if (unlikely(next_triplet < 0)) { acc_error_log(q, (void *)op, - "Mismatch between data to process and mbuf data length in bbdev_op: %p", + "Mismatch between data to process and mbuf data length in bbdev_op: %p\n", op); return -1; } @@ -2017,16 +2035,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) { acc_error_log(q, (void *)op, "HARQ output is not defined\n"); 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; @@ -2600,7 +2617,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, @@ -2619,9 +2635,10 @@ vrb_enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op, hq_output = op->ldpc_dec.harq_combined_output.data; hq_len = op->ldpc_dec.harq_combined_output.length; if (unlikely(!mbuf_append(hq_output_head, hq_output, hq_len))) { - rte_bbdev_log(ERR, "HARQ output mbuf issue %d %d\n", - hq_output->buf_len, - hq_len); + acc_error_log(q, (void *)op, + "HARQ output mbuf cannot be appended Buffer %d Current data %d New data %d\n", + hq_output->buf_len, hq_output->data_len, hq_len); + return -1; } } @@ -2662,7 +2679,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; @@ -2866,6 +2882,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; } @@ -2973,6 +2990,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; @@ -3079,6 +3097,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; } @@ -3120,6 +3139,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; } @@ -3290,7 +3310,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 @@ -3890,6 +3910,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; } @@ -3956,7 +3977,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; } @@ -4211,6 +4234,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; } -- 2.37.1