From patchwork Sat Jul 2 16:03:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy McDaniel X-Patchwork-Id: 113639 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 016ACA0093; Sat, 2 Jul 2022 18:04:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF98A42B6C; Sat, 2 Jul 2022 18:03:49 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id D646541132 for ; Sat, 2 Jul 2022 18:03:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656777826; x=1688313826; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0jazhvvuNDnxW1EBec2phsOx1f+WDm0lXEHz8d/OGjU=; b=aaN049XgFKFMF8jRseLlN8RO5aE7VLkyOxbaU79XTNCn8YtPCqmL7y0n m/iKbKnaCWi3e0zo3LmVUmqwkqybfBxCvyh0T13o97p2oJcuP/qrSMWSD 1O3UW3n9UPo4sjCxLVAhX/8Y8jcez8wFga6hgTDKLXBcXeJPfLGZYSzYl A/yGaJem7bnN69fMKfZDwGfGHU97U3kU3jC0UmpsGrh0075fuZPX+iWvw 7vQodJCt4EhoChALOA6IzKxTEEDh7UDBTLeahNQs/2/zPaK92mTYilSxN fHbJDb1iMFJPRKwnQx4QckYddiG96oEAesMfaenjkB9Ew06RIYesXRCy5 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10396"; a="271616951" X-IronPort-AV: E=Sophos;i="5.92,240,1650956400"; d="scan'208";a="271616951" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2022 09:03:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,240,1650956400"; d="scan'208";a="648776827" Received: from txanpdk03.an.intel.com ([10.123.117.78]) by fmsmga008.fm.intel.com with ESMTP; 02 Jul 2022 09:03:44 -0700 From: Timothy McDaniel To: jerinj@marvell.com Cc: dev@dpdk.org, timothy.mcdaniel@intel.com Subject: [PATCH v2 3/5] event/dlb2: fix cq depth override Date: Sat, 2 Jul 2022 11:03:38 -0500 Message-Id: <20220702160340.1591058-4-timothy.mcdaniel@intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220702160340.1591058-1-timothy.mcdaniel@intel.com> References: <20220629153638.1269743-1-timothy.mcdaniel@intel.com> <20220702160340.1591058-1-timothy.mcdaniel@intel.com> MIME-Version: 1.0 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 This commit fixes a bug, where we could assign a cq depth of zero, leading to a subsequent divide-by-zero fault. It also fixes an issue where the original default cq depth was returned on a query, insgtead of the overridden value. Fixes: 86fe66d45667 ("event/dlb2: allow CQ depths up to 1024") Cc: timothy.mcdaniel@intel.com Signed-off-by: Timothy McDaniel --- drivers/event/dlb2/dlb2.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c index a6182a1ac7..b50cd8e5ce 100644 --- a/drivers/event/dlb2/dlb2.c +++ b/drivers/event/dlb2/dlb2.c @@ -4505,7 +4505,14 @@ dlb2_primary_eventdev_probe(struct rte_eventdev *dev, dlb2->hw_credit_quanta = dlb2_args->hw_credit_quanta; dlb2->default_depth_thresh = dlb2_args->default_depth_thresh; dlb2->vector_opts_enabled = dlb2_args->vector_opts_enabled; - dlb2->max_cq_depth = dlb2_args->max_cq_depth; + + + if (dlb2_args->max_cq_depth != 0) + dlb2->max_cq_depth = dlb2_args->max_cq_depth; + else + dlb2->max_cq_depth = DLB2_DEFAULT_CQ_DEPTH; + + evdev_dlb2_default_info.max_event_port_dequeue_depth = dlb2->max_cq_depth; err = dlb2_iface_open(&dlb2->qm_instance, name); if (err < 0) {