aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_scsi.c
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2007-08-02 11:10:09 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-08-01 13:21:26 -0400
commite8b62011d88d6fdba585fb2bb77c9274a63cadab (patch)
tree838c3abee73ec571456ae3ae83e51ecbed8e4a64 /drivers/scsi/lpfc/lpfc_scsi.c
parent3de2a653a127c468284c48e233719dc39769e354 (diff)
[SCSI] lpfc 8.2.2 : Rework the lpfc_printf_log() macro
Rework the lpfc_printf_log() macro so that logging is enabled on a per-vport basis. Used to be on a physical-port basis, thus logging with large numbers of vports became a mess. Required redefinition of the macro, and an update of every use. Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_scsi.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c246
1 files changed, 108 insertions, 138 deletions
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 78666c62330e..9ee2927ad82a 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -406,9 +406,7 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
406 struct scsi_cmnd *cmnd = lpfc_cmd->pCmd; 406 struct scsi_cmnd *cmnd = lpfc_cmd->pCmd;
407 struct fcp_cmnd *fcpcmd = lpfc_cmd->fcp_cmnd; 407 struct fcp_cmnd *fcpcmd = lpfc_cmd->fcp_cmnd;
408 struct fcp_rsp *fcprsp = lpfc_cmd->fcp_rsp; 408 struct fcp_rsp *fcprsp = lpfc_cmd->fcp_rsp;
409 struct lpfc_hba *phba = vport->phba;
410 uint32_t fcpi_parm = rsp_iocb->iocb.un.fcpi.fcpi_parm; 409 uint32_t fcpi_parm = rsp_iocb->iocb.un.fcpi.fcpi_parm;
411 uint32_t vpi = vport->vpi;
412 uint32_t resp_info = fcprsp->rspStatus2; 410 uint32_t resp_info = fcprsp->rspStatus2;
413 uint32_t scsi_status = fcprsp->rspStatus3; 411 uint32_t scsi_status = fcprsp->rspStatus3;
414 uint32_t *lp; 412 uint32_t *lp;
@@ -440,15 +438,15 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
440 if (!scsi_status && (resp_info & RESID_UNDER)) 438 if (!scsi_status && (resp_info & RESID_UNDER))
441 logit = LOG_FCP; 439 logit = LOG_FCP;
442 440
443 lpfc_printf_log(phba, KERN_WARNING, logit, 441 lpfc_printf_vlog(vport, KERN_WARNING, logit,
444 "%d (%d):0730 FCP command x%x failed: x%x SNS x%x x%x " 442 "0730 FCP command x%x failed: x%x SNS x%x x%x "
445 "Data: x%x x%x x%x x%x x%x\n", 443 "Data: x%x x%x x%x x%x x%x\n",
446 phba->brd_no, vpi, cmnd->cmnd[0], scsi_status, 444 cmnd->cmnd[0], scsi_status,
447 be32_to_cpu(*lp), be32_to_cpu(*(lp + 3)), resp_info, 445 be32_to_cpu(*lp), be32_to_cpu(*(lp + 3)), resp_info,
448 be32_to_cpu(fcprsp->rspResId), 446 be32_to_cpu(fcprsp->rspResId),
449 be32_to_cpu(fcprsp->rspSnsLen), 447 be32_to_cpu(fcprsp->rspSnsLen),
450 be32_to_cpu(fcprsp->rspRspLen), 448 be32_to_cpu(fcprsp->rspRspLen),
451 fcprsp->rspInfo3); 449 fcprsp->rspInfo3);
452 450
453 if (resp_info & RSP_LEN_VALID) { 451 if (resp_info & RSP_LEN_VALID) {
454 rsplen = be32_to_cpu(fcprsp->rspRspLen); 452 rsplen = be32_to_cpu(fcprsp->rspRspLen);
@@ -463,12 +461,12 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
463 if (resp_info & RESID_UNDER) { 461 if (resp_info & RESID_UNDER) {
464 scsi_set_resid(cmnd, be32_to_cpu(fcprsp->rspResId)); 462 scsi_set_resid(cmnd, be32_to_cpu(fcprsp->rspResId));
465 463
466 lpfc_printf_log(phba, KERN_INFO, LOG_FCP, 464 lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
467 "%d (%d):0716 FCP Read Underrun, expected %d, " 465 "0716 FCP Read Underrun, expected %d, "
468 "residual %d Data: x%x x%x x%x\n", 466 "residual %d Data: x%x x%x x%x\n",
469 phba->brd_no, vpi, be32_to_cpu(fcpcmd->fcpDl), 467 be32_to_cpu(fcpcmd->fcpDl),
470 scsi_get_resid(cmnd), fcpi_parm, cmnd->cmnd[0], 468 scsi_get_resid(cmnd), fcpi_parm, cmnd->cmnd[0],
471 cmnd->underflow); 469 cmnd->underflow);
472 470
473 /* 471 /*
474 * If there is an under run check if under run reported by 472 * If there is an under run check if under run reported by
@@ -478,14 +476,13 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
478 if ((cmnd->sc_data_direction == DMA_FROM_DEVICE) && 476 if ((cmnd->sc_data_direction == DMA_FROM_DEVICE) &&
479 fcpi_parm && 477 fcpi_parm &&
480 (scsi_get_resid(cmnd) != fcpi_parm)) { 478 (scsi_get_resid(cmnd) != fcpi_parm)) {
481 lpfc_printf_log(phba, KERN_WARNING, 479 lpfc_printf_vlog(vport, KERN_WARNING,
482 LOG_FCP | LOG_FCP_ERROR, 480 LOG_FCP | LOG_FCP_ERROR,
483 "%d (%d):0735 FCP Read Check Error " 481 "0735 FCP Read Check Error "
484 "and Underrun Data: x%x x%x x%x x%x\n", 482 "and Underrun Data: x%x x%x x%x x%x\n",
485 phba->brd_no, vpi, 483 be32_to_cpu(fcpcmd->fcpDl),
486 be32_to_cpu(fcpcmd->fcpDl), 484 scsi_get_resid(cmnd), fcpi_parm,
487 scsi_get_resid(cmnd), fcpi_parm, 485 cmnd->cmnd[0]);
488 cmnd->cmnd[0]);
489 scsi_set_resid(cmnd, scsi_bufflen(cmnd)); 486 scsi_set_resid(cmnd, scsi_bufflen(cmnd));
490 host_status = DID_ERROR; 487 host_status = DID_ERROR;
491 } 488 }
@@ -499,21 +496,19 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
499 (scsi_status == SAM_STAT_GOOD) && 496 (scsi_status == SAM_STAT_GOOD) &&
500 (scsi_bufflen(cmnd) - scsi_get_resid(cmnd) 497 (scsi_bufflen(cmnd) - scsi_get_resid(cmnd)
501 < cmnd->underflow)) { 498 < cmnd->underflow)) {
502 lpfc_printf_log(phba, KERN_INFO, LOG_FCP, 499 lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
503 "%d (%d):0717 FCP command x%x residual " 500 "0717 FCP command x%x residual "
504 "underrun converted to error " 501 "underrun converted to error "
505 "Data: x%x x%x x%x\n", 502 "Data: x%x x%x x%x\n",
506 phba->brd_no, vpi, cmnd->cmnd[0], 503 cmnd->cmnd[0], cmnd->request_bufflen,
507 scsi_bufflen(cmnd), 504 scsi_get_resid(cmnd), cmnd->underflow);
508 scsi_get_resid(cmnd), cmnd->underflow);
509 host_status = DID_ERROR; 505 host_status = DID_ERROR;
510 } 506 }
511 } else if (resp_info & RESID_OVER) { 507 } else if (resp_info & RESID_OVER) {
512 lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, 508 lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
513 "%d (%d):0720 FCP command x%x residual " 509 "0720 FCP command x%x residual overrun error. "
514 "overrun error. Data: x%x x%x \n", 510 "Data: x%x x%x \n", cmnd->cmnd[0],
515 phba->brd_no, vpi, cmnd->cmnd[0], 511 scsi_bufflen(cmnd), scsi_get_resid(cmnd));
516 scsi_bufflen(cmnd), scsi_get_resid(cmnd));
517 host_status = DID_ERROR; 512 host_status = DID_ERROR;
518 513
519 /* 514 /*
@@ -522,13 +517,12 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
522 */ 517 */
523 } else if ((scsi_status == SAM_STAT_GOOD) && fcpi_parm && 518 } else if ((scsi_status == SAM_STAT_GOOD) && fcpi_parm &&
524 (cmnd->sc_data_direction == DMA_FROM_DEVICE)) { 519 (cmnd->sc_data_direction == DMA_FROM_DEVICE)) {
525 lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_FCP_ERROR, 520 lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP | LOG_FCP_ERROR,
526 "%d (%d):0734 FCP Read Check Error Data: " 521 "0734 FCP Read Check Error Data: "
527 "x%x x%x x%x x%x\n", 522 "x%x x%x x%x x%x\n",
528 phba->brd_no, vpi, 523 be32_to_cpu(fcpcmd->fcpDl),
529 be32_to_cpu(fcpcmd->fcpDl), 524 be32_to_cpu(fcprsp->rspResId),
530 be32_to_cpu(fcprsp->rspResId), 525 fcpi_parm, cmnd->cmnd[0]);
531 fcpi_parm, cmnd->cmnd[0]);
532 host_status = DID_ERROR; 526 host_status = DID_ERROR;
533 scsi_set_resid(cmnd, scsi_bufflen(cmnd)); 527 scsi_set_resid(cmnd, scsi_bufflen(cmnd));
534 } 528 }
@@ -547,9 +541,6 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
547 struct lpfc_rport_data *rdata = lpfc_cmd->rdata; 541 struct lpfc_rport_data *rdata = lpfc_cmd->rdata;
548 struct lpfc_nodelist *pnode = rdata->pnode; 542 struct lpfc_nodelist *pnode = rdata->pnode;
549 struct scsi_cmnd *cmd = lpfc_cmd->pCmd; 543 struct scsi_cmnd *cmd = lpfc_cmd->pCmd;
550 uint32_t vpi = (lpfc_cmd->cur_iocbq.vport
551 ? lpfc_cmd->cur_iocbq.vport->vpi
552 : 0);
553 int result; 544 int result;
554 struct scsi_device *sdev, *tmp_sdev; 545 struct scsi_device *sdev, *tmp_sdev;
555 int depth = 0; 546 int depth = 0;
@@ -564,15 +555,15 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
564 else if (lpfc_cmd->status >= IOSTAT_CNT) 555 else if (lpfc_cmd->status >= IOSTAT_CNT)
565 lpfc_cmd->status = IOSTAT_DEFAULT; 556 lpfc_cmd->status = IOSTAT_DEFAULT;
566 557
567 lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, 558 lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
568 "%d (%d):0729 FCP cmd x%x failed <%d/%d> " 559 "0729 FCP cmd x%x failed <%d/%d> "
569 "status: x%x result: x%x Data: x%x x%x\n", 560 "status: x%x result: x%x Data: x%x x%x\n",
570 phba->brd_no, vpi, cmd->cmnd[0], 561 cmd->cmnd[0],
571 cmd->device ? cmd->device->id : 0xffff, 562 cmd->device ? cmd->device->id : 0xffff,
572 cmd->device ? cmd->device->lun : 0xffff, 563 cmd->device ? cmd->device->lun : 0xffff,
573 lpfc_cmd->status, lpfc_cmd->result, 564 lpfc_cmd->status, lpfc_cmd->result,
574 pIocbOut->iocb.ulpContext, 565 pIocbOut->iocb.ulpContext,
575 lpfc_cmd->cur_iocbq.iocb.ulpIoTag); 566 lpfc_cmd->cur_iocbq.iocb.ulpIoTag);
576 567
577 switch (lpfc_cmd->status) { 568 switch (lpfc_cmd->status) {
578 case IOSTAT_FCP_RSP_ERROR: 569 case IOSTAT_FCP_RSP_ERROR:
@@ -605,13 +596,12 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
605 if (cmd->result || lpfc_cmd->fcp_rsp->rspSnsLen) { 596 if (cmd->result || lpfc_cmd->fcp_rsp->rspSnsLen) {
606 uint32_t *lp = (uint32_t *)cmd->sense_buffer; 597 uint32_t *lp = (uint32_t *)cmd->sense_buffer;
607 598
608 lpfc_printf_log(phba, KERN_INFO, LOG_FCP, 599 lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
609 "%d (%d):0710 Iodone <%d/%d> cmd %p, error " 600 "0710 Iodone <%d/%d> cmd %p, error "
610 "x%x SNS x%x x%x Data: x%x x%x\n", 601 "x%x SNS x%x x%x Data: x%x x%x\n",
611 phba->brd_no, vpi, cmd->device->id, 602 cmd->device->id, cmd->device->lun, cmd,
612 cmd->device->lun, cmd, cmd->result, 603 cmd->result, *lp, *(lp + 3), cmd->retries,
613 *lp, *(lp + 3), cmd->retries, 604 scsi_get_resid(cmd));
614 scsi_get_resid(cmd));
615 } 605 }
616 606
617 result = cmd->result; 607 result = cmd->result;
@@ -675,10 +665,9 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
675 depth = sdev->host->cmd_per_lun; 665 depth = sdev->host->cmd_per_lun;
676 666
677 if (depth) { 667 if (depth) {
678 lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, 668 lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
679 "%d (%d):0711 detected queue full - " 669 "0711 detected queue full - lun queue "
680 "lun queue depth adjusted to %d.\n", 670 "depth adjusted to %d.\n", depth);
681 phba->brd_no, vpi, depth);
682 } 671 }
683 } 672 }
684 673
@@ -848,12 +837,9 @@ lpfc_scsi_tgt_reset(struct lpfc_scsi_buf *lpfc_cmd, struct lpfc_vport *vport,
848 return FAILED; 837 return FAILED;
849 838
850 /* Issue Target Reset to TGT <num> */ 839 /* Issue Target Reset to TGT <num> */
851 lpfc_printf_log(phba, KERN_INFO, LOG_FCP, 840 lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
852 "%d (%d):0702 Issue Target Reset to TGT %d " 841 "0702 Issue Target Reset to TGT %d Data: x%x x%x\n",
853 "Data: x%x x%x\n", 842 tgt_id, rdata->pnode->nlp_rpi, rdata->pnode->nlp_flag);
854 phba->brd_no, vport->vpi, tgt_id,
855 rdata->pnode->nlp_rpi, rdata->pnode->nlp_flag);
856
857 ret = lpfc_sli_issue_iocb_wait(phba, 843 ret = lpfc_sli_issue_iocb_wait(phba,
858 &phba->sli.ring[phba->sli.fcp_ring], 844 &phba->sli.ring[phba->sli.fcp_ring],
859 iocbq, iocbqrsp, lpfc_cmd->timeout); 845 iocbq, iocbqrsp, lpfc_cmd->timeout);
@@ -960,10 +946,9 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *))
960 if (lpfc_cmd == NULL) { 946 if (lpfc_cmd == NULL) {
961 lpfc_adjust_queue_depth(phba); 947 lpfc_adjust_queue_depth(phba);
962 948
963 lpfc_printf_log(phba, KERN_INFO, LOG_FCP, 949 lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
964 "%d (%d):0707 driver's buffer pool is empty, " 950 "0707 driver's buffer pool is empty, "
965 "IO busied\n", 951 "IO busied\n");
966 phba->brd_no, vport->vpi);
967 goto out_host_busy; 952 goto out_host_busy;
968 } 953 }
969 954
@@ -1104,22 +1089,19 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
1104 1089
1105 if (lpfc_cmd->pCmd == cmnd) { 1090 if (lpfc_cmd->pCmd == cmnd) {
1106 ret = FAILED; 1091 ret = FAILED;
1107 lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1092 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
1108 "%d (%d):0748 abort handler timed out waiting " 1093 "0748 abort handler timed out waiting "
1109 "for abort to complete: ret %#x, ID %d, " 1094 "for abort to complete: ret %#x, ID %d, "
1110 "LUN %d, snum %#lx\n", 1095 "LUN %d, snum %#lx\n",
1111 phba->brd_no, vport->vpi, ret, 1096 ret, cmnd->device->id, cmnd->device->lun,
1112 cmnd->device->id, cmnd->device->lun, 1097 cmnd->serial_number);
1113 cmnd->serial_number);
1114 } 1098 }
1115 1099
1116 out: 1100 out:
1117 lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, 1101 lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
1118 "%d (%d):0749 SCSI Layer I/O Abort Request " 1102 "0749 SCSI Layer I/O Abort Request Status x%x ID %d "
1119 "Status x%x ID %d LUN %d snum %#lx\n", 1103 "LUN %d snum %#lx\n", ret, cmnd->device->id,
1120 phba->brd_no, vport->vpi, ret, cmnd->device->id, 1104 cmnd->device->lun, cmnd->serial_number);
1121 cmnd->device->lun, cmnd->serial_number);
1122
1123 return ret; 1105 return ret;
1124} 1106}
1125 1107
@@ -1154,11 +1136,10 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd)
1154 rdata = cmnd->device->hostdata; 1136 rdata = cmnd->device->hostdata;
1155 if (!rdata || 1137 if (!rdata ||
1156 (loopcnt > ((vport->cfg_devloss_tmo * 2) + 1))){ 1138 (loopcnt > ((vport->cfg_devloss_tmo * 2) + 1))){
1157 lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1139 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
1158 "%d (%d):0721 LUN Reset rport " 1140 "0721 LUN Reset rport "
1159 "failure: cnt x%x rdata x%p\n", 1141 "failure: cnt x%x rdata x%p\n",
1160 phba->brd_no, vport->vpi, 1142 loopcnt, rdata);
1161 loopcnt, rdata);
1162 goto out; 1143 goto out;
1163 } 1144 }
1164 pnode = rdata->pnode; 1145 pnode = rdata->pnode;
@@ -1188,12 +1169,10 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd)
1188 if (iocbqrsp == NULL) 1169 if (iocbqrsp == NULL)
1189 goto out_free_scsi_buf; 1170 goto out_free_scsi_buf;
1190 1171
1191 lpfc_printf_log(phba, KERN_INFO, LOG_FCP, 1172 lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
1192 "%d (%d):0703 Issue target reset to TGT %d LUN %d " 1173 "0703 Issue target reset to TGT %d LUN %d "
1193 "rpi x%x nlp_flag x%x\n", 1174 "rpi x%x nlp_flag x%x\n", cmnd->device->id,
1194 phba->brd_no, vport->vpi, cmnd->device->id, 1175 cmnd->device->lun, pnode->nlp_rpi, pnode->nlp_flag);
1195 cmnd->device->lun, pnode->nlp_rpi, pnode->nlp_flag);
1196
1197 iocb_status = lpfc_sli_issue_iocb_wait(phba, 1176 iocb_status = lpfc_sli_issue_iocb_wait(phba,
1198 &phba->sli.ring[phba->sli.fcp_ring], 1177 &phba->sli.ring[phba->sli.fcp_ring],
1199 iocbq, iocbqrsp, lpfc_cmd->timeout); 1178 iocbq, iocbqrsp, lpfc_cmd->timeout);
@@ -1239,10 +1218,9 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd)
1239 } 1218 }
1240 1219
1241 if (cnt) { 1220 if (cnt) {
1242 lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1221 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
1243 "%d (%d):0719 device reset I/O flush failure: " 1222 "0719 device reset I/O flush failure: "
1244 "cnt x%x\n", 1223 "cnt x%x\n", cnt);
1245 phba->brd_no, vport->vpi, cnt);
1246 ret = FAILED; 1224 ret = FAILED;
1247 } 1225 }
1248 1226
@@ -1250,12 +1228,11 @@ out_free_scsi_buf:
1250 if (iocb_status != IOCB_TIMEDOUT) { 1228 if (iocb_status != IOCB_TIMEDOUT) {
1251 lpfc_release_scsi_buf(phba, lpfc_cmd); 1229 lpfc_release_scsi_buf(phba, lpfc_cmd);
1252 } 1230 }
1253 lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1231 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
1254 "%d (%d):0713 SCSI layer issued device reset (%d, %d) " 1232 "0713 SCSI layer issued device reset (%d, %d) "
1255 "return x%x status x%x result x%x\n", 1233 "return x%x status x%x result x%x\n",
1256 phba->brd_no, vport->vpi, cmnd->device->id, 1234 cmnd->device->id, cmnd->device->lun, ret,
1257 cmnd->device->lun, ret, cmd_status, cmd_result); 1235 cmd_status, cmd_result);
1258
1259out: 1236out:
1260 return ret; 1237 return ret;
1261} 1238}
@@ -1306,10 +1283,9 @@ lpfc_bus_reset_handler(struct scsi_cmnd *cmnd)
1306 cmnd->device->lun, 1283 cmnd->device->lun,
1307 ndlp->rport->dd_data); 1284 ndlp->rport->dd_data);
1308 if (ret != SUCCESS) { 1285 if (ret != SUCCESS) {
1309 lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1286 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
1310 "%d (%d):0700 Bus Reset on target %d " 1287 "0700 Bus Reset on target %d failed\n",
1311 "failed\n", 1288 i);
1312 phba->brd_no, vport->vpi, i);
1313 err_count++; 1289 err_count++;
1314 break; 1290 break;
1315 } 1291 }
@@ -1347,16 +1323,14 @@ lpfc_bus_reset_handler(struct scsi_cmnd *cmnd)
1347 } 1323 }
1348 1324
1349 if (cnt) { 1325 if (cnt) {
1350 lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1326 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
1351 "%d (%d):0715 Bus Reset I/O flush failure: " 1327 "0715 Bus Reset I/O flush failure: "
1352 "cnt x%x left x%x\n", 1328 "cnt x%x left x%x\n", cnt, i);
1353 phba->brd_no, vport->vpi, cnt, i);
1354 ret = FAILED; 1329 ret = FAILED;
1355 } 1330 }
1356 1331
1357 lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1332 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
1358 "%d (%d):0714 SCSI layer issued Bus Reset Data: x%x\n", 1333 "0714 SCSI layer issued Bus Reset Data: x%x\n", ret);
1359 phba->brd_no, vport->vpi, ret);
1360out: 1334out:
1361 return ret; 1335 return ret;
1362} 1336}
@@ -1389,32 +1363,28 @@ lpfc_slave_alloc(struct scsi_device *sdev)
1389 1363
1390 /* Allow some exchanges to be available always to complete discovery */ 1364 /* Allow some exchanges to be available always to complete discovery */
1391 if (total >= phba->cfg_hba_queue_depth - LPFC_DISC_IOCB_BUFF_COUNT ) { 1365 if (total >= phba->cfg_hba_queue_depth - LPFC_DISC_IOCB_BUFF_COUNT ) {
1392 lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, 1366 lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
1393 "%d (%d):0704 At limitation of %d " 1367 "0704 At limitation of %d preallocated "
1394 "preallocated command buffers\n", 1368 "command buffers\n", total);
1395 phba->brd_no, vport->vpi, total);
1396 return 0; 1369 return 0;
1397
1398 /* Allow some exchanges to be available always to complete discovery */ 1370 /* Allow some exchanges to be available always to complete discovery */
1399 } else if (total + num_to_alloc > 1371 } else if (total + num_to_alloc >
1400 phba->cfg_hba_queue_depth - LPFC_DISC_IOCB_BUFF_COUNT ) { 1372 phba->cfg_hba_queue_depth - LPFC_DISC_IOCB_BUFF_COUNT ) {
1401 lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, 1373 lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
1402 "%d (%d):0705 Allocation request of %d " 1374 "0705 Allocation request of %d "
1403 "command buffers will exceed max of %d. " 1375 "command buffers will exceed max of %d. "
1404 "Reducing allocation request to %d.\n", 1376 "Reducing allocation request to %d.\n",
1405 phba->brd_no, vport->vpi, num_to_alloc, 1377 num_to_alloc, phba->cfg_hba_queue_depth,
1406 phba->cfg_hba_queue_depth, 1378 (phba->cfg_hba_queue_depth - total));
1407 (phba->cfg_hba_queue_depth - total));
1408 num_to_alloc = phba->cfg_hba_queue_depth - total; 1379 num_to_alloc = phba->cfg_hba_queue_depth - total;
1409 } 1380 }
1410 1381
1411 for (i = 0; i < num_to_alloc; i++) { 1382 for (i = 0; i < num_to_alloc; i++) {
1412 scsi_buf = lpfc_new_scsi_buf(vport); 1383 scsi_buf = lpfc_new_scsi_buf(vport);
1413 if (!scsi_buf) { 1384 if (!scsi_buf) {
1414 lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1385 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
1415 "%d (%d):0706 Failed to allocate " 1386 "0706 Failed to allocate "
1416 "command buffer\n", 1387 "command buffer\n");
1417 phba->brd_no, vport->vpi);
1418 break; 1388 break;
1419 } 1389 }
1420 1390