1 /* SPDX-License-Identifier: MIT */ 2 /* 3 * Copyright © 2024 Intel Corporation 4 */ 5 6 #ifndef _XE_GUC_KLV_THRESHOLDS_SET_TYPES_H_ 7 #define _XE_GUC_KLV_THRESHOLDS_SET_TYPES_H_ 8 9 #include "xe_args.h" 10 11 /** 12 * MAKE_XE_GUC_KLV_THRESHOLDS_SET - Generate various GuC thresholds definitions. 13 * @define: name of the inner macro to expand. 14 * 15 * The GuC firmware is able to monitor VF's adverse activity and will notify the 16 * PF driver once any threshold is exceeded. 17 * 18 * This super macro allows various conversions between the GuC adverse event 19 * threshold KLV definitions and the driver code without repeating similar code 20 * or risking missing some cases. 21 * 22 * For each GuC threshold definition, the inner macro &define will be provided 23 * with the &TAG, that corresponds to the GuC threshold KLV key name defined by 24 * ABI and the associated &NAME, that may be used in code or debugfs/sysfs:: 25 * 26 * define(TAG, NAME) 27 */ 28 #define MAKE_XE_GUC_KLV_THRESHOLDS_SET(define) \ 29 define(CAT_ERR, cat_error_count) \ 30 define(ENGINE_RESET, engine_reset_count) \ 31 define(PAGE_FAULT, page_fault_count) \ 32 define(H2G_STORM, guc_time_us) \ 33 define(IRQ_STORM, irq_time_us) \ 34 define(DOORBELL_STORM, doorbell_time_us) \ 35 /* end */ 36 37 /** 38 * XE_GUC_KLV_NUM_THRESHOLDS - Number of GuC thresholds KLVs. 39 * 40 * Calculated automatically using &MAKE_XE_GUC_KLV_THRESHOLDS_SET. 41 */ 42 #define XE_GUC_KLV_NUM_THRESHOLDS \ 43 (CALL_ARGS(COUNT_ARGS, MAKE_XE_GUC_KLV_THRESHOLDS_SET(ARGS_SEP_COMMA)) - 1) 44 45 /** 46 * MAKE_XE_GUC_KLV_THRESHOLD_INDEX - Create enumerator name. 47 * @TAG: unique TAG of the enum xe_guc_klv_threshold_index. 48 */ 49 #define MAKE_XE_GUC_KLV_THRESHOLD_INDEX(TAG) \ 50 CONCATENATE(XE_GUC_KLV_THRESHOLD_INDEX_, TAG) 51 52 /** 53 * enum xe_guc_klv_threshold_index - Index of the tracked GuC threshold. 54 * 55 * This enum is automatically generated using &MAKE_XE_GUC_KLV_THRESHOLDS_SET. 56 * All these generated enumerators will only be used by the also generated code. 57 */ 58 enum xe_guc_klv_threshold_index { 59 #define define_xe_guc_klv_threshold_index_enum(TAG, ...) \ 60 \ 61 MAKE_XE_GUC_KLV_THRESHOLD_INDEX(TAG), 62 63 /* private: auto-generated enum definitions */ 64 MAKE_XE_GUC_KLV_THRESHOLDS_SET(define_xe_guc_klv_threshold_index_enum) 65 #undef define_xe_guc_klv_threshold_index_enum 66 }; 67 68 #endif 69