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 0E075A00C5; Wed, 14 Sep 2022 18:26:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E6BB44021D; Wed, 14 Sep 2022 18:26:22 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 3481A40156 for ; Wed, 14 Sep 2022 18:26:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663172781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uNtPmEIR1S9V5HYTYLuCf+XqjeAeOi8y1rPUtIcp5Uw=; b=g9tfOIB1RtHY0uBxtNHnjfExEhRA49qTYBqUYqb8l0DoUeKP3rMHbFg76dfw7aTR8GWVfT v3BV30mvrMwlxKgHaDKOlvLIkz7DCuLYi/FKerE9nVm7NlL6DWT6gRxi9gwa0MLr1M74cg viSGucSpWW5h9lg6eNiq0L0CTZfCEfA= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-114-swoNEzCjNbinDN_E4zDiFQ-1; Wed, 14 Sep 2022 12:26:19 -0400 X-MC-Unique: swoNEzCjNbinDN_E4zDiFQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0F15E38164CC; Wed, 14 Sep 2022 16:26:19 +0000 (UTC) Received: from [10.39.208.12] (unknown [10.39.208.12]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 87755C15BA4; Wed, 14 Sep 2022 16:26:17 +0000 (UTC) Message-ID: <76c2fb0e-563a-25e7-0ed8-ab09bd6fc51a@redhat.com> Date: Wed, 14 Sep 2022 18:26:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 To: Hernan Vargas , dev@dpdk.org, gakhil@marvell.com, trix@redhat.com Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com References: <20220820023157.189047-1-hernan.vargas@intel.com> <20220820023157.189047-2-hernan.vargas@intel.com> From: Maxime Coquelin Subject: Re: [PATCH v2 01/37] baseband/acc100: add enqueue status In-Reply-To: <20220820023157.189047-2-hernan.vargas@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 8/20/22 04:31, Hernan Vargas wrote: > 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 > --- > drivers/baseband/acc100/rte_acc100_pmd.c | 85 ++++++++++++++++++++---- > 1 file changed, 71 insertions(+), 14 deletions(-) > > diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c > index a68a9b0fd9..7f698ec3d2 100644 > --- a/drivers/baseband/acc100/rte_acc100_pmd.c > +++ b/drivers/baseband/acc100/rte_acc100_pmd.c > @@ -3436,6 +3436,35 @@ get_num_cbs_in_tb_ldpc_dec(struct rte_bbdev_op_ldpc_dec *ldpc_dec) > return cbs_in_tb; > } > > +static inline void > +acc100_enqueue_status(struct rte_bbdev_queue_data *q_data, > + enum rte_bbdev_enqueue_status status) > +{ > + q_data->enqueue_status = status; > + q_data->queue_stats.enqueue_status_count[status]++; > + rte_bbdev_log(WARNING, "Enqueue Status: %d %#"PRIx64"", > + status, > + q_data->queue_stats.enqueue_status_count[status]); > +} > + > +static inline void > +acc100_enqueue_invalid(struct rte_bbdev_queue_data *q_data) > +{ > + acc100_enqueue_status(q_data, RTE_BBDEV_ENQ_STATUS_INVALID_OP); > +} > + > +static inline void > +acc100_enqueue_ring_full(struct rte_bbdev_queue_data *q_data) > +{ > + acc100_enqueue_status(q_data, RTE_BBDEV_ENQ_STATUS_RING_FULL); > +} > + > +static inline void > +acc100_enqueue_queue_full(struct rte_bbdev_queue_data *q_data) > +{ > + acc100_enqueue_status(q_data, RTE_BBDEV_ENQ_STATUS_QUEUE_FULL); > +} This one is not used in this patch, is that expected? > + > /* Enqueue encode operations for ACC100 device in CB mode. */ > static uint16_t > acc100_enqueue_enc_cb(struct rte_bbdev_queue_data *q_data, > @@ -3449,13 +3478,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)) { > + acc100_enqueue_ring_full(q_data); > break; > + } > avail -= 1; > > ret = enqueue_enc_one_op_cb(q, ops[i], i); > - if (ret < 0) > + if (ret < 0) { > + acc100_enqueue_invalid(q_data); > break; > + } > } > > if (unlikely(i == 0)) > @@ -3505,20 +3538,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)) { > + acc100_enqueue_ring_full(q_data); > break; > + } > avail--; > enq = RTE_MIN(left, ACC100_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) { > + acc100_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) { > + acc100_enqueue_invalid(q_data); > break; > + } > i++; > } > desc_idx++; > @@ -3557,13 +3596,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)) { > + acc100_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) { > + acc100_enqueue_invalid(q_data); > break; > + } > enqueued_cbs += ret; > } > if (unlikely(enqueued_cbs == 0)) > @@ -3618,13 +3661,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)) { > + acc100_enqueue_ring_full(q_data); > break; > + } > avail -= 1; > > ret = enqueue_dec_one_op_cb(q, ops[i], i); > - if (ret < 0) > + if (ret < 0) { > + acc100_enqueue_invalid(q_data); > break; > + } > } > > if (unlikely(i == 0)) > @@ -3678,8 +3725,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) { > + acc100_enqueue_invalid(q_data); > break; > + } > enqueued_cbs += ret; > } > > @@ -3704,8 +3753,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)) { > + acc100_enqueue_ring_full(q_data); > break; > + } > avail -= 1; > > if (i > 0) > @@ -3718,8 +3769,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) { > + acc100_enqueue_invalid(q_data); > break; > + } > } > > if (unlikely(i == 0)) > @@ -3755,13 +3808,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)) { > + acc100_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) { > + acc100_enqueue_invalid(q_data); > break; > + } > enqueued_cbs += ret; > } > Reviewed-by: Maxime Coquelin Thanks, Maxime