zfcp: Add sysfs attributes for polling adapter data
Subsystems (3)
cover zfcp: Add sysfs attributes for polling adapter data
The FCP adapter on the System z platform provides some additional data that can be polled from device drivers. The first two patches in this series prepare the FSF command layer in zfcp for polling the additional data. The third patch implements the sysfs attributes that can be read to get the data.
The patch series is a part of the previously send zfcp adapter statistics. We split old patch to make the change more transparent for reviewing.
The patch series applies to current scsi-misc.
Christof
PATCH 1/3 zfcp: Wait for free SBAL during exchange config
From: Swen Schillig <[email protected]>
When sending a exchange config data command, wait for a free SBAL. This does not matter during adapter initialization, but this is required for pulling adapter statistics during high I/O load.
--- drivers/s390/scsi/zfcp_fsf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/s390/scsi/zfcp_fsf.c +2 -1
@@ -1927,7 +1927,8 @@ zfcp_fsf_exchange_config_data_sync(struc/* setup new FSF request */ retval =zfcp_fsf_req_create (adapter,FSF_QTCB_EXCHANGE_CONFIG_DATA , -0 ,NULL , &lock_flags, &fsf_req); +ZFCP_WAIT_FOR_SBAL ,NULL , &lock_flags, + &fsf_req);if (retval) { ZFCP_LOG_INFO("error: Could not create exchange configuration " "data request for adapter %s.\n",
PATCH 2/3 zfcp: Print some messages only during ERP
In reply to Christof SchmittFrom: Swen Schillig <[email protected]>
When statistics are polled from sysfs, the statistics use the same commands as the adapter initialization. Change the messages printed here, so they are only printed during initialization and not for each poll of adapter data.
--- drivers/s390/scsi/zfcp_fsf.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-)
drivers/s390/scsi/zfcp_fsf.c +19 -17
@@ -2036,21 +2036,21 @@ zfcp_fsf_exchange_config_evaluate(struct min(FC_SERIAL_NUMBER_SIZE, 17)); } -ZFCP_LOG_NORMAL ("The adapter %s reported the following " -"characteristics:\n" -"WWNN 0x%016Lx, " -"WWPN 0x%016Lx, " -"S_ID 0x%06x,\n" -"adapter version 0x%x, " -"LIC version 0x%x, " -"FC link speed %d Gb/s\n" , -zfcp_get_busid_by_adapter (adapter), - (wwn_t )fc_host_node_name (shost), - (wwn_t )fc_host_port_name (shost), -fc_host_port_id (shost), - adapter->hydra_version, - adapter->fsf_lic_version, -fc_host_speed (shost)); +if (fsf_req->erp_action) +ZFCP_LOG_NORMAL ("The adapter %s reported the following " +"characteristics:\n" +"WWNN 0x%016Lx, WWPN 0x%016Lx, " +"S_ID 0x%06x,\n" +"adapter version 0x%x, " +"LIC version 0x%x, " +"FC link speed %d Gb/s\n" , +zfcp_get_busid_by_adapter (adapter), + (wwn_t )fc_host_node_name (shost), + (wwn_t )fc_host_port_name (shost), +fc_host_port_id (shost), + adapter->hydra_version, + adapter->fsf_lic_version, +fc_host_speed (shost));if (ZFCP_QTCB_VERSION < bottom->low_qtcb_version) {ZFCP_LOG_NORMAL ("error: the adapter %s " "only supports newer control block "
@@ -2115,8 +2115,10 @@ zfcp_fsf_exchange_config_data_handler(stzfcp_erp_adapter_shutdown (adapter,0 ,127 , fsf_req);return -EIO ;case FC_PORTTYPE_NPORT : -ZFCP_LOG_NORMAL ("Switched fabric fibrechannel " -"network detected at adapter %s.\n" , +if (fsf_req->erp_action) +ZFCP_LOG_NORMAL ("Switched fabric fibrechannel " +"network detected at adapter " +"%s.\n" ,zfcp_get_busid_by_adapter (adapter));break ;default :
PATCH 3/3 zfcp: Add some statistics provided by the FCP adapter to the sysfs
In reply to Christof SchmittFrom: Swen Schillig <[email protected]>
The new FCP adapter statistics provide a variety of information about the virtual adapter (subchannel). In order to collect this information the zfcp driver is extended to query this information.
The information provided by the new FCP adapter statistics can be fetched by reading from the following files in the sysfs filesystem
/sys/class/scsi_host/host<n>/seconds_active
/sys/class/scsi_host/host<n>/requests
/sys/class/scsi_host/host<n>/megabytes
/sys/class/scsi_host/host<n>/utilization
These are the statistics on a virtual adapter (subchannel) level.
The information provided is raw and not modified or interpreted by any means. No interpretation or modification of the values is done by the zfcp driver.
--- drivers/s390/scsi/zfcp_fsf.h | 18 +++++- drivers/s390/scsi/zfcp_scsi.c | 114 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+), 2 deletions(-)
drivers/s390/scsi/zfcp_fsf.h +16 -2
@@ -213,6 +213,7 @@#define FSF_FEATURE_HBAAPI_MANAGEMENT 0x00000010#define FSF_FEATURE_ELS_CT_CHAINED_SBALS 0x00000020#define FSF_FEATURE_UPDATE_ALERT 0x00000100 +#define FSF_FEATURE_MEASUREMENT_DATA 0x00000200/* host connection features */ #define FSF_FEATURE_NPIV_MODE 0x00000001
@@ -340,6 +341,15 @@ struct fsf_qtcb_prefix {u8 res1[20 ]; } __attribute__ ((packed)); +struct fsf_statistics_info { +u64 input_req; +u64 output_req; +u64 control_req; +u64 input_mb; +u64 output_mb; +u64 seconds_act; +} __attribute__ ((packed)); +union fsf_status_qual {u8 byte[FSF_STATUS_QUALIFIER_SIZE ];u16 halfword[FSF_STATUS_QUALIFIER_SIZE /sizeof (u16)];
@@ -436,7 +446,8 @@ struct fsf_qtcb_bottom_config {u32 hardware_version;u8 serial_number[32 ];struct fsf_nport_serv_param plogi_payload; -u8 res4[160 ]; +struct fsf_statistics_info stat_info; +u8 res4[112 ]; } __attribute__ ((packed));struct fsf_qtcb_bottom_port {
@@ -469,7 +480,10 @@ struct fsf_qtcb_bottom_port {u64 control_requests;u64 input_mb;/* where 1 MByte == 1.000.000 Bytes */ u64 output_mb;/* where 1 MByte == 1.000.000 Bytes */ -u8 res2[256 ]; +u8 cp_util; +u8 cb_util; +u8 a_util; +u8 res2[253 ]; } __attribute__ ((packed));union fsf_qtcb_bottom {
drivers/s390/scsi/zfcp_scsi.c +114 -0
130 lines not on this page · raw message