Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/include/sys/damap.h
Real path: /usr/include/sys/damap.h
Zurück
/* * Copyright (c) 2009, 2022, Oracle and/or its affiliates. */ #ifndef _SYS_DAMAP_H #define _SYS_DAMAP_H #ifdef __cplusplus extern "C" { #endif /* * Delta (device) Address Map Interfaces * * These interfaces provide time-stablized sets of 'addresses', * where addresses are string representations of device * or bus-specific address. The mechanisms include interfaces to * report and remove address from a map, time stabilization, callouts * to higher-level configuration and unconfiguration actions, and * address lookup functions. * * Per Address Reports * With per-address reporting, the caller reports the addition and removal of * each address visible to it. Each report is independently time stabilized; * Once a report has stabilized, the reported address is either * activated & configured, or unconfigured & released. * * Full Set Reports * When using fullset reporting, the report provider enumerates the entire * set of addresses visible to the provider at a given point in time. * The entire set is then stabilized. * Upon stabilizing, any newly reported addresses are activated & configured * and any previously active addresses which are no longer visible are * automatically unconfigured and released, freeing the provider from * the need to explicitly unconfigure addresses no longer present. * * Stabilization * Once an address has been reported (or reported as removed), the report * is time stabilized before the framework initiates a configuration * or unconfiguration action. If the address is re-reported while undergoing * stabilization, the timer is reset for either the address or the full * set of addresses reported to the map. * * Activation/Release * Once a reported address has passed its stabilization, the address is * 'activated' by the framework. Once activated, the address is passed * to a configuration callout to perform whatever actions are necessary. * If a reported address is deleted or fails to stabilize, the address * is released by the map. * A report provider may register callback functions to be invoked * as part of the address activation & release process. In addition to * the callbacks, a provider can also supply a handle to provider-private * data at the time an address is reported. This handle is returned to * provider as an argument to the activation & release callbacks. * * Lookup/Access * The set of stable addresses contained in a map can be obtained by * calling interfaces to lookup either a single address or the full * list of stable addresses. */ /* * damap_t: Handle to a delta address map * damap_id_t: Handle to an entry of damap_t */ typedef struct __damap_dm *damap_t; typedef id_t damap_id_t; typedef int damap_flavor_t; #define DAMAP_FLAVOR_UNUSED 0 #define DAMAP_FLAVOR_UNKNOWN -1 /* * damap_id_list_t: List of damap_id_handles */ typedef struct __damap_id_list *damap_id_list_t; #define NODAM ((damap_id_t)0) #define BADDAM ((damap_id_t)-1) /* error classes used in consideration of populating xerr bitset */ typedef enum { DAMAP_XERR_CLASS_TRAN_ERR = 1, DAMAP_XERR_CLASS_TIMEOUT, DAMAP_XERR_CLASS_DEV_GONE } damap_xerr_class_t; /* reason for address appearing in xerr bit set. */ typedef enum { DAMAP_XERR_SRC_NA = 0, /* field not applicable */ DAMAP_XERR_SRC_ERROR, /* erred IO threshold exceeded */ DAMAP_XERR_SRC_TIMEOUT, /* IO timeout threshold exceeded */ DAMAP_XERR_SRC_JITTER /* jitter threshold exceeded */ } damap_xerr_src_t; /* * activate_cb: Provider callback when reported address is activated * deactivate_cb: Provider callback when address has been released */ typedef enum { DAMAP_DEACT_RSN_GONE = 0, DAMAP_DEACT_RSN_CFG_FAIL, DAMAP_DEACT_RSN_UNSTBL } damap_deact_rsn_t; typedef void (*damap_activate_cb_t)(void *, char *, int, void **); typedef void (*damap_deactivate_cb_t)(void *, char *, int, void *, damap_deact_rsn_t); /* * configure_cb: Class callout to configure newly activated addresses * unconfig_cb: Class callout to unconfigure deactivated addresses */ typedef enum { DAMAP_CONFIG_RSN_CONFIG_ONE = 0, /* Typical configure callback */ DAMAP_CONFIG_RSN_CONFIG_ALL_CMPLT /* All configs are complete */ } damap_config_rsn_t; typedef enum { DAMAP_UNCONFIG_RSN_GONE = 0, DAMAP_UNCONFIG_RSN_UNSTBL } damap_unconfig_rsn_t; /* damap display options used in mdb macros */ #define DAMAP_STANDARD_DISPLAY 0x01 /* default damap display */ #define DAMAP_VERBOSE_DISPLAY 0x02 #define DAMAP_FENCE_DISPLAY 0x04 #define DAMAP_RECURSION_DISPLAY 0x08 typedef int (*damap_configure_cb_t)(void *, damap_t *, damap_id_t, damap_config_rsn_t); typedef int (*damap_reconfig_cb_t)(void *, damap_t *, damap_id_t); typedef int (*damap_unconfig_cb_t)(void *, damap_t *, damap_id_t, damap_unconfig_rsn_t, damap_xerr_src_t); /* * Map reporting mode */ typedef enum {DAMAP_REPORT_PERADDR, DAMAP_REPORT_FULLSET} damap_rptmode_t; /* * Map create options flags * DAMAP_SERIALCONFIG - serialize activate/deactivate operations * DAMAP_MTCONFIG - multithread config/unconfg operations */ #define DAMAP_SERIALCONFIG 0 #define DAMAP_MTCONFIG 1 /* * damap_empty methods * * DAMAP_EMPTY_NORMAL: Honor map stabilization period * DAMAP_EMPTY_IMMEDIATE: Stabilize immediately * DAMAP_EMPTY_SYNC: empty before return */ typedef enum { DAMAP_EMPTY_NORMAL, DAMAP_EMPTY_IMMEDIATE, DAMAP_EMPTY_SYNC } damap_empty_method_t; /* * structure to pass various thresholds used in damap * * dp_stable_usec: # of quiescent microseconds before report/map is stable * NOTE: value of 1usec->1tick. * dp_error_win_usec: Size of transport error detection window (in usecs) * dp_error_thresh: Error threshold ([0..100] percent) * 0 = No threshold (Never unconfig based on xp errors) * 100 = Every completion within the window must have had * a transport error to trigger deactivation * dp_error_iops_thresh:Must be non-negative. This indicates the minimum * average I/Os per second in a window in order to trigger * any action based on errors. If this is 0, the DAM will * use its own default value. * dp_fence_sec: # of seconds a device address deactivated due to * instability is banned from configuration/activation * processing. This misbehaving address still participates * in report/map stabilization but is prohibited from * activation/configuration until its fence time has * completed. * dp_timeout_threshold:Threshold for consecutive timeout transport errors * reported against an address if exceeded would lead to * that address determined as unstable resulting in * unconfigure/deactivation and fencing processing. */ typedef struct { int dp_stable_usec; int dp_error_win_usec; int dp_error_thresh; int dp_error_iops_thresh; int dp_fence_sec; int dp_timeout_threshold; } damap_params_t; int damap_create(char *, damap_rptmode_t, int, damap_params_t *, void *, damap_activate_cb_t, damap_deactivate_cb_t, void *, damap_configure_cb_t, damap_reconfig_cb_t, damap_unconfig_cb_t, damap_t **); void damap_destroy(damap_t *); char *damap_name(damap_t *); int damap_size(damap_t *); int damap_is_empty(damap_t *, int *); int damap_sync(damap_t *, int, int); int damap_empty(damap_t *, damap_empty_method_t); int damap_addr_add(damap_t *, char *, damap_flavor_t, void *); int damap_addr_del(damap_t *, char *, damap_flavor_t); int damap_addrid_del(damap_t *, int); int damap_addrid_isdevgone(damap_t *, damap_id_t); int damap_addrset_begin(damap_t *); int damap_addrset_add(damap_t *, char *, damap_flavor_t, void *, int); int damap_addrset_end(damap_t *); int damap_addrset_flush(damap_t *); int damap_addrset_reset(damap_t *, int); damap_id_t damap_id_next(damap_t *, damap_id_list_t, damap_id_t); char *damap_id2addr(damap_t *, damap_id_t); damap_flavor_t damap_id2flavor(damap_t *, damap_id_t); void damap_id_rele(damap_t *, damap_id_t); int damap_id_ref(damap_t *, damap_id_t); void damap_id_list_rele(damap_t *, damap_id_list_t); void *damap_id_priv_get(damap_t *, damap_id_t); void damap_id_priv_set(damap_t *, damap_id_t, void *); void *damap_id_priv_err_get(damap_t *, damap_id_t); void damap_id_priv_err_set(damap_t *, damap_id_t, void *); damap_t *damap_parentdamap_get(damap_t *); damap_t *damap_id_subdamap_get(damap_t *, damap_id_t); void damap_id_subdamap_set(damap_t *, damap_id_t, damap_t *); damap_id_t damap_lookup(damap_t *, char *, boolean_t); int damap_lookup_all(damap_t *, damap_id_list_t *); void damap_x_bind(damap_t *, damap_id_t, uint32_t **); void damap_x_unbind(damap_t *, damap_id_t, uint32_t **); void damap_xerr_report(damap_t *, damap_id_t, damap_xerr_class_t); int damap_timeout_threshold(damap_t *); #define DAM_SUCCESS 0 #define DAM_EEXIST 1 #define DAM_MAPFULL 2 #define DAM_EINVAL 3 #define DAM_FAILURE 4 #define DAM_SHAME 5 #ifdef __cplusplus } #endif #endif /* _SYS_DAMAP_H */