Commit b874ee07 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] s390: zfcp host adapater

From: Martin Schwidefsky <schwidefsky@de.ibm.com>

zfcp host adapter change:
 - Remove misplaced dot in error message.
 - Remove unused performance statistics code.
parent 1f5a9d4e
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
*/ */
/* this drivers version (do not edit !!! generated and updated by cvs) */ /* this drivers version (do not edit !!! generated and updated by cvs) */
#define ZFCP_AUX_REVISION "$Revision: 1.107 $" #define ZFCP_AUX_REVISION "$Revision: 1.108 $"
#include "zfcp_ext.h" #include "zfcp_ext.h"
...@@ -47,12 +47,6 @@ int zfcp_reboot_handler(struct notifier_block *, unsigned long, void *); ...@@ -47,12 +47,6 @@ int zfcp_reboot_handler(struct notifier_block *, unsigned long, void *);
static void zfcp_ns_gid_pn_handler(unsigned long); static void zfcp_ns_gid_pn_handler(unsigned long);
/* miscellaneous */ /* miscellaneous */
#ifdef ZFCP_STAT_REQSIZES
static int zfcp_statistics_init_all(void);
static int zfcp_statistics_clear_all(void);
static int zfcp_statistics_clear(struct list_head *);
static int zfcp_statistics_new(struct list_head *, u32);
#endif
static inline int zfcp_sg_list_alloc(struct zfcp_sg_list *, size_t); static inline int zfcp_sg_list_alloc(struct zfcp_sg_list *, size_t);
static inline int zfcp_sg_list_free(struct zfcp_sg_list *); static inline int zfcp_sg_list_free(struct zfcp_sg_list *);
...@@ -136,96 +130,6 @@ _zfcp_hex_dump(char *addr, int count) ...@@ -136,96 +130,6 @@ _zfcp_hex_dump(char *addr, int count)
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_OTHER #define ZFCP_LOG_AREA ZFCP_LOG_AREA_OTHER
#ifdef ZFCP_STAT_REQSIZES
static int
zfcp_statistics_clear(struct list_head *head)
{
int retval = 0;
unsigned long flags;
struct zfcp_statistics *stat, *tmp;
write_lock_irqsave(&zfcp_data.stat_lock, flags);
list_for_each_entry_safe(stat, tmp, head, list) {
list_del(&stat->list);
kfree(stat);
}
write_unlock_irqrestore(&zfcp_data.stat_lock, flags);
return retval;
}
/* Add new statistics entry */
static int
zfcp_statistics_new(struct list_head *head, u32 num)
{
int retval = 0;
struct zfcp_statistics *stat;
stat = kmalloc(sizeof (struct zfcp_statistics), GFP_ATOMIC);
if (stat) {
memset(stat, 0, sizeof (struct zfcp_statistics));
stat->num = num;
stat->occurrence = 1;
list_add_tail(&stat->list, head);
} else
zfcp_data.stat_errors++;
return retval;
}
int
zfcp_statistics_inc(struct list_head *head, u32 num)
{
int retval = 0;
unsigned long flags;
struct zfcp_statistics *stat;
write_lock_irqsave(&zfcp_data.stat_lock, flags);
list_for_each_entry(stat, head, list) {
if (stat->num == num) {
stat->occurrence++;
goto unlock;
}
}
/* occurrence must be initialized to 1 */
zfcp_statistics_new(head, num);
unlock:
write_unlock_irqrestore(&zfcp_data.stat_lock, flags);
return retval;
}
static int
zfcp_statistics_init_all(void)
{
int retval = 0;
rwlock_init(&zfcp_data.stat_lock);
INIT_LIST_HEAD(&zfcp_data.read_req_head);
INIT_LIST_HEAD(&zfcp_data.write_req_head);
INIT_LIST_HEAD(&zfcp_data.read_sg_head);
INIT_LIST_HEAD(&zfcp_data.write_sg_head);
INIT_LIST_HEAD(&zfcp_data.read_sguse_head);
INIT_LIST_HEAD(&zfcp_data.write_sguse_head);
return retval;
}
static int
zfcp_statistics_clear_all(void)
{
int retval = 0;
zfcp_statistics_clear(&zfcp_data.read_req_head);
zfcp_statistics_clear(&zfcp_data.write_req_head);
zfcp_statistics_clear(&zfcp_data.read_sg_head);
zfcp_statistics_clear(&zfcp_data.write_sg_head);
zfcp_statistics_clear(&zfcp_data.read_sguse_head);
zfcp_statistics_clear(&zfcp_data.write_sguse_head);
return retval;
}
#endif /* ZFCP_STAT_REQSIZES */
static inline int static inline int
zfcp_fsf_req_is_scsi_cmnd(struct zfcp_fsf_req *fsf_req) zfcp_fsf_req_is_scsi_cmnd(struct zfcp_fsf_req *fsf_req)
{ {
...@@ -406,10 +310,6 @@ zfcp_module_init(void) ...@@ -406,10 +310,6 @@ zfcp_module_init(void)
/* initialize adapters to be removed list head */ /* initialize adapters to be removed list head */
INIT_LIST_HEAD(&zfcp_data.adapter_remove_lh); INIT_LIST_HEAD(&zfcp_data.adapter_remove_lh);
#ifdef ZFCP_STAT_REQSIZES
zfcp_statistics_init_all();
#endif
#ifdef CONFIG_S390_SUPPORT #ifdef CONFIG_S390_SUPPORT
retval = register_ioctl32_conversion(zfcp_ioctl_trans.cmd, retval = register_ioctl32_conversion(zfcp_ioctl_trans.cmd,
zfcp_ioctl_trans.handler); zfcp_ioctl_trans.handler);
...@@ -460,9 +360,6 @@ zfcp_module_init(void) ...@@ -460,9 +360,6 @@ zfcp_module_init(void)
unregister_ioctl32_conversion(zfcp_ioctl_trans.cmd); unregister_ioctl32_conversion(zfcp_ioctl_trans.cmd);
out_ioctl32: out_ioctl32:
#endif #endif
#ifdef ZFCP_STAT_REQSIZES
zfcp_statistics_clear_all();
#endif
out: out:
return retval; return retval;
......
...@@ -26,13 +26,9 @@ ...@@ -26,13 +26,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#define ZFCP_CCW_C_REVISION "$Revision: 1.54 $" #define ZFCP_CCW_C_REVISION "$Revision: 1.55 $"
#include <linux/init.h>
#include <linux/module.h>
#include <asm/ccwdev.h>
#include "zfcp_ext.h" #include "zfcp_ext.h"
#include "zfcp_def.h"
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG #define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#define ZFCP_DEF_H #define ZFCP_DEF_H
/* this drivers version (do not edit !!! generated and updated by cvs) */ /* this drivers version (do not edit !!! generated and updated by cvs) */
#define ZFCP_DEF_REVISION "$Revision: 1.72 $" #define ZFCP_DEF_REVISION "$Revision: 1.73 $"
/*************************** INCLUDES *****************************************/ /*************************** INCLUDES *****************************************/
...@@ -64,8 +64,6 @@ ...@@ -64,8 +64,6 @@
/************************ DEBUG FLAGS *****************************************/ /************************ DEBUG FLAGS *****************************************/
#define ZFCP_PRINT_FLAGS #define ZFCP_PRINT_FLAGS
#define ZFCP_STAT_REQSIZES
#define ZFCP_STAT_QUEUES
/********************* GENERAL DEFINES *********************************/ /********************* GENERAL DEFINES *********************************/
...@@ -1080,31 +1078,8 @@ struct zfcp_data { ...@@ -1080,31 +1078,8 @@ struct zfcp_data {
char init_busid[BUS_ID_SIZE]; char init_busid[BUS_ID_SIZE];
wwn_t init_wwpn; wwn_t init_wwpn;
fcp_lun_t init_fcp_lun; fcp_lun_t init_fcp_lun;
#ifdef ZFCP_STAT_REQSIZES /* Statistical accounting
of processed data */
struct list_head read_req_head;
struct list_head write_req_head;
struct list_head read_sg_head;
struct list_head write_sg_head;
struct list_head read_sguse_head;
struct list_head write_sguse_head;
unsigned long stat_errors;
rwlock_t stat_lock;
#endif
#ifdef ZFCP_STAT_QUEUES
atomic_t outbound_queue_full;
atomic_t outbound_total;
#endif
}; };
#ifdef ZFCP_STAT_REQSIZES
struct zfcp_statistics {
struct list_head list;
u32 num;
u32 occurrence;
};
#endif
struct zfcp_sg_list { struct zfcp_sg_list {
struct scatterlist *sg; struct scatterlist *sg;
unsigned int count; unsigned int count;
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_ERP #define ZFCP_LOG_AREA ZFCP_LOG_AREA_ERP
/* this drivers version (do not edit !!! generated and updated by cvs) */ /* this drivers version (do not edit !!! generated and updated by cvs) */
#define ZFCP_ERP_REVISION "$Revision: 1.52 $" #define ZFCP_ERP_REVISION "$Revision: 1.54 $"
#include "zfcp_ext.h" #include "zfcp_ext.h"
...@@ -126,37 +126,6 @@ static void zfcp_erp_memwait_handler(unsigned long); ...@@ -126,37 +126,6 @@ static void zfcp_erp_memwait_handler(unsigned long);
static void zfcp_erp_timeout_handler(unsigned long); static void zfcp_erp_timeout_handler(unsigned long);
static inline void zfcp_erp_timeout_init(struct zfcp_erp_action *); static inline void zfcp_erp_timeout_init(struct zfcp_erp_action *);
/*
* function: zfcp_erp_adapter_shutdown_all
*
* purpose: recursively calls zfcp_erp_adapter_shutdown to stop all
* IO on each adapter, return all outstanding packets and
* relinquish all IRQs
* Note: This function waits for completion of all shutdowns
*
* returns: 0 in all cases
*/
int
zfcp_erp_adapter_shutdown_all(void)
{
int retval = 0;
unsigned long flags;
struct zfcp_adapter *adapter;
read_lock_irqsave(&zfcp_data.config_lock, flags);
list_for_each_entry(adapter, &zfcp_data.adapter_list_head, list)
zfcp_erp_adapter_shutdown(adapter, 0);
read_unlock_irqrestore(&zfcp_data.config_lock, flags);
/*
* FIXME : need to take config_lock but cannot, since we schedule here.
*/
/* start all shutdowns first before any waiting to allow for concurreny */
list_for_each_entry(adapter, &zfcp_data.adapter_list_head, list)
zfcp_erp_wait(adapter);
return retval;
}
/* /*
* function: zfcp_fsf_scsi_er_timeout_handler * function: zfcp_fsf_scsi_er_timeout_handler
...@@ -2328,7 +2297,7 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action) ...@@ -2328,7 +2297,7 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action)
if (qdio_establish(&adapter->qdio_init_data) != 0) { if (qdio_establish(&adapter->qdio_init_data) != 0) {
ZFCP_LOG_INFO("error: establishment of QDIO queues failed " ZFCP_LOG_INFO("error: establishment of QDIO queues failed "
"on adapter %s\n.", "on adapter %s\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
goto failed_qdio_establish; goto failed_qdio_establish;
} }
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#ifndef ZFCP_EXT_H #ifndef ZFCP_EXT_H
#define ZFCP_EXT_H #define ZFCP_EXT_H
/* this drivers version (do not edit !!! generated and updated by cvs) */ /* this drivers version (do not edit !!! generated and updated by cvs) */
#define ZFCP_EXT_REVISION "$Revision: 1.49 $" #define ZFCP_EXT_REVISION "$Revision: 1.50 $"
#include "zfcp_def.h" #include "zfcp_def.h"
...@@ -141,7 +141,6 @@ extern int zfcp_scsi_command_sync(struct zfcp_unit *unit, ...@@ -141,7 +141,6 @@ extern int zfcp_scsi_command_sync(struct zfcp_unit *unit,
extern void zfcp_erp_modify_adapter_status(struct zfcp_adapter *, u32, int); extern void zfcp_erp_modify_adapter_status(struct zfcp_adapter *, u32, int);
extern int zfcp_erp_adapter_reopen(struct zfcp_adapter *, int); extern int zfcp_erp_adapter_reopen(struct zfcp_adapter *, int);
extern int zfcp_erp_adapter_shutdown(struct zfcp_adapter *, int); extern int zfcp_erp_adapter_shutdown(struct zfcp_adapter *, int);
extern int zfcp_erp_adapter_shutdown_all(void);
extern void zfcp_erp_adapter_failed(struct zfcp_adapter *); extern void zfcp_erp_adapter_failed(struct zfcp_adapter *);
extern void zfcp_erp_modify_port_status(struct zfcp_port *, u32, int); extern void zfcp_erp_modify_port_status(struct zfcp_port *, u32, int);
...@@ -169,7 +168,4 @@ extern void zfcp_cmd_dbf_event_fsf(const char *, struct zfcp_fsf_req *, ...@@ -169,7 +168,4 @@ extern void zfcp_cmd_dbf_event_fsf(const char *, struct zfcp_fsf_req *,
extern void zfcp_cmd_dbf_event_scsi(const char *, struct scsi_cmnd *); extern void zfcp_cmd_dbf_event_scsi(const char *, struct scsi_cmnd *);
extern void zfcp_in_els_dbf_event(struct zfcp_adapter *, const char *, extern void zfcp_in_els_dbf_event(struct zfcp_adapter *, const char *,
struct fsf_status_read_buffer *, int); struct fsf_status_read_buffer *, int);
#ifdef ZFCP_STAT_REQSIZES
extern int zfcp_statistics_inc(struct list_head *, u32);
#endif
#endif /* ZFCP_EXT_H */ #endif /* ZFCP_EXT_H */
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
*/ */
/* this drivers version (do not edit !!! generated and updated by cvs) */ /* this drivers version (do not edit !!! generated and updated by cvs) */
#define ZFCP_FSF_C_REVISION "$Revision: 1.46 $" #define ZFCP_FSF_C_REVISION "$Revision: 1.47 $"
#include "zfcp_ext.h" #include "zfcp_ext.h"
...@@ -4809,9 +4809,6 @@ zfcp_fsf_req_create(struct zfcp_adapter *adapter, u32 fsf_cmd, int req_flags, ...@@ -4809,9 +4809,6 @@ zfcp_fsf_req_create(struct zfcp_adapter *adapter, u32 fsf_cmd, int req_flags,
goto success; goto success;
failed_sbals: failed_sbals:
#ifdef ZFCP_STAT_QUEUES
atomic_inc(&zfcp_data.outbound_queue_full);
#endif
/* dequeue new FSF request previously enqueued */ /* dequeue new FSF request previously enqueued */
zfcp_fsf_req_free(fsf_req); zfcp_fsf_req_free(fsf_req);
fsf_req = NULL; fsf_req = NULL;
...@@ -4948,9 +4945,6 @@ zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req, struct timer_list *timer) ...@@ -4948,9 +4945,6 @@ zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req, struct timer_list *timer)
} }
/* count FSF requests pending */ /* count FSF requests pending */
atomic_inc(&adapter->fsf_reqs_active); atomic_inc(&adapter->fsf_reqs_active);
#ifdef ZFCP_STAT_QUEUES
atomic_inc(&zfcp_data.outbound_total);
#endif
} }
return retval; return retval;
} }
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#define ZFCP_QDIO_C_REVISION "$Revision: 1.18 $" #define ZFCP_QDIO_C_REVISION "$Revision: 1.19 $"
#include "zfcp_ext.h" #include "zfcp_ext.h"
...@@ -682,12 +682,6 @@ zfcp_qdio_sbale_fill(struct zfcp_fsf_req *fsf_req, unsigned long sbtype, ...@@ -682,12 +682,6 @@ zfcp_qdio_sbale_fill(struct zfcp_fsf_req *fsf_req, unsigned long sbtype,
sbale = zfcp_qdio_sbale_curr(fsf_req); sbale = zfcp_qdio_sbale_curr(fsf_req);
sbale->addr = addr; sbale->addr = addr;
sbale->length = length; sbale->length = length;
#ifdef ZFCP_STAT_REQSIZES
if (sbtype == SBAL_FLAGS0_TYPE_READ)
zfcp_statistics_inc(&zfcp_data.read_sg_head, length);
else zfcp_statistics_inc(&zfcp_data.write_sg_head, length);
#endif
} }
/** /**
...@@ -770,18 +764,7 @@ zfcp_qdio_sbals_from_sg(struct zfcp_fsf_req *fsf_req, unsigned long sbtype, ...@@ -770,18 +764,7 @@ zfcp_qdio_sbals_from_sg(struct zfcp_fsf_req *fsf_req, unsigned long sbtype,
/* assume that no other SBALEs are to follow in the same SBAL */ /* assume that no other SBALEs are to follow in the same SBAL */
sbale = zfcp_qdio_sbale_curr(fsf_req); sbale = zfcp_qdio_sbale_curr(fsf_req);
sbale->flags |= SBAL_FLAGS_LAST_ENTRY; sbale->flags |= SBAL_FLAGS_LAST_ENTRY;
out: out:
#ifdef ZFCP_STAT_REQSIZES
if (sbtype == SBAL_FLAGS0_TYPE_READ) {
zfcp_statistics_inc(&zfcp_data.read_sguse_head, sg_count);
zfcp_statistics_inc(&zfcp_data.read_req_head, bytes);
} else {
zfcp_statistics_inc(&zfcp_data.write_sguse_head, sg_count);
zfcp_statistics_inc(&zfcp_data.write_req_head, bytes);
}
#endif
return bytes; return bytes;
} }
......
...@@ -31,9 +31,7 @@ ...@@ -31,9 +31,7 @@
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_SCSI #define ZFCP_LOG_AREA ZFCP_LOG_AREA_SCSI
/* this drivers version (do not edit !!! generated and updated by cvs) */ /* this drivers version (do not edit !!! generated and updated by cvs) */
#define ZFCP_SCSI_REVISION "$Revision: 1.61 $" #define ZFCP_SCSI_REVISION "$Revision: 1.62 $"
#include <linux/blkdev.h>
#include "zfcp_ext.h" #include "zfcp_ext.h"
......
...@@ -26,11 +26,9 @@ ...@@ -26,11 +26,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#define ZFCP_SYSFS_ADAPTER_C_REVISION "$Revision: 1.32 $" #define ZFCP_SYSFS_ADAPTER_C_REVISION "$Revision: 1.33 $"
#include <asm/ccwdev.h>
#include "zfcp_ext.h" #include "zfcp_ext.h"
#include "zfcp_def.h"
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG #define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG
......
...@@ -26,11 +26,9 @@ ...@@ -26,11 +26,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#define ZFCP_SYSFS_DRIVER_C_REVISION "$Revision: 1.12 $" #define ZFCP_SYSFS_DRIVER_C_REVISION "$Revision: 1.14 $"
#include <asm/ccwdev.h>
#include "zfcp_ext.h" #include "zfcp_ext.h"
#include "zfcp_def.h"
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG #define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG
......
...@@ -26,13 +26,9 @@ ...@@ -26,13 +26,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#define ZFCP_SYSFS_PORT_C_REVISION "$Revision: 1.39 $" #define ZFCP_SYSFS_PORT_C_REVISION "$Revision: 1.40 $"
#include <linux/init.h>
#include <linux/module.h>
#include <asm/ccwdev.h>
#include "zfcp_ext.h" #include "zfcp_ext.h"
#include "zfcp_def.h"
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG #define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG
......
...@@ -26,13 +26,9 @@ ...@@ -26,13 +26,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#define ZFCP_SYSFS_UNIT_C_REVISION "$Revision: 1.24 $" #define ZFCP_SYSFS_UNIT_C_REVISION "$Revision: 1.25 $"
#include <linux/init.h>
#include <linux/module.h>
#include <asm/ccwdev.h>
#include "zfcp_ext.h" #include "zfcp_ext.h"
#include "zfcp_def.h"
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG #define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment