PATCH [0/3] qla2xxx: new experimental changes...
Subsystems (2)
All,
Here's a set of patches which begin to strip legacy features from the qla2xxx driver. These 'features' have been superceded in functionality and simplicity by additions present (for some time) in the SCSI mid-layer.
Here's the breakdown of patches being submitted:
1. Remove internal command queuing. This entails removal of the driver's *_queue lists as well as modifications and removal of routines which used them. With the queuing removed -- the driver will be unable to tolerate cable-pulls. Thus we depend on the next patch for support.
2. Add initial support for FC remote port infrastructure. This patch is based off the proposal submitted by James Smart:
([Patch RFC ] Update FC transport for FC Remote Ports)
http://marc.theaimsgroup.com/?l=linux-scsi&m=110187926413504&w=2
3. Remove internal lun discovery routines and support structures. The mid-layer has a more exhaustive and fully capable set of functions for lun discovery.
Other patches in the queue:
A. Complete fc_host attributes support. This patch is mostly
complete, I'd just like to let the dust settle with the recent transport_template changes.
B. Additional dusting and scrubbing: /proc removal, unused
functions and structures left over from the cleanup.
C. lock simplification and consolidation -- we're still reviewing
the implications of removing the driver's 'hardware_lock' and begin using the host->host_lock exclusively.
D. additional hardware (ISP) support.
E. firmware loading via request_firmware() infrastructure.
Regards,
Andrew Vasquez
QLogic Corporation
PATCH [1/3] qla2xxx: remove internal queuing.
Remove internal command queuing from the driver. As is, this driver cannot tolerate cable-pulls as I/Os will begin to fail by the upper layers.
o Should be used in conjuction with the 11-fc_rport_adds.diff patch.
o Removes qla_listops.h file -- no longer needed.
drivers/scsi/qla2xxx/qla_listops.h | 351 ------ drivers/scsi/qla2xxx/qla_def.h | 22 drivers/scsi/qla2xxx/qla_gbl.h | 6 drivers/scsi/qla2xxx/qla_init.c | 106 - drivers/scsi/qla2xxx/qla_iocb.c | 13 drivers/scsi/qla2xxx/qla_isr.c | 147 -- drivers/scsi/qla2xxx/qla_os.c | 1911 ++++------------------------------- 7 files changed, 276 insertions(+), 2280 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +0 -22
@@ -2175,27 +2175,6 @@uint32_t current_outstanding_cmd;srb_t *status_srb;/* Status continuation entry. */ -/* -* Need to hold the list_lock with irq's disabled in order to access -* the following list. -* -* This list_lock is of lower priority than the host_lock. -*/ -spinlock_t list_lock____cacheline_aligned ; -/* lock to guard lists which -* hold srb_t's */ -struct list_head retry_queue;/* watchdog queue */ -struct list_head done_queue;/* job on done queue */ -struct list_head failover_queue;/* failover list link. */ -struct list_head scsi_retry_queue;/* SCSI retry queue */ -struct list_head pending_queue;/* SCSI command pending queue */ - -unsigned long done_q_cnt; -unsigned long pending_in_q; -uint32_t retry_q_cnt; -uint32_t scsi_retry_q_cnt; -uint32_t failover_cnt; -unsigned long last_irq_cpu;/* cpu where we got our last irq */ uint16_t revision;
@@ -2479,7 +2458,6 @@#include "qla_gbl.h" #include "qla_dbg.h" #include "qla_inline.h" -#include "qla_listops.h" /* * String arrays
drivers/scsi/qla2xxx/qla_gbl.h +1 -5
@@ -74,6 +74,7 @@#if defined(MODULE )extern char *ql2xopts;#endif +extern void qla2x00_sp_compl (scsi_qla_host_t *,srb_t *);extern char *qla2x00_get_fw_version_str (struct scsi_qla_host *,char *);
@@ -82,16 +83,11 @@extern int __qla2x00_suspend_lun (scsi_qla_host_t *,os_lun_t *,int ,int ,int );extern void qla2x00_done (scsi_qla_host_t *); -extern void qla2x00_next (scsi_qla_host_t *);extern void qla2x00_flush_failover_q (scsi_qla_host_t *,os_lun_t *);extern void qla2x00_reset_lun_fo_counts (scsi_qla_host_t *,os_lun_t *); -extern void qla2x00_extend_timeout (struct scsi_cmnd *,int ); -extern void qla2x00_mark_device_lost (scsi_qla_host_t *,fc_port_t *,int );extern void qla2x00_mark_all_devices_lost (scsi_qla_host_t *); - -extern void qla2x00_abort_queues (scsi_qla_host_t *,uint8_t );extern void qla2x00_blink_led (scsi_qla_host_t *);
drivers/scsi/qla2xxx/qla_init.c +2 -104
138 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_iocb.c +0 -13
@@ -334,7 +334,6 @@uint32_t index;uint32_t handle;cmd_entry_t *cmd_pkt; -uint32_t timeout;struct scatterlist *sg;uint16_t cnt;uint16_t req_cnt;
@@ -432,18 +431,6 @@break ; } } - -/* -* Allocate at least 5 (+ QLA_CMD_TIMER_DELTA) seconds for RISC timeout. -*/ - timeout = (uint32_t )(cmd->timeout_per_command /HZ ); -if (timeout >65535 ) - cmd_pkt->timeout =__constant_cpu_to_le16 (0 ); -else if (timeout >25 ) - cmd_pkt->timeout =cpu_to_le16 ((uint16_t )timeout - - (5 +QLA_CMD_TIMER_DELTA )); -else - cmd_pkt->timeout =cpu_to_le16 ((uint16_t )timeout);/* Load SCSI command packet. */ memcpy (cmd_pkt->scsi_cdb, cmd->cmnd, cmd->cmd_len);
drivers/scsi/qla2xxx/qla_isr.c +8 -139
257 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_os.c +265 -1646
2,235 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_listops.h deleted +0 -351
288 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Re: PATCH [1/3] qla2xxx: remove internal queuing.
Small incremental patch which fixes some annoyances sighted by Christoph Hellwig.
* Correct backing-out of msleep() calls
* remove superfluous return in qla2xxx_slave_destroy.
===== drivers/scsi/qla2xxx/qla_os.c 1.56 vs edited =====
drivers/scsi/qla2xxx/qla_os.c +2 -5
@@ -467,8 +467,7 @@ qla2x00_wait_for_hba_online(scsi_qla_hos test_bit(ISP_ABORT_RETRY, &ha->dpc_flags) || ha->dpc_active) && time_before(jiffies, wait_online)) { -set_current_state (TASK_UNINTERRUPTIBLE ); -schedule_timeout (HZ ); +msleep (1000 ); }if (ha->flags.online) return_status =QLA_SUCCESS ;
@@ -509,8 +508,7 @@ qla2x00_wait_for_loop_ready(scsi_qla_hos atomic_read(&ha->loop_state) == LOOP_DOWN) || test_bit(CFG_ACTIVE, &ha->cfg_flags) || atomic_read(&ha->loop_state) != LOOP_READY) { -set_current_state (TASK_UNINTERRUPTIBLE ); -schedule_timeout (HZ ); +msleep (1000 );if (time_after_eq (jiffies, loop_timeout)) { return_status =QLA_FUNCTION_FAILED ;break ;
@@ -1064,7 +1062,6 @@ static void qla2xxx_slave_destroy(struct scsi_device *sdev) { sdev->hostdata =NULL ; -return ; }/**
PATCH [2/3] qla2xxx: add FC remote port support.
In reply to Andrew VasquezAdd initial support for FC remote port infrastructure. Depends on patches submitted by James Smart ([Patch RFC ] Update FC transport for FC Remote Ports)
o Use fc_remote_port...() registration and block/unlock functions.
o Consolidate 'attribute' (fc-remote/sysfs) helpers into new qla_attr.c file.
drivers/scsi/qla2xxx/Makefile | 2 drivers/scsi/qla2xxx/qla_attr.c | 321 ++++++++++++++++++++++++++++++++++++++++ drivers/scsi/qla2xxx/qla_def.h | 3 drivers/scsi/qla2xxx/qla_gbl.h | 10 + drivers/scsi/qla2xxx/qla_init.c | 30 +++ drivers/scsi/qla2xxx/qla_os.c | 297 ++++--------------------------------- 6 files changed, 395 insertions(+), 268 deletions(-)
drivers/scsi/qla2xxx/Makefile +1 -1
@@ -1,7 +1,7 @@ EXTRA_CFLAGS += -DUNIQUE_FW_NAME qla2xxx-y := qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \ - qla_dbg.o qla_sup.o qla_rscn.o + qla_dbg.o qla_sup.o qla_rscn.o qla_attr.o qla2100-y := ql2100.o ql2100_fw.o qla2200-y := ql2200.o ql2200_fw.o
drivers/scsi/qla2xxx/qla_attr.c new file +179 -0
179 lines not on this page · raw message
+ spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+ return (count);
+}
+
+static struct bin_attribute sysfs_nvram_attr = {
+ .attr = {
+ .name = "nvram",
+ .mode = S_IRUSR | S_IWUSR,
+ .owner = THIS_MODULE,
+ },
+ .size = sizeof(nvram_t),
+ .read = qla2x00_sysfs_read_nvram,
+ .write = qla2x00_sysfs_write_nvram,
+};
+
+void
+qla2x00_alloc_sysfs_attr(scsi_qla_host_t *ha)
+{
+ struct Scsi_Host *host = ha->host;
+
+ sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_fw_dump_attr);
+ sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_nvram_attr);
+}
+
+void
+qla2x00_free_sysfs_attr(scsi_qla_host_t *ha)
+{
+ struct Scsi_Host *host = ha->host;
+
+ sysfs_remove_bin_file(&host->shost_gendev.kobj, &sysfs_fw_dump_attr);
+ sysfs_remove_bin_file(&host->shost_gendev.kobj, &sysfs_nvram_attr);
+}
+
+/* Host attributes. */
+
+static void
+qla2x00_get_host_port_id(struct Scsi_Host *shost)
+{
+ scsi_qla_host_t *ha = to_qla_host(shost);
+
+ fc_host_port_id(shost) = ha->d_id.b.domain << 16 |
+ ha->d_id.b.area << 8 | ha->d_id.b.al_pa;
+}
+
+static void
+qla2x00_get_starget_node_name(struct scsi_target *starget)
+{
+ struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
+ scsi_qla_host_t *ha = to_qla_host(host);
+ os_tgt_t *tq = (os_tgt_t *) TGT_Q(ha, starget->id);
+ uint64_t node_name = 0;
+
+ if (tq->fcport)
+ node_name = be64_to_cpu(*(uint64_t *)tq->fcport->node_name);
+ fc_starget_node_name(starget) = node_name;
+}
+
+static void
+qla2x00_get_starget_port_name(struct scsi_target *starget)
+{
+ struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
+ scsi_qla_host_t *ha = to_qla_host(host);
+ os_tgt_t *tq = (os_tgt_t *) TGT_Q(ha, starget->id);
+ uint64_t port_name = 0;
+
+ if (tq->fcport)
+ port_name = be64_to_cpu(*(uint64_t *)tq->fcport->port_name);
+ fc_starget_port_name(starget) = port_name;
+}
+
+static void
+qla2x00_get_starget_port_id(struct scsi_target *starget)
+{
+ struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
+ scsi_qla_host_t *ha = to_qla_host(host);
+ os_tgt_t *tq = (os_tgt_t *) TGT_Q(ha, starget->id);
+ uint32_t port_id = 0;
+
+ if (tq->fcport)
+ port_id = tq->fcport->d_id.b.domain << 16 |
+ tq->fcport->d_id.b.area << 8 | tq->fcport->d_id.b.al_pa;
+ fc_starget_port_id(starget) = port_id;
+}
+
+static void
+qla2x00_get_starget_loss_tmo(struct scsi_target *starget)
+{
+ struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
+ scsi_qla_host_t *ha = to_qla_host(host);
+
+ fc_starget_dev_loss_tmo(starget) = ha->port_down_retry_count + 5;
+}
+
+static void
+qla2x00_set_starget_loss_tmo(struct scsi_target *starget, uint32_t timeout) +{
+ struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
+ scsi_qla_host_t *ha = to_qla_host(host);
+
+ if (timeout)
+ ha->port_down_retry_count = timeout;
+ else
+ ha->port_down_retry_count = 1;
+}
+
+static struct fc_function_template qla2xxx_transport_functions = { +
+ .show_host_node_name = 1,
+ .show_host_port_name = 1,
+ .get_host_port_id = qla2x00_get_host_port_id,
+ .show_host_port_id = 1,
+
+ .get_starget_node_name = qla2x00_get_starget_node_name,
+ .show_starget_node_name = 1,
+ .get_starget_port_name = qla2x00_get_starget_port_name,
+ .show_starget_port_name = 1,
+ .get_starget_port_id = qla2x00_get_starget_port_id,
+ .show_starget_port_id = 1,
+
+ .get_starget_dev_loss_tmo = qla2x00_get_starget_loss_tmo,
+ .set_starget_dev_loss_tmo = qla2x00_set_starget_loss_tmo,
+ .show_starget_dev_loss_tmo = 1,
+
+};
+
+struct scsi_transport_template * +qla2x00_alloc_transport_tmpl(void)
+{
+ return (fc_attach_transport(&qla2xxx_transport_functions));
+}
+
+void
+qla2x00_init_host_attr(scsi_qla_host_t *ha)
+{
+ fc_host_node_name(ha->host) =
+ be64_to_cpu(*(uint64_t *)ha->init_cb->node_name);
+ fc_host_port_name(ha->host) =
+ be64_to_cpu(*(uint64_t *)ha->init_cb->port_name);
+ fc_host_link_down_tmo(ha->host) = ha->port_down_retry_count;
+
+}
drivers/scsi/qla2xxx/qla_def.h +2 -1
@@ -219,7 +219,7 @@/* * Timeout timer counts in seconds */ -#define PORT_RETRY_TIME 2 +#define PORT_RETRY_TIME 1#define LOOP_DOWN_TIMEOUT 60#define LOOP_DOWN_TIME 255/* 240 */ #define LOOP_DOWN_RESET (LOOP_DOWN_TIME - 30)
@@ -1718,6 +1718,7 @@uint8_t cur_path;/* current path id */ lun_bit_mask_t lun_mask; +struct fc_rport *rport; } fc_port_t;/*
drivers/scsi/qla2xxx/qla_gbl.h +0 -0
@@ -24,6 +24,7 @@
#define __QLA_GBL_H
#include <linux/interrupt.h>
+#include <scsi/scsi_transport.h>
extern void qla2x00_remove_one(struct pci_dev *);
extern int qla2x00_probe_one(struct pci_dev *, struct qla_board_info *);
@@ -250,4 +251,13 @@
#define qla2x00_alloc_ioctl_mem(ha) (0)
#define qla2x00_free_ioctl_mem(ha) do { } while (0)
+/*
+ * Global Function Prototypes in qla_attr.c source file.
+ */
+extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *); +extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *); +extern struct scsi_transport_template *qla2x00_alloc_transport_tmpl(void); +extern void qla2x00_init_host_attr(scsi_qla_host_t *);
+extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *); +extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *);
#endif /* _QLA_GBL_H */
drivers/scsi/qla2xxx/qla_init.c +28 -2
@@ -19,6 +19,7 @@#include "qla_def.h" #include <linux/delay.h> +#include <scsi/scsi_transport_fc.h> #include "qla_devtbl.h"
@@ -72,6 +73,7 @@static void qla2x00_reset_adapter (scsi_qla_host_t *);static os_tgt_t *qla2x00_tgt_alloc (scsi_qla_host_t *,uint16_t );static os_lun_t *qla2x00_lun_alloc (scsi_qla_host_t *,uint16_t ,uint16_t ); +static void qla2x00_reg_remote_port (scsi_qla_host_t *,fc_port_t *);/****************************************************************************/ /* QLogic ISP2x00 Hardware Support Functions. */
@@ -1927,8 +1929,33 @@qla2x00_lun_discovery (ha, fcport); }atomic_set (&fcport->state,FCS_ONLINE ); +qla2x00_reg_remote_port (ha, fcport); } +static void +qla2x00_reg_remote_port (scsi_qla_host_t *ha,fc_port_t *fcport) +{ +struct fc_rport_identifiers rport_ids; + +if (fcport->rport) { +fc_remote_port_unblock (fcport->rport); +return ; + } + + rport_ids.node_name =be64_to_cpu (*(uint64_t *)fcport->node_name); + rport_ids.port_name =be64_to_cpu (*(uint64_t *)fcport->port_name); + rport_ids.port_id = fcport->d_id.b.domain <<16 | + fcport->d_id.b.area <<8 | fcport->d_id.b.al_pa; + rport_ids.roles =FC_RPORT_ROLE_UNKNOWN ; +if (fcport->port_type ==FCT_INITIATOR ) + rport_ids.roles |=FC_RPORT_ROLE_FCP_INITIATOR ; +if (fcport->port_type ==FCT_TARGET ) + rport_ids.roles |=FC_RPORT_ROLE_FCP_TARGET ; + fcport->rport =fc_remote_port_add (ha->host,0 , &rport_ids); +if (!fcport->rport) +qla_printk (KERN_WARNING , ha, +"Unable to allocate fc remote port!\n" ); +}/* * qla2x00_lun_discovery * Issue SCSI inquiry command for LUN discovery.
@@ -2895,8 +2922,7 @@if (atomic_read (&fcport->state) ==FCS_ONLINE ) {if (format !=3 || fcport->port_type !=FCT_INITIATOR ) { -atomic_set (&fcport->state, -FCS_DEVICE_LOST ); +qla2x00_mark_device_lost (ha, fcport,0 ); } } fcport->flags &= ~FCF_FARP_DONE ;
drivers/scsi/qla2xxx/qla_os.c +1 -176
191 lines not on this page · raw message
{
@@ -1235,11 +1059,17 @@
static int
qla2xxx_slave_configure(struct scsi_device *sdev) {
+ scsi_qla_host_t *ha = to_qla_host(sdev->host);
+ os_tgt_t *tq = (os_tgt_t *) sdev->hostdata;
+
if (sdev->tagged_supported)
scsi_activate_tcq(sdev, 32);
else
scsi_deactivate_tcq(sdev, 32);
+ if (tq && sdev->sdev_target)
+ fc_starget_dev_loss_tmo(sdev->sdev_target) =
+ ha->port_down_retry_count + 5;
return 0;
}
@@ -1398,7 +1228,7 @@
/* Configure PCI I/O space */
ret = qla2x00_iospace_config(ha);
if (ret != 0) {
- goto probe_failed;
+ goto probe_alloc_failed;
}
/* Sanitize the information from PCI BIOS. */
@@ -1472,9 +1302,23 @@
qla_printk(KERN_WARNING, ha,
"[ERROR] Failed to allocate memory for adapter\n");
- goto probe_failed;
+ goto probe_alloc_failed;
}
+ pci_set_drvdata(pdev, ha);
+ host->this_id = 255;
+ host->cmd_per_lun = 3;
+ host->unique_id = ha->instance;
+ host->max_cmd_len = MAX_CMDSZ;
+ host->max_channel = ha->ports - 1;
+ host->max_id = ha->max_targets;
+ host->max_lun = ha->max_luns;
+ host->transportt = qla2xxx_transport_template;
+ if (scsi_add_host(host, &pdev->dev))
+ goto probe_alloc_failed;
+
+ qla2x00_alloc_sysfs_attr(ha);
+
if (qla2x00_initialize_adapter(ha) &&
!(ha->device_flags & DFLG_NO_CABLE)) {
@@ -1488,6 +1332,7 @@
goto probe_failed;
}
+ qla2x00_init_host_attr(ha);
/*
* Startup the kernel thread for this host adapter */
@@ -1501,16 +1346,6 @@
}
wait_for_completion(&ha->dpc_inited);
- host->this_id = 255;
- host->cmd_per_lun = 3;
- host->max_cmd_len = MAX_CMDSZ;
- host->max_channel = ha->ports - 1;
- host->max_lun = ha->max_luns;
- BUG_ON(qla2xxx_transport_template == NULL);
- host->transportt = qla2xxx_transport_template;
- host->unique_id = ha->instance;
- host->max_id = ha->max_targets;
-
if (IS_QLA2100(ha) || IS_QLA2200(ha))
ret = request_irq(host->irq, qla2100_intr_handler,
SA_INTERRUPT|SA_SHIRQ, ha->brd_info->drv_name, ha);
@@ -1571,7 +1406,6 @@
msleep(10);
}
- pci_set_drvdata(pdev, ha);
ha->flags.init_done = 1;
num_hosts++;
@@ -1580,12 +1414,6 @@
qla2x00_display_fc_names(ha);
}
- if (scsi_add_host(host, &pdev->dev))
- goto probe_failed;
-
- sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_fw_dump_attr);
- sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_nvram_attr);
-
qla_printk(KERN_INFO, ha, "\n"
" QLogic Fibre Channel HBA Driver: %s\n" " QLogic %s - %s\n"
@@ -1601,6 +1429,9 @@
return 0;
probe_failed:
+ scsi_remove_host(host);
+
+probe_alloc_failed:
qla2x00_free_device(ha);
scsi_host_put(host);
@@ -1618,9 +1449,7 @@
ha = pci_get_drvdata(pdev);
- sysfs_remove_bin_file(&ha->host->shost_gendev.kobj,
- &sysfs_fw_dump_attr);
- sysfs_remove_bin_file(&ha->host->shost_gendev.kobj, &sysfs_nvram_attr);
+ qla2x00_free_sysfs_attr(ha);
scsi_remove_host(ha->host);
@@ -2093,6 +1922,8 @@
void qla2x00_mark_device_lost(scsi_qla_host_t *ha, fc_port_t *fcport,
int do_login)
{
+ if (atomic_read(&fcport->state) == FCS_ONLINE && fcport->rport)
+ fc_remote_port_block(fcport->rport);
/*
* We may need to retry the login, so don't change the state of the
* port but do the retries.
@@ -2152,7 +1983,8 @@
*/
if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD)
continue;
-
+ if (atomic_read(&fcport->state) == FCS_ONLINE && fcport->rport)
+ fc_remote_port_block(fcport->rport);
atomic_set(&fcport->state, FCS_DEVICE_LOST);
}
}
@@ -2818,7 +2650,6 @@
cmd->scsi_done(cmd);
}
-
/**************************************************************************
* qla2x00_timer
*
@@ -2956,67 +2787,6 @@
return -ETIMEDOUT;
}
-static void
-qla2xxx_get_port_id(struct scsi_target *starget)
-{
- struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
- scsi_qla_host_t *ha = to_qla_host(shost);
- struct fc_port *fc;
-
- list_for_each_entry(fc, &ha->fcports, list) {
- if (fc->os_target_id == starget->id) {
- fc_starget_port_id(starget) = fc->d_id.b.domain << 16 |
- fc->d_id.b.area << 8 |
- fc->d_id.b.al_pa;
- return;
- }
- }
- fc_starget_port_id(starget) = -1;
-}
-
-static void
-qla2xxx_get_port_name(struct scsi_target *starget)
-{
- struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
- scsi_qla_host_t *ha = to_qla_host(shost);
- struct fc_port *fc;
-
- list_for_each_entry(fc, &ha->fcports, list) {
- if (fc->os_target_id == starget->id) {
- fc_starget_port_name(starget) =
- __be64_to_cpu(*(uint64_t *)fc->port_name);
- return;
- }
- }
- fc_starget_port_name(starget) = -1;
-}
-
-static void
-qla2xxx_get_node_name(struct scsi_target *starget)
-{
- struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
- scsi_qla_host_t *ha = to_qla_host(shost);
- struct fc_port *fc;
-
- list_for_each_entry(fc, &ha->fcports, list) {
- if (fc->os_target_id == starget->id) {
- fc_starget_node_name(starget) =
- __be64_to_cpu(*(uint64_t *)fc->node_name);
- return;
- }
- }
- fc_starget_node_name(starget) = -1;
-}
-
-static struct fc_function_template qla2xxx_transport_functions = {- .get_starget_port_id = qla2xxx_get_port_id,
- .show_starget_port_id = 1,
- .get_starget_port_name = qla2xxx_get_port_name,
- .show_starget_port_name = 1,
- .get_starget_node_name = qla2xxx_get_node_name,
- .show_starget_node_name = 1,
-};
-
/**
* qla2x00_module_init - Module initialization.
**/
@@ -3038,8 +2808,7 @@
#if DEBUG_QLA2100
strcat(qla2x00_version_str, "-debug");
#endif
-
- qla2xxx_transport_template = fc_attach_transport(&qla2xxx_transport_functions);
+ qla2xxx_transport_template = qla2x00_alloc_transport_tmpl();
if (!qla2xxx_transport_template)
return -ENODEV;
PATCH [3/3] qla2xxx: remove internal lun discovery...
In reply to Andrew VasquezRemove internal lun discovery routines and support structures.
drivers/scsi/qla2xxx/qla_dbg.c | 5 drivers/scsi/qla2xxx/qla_def.h | 69 ---- drivers/scsi/qla2xxx/qla_gbl.h | 6 drivers/scsi/qla2xxx/qla_init.c | 584 -------------------------------------- drivers/scsi/qla2xxx/qla_inline.h | 17 - drivers/scsi/qla2xxx/qla_iocb.c | 13 drivers/scsi/qla2xxx/qla_isr.c | 36 -- drivers/scsi/qla2xxx/qla_mbx.c | 5 drivers/scsi/qla2xxx/qla_os.c | 98 ------ 9 files changed, 21 insertions(+), 812 deletions(-)
drivers/scsi/qla2xxx/qla_dbg.c +0 -5
@@ -1067,11 +1067,6 @@printk (" sp flags=0x%x\n" , sp->flags);printk (" r_start=0x%lx, u_start=0x%lx, f_start=0x%lx, state=%d\n" , sp->r_start, sp->u_start, sp->f_start, sp->state); - -printk (" e_start= 0x%lx, ext_history=%d, fo retry=%d, loopid=%x, " -"port path=%d\n" , sp->e_start, sp->ext_history, sp->fo_retry_cnt, - sp->lun_queue->fclun->fcport->loop_id, - sp->lun_queue->fclun->fcport->cur_path); }#if defined(QL_DEBUG_ROUTINES )
drivers/scsi/qla2xxx/qla_def.h +0 -67
103 lines not on this page · raw message
@@ -2400,8 +2333,6 @@
#define LOOP_RDY(ha) (!LOOP_NOT_READY(ha))
#define TGT_Q(ha, t) (ha->otgt[t])
-#define LUN_Q(ha, t, l) (TGT_Q(ha, t)->olun[l])
-#define GET_LU_Q(ha, t, l) ((TGT_Q(ha,t) != NULL)? TGT_Q(ha, t)->olun[l] : NULL)
#define to_qla_host(x) ((scsi_qla_host_t *) (x)->hostdata)
drivers/scsi/qla2xxx/qla_gbl.h +0 -6
@@ -81,12 +81,6 @@extern void qla2x00_cmd_timeout (srb_t *); -extern int __qla2x00_suspend_lun (scsi_qla_host_t *,os_lun_t *,int ,int ,int ); - -extern void qla2x00_done (scsi_qla_host_t *); -extern void qla2x00_flush_failover_q (scsi_qla_host_t *,os_lun_t *); -extern void qla2x00_reset_lun_fo_counts (scsi_qla_host_t *,os_lun_t *); -extern void qla2x00_mark_device_lost (scsi_qla_host_t *,fc_port_t *,int );extern void qla2x00_mark_all_devices_lost (scsi_qla_host_t *);
drivers/scsi/qla2xxx/qla_init.c +4 -422
466 lines not on this page · raw message
* qla2x00_configure_fabric
@@ -3209,7 +2790,6 @@
}
}
-
/*
* qla2x00_config_os
* Setup OS target and LUN structures.
@@ -3224,7 +2804,6 @@
qla2x00_config_os(scsi_qla_host_t *ha)
{
fc_port_t *fcport;
- fc_lun_t *fclun;
os_tgt_t *tq;
uint16_t tgt;
@@ -3252,11 +2831,6 @@
if (qla2x00_fcport_bind(ha, fcport) == MAX_TARGETS) {
continue;
}
-
- /* Bind FC LUN to OS LUN number. */
- list_for_each_entry(fclun, &fcport->fcluns, list) {
- qla2x00_fclun_bind(ha, fcport, fclun);
- }
}
}
@@ -3363,54 +2937,6 @@
}
/*
- * qla2x00_fclun_bind
- * Binds all FC device LUNS to OS LUNS.
- *
- * Input:
- * ha: adapter state pointer.
- * fcport: FC port structure pointer.
- *
- * Returns:
- * target number
- *
- * Context:
- * Kernel context.
- */
-static os_lun_t *
-qla2x00_fclun_bind(scsi_qla_host_t *ha, fc_port_t *fcport, fc_lun_t *fclun) -{
- os_lun_t *lq;
- uint16_t tgt;
- uint16_t lun;
-
- tgt = fcport->os_target_id;
- lun = fclun->lun;
-
- /* Allocate LUNs */
- if (lun >= MAX_LUNS) {
- DEBUG2(printk("scsi(%ld): Unable to bind lun, invalid "
- "lun=(%x).\n", ha->host_no, lun));
- return (NULL);
- }
-
- /* Always alloc LUN 0 so kernel will scan past LUN 0. */
- if (lun != 0 && (EXT_IS_LUN_BIT_SET(&(fcport->lun_mask), lun))) {- return (NULL);
- }
-
- if ((lq = qla2x00_lun_alloc(ha, tgt, lun)) == NULL) {
- qla_printk(KERN_WARNING, ha,
- "Unable to bind fclun, loop_id=%x lun=%x\n",
- fcport->loop_id, lun);
- return (NULL);
- }
-
- lq->fclun = fclun;
-
- return (lq);
-}
-
-/*
* qla2x00_tgt_alloc
* Allocate and pre-initialize target queue.
*
@@ -3477,8 +3003,6 @@
qla2x00_tgt_free(scsi_qla_host_t *ha, uint16_t tgt) {
os_tgt_t *tq;
- uint16_t lun;
-
/*
* If SCSI addressing OK, allocate TGT queue and lock.
*/
@@ -3492,106 +3016,8 @@
tq = TGT_Q(ha, tgt);
if (tq != NULL) {
TGT_Q(ha, tgt) = NULL;
-- /* Free LUN structures. */
- for (lun = 0; lun < MAX_LUNS; lun++)
- qla2x00_lun_free(ha, tgt, lun);
-
kfree(tq);
}
-
- return;
-}
-
-/*
- * qla2x00_lun_alloc
- * Allocate and initialize LUN queue.
- *
- * Input:
- * ha = adapter block pointer.
- * t = SCSI target number.
- * l = LUN number.
- *
- * Returns:
- * NULL = failure
- *
- * Context:
- * Kernel context.
- */
-static os_lun_t *
-qla2x00_lun_alloc(scsi_qla_host_t *ha, uint16_t tgt, uint16_t lun) -{
- os_lun_t *lq;
-
- /*
- * If SCSI addressing OK, allocate LUN queue.
- */
- if (tgt >= MAX_TARGETS || lun >= MAX_LUNS || TGT_Q(ha, tgt) == NULL) {
- DEBUG2(printk("scsi(%ld): Unable to allocate lun, invalid "
- "parameter.\n", ha->host_no));
-
- return (NULL);
- }
-
- lq = LUN_Q(ha, tgt, lun);
- if (lq == NULL) {
- lq = kmalloc(sizeof(os_lun_t), GFP_ATOMIC);
- if (lq != NULL) {
- DEBUG2(printk("scsi(%ld): Alloc Lun %d @ tgt %d.\n",
- ha->host_no, lun, tgt));
-
- memset(lq, 0, sizeof(os_lun_t));
- LUN_Q(ha, tgt, lun) = lq;
-
- /*
- * The following lun queue initialization code
- * must be duplicated in alloc_ioctl_mem function
- * for ioctl_lq.
- */
- lq->q_state = LUN_STATE_READY;
- spin_lock_init(&lq->q_lock);
- }
- }
-
- if (lq == NULL) {
- qla_printk(KERN_WARNING, ha, "Unable to allocate lun.\n");
- }
-
- return (lq);
-}
-
-/*
- * qla2x00_lun_free
- * Frees LUN queue.
- *
- * Input:
- * ha = adapter block pointer.
- * t = SCSI target number.
- *
- * Context:
- * Kernel context.
- */
-static void
-qla2x00_lun_free(scsi_qla_host_t *ha, uint16_t tgt, uint16_t lun) -{
- os_lun_t *lq;
-
- /*
- * If SCSI addressing OK, allocate TGT queue and lock.
- */
- if (tgt >= MAX_TARGETS || lun >= MAX_LUNS) {
- DEBUG2(printk("scsi(%ld): Unable to deallocate lun, invalid "
- "parameter.\n", ha->host_no));
-
- return;
- }
-
- if (TGT_Q(ha, tgt) != NULL && (lq = LUN_Q(ha, tgt, lun)) != NULL) {
- LUN_Q(ha, tgt, lun) = NULL;
- kfree(lq);
- }
-
- return;
}
/*
@@ -3641,8 +3067,6 @@
ha->outstanding_cmds[cnt] = NULL; if (ha->actthreads)
ha->actthreads--;
- sp->lun_queue->out_cnt--;
-
sp->flags = 0;
sp->cmd->result = DID_RESET << 16; sp->cmd->host_scribble = (unsigned char *)NULL;
drivers/scsi/qla2xxx/qla_inline.h +0 -17
@@ -187,23 +187,6 @@return (0 ); } -static __inline__uint8_t -qla2x00_suspend_lun (scsi_qla_host_t *,os_lun_t *,int ,int ); -static __inline__uint8_t -qla2x00_delay_lun (scsi_qla_host_t *,os_lun_t *,int ); - -static __inline__uint8_t -qla2x00_suspend_lun (scsi_qla_host_t *ha,os_lun_t *lq,int time,int count) -{ -return (__qla2x00_suspend_lun (ha, lq, time, count,0 )); -} - -static __inline__uint8_t -qla2x00_delay_lun (scsi_qla_host_t *ha,os_lun_t *lq,int time) -{ -return (__qla2x00_suspend_lun (ha, lq, time,1 ,1 )); -} -static __inline__void qla2x00_check_fabric_devices (scsi_qla_host_t *);/* * This routine will wait for fabric devices for
drivers/scsi/qla2xxx/qla_iocb.c +4 -9
@@ -328,7 +328,6 @@int ret;unsigned long flags;scsi_qla_host_t *ha; -fc_lun_t *fclun;struct scsi_cmnd *cmd;uint32_t *clr_ptr;uint32_t index;
@@ -343,8 +342,7 @@/* Setup device pointers. */ ret =0 ; - fclun = sp->lun_queue->fclun; - ha = fclun->fcport->ha; + ha = sp->ha; reg = ha->iobase; cmd = sp->cmd;
@@ -411,11 +409,9 @@memset (clr_ptr,0 ,REQUEST_ENTRY_SIZE -8 ); cmd_pkt->dseg_count =cpu_to_le16 (tot_dsds); -/* Set target ID */ -SET_TARGET_ID (ha, cmd_pkt->target, fclun->fcport->loop_id); - -/* Set LUN number*/ - cmd_pkt->lun =cpu_to_le16 (fclun->lun); +/* Set target ID and LUN number*/ +SET_TARGET_ID (ha, cmd_pkt->target, sp->tgt_queue->fcport->loop_id); + cmd_pkt->lun =cpu_to_le16 (sp->cmd->device->lun);/* Update tagged queuing modifier */ cmd_pkt->control_flags =__constant_cpu_to_le16 (CF_SIMPLE_TAG );
@@ -453,7 +449,6 @@ ha->actthreads++; ha->total_ios++; - sp->lun_queue->out_cnt++; sp->flags |=SRB_DMA_VALID ; sp->state =SRB_ACTIVE_STATE ; sp->u_start = jiffies;
drivers/scsi/qla2xxx/qla_isr.c +2 -34
@@ -697,7 +697,6 @@if (ha->actthreads) ha->actthreads--; - sp->lun_queue->out_cnt--;CMD_COMPL_STATUS (sp->cmd) =0L ;CMD_SCSI_STATUS (sp->cmd) =0L ;
@@ -818,10 +817,8 @@static void qla2x00_status_entry (scsi_qla_host_t *ha,sts_entry_t *pkt) { -int ret;unsigned b, t, l;srb_t *sp; -os_lun_t *lq;os_tgt_t *tq;fc_port_t *fcport;struct scsi_cmnd *cp;
@@ -872,21 +869,6 @@if (ha->actthreads) ha->actthreads--; -if (sp->lun_queue ==NULL ) { -DEBUG2 (printk ("scsi(%ld): Status Entry invalid lun pointer.\n" , - ha->host_no)); -qla_printk (KERN_WARNING , ha, -"Status Entry invalid lun pointer.\n" ); - -set_bit (ISP_ABORT_NEEDED , &ha->dpc_flags); -if (ha->dpc_wait && !ha->dpc_active) -up (ha->dpc_wait); - -return ; - } - - sp->lun_queue->out_cnt--; - comp_status =le16_to_cpu (pkt->comp_status);/* Mask of reserved bits 12-15, before we examine the scsi status */ scsi_status =le16_to_cpu (pkt->scsi_status) &SS_MASK ;
@@ -902,7 +884,6 @@ l = cp->device->lun, tq = sp->tgt_queue; - lq = sp->lun_queue;/* Check for any FCP transport errors. */ if (scsi_status &SS_RESPONSE_INFO_LEN_VALID ) {
@@ -1096,7 +1077,7 @@* Target with DID_NO_CONNECT ELSE Queue the IOs in the * retry_queue. */ - fcport = sp->fclun->fcport; + fcport = tq->fcport; DEBUG2(printk("scsi(%ld:%d:%d): status_entry: Port Down " "pid=%ld, compl status=0x%x, port state=0x%x\n", ha->host_no, t, l, cp->serial_number, comp_status,
@@ -1137,8 +1118,7 @@ cp->result =DID_BUS_BUSY <<16 ; - fcport = lq->fclun->fcport; - + fcport = tq->fcport;/* Check to see if logout occurred */ if ((le16_to_cpu (pkt->status_flags) &SF_LOGOUT_SENT )) {qla2x00_mark_device_lost (ha, fcport,1 );
@@ -1154,16 +1134,6 @@ cp->result =DID_OK <<16 | lscsi_status; -/* TODO: ??? */ -/* Adjust queue depth */ - ret =scsi_track_queue_full (cp->device, - sp->lun_queue->out_cnt -1 ); -if (ret) { -qla_printk (KERN_INFO , ha, -"scsi(%ld:%d:%d:%d): Queue depth adjusted to %d.\n" , - ha->host_no, cp->device->channel, cp->device->id, - cp->device->lun, ret); - }break ;default :
@@ -1268,8 +1238,6 @@ ha->outstanding_cmds[pkt->handle] =NULL ;if (ha->actthreads) ha->actthreads--; - sp->lun_queue->out_cnt--; -/* Bad payload or header */ if (pkt->entry_status & (RF_INV_E_ORDER | RF_INV_E_COUNT |
drivers/scsi/qla2xxx/qla_mbx.c +2 -3
@@ -858,8 +858,7 @@ DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", ha->host_no);) - fcport = sp->fclun->fcport; - + fcport = sp->tgt_queue->fcport;if (atomic_read (&ha->loop_state) ==LOOP_DOWN ||atomic_read (&fcport->state) ==FCS_DEVICE_LOST ) {return 1 ;
@@ -884,7 +883,7 @@ mcp->mb[1 ] = fcport->loop_id <<8 ; mcp->mb[2 ] = (uint16_t )handle; mcp->mb[3 ] = (uint16_t )(handle >>16 ); - mcp->mb[6 ] = (uint16_t )sp->fclun->lun; + mcp->mb[6 ] = (uint16_t )sp->cmd->device->lun; mcp->out_mb =MBX_6 |MBX_3 |MBX_2 |MBX_1 |MBX_0 ; mcp->in_mb =MBX_0 ; mcp->tov =30 ;
drivers/scsi/qla2xxx/qla_os.c +9 -89
183 lines not on this page · raw message
patch3 seems to not have made it to the list. From a quick view the first three patches look fine, except for backing out one msleep conversion and the superflous return at the end of qla2xxx_slave_destroy
Quoted 1 line · Christoph Hellwig
patch3 seems to not have made it to the list.
I'll resend...
Quoted 4 lines
From a quick view
the first three patches look fine, except for backing out one msleep conversion and the superflous return at the end ofqla2xxx_slave_destroy
I'll send an incremental patch which fixes this.
--
AV
Quoted 6 lines · Andrew Vasquez
Quoted 1 line · Christoph Hellwig
patch3 seems to not have made it to the list.
I'll resend...
Is patch #3 rather large? I still haven't gotten it.
I also wonder if vger is censoring "xxx"...
Jeff
Quoted 10 lines · Jeff Garzik
Quoted 6 lines · Andrew Vasquez
Quoted 1 line · Christoph Hellwig
patch3 seems to not have made it to the list.
I'll resend...
Is patch #3 rather large? I still haven't gotten it.
No it's actually about a third the size of patch #1. I've checked MARC and it appears the repost seems to have made it:
http://marc.theaimsgroup.com/?l=linux-scsi&m=110755144431861&w=2
Quoted 2 lines
I also wonder if vger is censoring "xxx"...
Not sure why it didn't go through. Let me know if still have problems receiving the email -- I can just forward it to you directly.
--
Andrew
PATCH [3/3] qla2xxx: remove internal lun discovery...
In reply to Andrew VasquezRepost: seems as though first one didn't make it to the list.
Remove internal lun discovery routines and support structures.
drivers/scsi/qla2xxx/qla_dbg.c | 5 drivers/scsi/qla2xxx/qla_def.h | 69 ---- drivers/scsi/qla2xxx/qla_gbl.h | 6 drivers/scsi/qla2xxx/qla_init.c | 584 -------------------------------------- drivers/scsi/qla2xxx/qla_inline.h | 17 - drivers/scsi/qla2xxx/qla_iocb.c | 13 drivers/scsi/qla2xxx/qla_isr.c | 36 -- drivers/scsi/qla2xxx/qla_mbx.c | 5 drivers/scsi/qla2xxx/qla_os.c | 98 ------ 9 files changed, 21 insertions(+), 812 deletions(-)
drivers/scsi/qla2xxx/qla_dbg.c +0 -5
@@ -1067,11 +1067,6 @@printk (" sp flags=0x%x\n" , sp->flags);printk (" r_start=0x%lx, u_start=0x%lx, f_start=0x%lx, state=%d\n" , sp->r_start, sp->u_start, sp->f_start, sp->state); - -printk (" e_start= 0x%lx, ext_history=%d, fo retry=%d, loopid=%x, " -"port path=%d\n" , sp->e_start, sp->ext_history, sp->fo_retry_cnt, - sp->lun_queue->fclun->fcport->loop_id, - sp->lun_queue->fclun->fcport->cur_path); }#if defined(QL_DEBUG_ROUTINES )
drivers/scsi/qla2xxx/qla_def.h +0 -67
103 lines not on this page · raw message
@@ -2400,8 +2333,6 @@
#define LOOP_RDY(ha) (!LOOP_NOT_READY(ha))
#define TGT_Q(ha, t) (ha->otgt[t])
-#define LUN_Q(ha, t, l) (TGT_Q(ha, t)->olun[l])
-#define GET_LU_Q(ha, t, l) ((TGT_Q(ha,t) != NULL)? TGT_Q(ha, t)->olun[l] : NULL)
#define to_qla_host(x) ((scsi_qla_host_t *) (x)->hostdata)
drivers/scsi/qla2xxx/qla_gbl.h +0 -6
@@ -81,12 +81,6 @@extern void qla2x00_cmd_timeout (srb_t *); -extern int __qla2x00_suspend_lun (scsi_qla_host_t *,os_lun_t *,int ,int ,int ); - -extern void qla2x00_done (scsi_qla_host_t *); -extern void qla2x00_flush_failover_q (scsi_qla_host_t *,os_lun_t *); -extern void qla2x00_reset_lun_fo_counts (scsi_qla_host_t *,os_lun_t *); -extern void qla2x00_mark_device_lost (scsi_qla_host_t *,fc_port_t *,int );extern void qla2x00_mark_all_devices_lost (scsi_qla_host_t *);
drivers/scsi/qla2xxx/qla_init.c +4 -422
466 lines not on this page · raw message
* qla2x00_configure_fabric
@@ -3209,7 +2790,6 @@
}
}
-
/*
* qla2x00_config_os
* Setup OS target and LUN structures.
@@ -3224,7 +2804,6 @@
qla2x00_config_os(scsi_qla_host_t *ha)
{
fc_port_t *fcport;
- fc_lun_t *fclun;
os_tgt_t *tq;
uint16_t tgt;
@@ -3252,11 +2831,6 @@
if (qla2x00_fcport_bind(ha, fcport) == MAX_TARGETS) {
continue;
}
-
- /* Bind FC LUN to OS LUN number. */
- list_for_each_entry(fclun, &fcport->fcluns, list) {
- qla2x00_fclun_bind(ha, fcport, fclun);
- }
}
}
@@ -3363,54 +2937,6 @@
}
/*
- * qla2x00_fclun_bind
- * Binds all FC device LUNS to OS LUNS.
- *
- * Input:
- * ha: adapter state pointer.
- * fcport: FC port structure pointer.
- *
- * Returns:
- * target number
- *
- * Context:
- * Kernel context.
- */
-static os_lun_t *
-qla2x00_fclun_bind(scsi_qla_host_t *ha, fc_port_t *fcport, fc_lun_t *fclun) -{
- os_lun_t *lq;
- uint16_t tgt;
- uint16_t lun;
-
- tgt = fcport->os_target_id;
- lun = fclun->lun;
-
- /* Allocate LUNs */
- if (lun >= MAX_LUNS) {
- DEBUG2(printk("scsi(%ld): Unable to bind lun, invalid "
- "lun=(%x).\n", ha->host_no, lun));
- return (NULL);
- }
-
- /* Always alloc LUN 0 so kernel will scan past LUN 0. */
- if (lun != 0 && (EXT_IS_LUN_BIT_SET(&(fcport->lun_mask), lun))) {- return (NULL);
- }
-
- if ((lq = qla2x00_lun_alloc(ha, tgt, lun)) == NULL) {
- qla_printk(KERN_WARNING, ha,
- "Unable to bind fclun, loop_id=%x lun=%x\n",
- fcport->loop_id, lun);
- return (NULL);
- }
-
- lq->fclun = fclun;
-
- return (lq);
-}
-
-/*
* qla2x00_tgt_alloc
* Allocate and pre-initialize target queue.
*
@@ -3477,8 +3003,6 @@
qla2x00_tgt_free(scsi_qla_host_t *ha, uint16_t tgt) {
os_tgt_t *tq;
- uint16_t lun;
-
/*
* If SCSI addressing OK, allocate TGT queue and lock.
*/
@@ -3492,106 +3016,8 @@
tq = TGT_Q(ha, tgt);
if (tq != NULL) {
TGT_Q(ha, tgt) = NULL;
-- /* Free LUN structures. */
- for (lun = 0; lun < MAX_LUNS; lun++)
- qla2x00_lun_free(ha, tgt, lun);
-
kfree(tq);
}
-
- return;
-}
-
-/*
- * qla2x00_lun_alloc
- * Allocate and initialize LUN queue.
- *
- * Input:
- * ha = adapter block pointer.
- * t = SCSI target number.
- * l = LUN number.
- *
- * Returns:
- * NULL = failure
- *
- * Context:
- * Kernel context.
- */
-static os_lun_t *
-qla2x00_lun_alloc(scsi_qla_host_t *ha, uint16_t tgt, uint16_t lun) -{
- os_lun_t *lq;
-
- /*
- * If SCSI addressing OK, allocate LUN queue.
- */
- if (tgt >= MAX_TARGETS || lun >= MAX_LUNS || TGT_Q(ha, tgt) == NULL) {
- DEBUG2(printk("scsi(%ld): Unable to allocate lun, invalid "
- "parameter.\n", ha->host_no));
-
- return (NULL);
- }
-
- lq = LUN_Q(ha, tgt, lun);
- if (lq == NULL) {
- lq = kmalloc(sizeof(os_lun_t), GFP_ATOMIC);
- if (lq != NULL) {
- DEBUG2(printk("scsi(%ld): Alloc Lun %d @ tgt %d.\n",
- ha->host_no, lun, tgt));
-
- memset(lq, 0, sizeof(os_lun_t));
- LUN_Q(ha, tgt, lun) = lq;
-
- /*
- * The following lun queue initialization code
- * must be duplicated in alloc_ioctl_mem function
- * for ioctl_lq.
- */
- lq->q_state = LUN_STATE_READY;
- spin_lock_init(&lq->q_lock);
- }
- }
-
- if (lq == NULL) {
- qla_printk(KERN_WARNING, ha, "Unable to allocate lun.\n");
- }
-
- return (lq);
-}
-
-/*
- * qla2x00_lun_free
- * Frees LUN queue.
- *
- * Input:
- * ha = adapter block pointer.
- * t = SCSI target number.
- *
- * Context:
- * Kernel context.
- */
-static void
-qla2x00_lun_free(scsi_qla_host_t *ha, uint16_t tgt, uint16_t lun) -{
- os_lun_t *lq;
-
- /*
- * If SCSI addressing OK, allocate TGT queue and lock.
- */
- if (tgt >= MAX_TARGETS || lun >= MAX_LUNS) {
- DEBUG2(printk("scsi(%ld): Unable to deallocate lun, invalid "
- "parameter.\n", ha->host_no));
-
- return;
- }
-
- if (TGT_Q(ha, tgt) != NULL && (lq = LUN_Q(ha, tgt, lun)) != NULL) {
- LUN_Q(ha, tgt, lun) = NULL;
- kfree(lq);
- }
-
- return;
}
/*
@@ -3641,8 +3067,6 @@
ha->outstanding_cmds[cnt] = NULL; if (ha->actthreads)
ha->actthreads--;
- sp->lun_queue->out_cnt--;
-
sp->flags = 0;
sp->cmd->result = DID_RESET << 16; sp->cmd->host_scribble = (unsigned char *)NULL;
drivers/scsi/qla2xxx/qla_inline.h +0 -17
@@ -187,23 +187,6 @@return (0 ); } -static __inline__uint8_t -qla2x00_suspend_lun (scsi_qla_host_t *,os_lun_t *,int ,int ); -static __inline__uint8_t -qla2x00_delay_lun (scsi_qla_host_t *,os_lun_t *,int ); - -static __inline__uint8_t -qla2x00_suspend_lun (scsi_qla_host_t *ha,os_lun_t *lq,int time,int count) -{ -return (__qla2x00_suspend_lun (ha, lq, time, count,0 )); -} - -static __inline__uint8_t -qla2x00_delay_lun (scsi_qla_host_t *ha,os_lun_t *lq,int time) -{ -return (__qla2x00_suspend_lun (ha, lq, time,1 ,1 )); -} -static __inline__void qla2x00_check_fabric_devices (scsi_qla_host_t *);/* * This routine will wait for fabric devices for
drivers/scsi/qla2xxx/qla_iocb.c +4 -9
@@ -328,7 +328,6 @@int ret;unsigned long flags;scsi_qla_host_t *ha; -fc_lun_t *fclun;struct scsi_cmnd *cmd;uint32_t *clr_ptr;uint32_t index;
@@ -343,8 +342,7 @@/* Setup device pointers. */ ret =0 ; - fclun = sp->lun_queue->fclun; - ha = fclun->fcport->ha; + ha = sp->ha; reg = ha->iobase; cmd = sp->cmd;
@@ -411,11 +409,9 @@memset (clr_ptr,0 ,REQUEST_ENTRY_SIZE -8 ); cmd_pkt->dseg_count =cpu_to_le16 (tot_dsds); -/* Set target ID */ -SET_TARGET_ID (ha, cmd_pkt->target, fclun->fcport->loop_id); - -/* Set LUN number*/ - cmd_pkt->lun =cpu_to_le16 (fclun->lun); +/* Set target ID and LUN number*/ +SET_TARGET_ID (ha, cmd_pkt->target, sp->tgt_queue->fcport->loop_id); + cmd_pkt->lun =cpu_to_le16 (sp->cmd->device->lun);/* Update tagged queuing modifier */ cmd_pkt->control_flags =__constant_cpu_to_le16 (CF_SIMPLE_TAG );
@@ -453,7 +449,6 @@ ha->actthreads++; ha->total_ios++; - sp->lun_queue->out_cnt++; sp->flags |=SRB_DMA_VALID ; sp->state =SRB_ACTIVE_STATE ; sp->u_start = jiffies;
drivers/scsi/qla2xxx/qla_isr.c +2 -34
@@ -697,7 +697,6 @@if (ha->actthreads) ha->actthreads--; - sp->lun_queue->out_cnt--;CMD_COMPL_STATUS (sp->cmd) =0L ;CMD_SCSI_STATUS (sp->cmd) =0L ;
@@ -818,10 +817,8 @@static void qla2x00_status_entry (scsi_qla_host_t *ha,sts_entry_t *pkt) { -int ret;unsigned b, t, l;srb_t *sp; -os_lun_t *lq;os_tgt_t *tq;fc_port_t *fcport;struct scsi_cmnd *cp;
@@ -872,21 +869,6 @@if (ha->actthreads) ha->actthreads--; -if (sp->lun_queue ==NULL ) { -DEBUG2 (printk ("scsi(%ld): Status Entry invalid lun pointer.\n" , - ha->host_no)); -qla_printk (KERN_WARNING , ha, -"Status Entry invalid lun pointer.\n" ); - -set_bit (ISP_ABORT_NEEDED , &ha->dpc_flags); -if (ha->dpc_wait && !ha->dpc_active) -up (ha->dpc_wait); - -return ; - } - - sp->lun_queue->out_cnt--; - comp_status =le16_to_cpu (pkt->comp_status);/* Mask of reserved bits 12-15, before we examine the scsi status */ scsi_status =le16_to_cpu (pkt->scsi_status) &SS_MASK ;
@@ -902,7 +884,6 @@ l = cp->device->lun, tq = sp->tgt_queue; - lq = sp->lun_queue;/* Check for any FCP transport errors. */ if (scsi_status &SS_RESPONSE_INFO_LEN_VALID ) {
@@ -1096,7 +1077,7 @@* Target with DID_NO_CONNECT ELSE Queue the IOs in the * retry_queue. */ - fcport = sp->fclun->fcport; + fcport = tq->fcport; DEBUG2(printk("scsi(%ld:%d:%d): status_entry: Port Down " "pid=%ld, compl status=0x%x, port state=0x%x\n", ha->host_no, t, l, cp->serial_number, comp_status,
@@ -1137,8 +1118,7 @@ cp->result =DID_BUS_BUSY <<16 ; - fcport = lq->fclun->fcport; - + fcport = tq->fcport;/* Check to see if logout occurred */ if ((le16_to_cpu (pkt->status_flags) &SF_LOGOUT_SENT )) {qla2x00_mark_device_lost (ha, fcport,1 );
@@ -1154,16 +1134,6 @@ cp->result =DID_OK <<16 | lscsi_status; -/* TODO: ??? */ -/* Adjust queue depth */ - ret =scsi_track_queue_full (cp->device, - sp->lun_queue->out_cnt -1 ); -if (ret) { -qla_printk (KERN_INFO , ha, -"scsi(%ld:%d:%d:%d): Queue depth adjusted to %d.\n" , - ha->host_no, cp->device->channel, cp->device->id, - cp->device->lun, ret); - }break ;default :
@@ -1268,8 +1238,6 @@ ha->outstanding_cmds[pkt->handle] =NULL ;if (ha->actthreads) ha->actthreads--; - sp->lun_queue->out_cnt--; -/* Bad payload or header */ if (pkt->entry_status & (RF_INV_E_ORDER | RF_INV_E_COUNT |
drivers/scsi/qla2xxx/qla_mbx.c +2 -3
@@ -858,8 +858,7 @@ DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", ha->host_no);) - fcport = sp->fclun->fcport; - + fcport = sp->tgt_queue->fcport;if (atomic_read (&ha->loop_state) ==LOOP_DOWN ||atomic_read (&fcport->state) ==FCS_DEVICE_LOST ) {return 1 ;
@@ -884,7 +883,7 @@ mcp->mb[1 ] = fcport->loop_id <<8 ; mcp->mb[2 ] = (uint16_t )handle; mcp->mb[3 ] = (uint16_t )(handle >>16 ); - mcp->mb[6 ] = (uint16_t )sp->fclun->lun; + mcp->mb[6 ] = (uint16_t )sp->cmd->device->lun; mcp->out_mb =MBX_6 |MBX_3 |MBX_2 |MBX_1 |MBX_0 ; mcp->in_mb =MBX_0 ; mcp->tov =30 ;
drivers/scsi/qla2xxx/qla_os.c +9 -89
183 lines not on this page · raw message
Quoted 3 lines · Andrew Vasquez
Here's the breakdown of patches being submitted:
Not sure what's going on with VGER, but several folks appear to be having some difficulties getting the patches (including my own @pobox.com account).
All the patches can be found at the following URL:
ftp://ftp.qlogic.com/outgoing/linux/patches/8.x/8.00.02b10k/
Quoted 5 lines
1. Remove internal command queuing. This entails removal of the driver's
*_queuelists as well as modifications and removal of routines which used them. With the queuing removed -- the driver will be unable to tolerate cable-pulls. Thus we depend on the next patch for support.
ftp://ftp.qlogic.com/outgoing/linux/patches/8.x/8.00.02b10k/10-int_q_removal.diff
Quoted 4 lines
2. Add initial support for FC remote port infrastructure. This patch is based off the proposal submitted by James Smart:
([Patch RFC ] Update FC transport for FC Remote Ports)
http://marc.theaimsgroup.com/?l=linux-scsi&m=110187926413504&w=2
ftp://ftp.qlogic.com/outgoing/linux/patches/8.x/8.00.02b10k/11-fc_rport_adds.diff
Quoted 4 lines
3. Remove internal lun discovery routines and support structures. The mid-layer has a more exhaustive and fully capable set of functions for lun discovery.
ftp://ftp.qlogic.com/outgoing/linux/patches/8.x/8.00.02b10k/12-discovery_removal.diff
And a final incremental patch which fixes some backout problems with patch #1:
ftp://ftp.qlogic.com/outgoing/linux/patches/8.x/8.00.02b10k/13-sm_fixes.diff
I apologize for the confusion (still not sure what's going on).
--
Andrew