Add new field in show-details to report Sync Write Cache support for a given IOA. This will only be displayed when passing an IOA to command 'show-details'.
This field tells if the adapter has support to sync cache enabled/implemented. It does not mean that sync cache is enabled for a specific device. It has three states: Unsupported - in case adapter doesn't support it; Enabled - if Sync Cache is supported and is globally enabled for this adapter; Disabled - in case it is supported but was disabled for the whole adapter. The information is recovered from the device using the Query Cache Parameters command. It can return a new value now, indicating if Volume Set Caching Mode Page is enabled. Signed-off-by: Gabriel Krisman Bertazi <kris...@linux.vnet.ibm.com> --- iprconfig.c | 9 +++++++++ iprlib.c | 8 +++++++- iprlib.h | 13 ++++++++++--- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/iprconfig.c b/iprconfig.c index 2ee1e5a..b811bfd 100644 --- a/iprconfig.c +++ b/iprconfig.c @@ -2166,6 +2166,15 @@ static char *ioa_details(char *body, struct ipr_dev *dev) body = add_line_to_body(body,_("Current Requested Caching Mode"), _("Default")); } + if (dev->ioa->has_vset_write_cache) { + if (dev->ioa->vset_write_cache) + strcpy(buffer, "Enabled"); + else + strcpy(buffer, "Disabled"); + } else + strcpy(buffer, "Unsupported"); + body = add_line_to_body(body, _("Vset Write Cache"), buffer); + return body; } diff --git a/iprlib.c b/iprlib.c index a31a60d..b03c995 100644 --- a/iprlib.c +++ b/iprlib.c @@ -6384,6 +6384,10 @@ void check_current_config(bool allow_rebuild_refresh) get_dual_ioa_state(ioa); get_subsys_config(ioa); + if (ioa->has_vset_write_cache == 1 && + get_ioa_caching(ioa) == IPR_IOA_VSET_CACHE_ENABLED) + ioa->vset_write_cache = 1; + /* Get Query Array Config Data */ rc = ipr_query_array_config(ioa, allow_rebuild_refresh, 0, 0, 0, qac_data); @@ -7316,7 +7320,9 @@ int get_ioa_caching(struct ipr_ioa *ioa) return IPR_IOA_CACHING_DISABLED_DUAL_ENABLED; else return IPR_IOA_CACHING_DEFAULT_DUAL_ENABLED; - else + else if (term->vset_write_cache_enabled) + return IPR_IOA_VSET_CACHE_ENABLED; + else if (term->disable_caching_requested == IPR_IOA_REQUESTED_CACHING_DISABLED) return IPR_IOA_REQUESTED_CACHING_DISABLED; else diff --git a/iprlib.h b/iprlib.h index fa01186..7bd0172 100644 --- a/iprlib.h +++ b/iprlib.h @@ -216,6 +216,8 @@ typedef uint64_t u64; #define IPR_IOA_CACHING_DEFAULT_DUAL_ENABLED 0x2 #define IPR_IOA_CACHING_DISABLED_DUAL_ENABLED 0x3 +#define IPR_IOA_VSET_CACHE_ENABLED 0x4 + #define IPR_IOA_SET_CACHING_DEFAULT 0x0 #define IPR_IOA_SET_CACHING_DISABLED 0x10 #define IPR_IOA_SET_CACHING_DUAL_DISABLED 0x20 @@ -1501,6 +1503,7 @@ struct ipr_ioa { u8 yl_serial_num[YL_SERIAL_NUM_LEN]; u8 has_vset_write_cache:1; + u8 vset_write_cache:1; struct ipr_dev dev[IPR_MAX_IOA_DEVICES]; struct ipr_multi_ioa_status ioa_status; @@ -2194,13 +2197,17 @@ struct ipr_global_cache_params_term { #if defined (__BIG_ENDIAN_BITFIELD) u8 enable_caching_dual_ioa_failure:1; u8 disable_caching_requested:1; - u8 reserved1:6; + u8 reserved1:2; + u8 vset_write_cache_enabled:1; + u8 reserved2:3; #elif defined (__LITTLE_ENDIAN_BITFIELD) - u8 reserved1:6; + u8 reserved2:3; + u8 vset_write_cache_enabled:1; + u8 reserved1:2; u8 disable_caching_requested:1; u8 enable_caching_dual_ioa_failure:1; #endif - u8 reserved2; + u8 reserved3; }; struct ipr_query_ioa_caching_info { -- 2.1.0 ------------------------------------------------------------------------------ _______________________________________________ Iprdd-devel mailing list Iprdd-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iprdd-devel