The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/qat/qat_api/common/compression/dc_stats.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* SPDX-License-Identifier: BSD-3-Clause */
    2 /* Copyright(c) 2007-2022 Intel Corporation */
    3 /* $FreeBSD$ */
    4 /**
    5  *****************************************************************************
    6  * @file dc_stats.c
    7  *
    8  * @ingroup Dc_DataCompression
    9  *
   10  * @description
   11  *      Implementation of the Data Compression stats operations.
   12  *
   13  *****************************************************************************/
   14 
   15 /*
   16  *******************************************************************************
   17  * Include public/global header files
   18  *******************************************************************************
   19  */
   20 #include "cpa.h"
   21 #include "cpa_dc.h"
   22 #include "icp_accel_devices.h"
   23 #include "icp_adf_debug.h"
   24 /*
   25  *******************************************************************************
   26  * Include private header files
   27  *******************************************************************************
   28  */
   29 #include "lac_common.h"
   30 #include "icp_accel_devices.h"
   31 #include "sal_statistics.h"
   32 #include "dc_session.h"
   33 #include "dc_datapath.h"
   34 #include "lac_mem_pools.h"
   35 #include "sal_service_state.h"
   36 #include "sal_types_compression.h"
   37 #include "dc_stats.h"
   38 
   39 CpaStatus
   40 dcStatsInit(sal_compression_service_t *pService)
   41 {
   42         CpaStatus status = CPA_STATUS_SUCCESS;
   43 
   44         pService->pCompStatsArr =
   45             LAC_OS_MALLOC(COMPRESSION_NUM_STATS * sizeof(QatUtilsAtomic));
   46 
   47         if (pService->pCompStatsArr == NULL) {
   48                 status = CPA_STATUS_RESOURCE;
   49         }
   50 
   51         if (CPA_STATUS_SUCCESS == status) {
   52                 COMPRESSION_STATS_RESET(pService);
   53         }
   54 
   55         return status;
   56 }
   57 
   58 void
   59 dcStatsFree(sal_compression_service_t *pService)
   60 {
   61         if (NULL != pService->pCompStatsArr) {
   62                 LAC_OS_FREE(pService->pCompStatsArr);
   63         }
   64 }
   65 
   66 CpaStatus
   67 cpaDcGetStats(CpaInstanceHandle dcInstance, CpaDcStats *pStatistics)
   68 {
   69         sal_compression_service_t *pService = NULL;
   70         CpaInstanceHandle insHandle = NULL;
   71 
   72         if (CPA_INSTANCE_HANDLE_SINGLE == dcInstance) {
   73                 insHandle = dcGetFirstHandle();
   74         } else {
   75                 insHandle = dcInstance;
   76         }
   77 
   78         pService = (sal_compression_service_t *)insHandle;
   79 
   80         LAC_CHECK_NULL_PARAM(insHandle);
   81         LAC_CHECK_NULL_PARAM(pStatistics);
   82         SAL_RUNNING_CHECK(insHandle);
   83 
   84         SAL_CHECK_INSTANCE_TYPE(insHandle, SAL_SERVICE_TYPE_COMPRESSION);
   85 
   86         /* Retrieves the statistics for compression */
   87         COMPRESSION_STATS_GET(pStatistics, pService);
   88 
   89         return CPA_STATUS_SUCCESS;
   90 }

Cache object: 9f78344cdd230e3260de6401698bd8ef


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.