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 54F3BA0560; Tue, 18 Oct 2022 18:44:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2160142BB0; Tue, 18 Oct 2022 18:43:06 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 6B9224281B for ; Tue, 18 Oct 2022 18:42:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666111375; x=1697647375; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OBJWEpiSae9mkfRxOX3MgWBU3+l0mQfwqbKDDTD63QM=; b=KhyFbXqKyOZoF+ShAmi2MZjtkDJGpU9ou0j50N+zdMedCL85Gs78XhS8 glrcn8VS17hhGy4p9f2ixCLyqQodIiNuVzKrn+Llix1p72hPJqwYzlW43 1nMImm749VAZh88Uhy5j0HvUMIlXyB8CjoTm/I3zrWKSF25u8bz1NAOL2 3GmDAFT/jRgqheTerEfukijfdn01NRRuBlhsh6SnjfTqZZyyS+Vg7PJWv cDr01a+vpk+6GEILCFwpauN9480tfQmc2207NEcp4BTHhFvbKowLqz0gx kZvFkjRQ0F/M3DV0cyrwZrQFr4UkKN74Lpge1hbJ6TbiOfL9jn+LibvBq A==; X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="368192086" X-IronPort-AV: E=Sophos;i="5.95,193,1661842800"; d="scan'208";a="368192086" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 09:42:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="803836081" X-IronPort-AV: E=Sophos;i="5.95,193,1661842800"; d="scan'208";a="803836081" Received: from unknown (HELO csl-npg-qt0.la.intel.com) ([10.233.181.103]) by orsmga005.jf.intel.com with ESMTP; 18 Oct 2022 09:42:54 -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 v4 15/30] baseband/acc100: add enqueue status Date: Tue, 18 Oct 2022 17:39:03 -0700 Message-Id: <20221019003918.257506-16-hernan.vargas@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221019003918.257506-1-hernan.vargas@intel.com> References: <20221019003918.257506-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 Add enqueue status as part of rte_bbdev_queue_data. This is a new feature to update queue status and indicate the reason why a previous enqueue may or may not have consumed all requested operations. Signed-off-by: Hernan Vargas Reviewed-by: Maxime Coquelin --- drivers/baseband/acc/rte_acc100_pmd.c | 56 ++++++++++++++++++++------- 1 file changed, 42 insertions(+), 14 deletions(-) diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c index fc2fbe5511..ca92ae906f 100644 --- a/drivers/baseband/acc/rte_acc100_pmd.c +++ b/drivers/baseband/acc/rte_acc100_pmd.c @@ -2968,13 +2968,17 @@ acc100_enqueue_enc_cb(struct rte_bbdev_queue_data *q_data, for (i = 0; i < num; ++i) { /* Check if there are available space for further processing */ - if (unlikely(avail - 1 < 0)) + if (unlikely(avail - 1 < 0)) { + acc_enqueue_ring_full(q_data); break; + } avail -= 1; ret = enqueue_enc_one_op_cb(q, ops[i], i); - if (ret < 0) + if (ret < 0) { + acc_enqueue_invalid(q_data); break; + } } if (unlikely(i == 0)) @@ -3006,20 +3010,26 @@ acc100_enqueue_ldpc_enc_cb(struct rte_bbdev_queue_data *q_data, int16_t enq, left = num; while (left > 0) { - if (unlikely(avail < 1)) + if (unlikely(avail < 1)) { + acc_enqueue_ring_full(q_data); break; + } avail--; enq = RTE_MIN(left, ACC_MUX_5GDL_DESC); if (check_mux(&ops[i], enq)) { ret = enqueue_ldpc_enc_n_op_cb(q, &ops[i], desc_idx, enq); - if (ret < 0) + if (ret < 0) { + acc_enqueue_invalid(q_data); break; + } i += enq; } else { ret = enqueue_ldpc_enc_one_op_cb(q, ops[i], desc_idx); - if (ret < 0) + if (ret < 0) { + acc_enqueue_invalid(q_data); break; + } i++; } desc_idx++; @@ -3057,13 +3067,17 @@ acc100_enqueue_enc_tb(struct rte_bbdev_queue_data *q_data, for (i = 0; i < num; ++i) { cbs_in_tb = get_num_cbs_in_tb_enc(&ops[i]->turbo_enc); /* Check if there are available space for further processing */ - if (unlikely(avail - cbs_in_tb < 0)) + if (unlikely(avail - cbs_in_tb < 0)) { + acc_enqueue_ring_full(q_data); break; + } avail -= cbs_in_tb; ret = enqueue_enc_one_op_tb(q, ops[i], enqueued_cbs, cbs_in_tb); - if (ret < 0) + if (ret < 0) { + acc_enqueue_invalid(q_data); break; + } enqueued_cbs += ret; } if (unlikely(enqueued_cbs == 0)) @@ -3120,13 +3134,17 @@ acc100_enqueue_dec_cb(struct rte_bbdev_queue_data *q_data, for (i = 0; i < num; ++i) { /* Check if there are available space for further processing */ - if (unlikely(avail - 1 < 0)) + if (unlikely(avail - 1 < 0)) { + acc_enqueue_ring_full(q_data); break; + } avail -= 1; ret = enqueue_dec_one_op_cb(q, ops[i], i); - if (ret < 0) + if (ret < 0) { + acc_enqueue_invalid(q_data); break; + } } if (unlikely(i == 0)) @@ -3166,8 +3184,10 @@ acc100_enqueue_ldpc_dec_tb(struct rte_bbdev_queue_data *q_data, ret = enqueue_ldpc_dec_one_op_tb(q, ops[i], enqueued_cbs, cbs_in_tb); - if (ret < 0) + if (ret < 0) { + acc_enqueue_invalid(q_data); break; + } enqueued_cbs += ret; } if (unlikely(enqueued_cbs == 0)) @@ -3194,8 +3214,10 @@ acc100_enqueue_ldpc_dec_cb(struct rte_bbdev_queue_data *q_data, bool same_op = false; for (i = 0; i < num; ++i) { /* Check if there are available space for further processing */ - if (unlikely(avail < 1)) + if (unlikely(avail < 1)) { + acc_enqueue_ring_full(q_data); break; + } avail -= 1; if (i > 0) @@ -3208,8 +3230,10 @@ acc100_enqueue_ldpc_dec_cb(struct rte_bbdev_queue_data *q_data, 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); - if (ret < 0) + if (ret < 0) { + acc_enqueue_invalid(q_data); break; + } } if (unlikely(i == 0)) @@ -3244,13 +3268,17 @@ acc100_enqueue_dec_tb(struct rte_bbdev_queue_data *q_data, for (i = 0; i < num; ++i) { cbs_in_tb = get_num_cbs_in_tb_dec(&ops[i]->turbo_dec); /* Check if there are available space for further processing */ - if (unlikely(avail - cbs_in_tb < 0)) + if (unlikely(avail - cbs_in_tb < 0)) { + acc_enqueue_ring_full(q_data); break; + } avail -= cbs_in_tb; ret = enqueue_dec_one_op_tb(q, ops[i], enqueued_cbs, cbs_in_tb); - if (ret < 0) + if (ret < 0) { + acc_enqueue_invalid(q_data); break; + } enqueued_cbs += ret; } -- 2.37.1