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 5D66743F6C; Thu, 2 May 2024 22:49:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7A31A402E1; Thu, 2 May 2024 22:49:23 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by mails.dpdk.org (Postfix) with ESMTP id D104D402C5 for ; Thu, 2 May 2024 22:49:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714682960; x=1746218960; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EQnJ5kOBWZFxJbSLwL9JPxSVr6rwq4TGCkjR/CTcspc=; b=eDjhQo+wDjwaJGbd2I8NPrXK/d/DQnww9HdWeFE/5jnjEXpqfxgFmtc9 kU/cFcjKKiJfOogEfaX6iO2dFkmM5e3Og5ceWuu5yRkUtKTIfwwvsvCCr i1ZdQebJ+ImWYWwuCiwNr8Z+zI/pPgq0271wzJ1Us0HusRLA6ssZ87PyP P6+a3Lm3FeMyNey+Hr5l72iE/cHgikVonG9Xkv5VPEeTCjfCoPGWCUQHe bQEpxfB5j0eEulAVL5Vm4800jloKnNR4m9gQYwC0vnUFYiNVg2X/YkAo0 xdiQ3dpqaB+kKJNSRCVmcEPyke6OP6PgBjeUM6dL1JUe447icvEKC4Zm/ A==; X-CSE-ConnectionGUID: Y/Lk5aFfQHWk7JPBd4do/w== X-CSE-MsgGUID: PeqENwshQjySyN031aLAnA== X-IronPort-AV: E=McAfee;i="6600,9927,11062"; a="21032749" X-IronPort-AV: E=Sophos;i="6.07,247,1708416000"; d="scan'208";a="21032749" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2024 13:49:18 -0700 X-CSE-ConnectionGUID: fSczkcpzRXSGMfkYi1YnCA== X-CSE-MsgGUID: FJzXlgCrRiKlCpIRzvJ5LA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,247,1708416000"; d="scan'208";a="27838121" Received: from unknown (HELO csl-npg-qt0.la.intel.com) ([10.233.181.103]) by orviesa008.jf.intel.com with ESMTP; 02 May 2024 13:49:18 -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 v2 2/5] baseband/acc: remove ACC100 unused code Date: Thu, 2 May 2024 13:45:45 -0700 Message-Id: <20240502204548.236729-3-hernan.vargas@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20240502204548.236729-1-hernan.vargas@intel.com> References: <20240502204548.236729-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 Remove dead code and unused function in ACC100 driver. Signed-off-by: Hernan Vargas Reviewed-by: Maxime Coquelin --- drivers/baseband/acc/rte_acc100_pmd.c | 213 ++++++++------------------ 1 file changed, 68 insertions(+), 145 deletions(-) diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c index 4f666e514b72..d6b0b9400c82 100644 --- a/drivers/baseband/acc/rte_acc100_pmd.c +++ b/drivers/baseband/acc/rte_acc100_pmd.c @@ -1640,59 +1640,6 @@ acc100_dma_desc_ld_fill(struct rte_bbdev_dec_op *op, return 0; } -static inline void -acc100_dma_desc_ld_update(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, - union acc_harq_layout_data *harq_layout) -{ - int next_triplet = 1; /* FCW already done */ - desc->data_ptrs[next_triplet].address = - rte_pktmbuf_iova_offset(input, *in_offset); - next_triplet++; - - if (check_bit(op->ldpc_dec.op_flags, - RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE)) { - struct rte_bbdev_op_data hi = op->ldpc_dec.harq_combined_input; - desc->data_ptrs[next_triplet].address = hi.offset; -#ifndef ACC100_EXT_MEM - desc->data_ptrs[next_triplet].address = - rte_pktmbuf_iova_offset(hi.data, hi.offset); -#endif - next_triplet++; - } - - desc->data_ptrs[next_triplet].address = - rte_pktmbuf_iova_offset(h_output, *h_out_offset); - *h_out_length = desc->data_ptrs[next_triplet].blen; - next_triplet++; - - if (check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_HQ_COMBINE_OUT_ENABLE)) { - struct rte_bbdev_dec_op *prev_op; - uint32_t harq_idx, prev_harq_idx; - desc->data_ptrs[next_triplet].address = op->ldpc_dec.harq_combined_output.offset; - /* Adjust based on previous operation */ - prev_op = desc->op_addr; - op->ldpc_dec.harq_combined_output.length = - prev_op->ldpc_dec.harq_combined_output.length; - harq_idx = hq_index(op->ldpc_dec.harq_combined_output.offset); - prev_harq_idx = hq_index(prev_op->ldpc_dec.harq_combined_output.offset); - harq_layout[harq_idx].val = harq_layout[prev_harq_idx].val; -#ifndef ACC100_EXT_MEM - struct rte_bbdev_op_data ho = - op->ldpc_dec.harq_combined_output; - desc->data_ptrs[next_triplet].address = - rte_pktmbuf_iova_offset(ho.data, ho.offset); -#endif - next_triplet++; - } - - op->ldpc_dec.hard_output.length += *h_out_length; - desc->op_addr = op; -} - #ifndef RTE_LIBRTE_BBDEV_SKIP_VALIDATE /* Validates turbo encoder parameters */ static inline int @@ -2935,8 +2882,7 @@ derm_workaround_recommended(struct rte_bbdev_op_ldpc_dec *ldpc_dec, struct acc_q /** Enqueue one decode operations for ACC100 device in CB mode */ static inline int enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op, - uint16_t total_enqueued_cbs, bool same_op, - struct rte_bbdev_queue_data *q_data) + uint16_t total_enqueued_cbs, struct rte_bbdev_queue_data *q_data) { int ret; if (unlikely(check_bit(op->ldpc_dec.op_flags, @@ -2969,93 +2915,73 @@ enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op, #endif union acc_harq_layout_data *harq_layout = q->d->harq_layout; - if (same_op) { - union acc_dma_desc *prev_desc; - prev_desc = acc_desc(q, total_enqueued_cbs - 1); - uint8_t *prev_ptr = (uint8_t *) prev_desc; - uint8_t *new_ptr = (uint8_t *) desc; - /* Copy first 4 words and BDESCs */ - rte_memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0); - rte_memcpy(new_ptr + ACC_5GUL_OFFSET_0, - prev_ptr + ACC_5GUL_OFFSET_0, - ACC_5GUL_SIZE_1); - desc->req.op_addr = prev_desc->req.op_addr; - /* Copy FCW */ - rte_memcpy(new_ptr + ACC_DESC_FCW_OFFSET, - prev_ptr + ACC_DESC_FCW_OFFSET, - ACC_FCW_LD_BLEN); - acc100_dma_desc_ld_update(op, &desc->req, input, h_output, - &in_offset, &h_out_offset, - &h_out_length, harq_layout); - } else { - struct acc_fcw_ld *fcw; - uint32_t seg_total_left; - - if (derm_workaround_recommended(&op->ldpc_dec, q)) { - #ifdef RTE_BBDEV_SDK_AVX512 - struct rte_bbdev_op_ldpc_dec *dec = &op->ldpc_dec; - struct bblib_rate_dematching_5gnr_request derm_req; - struct bblib_rate_dematching_5gnr_response derm_resp; - uint8_t *in; - - /* Checking input size is matching with E */ - if (dec->input.data->data_len < (dec->cb_params.e % 65536)) { - rte_bbdev_log(ERR, "deRM: Input size mismatch"); - return -EFAULT; - } - /* Run first deRM processing in SW */ - in = rte_pktmbuf_mtod_offset(dec->input.data, uint8_t *, in_offset); - derm_req.p_in = (int8_t *) in; - derm_req.p_harq = (int8_t *) q->derm_buffer; - derm_req.base_graph = dec->basegraph; - derm_req.zc = dec->z_c; - derm_req.ncb = dec->n_cb; - derm_req.e = dec->cb_params.e; - if (derm_req.e > ACC_MAX_E) { - rte_bbdev_log(WARNING, - "deRM: E %d > %d max", - derm_req.e, ACC_MAX_E); - derm_req.e = ACC_MAX_E; - } - derm_req.k0 = 0; /* Actual output from SDK */ - derm_req.isretx = false; - derm_req.rvid = dec->rv_index; - derm_req.modulation_order = dec->q_m; - derm_req.start_null_index = - (dec->basegraph == 1 ? 22 : 10) - * dec->z_c - 2 * dec->z_c - - dec->n_filler; - derm_req.num_of_null = dec->n_filler; - bblib_rate_dematching_5gnr(&derm_req, &derm_resp); - /* Force back the HW DeRM */ - dec->q_m = 1; - dec->cb_params.e = dec->n_cb - dec->n_filler; - dec->rv_index = 0; - rte_memcpy(in, q->derm_buffer, dec->cb_params.e); - /* Capture counter when pre-processing is used */ - q_data->queue_stats.enqueue_warn_count++; - #else - RTE_SET_USED(q_data); - rte_bbdev_log(INFO, "Corner case may require deRM pre-processing in SDK"); - #endif + struct acc_fcw_ld *fcw; + uint32_t seg_total_left; + + if (derm_workaround_recommended(&op->ldpc_dec, q)) { + #ifdef RTE_BBDEV_SDK_AVX512 + struct rte_bbdev_op_ldpc_dec *dec = &op->ldpc_dec; + struct bblib_rate_dematching_5gnr_request derm_req; + struct bblib_rate_dematching_5gnr_response derm_resp; + uint8_t *in; + + /* Checking input size is matching with E */ + if (dec->input.data->data_len < (dec->cb_params.e % 65536)) { + rte_bbdev_log(ERR, "deRM: Input size mismatch"); + return -EFAULT; } + /* Run first deRM processing in SW */ + in = rte_pktmbuf_mtod_offset(dec->input.data, uint8_t *, in_offset); + derm_req.p_in = (int8_t *) in; + derm_req.p_harq = (int8_t *) q->derm_buffer; + derm_req.base_graph = dec->basegraph; + derm_req.zc = dec->z_c; + derm_req.ncb = dec->n_cb; + derm_req.e = dec->cb_params.e; + if (derm_req.e > ACC_MAX_E) { + rte_bbdev_log(WARNING, + "deRM: E %d > %d max", + derm_req.e, ACC_MAX_E); + derm_req.e = ACC_MAX_E; + } + derm_req.k0 = 0; /* Actual output from SDK */ + derm_req.isretx = false; + derm_req.rvid = dec->rv_index; + derm_req.modulation_order = dec->q_m; + derm_req.start_null_index = + (dec->basegraph == 1 ? 22 : 10) + * dec->z_c - 2 * dec->z_c + - dec->n_filler; + derm_req.num_of_null = dec->n_filler; + bblib_rate_dematching_5gnr(&derm_req, &derm_resp); + /* Force back the HW DeRM */ + dec->q_m = 1; + dec->cb_params.e = dec->n_cb - dec->n_filler; + dec->rv_index = 0; + rte_memcpy(in, q->derm_buffer, dec->cb_params.e); + /* Capture counter when pre-processing is used */ + q_data->queue_stats.enqueue_warn_count++; + #else + RTE_SET_USED(q_data); + rte_bbdev_log(INFO, "Corner case may require deRM pre-processing in SDK"); + #endif + } - fcw = &desc->req.fcw_ld; - q->d->fcw_ld_fill(op, fcw, harq_layout); + fcw = &desc->req.fcw_ld; + q->d->fcw_ld_fill(op, fcw, harq_layout); - /* Special handling when using mbuf or not */ - if (check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_DEC_SCATTER_GATHER)) - seg_total_left = rte_pktmbuf_data_len(input) - in_offset; - else - seg_total_left = fcw->rm_e; + /* Special handling when using mbuf or not */ + if (check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_DEC_SCATTER_GATHER)) + seg_total_left = rte_pktmbuf_data_len(input) - in_offset; + else + seg_total_left = fcw->rm_e; - ret = acc100_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); - if (unlikely(ret < 0)) - return ret; - } + ret = acc100_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); + if (unlikely(ret < 0)) + return ret; /* Hard output */ mbuf_append(h_output_head, h_output, h_out_length); @@ -3553,7 +3479,7 @@ acc100_enqueue_ldpc_dec_cb(struct rte_bbdev_queue_data *q_data, int32_t avail = acc_ring_avail_enq(q); uint16_t i; int ret; - bool same_op = false; + for (i = 0; i < num; ++i) { /* Check if there are available space for further processing */ if (unlikely(avail < 1)) { @@ -3562,16 +3488,13 @@ acc100_enqueue_ldpc_dec_cb(struct rte_bbdev_queue_data *q_data, } avail -= 1; - if (i > 0) - same_op = cmp_ldpc_dec_op(&ops[i-1]); - rte_bbdev_log(INFO, "Op %d %d %d %d %d %d %d %d %d %d %d %d\n", + rte_bbdev_log(INFO, "Op %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, ops[i]->ldpc_dec.basegraph, ops[i]->ldpc_dec.z_c, ops[i]->ldpc_dec.n_cb, ops[i]->ldpc_dec.q_m, - ops[i]->ldpc_dec.n_filler, ops[i]->ldpc_dec.cb_params.e, - same_op); - ret = enqueue_ldpc_dec_one_op_cb(q, ops[i], i, same_op, q_data); + ops[i]->ldpc_dec.n_filler, ops[i]->ldpc_dec.cb_params.e); + ret = enqueue_ldpc_dec_one_op_cb(q, ops[i], i, q_data); if (ret < 0) { acc_enqueue_invalid(q_data); break; -- 2.37.1