From patchwork Thu Apr 15 01:49:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy McDaniel X-Patchwork-Id: 91504 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 CB4C1A0562; Thu, 15 Apr 2021 03:52:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C9430161E72; Thu, 15 Apr 2021 03:51:01 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id B1407161E45 for ; Thu, 15 Apr 2021 03:50:44 +0200 (CEST) IronPort-SDR: 8Ux2Fbvt56S5+1w+kndatXiBG8Ywwg3QDsU4f5VJZfxHE975L8L6IPDRbuo9gqeh6+V/RYCnyu ufM7ceeHhJ0A== X-IronPort-AV: E=McAfee;i="6200,9189,9954"; a="215272822" X-IronPort-AV: E=Sophos;i="5.82,223,1613462400"; d="scan'208";a="215272822" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2021 18:50:43 -0700 IronPort-SDR: vc9tBWzFq4s2IDk1pnGNSejUssEtPrHTWgvkjGxmf8NFkKLREUf7Le1sLmZVna5jhbCGPBtCLr mPuCiTe7twow== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,223,1613462400"; d="scan'208";a="382569891" Received: from txasoft-yocto.an.intel.com ([10.123.72.192]) by orsmga003.jf.intel.com with ESMTP; 14 Apr 2021 18:50:42 -0700 From: Timothy McDaniel To: Cc: dev@dpdk.org, erik.g.carrillo@intel.com, harry.van.haaren@intel.com, jerinj@marvell.com, thomas@monjalon.net Date: Wed, 14 Apr 2021 20:49:12 -0500 Message-Id: <1618451359-20693-21-git-send-email-timothy.mcdaniel@intel.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1618451359-20693-1-git-send-email-timothy.mcdaniel@intel.com> References: <20210316221857.2254-2-timothy.mcdaniel@intel.com> <1618451359-20693-1-git-send-email-timothy.mcdaniel@intel.com> Subject: [dpdk-dev] [PATCH v4 20/27] event/dlb2: use new implementation of resource header 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 Sender: "dev" A temporary version of dlb_resource.h (dlb_resource_new.h) was used by the previous commits in this patch series. Merge the two files now that DLB v2.5 support has been fully added to dlb_resource.c. Signed-off-by: Timothy McDaniel --- drivers/event/dlb2/pf/base/dlb2_osdep.h | 2 - drivers/event/dlb2/pf/base/dlb2_resource.h | 36 +++++++++ .../event/dlb2/pf/base/dlb2_resource_new.c | 2 +- .../event/dlb2/pf/base/dlb2_resource_new.h | 73 ------------------- drivers/event/dlb2/pf/dlb2_main.c | 2 +- drivers/event/dlb2/pf/dlb2_pf.c | 2 +- 6 files changed, 39 insertions(+), 78 deletions(-) delete mode 100644 drivers/event/dlb2/pf/base/dlb2_resource_new.h diff --git a/drivers/event/dlb2/pf/base/dlb2_osdep.h b/drivers/event/dlb2/pf/base/dlb2_osdep.h index 3b0ca84ba..cffe22f3c 100644 --- a/drivers/event/dlb2/pf/base/dlb2_osdep.h +++ b/drivers/event/dlb2/pf/base/dlb2_osdep.h @@ -17,8 +17,6 @@ #include #include "../dlb2_main.h" -/* TEMPORARY inclusion of both headers for merge */ -#include "dlb2_resource_new.h" #include "dlb2_resource.h" #include "../../dlb2_log.h" diff --git a/drivers/event/dlb2/pf/base/dlb2_resource.h b/drivers/event/dlb2/pf/base/dlb2_resource.h index 00a0b6b57..684049cd6 100644 --- a/drivers/event/dlb2/pf/base/dlb2_resource.h +++ b/drivers/event/dlb2/pf/base/dlb2_resource.h @@ -8,6 +8,42 @@ #include "dlb2_user.h" #include "dlb2_osdep_types.h" +/** + * dlb2_resource_init() - initialize the device + * @hw: pointer to struct dlb2_hw. + * @ver: device version. + * + * This function initializes the device's software state (pointed to by the hw + * argument) and programs global scheduling QoS registers. This function should + * be called during driver initialization. + * + * The dlb2_hw struct must be unique per DLB 2.0 device and persist until the + * device is reset. + * + * Return: + * Returns 0 upon success, <0 otherwise. + */ +int dlb2_resource_init(struct dlb2_hw *hw, enum dlb2_hw_ver ver); + +/** + * dlb2_clr_pmcsr_disable() - power on bulk of DLB 2.0 logic + * @hw: dlb2_hw handle for a particular device. + * @ver: device version. + * + * Clearing the PMCSR must be done at initialization to make the device fully + * operational. + */ +void dlb2_clr_pmcsr_disable(struct dlb2_hw *hw, enum dlb2_hw_ver ver); + +/** + * dlb2_resource_free() - free device state memory + * @hw: dlb2_hw handle for a particular device. + * + * This function frees software state pointed to by dlb2_hw. This function + * should be called when resetting the device or unloading the driver. + */ +void dlb2_resource_free(struct dlb2_hw *hw); + /** * dlb2_resource_reset() - reset in-use resources to their initial state * @hw: dlb2_hw handle for a particular device. diff --git a/drivers/event/dlb2/pf/base/dlb2_resource_new.c b/drivers/event/dlb2/pf/base/dlb2_resource_new.c index 927b65568..2f66b2c71 100644 --- a/drivers/event/dlb2/pf/base/dlb2_resource_new.c +++ b/drivers/event/dlb2/pf/base/dlb2_resource_new.c @@ -11,7 +11,7 @@ #include "dlb2_osdep_bitmap.h" #include "dlb2_osdep_types.h" #include "dlb2_regs_new.h" -#include "dlb2_resource_new.h" /* TEMP FOR UPSTREAMPATCHES */ +#include "dlb2_resource.h" #include "../../dlb2_priv.h" #include "../../dlb2_inline_fns.h" diff --git a/drivers/event/dlb2/pf/base/dlb2_resource_new.h b/drivers/event/dlb2/pf/base/dlb2_resource_new.h deleted file mode 100644 index 51f31543c..000000000 --- a/drivers/event/dlb2/pf/base/dlb2_resource_new.h +++ /dev/null @@ -1,73 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2016-2020 Intel Corporation - */ - -#ifndef __DLB2_RESOURCE_NEW_H -#define __DLB2_RESOURCE_NEW_H - -#include "dlb2_user.h" -#include "dlb2_osdep_types.h" - -/** - * dlb2_resource_init() - initialize the device - * @hw: pointer to struct dlb2_hw. - * @ver: device version. - * - * This function initializes the device's software state (pointed to by the hw - * argument) and programs global scheduling QoS registers. This function should - * be called during driver initialization. - * - * The dlb2_hw struct must be unique per DLB 2.0 device and persist until the - * device is reset. - * - * Return: - * Returns 0 upon success, <0 otherwise. - */ -int dlb2_resource_init(struct dlb2_hw *hw, enum dlb2_hw_ver ver); - -/** - * dlb2_clr_pmcsr_disable() - power on bulk of DLB 2.0 logic - * @hw: dlb2_hw handle for a particular device. - * @ver: device version. - * - * Clearing the PMCSR must be done at initialization to make the device fully - * operational. - */ -void dlb2_clr_pmcsr_disable(struct dlb2_hw *hw, enum dlb2_hw_ver ver); - -/** - * dlb2_finish_unmap_qid_procedures() - finish any pending unmap procedures - * @hw: dlb2_hw handle for a particular device. - * - * This function attempts to finish any outstanding unmap procedures. - * This function should be called by the kernel thread responsible for - * finishing map/unmap procedures. - * - * Return: - * Returns the number of procedures that weren't completed. - */ -unsigned int dlb2_finish_unmap_qid_procedures(struct dlb2_hw *hw); - -/** - * dlb2_finish_map_qid_procedures() - finish any pending map procedures - * @hw: dlb2_hw handle for a particular device. - * - * This function attempts to finish any outstanding map procedures. - * This function should be called by the kernel thread responsible for - * finishing map/unmap procedures. - * - * Return: - * Returns the number of procedures that weren't completed. - */ -unsigned int dlb2_finish_map_qid_procedures(struct dlb2_hw *hw); - -/** - * dlb2_resource_free() - free device state memory - * @hw: dlb2_hw handle for a particular device. - * - * This function frees software state pointed to by dlb2_hw. This function - * should be called when resetting the device or unloading the driver. - */ -void dlb2_resource_free(struct dlb2_hw *hw); - -#endif /* __DLB2_RESOURCE_NEW_H */ diff --git a/drivers/event/dlb2/pf/dlb2_main.c b/drivers/event/dlb2/pf/dlb2_main.c index 5c0640b3c..bac07f097 100644 --- a/drivers/event/dlb2/pf/dlb2_main.c +++ b/drivers/event/dlb2/pf/dlb2_main.c @@ -17,7 +17,7 @@ #include "base/dlb2_regs_new.h" #include "base/dlb2_hw_types_new.h" -#include "base/dlb2_resource_new.h" +#include "base/dlb2_resource.h" #include "base/dlb2_osdep.h" #include "dlb2_main.h" #include "../dlb2_user.h" diff --git a/drivers/event/dlb2/pf/dlb2_pf.c b/drivers/event/dlb2/pf/dlb2_pf.c index 1e815f20d..880964a29 100644 --- a/drivers/event/dlb2/pf/dlb2_pf.c +++ b/drivers/event/dlb2/pf/dlb2_pf.c @@ -40,7 +40,7 @@ #include "dlb2_main.h" #include "base/dlb2_hw_types_new.h" #include "base/dlb2_osdep.h" -#include "base/dlb2_resource_new.h" +#include "base/dlb2_resource.h" static const char *event_dlb2_pf_name = RTE_STR(EVDEV_DLB2_NAME_PMD);