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 ABA2CA0C43; Tue, 16 Nov 2021 11:56:19 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A50B411AB; Tue, 16 Nov 2021 11:56:15 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 445DB40040 for ; Tue, 16 Nov 2021 06:49:14 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10169"; a="214350292" X-IronPort-AV: E=Sophos;i="5.87,238,1631602800"; d="scan'208";a="214350292" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2021 21:49:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,238,1631602800"; d="scan'208";a="454323472" Received: from unknown (HELO localhost.localdomain.bj.intel.com) ([10.240.224.210]) by orsmga006.jf.intel.com with ESMTP; 15 Nov 2021 21:49:11 -0800 From: "Zhang, Mingshan" To: dev@dpdk.org, akhil.goyal@nxp.com Cc: nicolas.chautru@intel.com Subject: [PATCH -v1] SCSY-51090 ACC100 Padding 5GDL input BLEN Date: Tue, 16 Nov 2021 13:12:15 +0800 Message-Id: <1637039535-184462-2-git-send-email-mingshan.zhang@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1637039535-184462-1-git-send-email-mingshan.zhang@intel.com> References: <1637039535-184462-1-git-send-email-mingshan.zhang@intel.com> X-Mailman-Approved-At: Tue, 16 Nov 2021 11:56:12 +0100 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 From: Nicolas Chautru Signed-off-by: Nicolas Chautru --- drivers/baseband/acc100/rte_acc100_pmd.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c index 392b0f9..794ebcc 100644 --- a/drivers/baseband/acc100/rte_acc100_pmd.c +++ b/drivers/baseband/acc100/rte_acc100_pmd.c @@ -1694,6 +1694,15 @@ static inline uint32_t hq_index(uint32_t offset) return 0; } +/* May need to pad LDPC Encoder input to avoid small beat */ +static inline uint16_t pad_le_in(uint16_t blen) +{ + uint16_t last_beat = blen % 64; + if ((last_beat > 0) && (last_beat <= 8)) + blen += 8; + return blen; +} + static inline int acc100_dma_desc_le_fill(struct rte_bbdev_enc_op *op, struct acc100_dma_req_desc *desc, struct rte_mbuf **input, @@ -1722,10 +1731,9 @@ static inline uint32_t hq_index(uint32_t offset) } next_triplet = acc100_dma_fill_blk_type_in(desc, input, in_offset, - in_length_in_bytes, + pad_le_in(in_length_in_bytes), seg_total_left, next_triplet, - check_bit(op->ldpc_enc.op_flags, - RTE_BBDEV_LDPC_ENC_SCATTER_GATHER)); + false); if (unlikely(next_triplet < 0)) { rte_bbdev_log(ERR, "Mismatch between data to process and mbuf data length in bbdev_op: %p", @@ -2689,6 +2697,7 @@ static inline uint32_t hq_index(uint32_t offset) return 1; } + /* Enqueue one encode operations for ACC100 device in CB mode * multiplexed on the same descriptor */ @@ -2719,7 +2728,7 @@ static inline uint32_t hq_index(uint32_t offset) acc100_header_init(&desc->req); desc->req.numCBs = num; - in_length_in_bytes = ops[0]->ldpc_enc.input.data->data_len; + in_length_in_bytes = pad_le_in(ops[0]->ldpc_enc.input.data->data_len); out_length = (enc->cb_params.e + 7) >> 3; desc->req.m2dlen = 1 + num; desc->req.d2mlen = num; @@ -4252,9 +4261,6 @@ static inline uint32_t hq_index(uint32_t offset) /* Clearing status, it will be set based on response */ op->status = 0; - - 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); @@ -4332,8 +4338,6 @@ static inline uint32_t hq_index(uint32_t offset) rsp.val, descs_in_tb, desc->req.numCBs); - 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); -- 1.8.3.1