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/include/dc_stats.h

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.h
    7  *
    8  * @ingroup Dc_DataCompression
    9  *
   10  * @description
   11  *      Definition of the Data Compression stats parameters.
   12  *
   13  *****************************************************************************/
   14 #ifndef DC_STATS_H_
   15 #define DC_STATS_H_
   16 
   17 /* Number of Compression statistics */
   18 #define COMPRESSION_NUM_STATS (sizeof(CpaDcStats) / sizeof(Cpa64U))
   19 
   20 #define COMPRESSION_STAT_INC(statistic, pService)                              \
   21         do {                                                                   \
   22                 if (CPA_TRUE ==                                                \
   23                     pService->generic_service_info.stats->bDcStatsEnabled) {   \
   24                         qatUtilsAtomicInc(                                     \
   25                             &pService->pCompStatsArr[offsetof(CpaDcStats,      \
   26                                                               statistic) /     \
   27                                                      sizeof(Cpa64U)]);         \
   28                 }                                                              \
   29         } while (0)
   30 
   31 /* Macro to get all Compression stats (from internal array of atomics) */
   32 #define COMPRESSION_STATS_GET(compStats, pService)                             \
   33         do {                                                                   \
   34                 int i;                                                         \
   35                 for (i = 0; i < COMPRESSION_NUM_STATS; i++) {                  \
   36                         ((Cpa64U *)compStats)[i] =                             \
   37                             qatUtilsAtomicGet(&pService->pCompStatsArr[i]);    \
   38                 }                                                              \
   39         } while (0)
   40 
   41 /* Macro to reset all Compression stats */
   42 #define COMPRESSION_STATS_RESET(pService)                                      \
   43         do {                                                                   \
   44                 int i;                                                         \
   45                 for (i = 0; i < COMPRESSION_NUM_STATS; i++) {                  \
   46                         qatUtilsAtomicSet(0, &pService->pCompStatsArr[i]);     \
   47                 }                                                              \
   48         } while (0)
   49 
   50 /**
   51 *******************************************************************************
   52 * @ingroup Dc_DataCompression
   53 *      Initialises the compression stats
   54 *
   55 * @description
   56 *      This function allocates and initialises the stats array to 0
   57 *
   58 * @param[in] pService          Pointer to a compression service structure
   59 *
   60 * @retval CPA_STATUS_SUCCESS   initialisation successful
   61 * @retval CPA_STATUS_RESOURCE  array allocation failed
   62 *
   63 *****************************************************************************/
   64 CpaStatus dcStatsInit(sal_compression_service_t *pService);
   65 
   66 /**
   67 *******************************************************************************
   68 * @ingroup Dc_DataCompression
   69 *      Frees the compression stats
   70 *
   71 * @description
   72 *      This function frees the stats array
   73 *
   74 * @param[in] pService          Pointer to a compression service structure
   75 *
   76 * @retval None
   77 *
   78 *****************************************************************************/
   79 void dcStatsFree(sal_compression_service_t *pService);
   80 
   81 #endif /* DC_STATS_H_ */

Cache object: 1e1b3bb7c0014efed7af52aa4671a244


[ 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.