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 5F7E9425D9; Mon, 18 Sep 2023 17:20:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DACC24025D; Mon, 18 Sep 2023 17:20:57 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 0D5334025C for ; Mon, 18 Sep 2023 17:20:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695050455; 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=zVjkM9Wi6jUtx8KaYgZdisFlAaKmx/8s+4yYMzvrm4c=; b=i0r7auPuVJkEnu8HUMOKXm2Q5+4q9r4dRvmsb0gLcZ0cgtbgGW12HJLRKWM8n4mkitVrLQ ZtXWhGb9b8H00wwU64GvgaEfwSfaBB36Q7LmPXhvAmZ5dJ2Leh4h+fnaSurSCvxbzmAJQW pnH+gYTVNxoGiVXZp6/ZS/9uKpuYtAc= Received: from mimecast-mx02.redhat.com (mx-ext.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-435-r7KQ-zF-PSGTa-fpd57UqA-1; Mon, 18 Sep 2023 11:20:51 -0400 X-MC-Unique: r7KQ-zF-PSGTa-fpd57UqA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1C94A29AA2C0; Mon, 18 Sep 2023 15:20:51 +0000 (UTC) Received: from [10.39.208.35] (unknown [10.39.208.35]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BD831401408; Mon, 18 Sep 2023 15:20:49 +0000 (UTC) Message-ID: <7e403933-adb1-2674-7030-62cbb9587dc9@redhat.com> Date: Mon, 18 Sep 2023 17:20:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 To: Nicolas Chautru , dev@dpdk.org Cc: trix@redhat.com, hemant.agrawal@nxp.com, david.marchand@redhat.com, hernan.vargas@intel.com References: <20230615164901.40845-1-nicolas.chautru@intel.com> <20230615164901.40845-5-nicolas.chautru@intel.com> From: Maxime Coquelin Subject: Re: [PATCH v2 4/5] bbdev: improving error handling for queue configuration In-Reply-To: <20230615164901.40845-5-nicolas.chautru@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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 6/15/23 18:49, Nicolas Chautru wrote: > Refactor of the error handling based on available priority > queue to be more generic. > > Signed-off-by: Nicolas Chautru > --- > lib/bbdev/rte_bbdev.c | 15 ++++++--------- > 1 file changed, 6 insertions(+), 9 deletions(-) > > diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c > index 26fc077bdc..589b796ea3 100644 > --- a/lib/bbdev/rte_bbdev.c > +++ b/lib/bbdev/rte_bbdev.c > @@ -441,6 +441,7 @@ rte_bbdev_queue_configure(uint16_t dev_id, uint16_t queue_id, > const struct rte_bbdev_op_cap *p; > struct rte_bbdev_queue_conf *stored_conf; > const char *op_type_str; > + unsigned int max_priority; > VALID_DEV_OR_RET_ERR(dev, dev_id); > > VALID_DEV_OPS_OR_RET_ERR(dev, dev_id); > @@ -494,20 +495,16 @@ rte_bbdev_queue_configure(uint16_t dev_id, uint16_t queue_id, > conf->queue_size, queue_id, dev_id); > return -EINVAL; > } > - if (conf->op_type == RTE_BBDEV_OP_TURBO_DEC && > - conf->priority > dev_info.max_ul_queue_priority) { > + if ((uint8_t)conf->op_type >= RTE_BBDEV_OP_TYPE_SIZE_MAX) { > rte_bbdev_log(ERR, > - "Priority (%u) of queue %u of bbdev %u must be <= %u", > - conf->priority, queue_id, dev_id, > - dev_info.max_ul_queue_priority); > + "Invalid operation type (%u) ", conf->op_type); > return -EINVAL; > } > - if (conf->op_type == RTE_BBDEV_OP_TURBO_ENC && > - conf->priority > dev_info.max_dl_queue_priority) { > + max_priority = dev_info.queue_priority[conf->op_type]; > + if (conf->priority > max_priority) { > rte_bbdev_log(ERR, > "Priority (%u) of queue %u of bbdev %u must be <= %u", > - conf->priority, queue_id, dev_id, > - dev_info.max_dl_queue_priority); > + conf->priority, queue_id, dev_id, max_priority); > return -EINVAL; > } > } Reviewed-by: Maxime Coquelin Maxime