diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-06 15:10:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-06 15:10:33 -0400 |
commit | 90311148415ab23f5767fbb577a012d4405f12e5 (patch) | |
tree | b66d2fe65409b949bb559d628bcf72c443ef1264 /drivers/scsi/fnic | |
parent | 3a564bb3a8a6950e18b1f5d209bda39fc3831074 (diff) | |
parent | c345c6ca13825d1a15de5399226802433dd30f8c (diff) |
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI updates from James Bottomley:
"This is mostly updates of the usual suspects: lpfc, qla2xxx, bnx2fc,
qedf, hpsa, hisi_sas, smartpqi, cxlflash, aacraid, csiostor along with
a host of minor and miscellaneous changes"
* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (276 commits)
qla2xxx: Fix NVMe entry_type for iocb packet on BE system
scsi: qla2xxx: avoid unused-function warning
scsi: snic: fix a couple of spelling mistakes/typos
scsi: qla2xxx: fix a bunch of typos and spelling mistakes
scsi: lpfc: don't double count abort errors
scsi: lpfc: spin_lock_irq() is not nestable
scsi: hisi_sas: optimise DMA slot memory
scsi: ibmvfc: constify dev_pm_ops structures.
scsi: ibmvscsi: constify dev_pm_ops structures.
scsi: cxlflash: Update debug prints in reset handlers
scsi: cxlflash: Update send_tmf() parameters
scsi: cxlflash: Avoid double free of character device
scsi: Add STARGET_CREATED_REMOVE state to scsi_target_state
scsi: ses: do not add a device to an enclosure if enclosure_add_links() fails.
scsi: ufs: flush eh_work when eh_work scheduled.
scsi: qla2xxx: Protect access to qpair members with qpair->qp_lock
scsi: sun_esp: fix device reference leaks
scsi: fnic: changing queue command to return result DID_IMM_RETRY when rport is init
scsi: fnic: correct speed display and add support for 25,40 and 100G
scsi: fnic: added timestamp reporting in fnic debug stats
...
Diffstat (limited to 'drivers/scsi/fnic')
-rw-r--r-- | drivers/scsi/fnic/fnic_debugfs.c | 1 | ||||
-rw-r--r-- | drivers/scsi/fnic/fnic_fcs.c | 24 | ||||
-rw-r--r-- | drivers/scsi/fnic/fnic_io.h | 9 | ||||
-rw-r--r-- | drivers/scsi/fnic/fnic_main.c | 14 | ||||
-rw-r--r-- | drivers/scsi/fnic/fnic_scsi.c | 17 | ||||
-rw-r--r-- | drivers/scsi/fnic/fnic_stats.h | 7 | ||||
-rw-r--r-- | drivers/scsi/fnic/fnic_trace.c | 24 |
7 files changed, 92 insertions, 4 deletions
diff --git a/drivers/scsi/fnic/fnic_debugfs.c b/drivers/scsi/fnic/fnic_debugfs.c index d6498fabe628..5e3d909cfc53 100644 --- a/drivers/scsi/fnic/fnic_debugfs.c +++ b/drivers/scsi/fnic/fnic_debugfs.c | |||
@@ -632,6 +632,7 @@ static ssize_t fnic_reset_stats_write(struct file *file, | |||
632 | sizeof(struct io_path_stats) - sizeof(u64)); | 632 | sizeof(struct io_path_stats) - sizeof(u64)); |
633 | memset(fw_stats_p+1, 0, | 633 | memset(fw_stats_p+1, 0, |
634 | sizeof(struct fw_stats) - sizeof(u64)); | 634 | sizeof(struct fw_stats) - sizeof(u64)); |
635 | getnstimeofday(&stats->stats_timestamps.last_reset_time); | ||
635 | } | 636 | } |
636 | 637 | ||
637 | (*ppos)++; | 638 | (*ppos)++; |
diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic/fnic_fcs.c index e72becaad8a5..999fc7547560 100644 --- a/drivers/scsi/fnic/fnic_fcs.c +++ b/drivers/scsi/fnic/fnic_fcs.c | |||
@@ -65,6 +65,30 @@ void fnic_handle_link(struct work_struct *work) | |||
65 | fnic->link_status = vnic_dev_link_status(fnic->vdev); | 65 | fnic->link_status = vnic_dev_link_status(fnic->vdev); |
66 | fnic->link_down_cnt = vnic_dev_link_down_cnt(fnic->vdev); | 66 | fnic->link_down_cnt = vnic_dev_link_down_cnt(fnic->vdev); |
67 | 67 | ||
68 | switch (vnic_dev_port_speed(fnic->vdev)) { | ||
69 | case DCEM_PORTSPEED_10G: | ||
70 | fc_host_speed(fnic->lport->host) = FC_PORTSPEED_10GBIT; | ||
71 | fnic->lport->link_supported_speeds = FC_PORTSPEED_10GBIT; | ||
72 | break; | ||
73 | case DCEM_PORTSPEED_25G: | ||
74 | fc_host_speed(fnic->lport->host) = FC_PORTSPEED_25GBIT; | ||
75 | fnic->lport->link_supported_speeds = FC_PORTSPEED_25GBIT; | ||
76 | break; | ||
77 | case DCEM_PORTSPEED_40G: | ||
78 | case DCEM_PORTSPEED_4x10G: | ||
79 | fc_host_speed(fnic->lport->host) = FC_PORTSPEED_40GBIT; | ||
80 | fnic->lport->link_supported_speeds = FC_PORTSPEED_40GBIT; | ||
81 | break; | ||
82 | case DCEM_PORTSPEED_100G: | ||
83 | fc_host_speed(fnic->lport->host) = FC_PORTSPEED_100GBIT; | ||
84 | fnic->lport->link_supported_speeds = FC_PORTSPEED_100GBIT; | ||
85 | break; | ||
86 | default: | ||
87 | fc_host_speed(fnic->lport->host) = FC_PORTSPEED_UNKNOWN; | ||
88 | fnic->lport->link_supported_speeds = FC_PORTSPEED_UNKNOWN; | ||
89 | break; | ||
90 | } | ||
91 | |||
68 | if (old_link_status == fnic->link_status) { | 92 | if (old_link_status == fnic->link_status) { |
69 | if (!fnic->link_status) { | 93 | if (!fnic->link_status) { |
70 | /* DOWN -> DOWN */ | 94 | /* DOWN -> DOWN */ |
diff --git a/drivers/scsi/fnic/fnic_io.h b/drivers/scsi/fnic/fnic_io.h index c35b8f1889ea..e0bc659ed71f 100644 --- a/drivers/scsi/fnic/fnic_io.h +++ b/drivers/scsi/fnic/fnic_io.h | |||
@@ -66,4 +66,13 @@ struct fnic_io_req { | |||
66 | struct completion *dr_done; /* completion for device reset */ | 66 | struct completion *dr_done; /* completion for device reset */ |
67 | }; | 67 | }; |
68 | 68 | ||
69 | enum fnic_port_speeds { | ||
70 | DCEM_PORTSPEED_NONE = 0, | ||
71 | DCEM_PORTSPEED_1G = 1000, | ||
72 | DCEM_PORTSPEED_10G = 10000, | ||
73 | DCEM_PORTSPEED_40G = 40000, | ||
74 | DCEM_PORTSPEED_4x10G = 41000, | ||
75 | DCEM_PORTSPEED_25G = 25000, | ||
76 | DCEM_PORTSPEED_100G = 100000, | ||
77 | }; | ||
69 | #endif /* _FNIC_IO_H_ */ | 78 | #endif /* _FNIC_IO_H_ */ |
diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c index ba58b7953263..aacadbf20b69 100644 --- a/drivers/scsi/fnic/fnic_main.c +++ b/drivers/scsi/fnic/fnic_main.c | |||
@@ -176,11 +176,21 @@ static void fnic_get_host_speed(struct Scsi_Host *shost) | |||
176 | 176 | ||
177 | /* Add in other values as they get defined in fw */ | 177 | /* Add in other values as they get defined in fw */ |
178 | switch (port_speed) { | 178 | switch (port_speed) { |
179 | case 10000: | 179 | case DCEM_PORTSPEED_10G: |
180 | fc_host_speed(shost) = FC_PORTSPEED_10GBIT; | 180 | fc_host_speed(shost) = FC_PORTSPEED_10GBIT; |
181 | break; | 181 | break; |
182 | case DCEM_PORTSPEED_25G: | ||
183 | fc_host_speed(shost) = FC_PORTSPEED_25GBIT; | ||
184 | break; | ||
185 | case DCEM_PORTSPEED_40G: | ||
186 | case DCEM_PORTSPEED_4x10G: | ||
187 | fc_host_speed(shost) = FC_PORTSPEED_40GBIT; | ||
188 | break; | ||
189 | case DCEM_PORTSPEED_100G: | ||
190 | fc_host_speed(shost) = FC_PORTSPEED_100GBIT; | ||
191 | break; | ||
182 | default: | 192 | default: |
183 | fc_host_speed(shost) = FC_PORTSPEED_10GBIT; | 193 | fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN; |
184 | break; | 194 | break; |
185 | } | 195 | } |
186 | } | 196 | } |
diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index d048f3b5006f..6c0646d62dfb 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c | |||
@@ -466,15 +466,27 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_ | |||
466 | } | 466 | } |
467 | 467 | ||
468 | rp = rport->dd_data; | 468 | rp = rport->dd_data; |
469 | if (!rp || rp->rp_state != RPORT_ST_READY) { | 469 | if (!rp || rp->rp_state == RPORT_ST_DELETE) { |
470 | FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, | 470 | FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, |
471 | "returning DID_NO_CONNECT for IO as rport is removed\n"); | 471 | "rport 0x%x removed, returning DID_NO_CONNECT\n", |
472 | rport->port_id); | ||
473 | |||
472 | atomic64_inc(&fnic_stats->misc_stats.rport_not_ready); | 474 | atomic64_inc(&fnic_stats->misc_stats.rport_not_ready); |
473 | sc->result = DID_NO_CONNECT<<16; | 475 | sc->result = DID_NO_CONNECT<<16; |
474 | done(sc); | 476 | done(sc); |
475 | return 0; | 477 | return 0; |
476 | } | 478 | } |
477 | 479 | ||
480 | if (rp->rp_state != RPORT_ST_READY) { | ||
481 | FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, | ||
482 | "rport 0x%x in state 0x%x, returning DID_IMM_RETRY\n", | ||
483 | rport->port_id, rp->rp_state); | ||
484 | |||
485 | sc->result = DID_IMM_RETRY << 16; | ||
486 | done(sc); | ||
487 | return 0; | ||
488 | } | ||
489 | |||
478 | if (lp->state != LPORT_ST_READY || !(lp->link_up)) | 490 | if (lp->state != LPORT_ST_READY || !(lp->link_up)) |
479 | return SCSI_MLQUEUE_HOST_BUSY; | 491 | return SCSI_MLQUEUE_HOST_BUSY; |
480 | 492 | ||
@@ -633,6 +645,7 @@ static int fnic_fcpio_fw_reset_cmpl_handler(struct fnic *fnic, | |||
633 | 645 | ||
634 | atomic64_set(&fnic->fnic_stats.fw_stats.active_fw_reqs, 0); | 646 | atomic64_set(&fnic->fnic_stats.fw_stats.active_fw_reqs, 0); |
635 | atomic64_set(&fnic->fnic_stats.io_stats.active_ios, 0); | 647 | atomic64_set(&fnic->fnic_stats.io_stats.active_ios, 0); |
648 | atomic64_set(&fnic->io_cmpl_skip, 0); | ||
636 | 649 | ||
637 | spin_lock_irqsave(&fnic->fnic_lock, flags); | 650 | spin_lock_irqsave(&fnic->fnic_lock, flags); |
638 | 651 | ||
diff --git a/drivers/scsi/fnic/fnic_stats.h b/drivers/scsi/fnic/fnic_stats.h index 88c73cccb015..e007feedbf72 100644 --- a/drivers/scsi/fnic/fnic_stats.h +++ b/drivers/scsi/fnic/fnic_stats.h | |||
@@ -16,6 +16,12 @@ | |||
16 | */ | 16 | */ |
17 | #ifndef _FNIC_STATS_H_ | 17 | #ifndef _FNIC_STATS_H_ |
18 | #define _FNIC_STATS_H_ | 18 | #define _FNIC_STATS_H_ |
19 | |||
20 | struct stats_timestamps { | ||
21 | struct timespec last_reset_time; | ||
22 | struct timespec last_read_time; | ||
23 | }; | ||
24 | |||
19 | struct io_path_stats { | 25 | struct io_path_stats { |
20 | atomic64_t active_ios; | 26 | atomic64_t active_ios; |
21 | atomic64_t max_active_ios; | 27 | atomic64_t max_active_ios; |
@@ -110,6 +116,7 @@ struct misc_stats { | |||
110 | }; | 116 | }; |
111 | 117 | ||
112 | struct fnic_stats { | 118 | struct fnic_stats { |
119 | struct stats_timestamps stats_timestamps; | ||
113 | struct io_path_stats io_stats; | 120 | struct io_path_stats io_stats; |
114 | struct abort_stats abts_stats; | 121 | struct abort_stats abts_stats; |
115 | struct terminate_stats term_stats; | 122 | struct terminate_stats term_stats; |
diff --git a/drivers/scsi/fnic/fnic_trace.c b/drivers/scsi/fnic/fnic_trace.c index b5ac5381a0d7..4826f596cb31 100644 --- a/drivers/scsi/fnic/fnic_trace.c +++ b/drivers/scsi/fnic/fnic_trace.c | |||
@@ -219,7 +219,31 @@ int fnic_get_stats_data(struct stats_debug_info *debug, | |||
219 | int buf_size = debug->buf_size; | 219 | int buf_size = debug->buf_size; |
220 | struct timespec val1, val2; | 220 | struct timespec val1, val2; |
221 | 221 | ||
222 | getnstimeofday(&val1); | ||
222 | len = snprintf(debug->debug_buffer + len, buf_size - len, | 223 | len = snprintf(debug->debug_buffer + len, buf_size - len, |
224 | "------------------------------------------\n" | ||
225 | "\t\tTime\n" | ||
226 | "------------------------------------------\n"); | ||
227 | |||
228 | len += snprintf(debug->debug_buffer + len, buf_size - len, | ||
229 | "Current time : [%ld:%ld]\n" | ||
230 | "Last stats reset time: [%ld:%ld]\n" | ||
231 | "Last stats read time: [%ld:%ld]\n" | ||
232 | "delta since last reset: [%ld:%ld]\n" | ||
233 | "delta since last read: [%ld:%ld]\n", | ||
234 | val1.tv_sec, val1.tv_nsec, | ||
235 | stats->stats_timestamps.last_reset_time.tv_sec, | ||
236 | stats->stats_timestamps.last_reset_time.tv_nsec, | ||
237 | stats->stats_timestamps.last_read_time.tv_sec, | ||
238 | stats->stats_timestamps.last_read_time.tv_nsec, | ||
239 | timespec_sub(val1, stats->stats_timestamps.last_reset_time).tv_sec, | ||
240 | timespec_sub(val1, stats->stats_timestamps.last_reset_time).tv_nsec, | ||
241 | timespec_sub(val1, stats->stats_timestamps.last_read_time).tv_sec, | ||
242 | timespec_sub(val1, stats->stats_timestamps.last_read_time).tv_nsec); | ||
243 | |||
244 | stats->stats_timestamps.last_read_time = val1; | ||
245 | |||
246 | len += snprintf(debug->debug_buffer + len, buf_size - len, | ||
223 | "------------------------------------------\n" | 247 | "------------------------------------------\n" |
224 | "\t\tIO Statistics\n" | 248 | "\t\tIO Statistics\n" |
225 | "------------------------------------------\n"); | 249 | "------------------------------------------\n"); |