diff --git a/iscsi-scst/conftest/bad_wr_mod/bad_wr_mod.c b/iscsi-scst/conftest/bad_wr_mod/bad_wr_mod.c index cfd76d393..8880f51cd 100644 --- a/iscsi-scst/conftest/bad_wr_mod/bad_wr_mod.c +++ b/iscsi-scst/conftest/bad_wr_mod/bad_wr_mod.c @@ -3,11 +3,11 @@ static int modinit(void) { - struct ib_qp *qp = NULL; - const struct ib_recv_wr *recv_wr = NULL; - const struct ib_recv_wr **bad_recv_wr = NULL; + struct ib_qp qp = { }; + const struct ib_recv_wr recv_wr = { }; + const struct ib_recv_wr *bad_recv_wr; - return ib_post_recv(qp, recv_wr, bad_recv_wr); + return ib_post_recv(&qp, &recv_wr, &bad_recv_wr); } module_init(modinit); diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf index b5bb733dc..fe664d8fc 100644 --- a/nightly/conf/nightly.conf +++ b/nightly/conf/nightly.conf @@ -7,22 +7,22 @@ ABT_KERNELS=" \ 5.1.21-nc \ 5.0.21-nc \ 4.20.17-nc \ -4.19.67-nc \ +4.19.68-nc \ 4.18.20-nc \ 4.17.19-nc \ 4.16.18-nc \ 4.15.18-nc \ -4.14.139-nc \ +4.14.140-nc \ 4.13.16-nc \ 4.12.14-nc \ 4.11.12-nc \ 4.10.17-nc \ -4.9.189-nc \ +4.9.190-nc \ 4.8.17-nc \ 4.7.10-nc \ 4.6.7-nc \ 4.5.7-nc \ -4.4.189-nc \ +4.4.190-nc \ 4.3.6-nc \ 4.2.8-nc \ 4.1.52-nc \ @@ -30,7 +30,7 @@ ABT_KERNELS=" \ 3.19.8-nc \ 3.18.140-nc \ 3.17.8-nc \ -3.16.72-nc \ +3.16.73-nc \ 3.15.10-nc \ 3.14.79-nc \ 3.13.11-nc \ diff --git a/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c b/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c index 1f576d8ae..ef2b34a8d 100644 --- a/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c +++ b/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c @@ -712,9 +712,8 @@ static void sqa_qla2xxx_free_session(struct fc_port *fcport) TRACE_ENTRY(); - TRACE_MGMT_DBG("sqatgt(%ld/%d): Deleting session %s fcid=%02x%02x%02x\n", - vha->host_no, vha->vp_idx, wwn_to_str(fcport->port_name), - fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa); + TRACE_MGMT_DBG("sqatgt(%ld/%d): Deleting session %8phC fcid=%3phC\n", + vha->host_no, vha->vp_idx, fcport->port_name, &fcport->d_id); { DECLARE_COMPLETION_ONSTACK(c); @@ -724,8 +723,8 @@ static void sqa_qla2xxx_free_session(struct fc_port *fcport) wait_for_completion(&c); } - TRACE_MGMT_DBG("sqatgt(%ld/%d): Unregister completed %s done\n", - vha->host_no, vha->vp_idx, wwn_to_str(fcport->port_name)); + TRACE_MGMT_DBG("sqatgt(%ld/%d): Unregister completed %8phC done \n", + vha->host_no, vha->vp_idx, fcport->port_name); kfree(se_sess); @@ -753,18 +752,15 @@ static int sqa_qla2xxx_check_initiator_node_acl(scsi_qla_host_t *vha, TRACE_ENTRY(); - PRINT_INFO("sqatgt(%ld/%d): Registering initiator: pwwn=%s", - vha->host_no, vha->vp_idx, wwn_to_str(fc_wwpn)); + PRINT_INFO("sqatgt(%ld/%d): Registering initiator: pwwn=%8phC", + vha->host_no, vha->vp_idx, fc_wwpn); se_sess = kzalloc(sizeof(*se_sess), GFP_KERNEL); if (!se_sess) return res; /* Create the SCST session. */ - ini_name = kasprintf(GFP_KERNEL, - "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", - fc_wwpn[0], fc_wwpn[1], fc_wwpn[2], fc_wwpn[3], - fc_wwpn[4], fc_wwpn[5], fc_wwpn[6], fc_wwpn[7]); + ini_name = kasprintf(GFP_KERNEL, "%8phC", fc_wwpn); if (!ini_name) goto free_sess; @@ -1408,7 +1404,7 @@ static void sqa_qla2xxx_add_target(struct scsi_qla_host *vha) TRACE_ENTRY(); - PRINT_INFO("sqatgt: add target %s", wwn_to_str(vha->port_name)); + PRINT_INFO("sqatgt: add target %8phC", vha->port_name); if (!vha->vha_tgt.target_lport_ptr) { mutex_lock(&sqa_mutex); @@ -1749,10 +1745,9 @@ static int sqa_get_initiator_port_transport_id(struct scst_tgt *tgt, } TRACE_DBG("sqatgt(%ld/%d): Creating transport id: target session=%p, " - "initiator=%s, fcid=0x%02x%02x%02x, loop=0x%04x", + "initiator=%8phC, fcid=%3phC, loop=0x%04x", sess->vha->host_no, sess->vha->vp_idx, sess, - wwn_to_str(sess->port_name), sess->d_id.b.domain, sess->d_id.b.area, - sess->d_id.b.al_pa, sess->loop_id); + sess->port_name, &sess->d_id.b, sess->loop_id); tr_id_size = 24; tr_id = kzalloc(tr_id_size, GFP_KERNEL); diff --git a/qla2x00t-32gbit/qla_def.h b/qla2x00t-32gbit/qla_def.h index 36b6c6aa5..4715e5fac 100644 --- a/qla2x00t-32gbit/qla_def.h +++ b/qla2x00t-32gbit/qla_def.h @@ -48,6 +48,14 @@ #define NEW_LIBFC_API #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 7) +#error +#error ***This version of qla2xxx does not support distributions based on*** +#error ***kernels before Linux kernel v3.15.*** +#error +#endif + /* Big endian Fibre Channel S_ID (source ID) or D_ID (destination ID). */ typedef struct { uint8_t domain; diff --git a/qla2x00t-32gbit/qla_dfs.c b/qla2x00t-32gbit/qla_dfs.c index 6c39e64dd..0a6fb359f 100644 --- a/qla2x00t-32gbit/qla_dfs.c +++ b/qla2x00t-32gbit/qla_dfs.c @@ -27,9 +27,9 @@ qla2x00_dfs_tgt_sess_show(struct seq_file *s, void *unused) spin_lock_irqsave(&ha->tgt.sess_lock, flags); list_for_each_entry(sess, &vha->vp_fcports, list) - seq_printf(s, "%02x:%02x:%02x %s %d\n", + seq_printf(s, "%02x:%02x:%02x %8phC %d\n", sess->d_id.b.domain, sess->d_id.b.area, - sess->d_id.b.al_pa, wwn_to_str(sess->port_name), + sess->d_id.b.al_pa, sess->port_name, sess->loop_id); spin_unlock_irqrestore(&ha->tgt.sess_lock, flags); } @@ -92,8 +92,8 @@ qla2x00_dfs_tgt_port_database_show(struct seq_file *s, void *unused) fc_port.loop_id = loop_id; rc = qla24xx_gpdb_wait(vha, &fc_port, 0); - seq_printf(s, "%s %02x%02x%02x %d\n", - wwn_to_str(fc_port.port_name), fc_port.d_id.b.domain, + seq_printf(s, "%8phC %02x%02x%02x %d\n", + fc_port.port_name, fc_port.d_id.b.domain, fc_port.d_id.b.area, fc_port.d_id.b.al_pa, fc_port.loop_id); gid = (void *)gid + ha->gid_list_info_size; diff --git a/qla2x00t-32gbit/qla_gs.c b/qla2x00t-32gbit/qla_gs.c index c878ce06b..87fb95fe8 100644 --- a/qla2x00t-32gbit/qla_gs.c +++ b/qla2x00t-32gbit/qla_gs.c @@ -2967,8 +2967,8 @@ void qla24xx_handle_gpsc_event(scsi_qla_host_t *vha, struct event_arg *ea) struct fc_port *fcport = ea->fcport; ql_dbg(ql_dbg_disc, vha, 0x20d8, - "%s %s DS %d LS %d rc %d login %d|%d rscn %d|%d lid %d\n", - __func__, wwn_to_str(fcport->port_name), fcport->disc_state, + "%s %8phC DS %d LS %d rc %d login %d|%d rscn %d|%d lid %d\n", + __func__, fcport->port_name, fcport->disc_state, fcport->fw_login_state, ea->rc, ea->sp->gen2, fcport->login_gen, ea->sp->gen2, fcport->rscn_gen|ea->sp->gen1, fcport->loop_id); @@ -2978,8 +2978,8 @@ void qla24xx_handle_gpsc_event(scsi_qla_host_t *vha, struct event_arg *ea) if (ea->sp->gen2 != fcport->login_gen) { /* target side must have changed it. */ ql_dbg(ql_dbg_disc, vha, 0x20d3, - "%s %s generation changed\n", - __func__, wwn_to_str(fcport->port_name)); + "%s %8phC generation changed\n", + __func__, fcport->port_name); return; } else if (ea->sp->gen1 != fcport->rscn_gen) { return; @@ -2998,8 +2998,9 @@ static void qla24xx_async_gpsc_sp_done(srb_t *sp, int res) ct_rsp = &fcport->ct_desc.ct_sns->p.rsp; - ql_dbg(ql_dbg_disc, vha, 0x2053, "Async done-%s res %x, WWPN %s \n", - sp->name, res, wwn_to_str(fcport->port_name)); + ql_dbg(ql_dbg_disc, vha, 0x2053, + "Async done-%s res %x, WWPN %8phC \n", + sp->name, res, fcport->port_name); fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); @@ -3024,8 +3025,8 @@ static void qla24xx_async_gpsc_sp_done(srb_t *sp, int res) be16_to_cpu(ct_rsp->rsp.gpsc.speed)); ql_dbg(ql_dbg_disc, vha, 0x2054, - "Async-%s OUT WWPN %s speeds=%04x speed=%04x.\n", - sp->name, wwn_to_str(fcport->fabric_port_name), + "Async-%s OUT WWPN %8phC speeds=%04x speed=%04x.\n", + sp->name, fcport->fabric_port_name, be16_to_cpu(ct_rsp->rsp.gpsc.speeds), be16_to_cpu(ct_rsp->rsp.gpsc.speed)); } @@ -3079,8 +3080,8 @@ int qla24xx_async_gpsc(scsi_qla_host_t *vha, fc_port_t *fcport) sp->done = qla24xx_async_gpsc_sp_done; ql_dbg(ql_dbg_disc, vha, 0x205e, - "Async-%s %s hdl=%x loopid=%x portid=%02x%02x%02x.\n", - sp->name, wwn_to_str(fcport->port_name), sp->handle, + "Async-%s %8phC hdl=%x loopid=%x portid=%02x%02x%02x.\n", + sp->name, fcport->port_name, sp->handle, fcport->loop_id, fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa); @@ -3195,16 +3196,16 @@ void qla24xx_handle_gpnid_event(scsi_qla_host_t *vha, struct event_arg *ea) case DSC_LOGIN_COMPLETE: /* recheck session is still intact. */ ql_dbg(ql_dbg_disc, vha, 0x210d, - "%s %d %s revalidate session with ADISC\n", - __func__, __LINE__, wwn_to_str(fcport->port_name)); + "%s %d %8phC revalidate session with ADISC\n", + __func__, __LINE__, fcport->port_name); data[0] = data[1] = 0; qla2x00_post_async_adisc_work(vha, fcport, data); break; case DSC_DELETED: ql_dbg(ql_dbg_disc, vha, 0x210d, - "%s %d %s login\n", __func__, __LINE__, - wwn_to_str(fcport->port_name)); + "%s %d %8phC login\n", __func__, __LINE__, + fcport->port_name); fcport->d_id = ea->id; qla24xx_fcport_handle_login(vha, fcport); break; @@ -3224,9 +3225,9 @@ void qla24xx_handle_gpnid_event(scsi_qla_host_t *vha, struct event_arg *ea) * conflict with new fcport. */ ql_dbg(ql_dbg_disc, vha, 0xffff, - "%s %d %s DS %d\n", + "%s %d %8phC DS %d\n", __func__, __LINE__, - wwn_to_str(conflict->port_name), + conflict->port_name, conflict->disc_state); conflict->scan_state = QLA_FCPORT_SCAN; @@ -3236,8 +3237,8 @@ void qla24xx_handle_gpnid_event(scsi_qla_host_t *vha, struct event_arg *ea) /* create new fcport */ ql_dbg(ql_dbg_disc, vha, 0x2065, - "%s %d %s post new sess\n", - __func__, __LINE__, wwn_to_str(ea->port_name)); + "%s %d %8phC post new sess\n", + __func__, __LINE__, ea->port_name); qla24xx_post_newsess_work(vha, &ea->id, ea->port_name, NULL, NULL, FC4_TYPE_UNKNOWN); } @@ -3257,20 +3258,14 @@ static void qla2x00_async_gpnid_sp_done(srb_t *sp, int res) if (res) ql_dbg(ql_dbg_disc, vha, 0x2066, - "Async done-%s fail res %x rscn gen %d ID %02x:%02x:%02x. %s\n", - sp->name, res, sp->gen1, - ct_req->req.port_id.port_id.domain, - ct_req->req.port_id.port_id.area, - ct_req->req.port_id.port_id.al_pa, - wwn_to_str(ct_rsp->rsp.gpn_id.port_name)); + "Async done-%s fail res %x rscn gen %d ID %3phC. %8phC\n", + sp->name, res, sp->gen1, &ct_req->req.port_id.port_id, + ct_rsp->rsp.gpn_id.port_name); else ql_dbg(ql_dbg_disc, vha, 0x2066, - "Async done-%s good rscn gen %d ID %02x:%02x:%02x. %s\n", - sp->name, sp->gen1, - ct_req->req.port_id.port_id.domain, - ct_req->req.port_id.port_id.area, - ct_req->req.port_id.port_id.al_pa, - wwn_to_str(ct_rsp->rsp.gpn_id.port_name)); + "Async done-%s good rscn gen %d ID %3phC. %8phC\n", + sp->name, sp->gen1, &ct_req->req.port_id.port_id, + ct_rsp->rsp.gpn_id.port_name); memset(&ea, 0, sizeof(ea)); memcpy(ea.port_name, ct_rsp->rsp.gpn_id.port_name, WWN_SIZE); @@ -3391,11 +3386,9 @@ int qla24xx_async_gpnid(scsi_qla_host_t *vha, port_id_t *id) sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; sp->done = qla2x00_async_gpnid_sp_done; - ql_dbg(ql_dbg_disc, vha, 0x2067, "Async-%s hdl=%x ID %02x:%02x:%02x.\n", - sp->name, sp->handle, - ct_req->req.port_id.port_id.domain, - ct_req->req.port_id.port_id.area, - ct_req->req.port_id.port_id.al_pa); + ql_dbg(ql_dbg_disc, vha, 0x2067, + "Async-%s hdl=%x ID %3phC.\n", sp->name, + sp->handle, &ct_req->req.port_id.port_id); rval = qla2x00_start_sp(sp); if (rval != QLA_SUCCESS) @@ -3443,8 +3436,8 @@ void qla24xx_async_gffid_sp_done(srb_t *sp, int res) struct event_arg ea; ql_dbg(ql_dbg_disc, vha, 0x2133, - "Async done-%s res %x ID %x. %s\n", - sp->name, res, fcport->d_id.b24, wwn_to_str(fcport->port_name)); + "Async done-%s res %x ID %x. %8phC\n", + sp->name, res, fcport->d_id.b24, fcport->port_name); fcport->flags &= ~FCF_ASYNC_SENT; ct_rsp = &fcport->ct_desc.ct_sns->p.rsp; @@ -3520,8 +3513,8 @@ int qla24xx_async_gffid(scsi_qla_host_t *vha, fc_port_t *fcport) sp->done = qla24xx_async_gffid_sp_done; ql_dbg(ql_dbg_disc, vha, 0x2132, - "Async-%s hdl=%x %s.\n", sp->name, - sp->handle, wwn_to_str(fcport->port_name)); + "Async-%s hdl=%x %8phC.\n", sp->name, + sp->handle, fcport->port_name); rval = qla2x00_start_sp(sp); if (rval != QLA_SUCCESS) @@ -3653,8 +3646,8 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp) if (!found) { ql_dbg(ql_dbg_disc, vha, 0xffff, - "%s %d %s post new sess\n", - __func__, __LINE__, wwn_to_str(rp->port_name)); + "%s %d %8phC post new sess\n", + __func__, __LINE__, rp->port_name); qla24xx_post_newsess_work(vha, &rp->id, rp->port_name, rp->node_name, NULL, rp->fc4type); } @@ -3685,9 +3678,9 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp) fcport->logout_on_delete = 0; ql_dbg(ql_dbg_disc, vha, 0x20f0, - "%s %d %s post del sess\n", + "%s %d %8phC post del sess\n", __func__, __LINE__, - wwn_to_str(fcport->port_name)); + fcport->port_name); qlt_schedule_sess_for_deletion(fcport); continue; @@ -4256,9 +4249,8 @@ static void qla2x00_async_gnnid_sp_done(srb_t *sp, int res) ea.rc = res; ql_dbg(ql_dbg_disc, vha, 0x204f, - "Async done-%s res %x, WWPN %s %s\n", - sp->name, res, wwn_to_str(fcport->port_name), - wwn_to_str(fcport->node_name)); + "Async done-%s res %x, WWPN %8phC %8phC\n", + sp->name, res, fcport->port_name, fcport->node_name); qla24xx_handle_gnnid_event(vha, &ea); @@ -4308,8 +4300,8 @@ int qla24xx_async_gnnid(scsi_qla_host_t *vha, fc_port_t *fcport) sp->done = qla2x00_async_gnnid_sp_done; ql_dbg(ql_dbg_disc, vha, 0xffff, - "Async-%s - %s hdl=%x loopid=%x portid %06x.\n", - sp->name, wwn_to_str(fcport->port_name), + "Async-%s - %8phC hdl=%x loopid=%x portid %06x.\n", + sp->name, fcport->port_name, sp->handle, fcport->loop_id, fcport->d_id.b24); rval = qla2x00_start_sp(sp); @@ -4348,8 +4340,8 @@ void qla24xx_handle_gfpnid_event(scsi_qla_host_t *vha, struct event_arg *ea) fc_port_t *fcport = ea->fcport; ql_dbg(ql_dbg_disc, vha, 0xffff, - "%s %s DS %d LS %d rc %d login %d|%d rscn %d|%d fcpcnt %d\n", - __func__, wwn_to_str(fcport->port_name), fcport->disc_state, + "%s %8phC DS %d LS %d rc %d login %d|%d rscn %d|%d fcpcnt %d\n", + __func__, fcport->port_name, fcport->disc_state, fcport->fw_login_state, ea->rc, fcport->login_gen, ea->sp->gen2, fcport->rscn_gen, ea->sp->gen1, vha->fcport_count); @@ -4359,8 +4351,8 @@ void qla24xx_handle_gfpnid_event(scsi_qla_host_t *vha, struct event_arg *ea) if (ea->sp->gen2 != fcport->login_gen) { /* target side must have changed it. */ ql_dbg(ql_dbg_disc, vha, 0x20d3, - "%s %s generation changed\n", - __func__, wwn_to_str(fcport->port_name)); + "%s %8phC generation changed\n", + __func__, fcport->port_name); return; } else if (ea->sp->gen1 != fcport->rscn_gen) { return; @@ -4387,9 +4379,8 @@ static void qla2x00_async_gfpnid_sp_done(srb_t *sp, int res) ea.rc = res; ql_dbg(ql_dbg_disc, vha, 0x204f, - "Async done-%s res %x, WWPN %s %s\n", - sp->name, res, wwn_to_str(fcport->port_name), - wwn_to_str(fcport->fabric_port_name)); + "Async done-%s res %x, WWPN %8phC %8phC\n", + sp->name, res, fcport->port_name, fcport->fabric_port_name); qla24xx_handle_gfpnid_event(vha, &ea); @@ -4437,8 +4428,8 @@ int qla24xx_async_gfpnid(scsi_qla_host_t *vha, fc_port_t *fcport) sp->done = qla2x00_async_gfpnid_sp_done; ql_dbg(ql_dbg_disc, vha, 0xffff, - "Async-%s - %s hdl=%x loopid=%x portid %06x.\n", - sp->name, wwn_to_str(fcport->port_name), + "Async-%s - %8phC hdl=%x loopid=%x portid %06x.\n", + sp->name, fcport->port_name, sp->handle, fcport->loop_id, fcport->d_id.b24); rval = qla2x00_start_sp(sp); diff --git a/qla2x00t-32gbit/qla_init.c b/qla2x00t-32gbit/qla_init.c index a8a136edf..6b9c810a8 100644 --- a/qla2x00t-32gbit/qla_init.c +++ b/qla2x00t-32gbit/qla_init.c @@ -185,9 +185,8 @@ qla2x00_async_iocb_timeout(void *data) if (fcport) { ql_dbg(ql_dbg_disc, fcport->vha, 0x2071, - "Async-%s timeout - hdl=%x portid=%06x %s.\n", - sp->name, sp->handle, fcport->d_id.b24, - wwn_to_str(fcport->port_name)); + "Async-%s timeout - hdl=%x portid=%06x %8phC.\n", + sp->name, sp->handle, fcport->d_id.b24, fcport->port_name); fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); } else { @@ -254,8 +253,8 @@ static void qla2x00_async_login_sp_done(srb_t *sp, int res) struct srb_iocb *lio = &sp->u.iocb_cmd; struct event_arg ea; - ql_dbg(ql_dbg_disc, vha, 0x20dd, "%s %s res %d \n", __func__, - wwn_to_str(sp->fcport->port_name), res); + ql_dbg(ql_dbg_disc, vha, 0x20dd, + "%s %8phC res %d \n", __func__, sp->fcport->port_name, res); sp->fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); @@ -332,9 +331,8 @@ qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, lio->u.logio.flags |= SRB_LOGIN_SKIP_PRLI; ql_dbg(ql_dbg_disc, vha, 0x2072, - "Async-login - %s hdl=%x, loopid=%x portid=%02x%02x%02x " - "retries=%d.\n", wwn_to_str(fcport->port_name), sp->handle, - fcport->loop_id, + "Async-login - %8phC hdl=%x, loopid=%x portid=%02x%02x%02x " + "retries=%d.\n", fcport->port_name, sp->handle, fcport->loop_id, fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa, fcport->login_retry); @@ -385,10 +383,10 @@ qla2x00_async_logout(struct scsi_qla_host *vha, fc_port_t *fcport) sp->done = qla2x00_async_logout_sp_done; ql_dbg(ql_dbg_disc, vha, 0x2070, - "Async-logout - hdl=%x loop-id=%x portid=%02x%02x%02x %s.\n", + "Async-logout - hdl=%x loop-id=%x portid=%02x%02x%02x %8phC.\n", sp->handle, fcport->loop_id, fcport->d_id.b.domain, - fcport->d_id.b.area, fcport->d_id.b.al_pa, - wwn_to_str(fcport->port_name)); + fcport->d_id.b.area, fcport->d_id.b.al_pa, + fcport->port_name); rval = qla2x00_start_sp(sp); if (rval != QLA_SUCCESS) @@ -470,8 +468,8 @@ void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea) struct fc_port *fcport = ea->fcport; ql_dbg(ql_dbg_disc, vha, 0x20d2, - "%s %s DS %d LS %d rc %d login %d|%d rscn %d|%d lid %d\n", - __func__, wwn_to_str(fcport->port_name), fcport->disc_state, + "%s %8phC DS %d LS %d rc %d login %d|%d rscn %d|%d lid %d\n", + __func__, fcport->port_name, fcport->disc_state, fcport->fw_login_state, ea->rc, fcport->login_gen, ea->sp->gen2, fcport->rscn_gen, ea->sp->gen1, fcport->loop_id); @@ -480,8 +478,8 @@ void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea) if (ea->data[0] != MBS_COMMAND_COMPLETE) { ql_dbg(ql_dbg_disc, vha, 0x2066, - "%s %s: adisc fail: post delete\n", - __func__, wwn_to_str(ea->fcport->port_name)); + "%s %8phC: adisc fail: post delete\n", + __func__, ea->fcport->port_name); /* deleted = 0 & logout_on_delete = force fw cleanup */ fcport->deleted = 0; fcport->logout_on_delete = 1; @@ -495,8 +493,8 @@ void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea) if (ea->sp->gen2 != ea->fcport->login_gen) { /* target side must have changed it. */ ql_dbg(ql_dbg_disc, vha, 0x20d3, - "%s %s generation changed\n", - __func__, wwn_to_str(ea->fcport->port_name)); + "%s %8phC generation changed\n", + __func__, ea->fcport->port_name); return; } else if (ea->sp->gen1 != ea->fcport->rscn_gen) { qla_rscn_replay(fcport); @@ -526,8 +524,9 @@ static void qla2x00_async_adisc_sp_done(srb_t *sp, int res) struct event_arg ea; struct srb_iocb *lio = &sp->u.iocb_cmd; - ql_dbg(ql_dbg_disc, vha, 0x2066, "Async done-%s res %x %s\n", - sp->name, res, wwn_to_str(sp->fcport->port_name)); + ql_dbg(ql_dbg_disc, vha, 0x2066, + "Async done-%s res %x %8phC\n", + sp->name, res, sp->fcport->port_name); sp->fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); @@ -575,9 +574,8 @@ qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport, lio->u.logio.flags |= SRB_LOGIN_RETRIED; ql_dbg(ql_dbg_disc, vha, 0x206f, - "Async-adisc - hdl=%x loopid=%x portid=%06x %s.\n", - sp->handle, fcport->loop_id, fcport->d_id.b24, - wwn_to_str(fcport->port_name)); + "Async-adisc - hdl=%x loopid=%x portid=%06x %8phC.\n", + sp->handle, fcport->loop_id, fcport->d_id.b24, fcport->port_name); rval = qla2x00_start_sp(sp); if (rval != QLA_SUCCESS) @@ -672,8 +670,8 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, fcport = ea->fcport; ql_dbg(ql_dbg_disc, vha, 0xffff, - "%s %s DS %d LS rc %d %d login %d|%d rscn %d|%d lid %d\n", - __func__, wwn_to_str(fcport->port_name), fcport->disc_state, + "%s %8phC DS %d LS rc %d %d login %d|%d rscn %d|%d lid %d\n", + __func__, fcport->port_name, fcport->disc_state, fcport->fw_login_state, ea->rc, fcport->login_gen, fcport->last_login_gen, fcport->rscn_gen, fcport->last_rscn_gen, vha->loop_id); @@ -696,16 +694,16 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, return; } else if (fcport->last_login_gen != fcport->login_gen) { ql_dbg(ql_dbg_disc, vha, 0x20e0, - "%s %s login gen changed\n", - __func__, wwn_to_str(fcport->port_name)); + "%s %8phC login gen changed\n", + __func__, fcport->port_name); return; } n = ea->data[0] / sizeof(struct get_name_list_extended); ql_dbg(ql_dbg_disc, vha, 0x20e1, - "%s %d %s n %d %02x%02x%02x lid %d \n", - __func__, __LINE__, wwn_to_str(fcport->port_name), n, + "%s %d %8phC n %d %02x%02x%02x lid %d \n", + __func__, __LINE__, fcport->port_name, n, fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa, fcport->loop_id); @@ -734,8 +732,8 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, ql_dbg(ql_dbg_disc, vha, 0x20e2, - "%s found %s CLS [%x|%x] nvme %d ID[%02x%02x%02x|%02x%02x%02x] lid[%d|%d]\n", - __func__, wwn_to_str(fcport->port_name), + "%s found %8phC CLS [%x|%x] nvme %d ID[%02x%02x%02x|%02x%02x%02x] lid[%d|%d]\n", + __func__, fcport->port_name, e->current_login_state, fcport->fw_login_state, fcport->fc4f_nvme, id.b.domain, id.b.area, id.b.al_pa, fcport->d_id.b.domain, fcport->d_id.b.area, @@ -751,9 +749,8 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, (fcport->loop_id != FC_NO_LOOP_ID && fcport->loop_id != loop_id)) { ql_dbg(ql_dbg_disc, vha, 0x20e3, - "%s %d %s post del sess\n", - __func__, __LINE__, - wwn_to_str(fcport->port_name)); + "%s %d %8phC post del sess\n", + __func__, __LINE__, fcport->port_name); qlt_schedule_sess_for_deletion(fcport); return; } @@ -781,9 +778,8 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, switch (current_login_state) { case DSC_LS_PRLI_COMP: ql_dbg(ql_dbg_disc + ql_dbg_verbose, - vha, 0x20e4, "%s %d %s post gpdb\n", - __func__, __LINE__, - wwn_to_str(fcport->port_name)); + vha, 0x20e4, "%s %d %8phC post gpdb\n", + __func__, __LINE__, fcport->port_name); if ((e->prli_svc_param_word_3[0] & BIT_4) == 0) fcport->port_type = FCT_INITIATOR; @@ -801,8 +797,8 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, DSC_LS_PORT_UNAVAIL; } ql_dbg(ql_dbg_disc, vha, 0x20e5, - "%s %d %s\n", __func__, __LINE__, - wwn_to_str(fcport->port_name)); + "%s %d %8phC\n", __func__, __LINE__, + fcport->port_name); qla24xx_fcport_handle_login(vha, fcport); break; } @@ -868,9 +864,9 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, if (conflict_fcport) { ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0x20e5, - "%s %d %s post del sess\n", + "%s %d %8phC post del sess\n", __func__, __LINE__, - wwn_to_str(conflict_fcport->port_name)); + conflict_fcport->port_name); qlt_schedule_sess_for_deletion (conflict_fcport); } @@ -966,8 +962,8 @@ static void qla24xx_async_gnl_sp_done(srb_t *sp, int res) wwn = wwn_to_u64(e->port_name); ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0x20e8, - "%s %s %02x:%02x:%02x state %d/%d lid %x \n", - __func__, wwn_to_str((u8 *)&wwn), e->port_id[2], e->port_id[1], + "%s %8phC %02x:%02x:%02x state %d/%d lid %x \n", + __func__, (void *)&wwn, e->port_id[2], e->port_id[1], e->port_id[0], e->current_login_state, e->last_login_state, (loop_id & 0x7fff)); } @@ -1014,8 +1010,8 @@ static void qla24xx_async_gnl_sp_done(srb_t *sp, int res) if (!found && wwn && !IS_SW_RESV_ADDR(id)) { ql_dbg(ql_dbg_disc, vha, 0x2065, - "%s %d %s %06x post new sess\n", - __func__, __LINE__, wwn_to_str((u8 *)&wwn), id.b24); + "%s %d %8phC %06x post new sess\n", + __func__, __LINE__, (u8 *)&wwn, id.b24); wwnn = wwn_to_u64(e->node_name); qla24xx_post_newsess_work(vha, &id, (u8 *)&wwn, (u8 *)&wwnn, NULL, FC4_TYPE_UNKNOWN); @@ -1040,8 +1036,8 @@ int qla24xx_async_gnl(struct scsi_qla_host *vha, fc_port_t *fcport) if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT)) return rval; - ql_dbg(ql_dbg_disc, vha, 0x20d9, "Async-gnlist WWPN %s\n", - wwn_to_str(fcport->port_name)); + ql_dbg(ql_dbg_disc, vha, 0x20d9, + "Async-gnlist WWPN %8phC \n", fcport->port_name); spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); fcport->flags |= FCF_ASYNC_SENT; @@ -1082,8 +1078,9 @@ int qla24xx_async_gnl(struct scsi_qla_host *vha, fc_port_t *fcport) sp->done = qla24xx_async_gnl_sp_done; - ql_dbg(ql_dbg_disc, vha, 0x20da, "Async-%s - OUT WWPN %s hndl %x\n", - sp->name, wwn_to_str(fcport->port_name), sp->handle); + ql_dbg(ql_dbg_disc, vha, 0x20da, + "Async-%s - OUT WWPN %8phC hndl %x\n", + sp->name, fcport->port_name, sp->handle); rval = qla2x00_start_sp(sp); if (rval != QLA_SUCCESS) @@ -1120,8 +1117,8 @@ static void qla24xx_async_gpdb_sp_done(srb_t *sp, int res) struct event_arg ea; ql_dbg(ql_dbg_disc, vha, 0x20db, - "Async done-%s res %x, WWPN %s mb[1]=%x mb[2]=%x \n", - sp->name, res, wwn_to_str(fcport->port_name), mb[1], mb[2]); + "Async done-%s res %x, WWPN %8phC mb[1]=%x mb[2]=%x \n", + sp->name, res, fcport->port_name, mb[1], mb[2]); if (res == QLA_FUNCTION_TIMEOUT) { dma_pool_free(sp->vha->hw->s_dma_pool, sp->u.iocb_cmd.u.mbx.in, @@ -1161,8 +1158,9 @@ static void qla2x00_async_prli_sp_done(srb_t *sp, int res) struct srb_iocb *lio = &sp->u.iocb_cmd; struct event_arg ea; - ql_dbg(ql_dbg_disc, vha, 0x2129, "%s %s res %d \n", __func__, - wwn_to_str(sp->fcport->port_name), res); + ql_dbg(ql_dbg_disc, vha, 0x2129, + "%s %8phC res %d \n", __func__, + sp->fcport->port_name, res); sp->fcport->flags &= ~FCF_ASYNC_SENT; @@ -1216,9 +1214,8 @@ qla24xx_async_prli(struct scsi_qla_host *vha, fc_port_t *fcport) lio->u.logio.flags |= SRB_LOGIN_NVME_PRLI; ql_dbg(ql_dbg_disc, vha, 0x211b, - "Async-prli - %s hdl=%x, loopid=%x portid=%06x retries=%d %s.\n", - wwn_to_str(fcport->port_name), sp->handle, fcport->loop_id, - fcport->d_id.b24, + "Async-prli - %8phC hdl=%x, loopid=%x portid=%06x retries=%d %s.\n", + fcport->port_name, sp->handle, fcport->loop_id, fcport->d_id.b24, fcport->login_retry, fcport->fc4f_nvme ? "nvme" : "fc"); rval = qla2x00_start_sp(sp); @@ -1306,8 +1303,9 @@ int qla24xx_async_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt) sp->done = qla24xx_async_gpdb_sp_done; - ql_dbg(ql_dbg_disc, vha, 0x20dc, "Async-%s %s hndl %x opt %x\n", - sp->name, wwn_to_str(fcport->port_name), sp->handle, opt); + ql_dbg(ql_dbg_disc, vha, 0x20dc, + "Async-%s %8phC hndl %x opt %x\n", + sp->name, fcport->port_name, sp->handle, opt); rval = qla2x00_start_sp(sp); if (rval != QLA_SUCCESS) @@ -1349,8 +1347,8 @@ void __qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) * Session is still valid. */ ql_dbg(ql_dbg_disc, vha, 0x20d6, - "%s %d %s session revalidate success\n", - __func__, __LINE__, wwn_to_str(ea->fcport->port_name)); + "%s %d %8phC session revalidate success\n", + __func__, __LINE__, ea->fcport->port_name); ea->fcport->disc_state = DSC_LOGIN_COMPLETE; } spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); @@ -1368,8 +1366,8 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) fcport->flags &= ~FCF_ASYNC_SENT; - ql_dbg(ql_dbg_disc, vha, 0x20d2, "%s %s DS %d LS %d nvme %x rc %d\n", - __func__, wwn_to_str(fcport->port_name), + ql_dbg(ql_dbg_disc, vha, 0x20d2, + "%s %8phC DS %d LS %d nvme %x rc %d\n", __func__, fcport->port_name, fcport->disc_state, pd->current_login_state, fcport->fc4f_nvme, ea->rc); @@ -1384,8 +1382,9 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) if (ea->sp->gen2 != fcport->login_gen) { /* target side must have changed it. */ - ql_dbg(ql_dbg_disc, vha, 0x20d3, "%s %s generation changed\n", - __func__, wwn_to_str(fcport->port_name)); + ql_dbg(ql_dbg_disc, vha, 0x20d3, + "%s %8phC generation changed\n", + __func__, fcport->port_name); return; } else if (ea->sp->gen1 != fcport->rscn_gen) { qla_rscn_replay(fcport); @@ -1411,8 +1410,8 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) case PDS_LOGO_PENDING: case PDS_PORT_UNAVAILABLE: default: - ql_dbg(ql_dbg_disc, vha, 0x20d5, "%s %d %s post del sess\n", - __func__, __LINE__, wwn_to_str(fcport->port_name)); + ql_dbg(ql_dbg_disc, vha, 0x20d5, "%s %d %8phC post del sess\n", + __func__, __LINE__, fcport->port_name); qlt_schedule_sess_for_deletion(fcport); return; } @@ -1454,16 +1453,16 @@ static void qla_chk_n2n_b4_login(struct scsi_qla_host *vha, fc_port_t *fcport) rc = qla2x00_find_new_loop_id(vha, fcport); if (rc) { ql_dbg(ql_dbg_disc, vha, 0x20e6, - "%s %d %s post del sess - out of loopid\n", - __func__, __LINE__, - wwn_to_str(fcport->port_name)); + "%s %d %8phC post del sess - out of loopid\n", + __func__, __LINE__, fcport->port_name); fcport->scan_state = 0; qlt_schedule_sess_for_deletion(fcport); return; } } - ql_dbg(ql_dbg_disc, vha, 0x20bf, "%s %d %s post login\n", - __func__, __LINE__, wwn_to_str(fcport->port_name)); + ql_dbg(ql_dbg_disc, vha, 0x20bf, + "%s %d %8phC post login\n", + __func__, __LINE__, fcport->port_name); qla2x00_post_async_login_work(vha, fcport, NULL); } } @@ -1475,8 +1474,8 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) u16 sec; ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0x20d8, - "%s %s DS %d LS %d P %d fl %x confl %p rscn %d|%d login %d lid %d scan %d\n", - __func__, wwn_to_str(fcport->port_name), fcport->disc_state, + "%s %8phC DS %d LS %d P %d fl %x confl %p rscn %d|%d login %d lid %d scan %d\n", + __func__, fcport->port_name, fcport->disc_state, fcport->fw_login_state, fcport->login_pause, fcport->flags, fcport->conflict, fcport->last_rscn_gen, fcport->rscn_gen, fcport->login_gen, fcport->loop_id, fcport->scan_state); @@ -1523,8 +1522,8 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) qla_post_els_plogi_work(vha, fcport); } else { ql_log(ql_log_info, vha, 0x705d, - "Unable to reach remote port %s", - wwn_to_str(fcport->port_name)); + "Unable to reach remote port %8phC", + fcport->port_name); } } else { qla24xx_post_gnl_work(vha, fcport); @@ -1533,14 +1532,13 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) default: if (wwn == 0) { ql_dbg(ql_dbg_disc, vha, 0xffff, - "%s %d %s post GNNID\n", - __func__, __LINE__, - wwn_to_str(fcport->port_name)); + "%s %d %8phC post GNNID\n", + __func__, __LINE__, fcport->port_name); qla24xx_post_gnnid_work(vha, fcport); } else if (fcport->loop_id == FC_NO_LOOP_ID) { ql_dbg(ql_dbg_disc, vha, 0x20bd, - "%s %d %s post gnl\n", - __func__, __LINE__, wwn_to_str(fcport->port_name)); + "%s %d %8phC post gnl\n", + __func__, __LINE__, fcport->port_name); qla24xx_post_gnl_work(vha, fcport); } else { qla_chk_n2n_b4_login(vha, fcport); @@ -1554,15 +1552,15 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) case ISP_CFG_N: if ((fcport->current_login_state & 0xf) == 0x6) { ql_dbg(ql_dbg_disc, vha, 0x2118, - "%s %d %s post GPDB work\n", - __func__, __LINE__, wwn_to_str(fcport->port_name)); + "%s %d %8phC post GPDB work\n", + __func__, __LINE__, fcport->port_name); fcport->chip_reset = vha->hw->base_qpair->chip_reset; qla24xx_post_gpdb_work(vha, fcport, 0); } else { ql_dbg(ql_dbg_disc, vha, 0x2118, - "%s %d %s post NVMe PRLI\n", - __func__, __LINE__, wwn_to_str(fcport->port_name)); + "%s %d %8phC post NVMe PRLI\n", + __func__, __LINE__, fcport->port_name); qla24xx_post_prli_work(vha, fcport); } break; @@ -1603,8 +1601,8 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) !(sec % 60)) { fcport->sec_since_registration = sec; ql_dbg(ql_dbg_disc, fcport->vha, 0xffff, - "%s %s - Slow Rport registration(%d Sec)\n", - __func__, wwn_to_str(fcport->port_name), sec); + "%s %8phC - Slow Rport registration(%d Sec)\n", + __func__, fcport->port_name, sec); } if (fcport->next_disc_state != DSC_DELETE_PEND) @@ -1667,8 +1665,8 @@ void qla24xx_handle_relogin_event(scsi_qla_host_t *vha, return; ql_dbg(ql_dbg_disc, vha, 0x2102, - "%s %s DS %d LS %d P %d del %d cnfl %p rscn %d|%d login %d|%d fl %x\n", - __func__, wwn_to_str(fcport->port_name), fcport->disc_state, + "%s %8phC DS %d LS %d P %d del %d cnfl %p rscn %d|%d login %d|%d fl %x\n", + __func__, fcport->port_name, fcport->disc_state, fcport->fw_login_state, fcport->login_pause, fcport->deleted, fcport->conflict, fcport->last_rscn_gen, fcport->rscn_gen, @@ -1687,9 +1685,8 @@ void qla24xx_handle_relogin_event(scsi_qla_host_t *vha, } if (fcport->last_rscn_gen != fcport->rscn_gen) { - ql_dbg(ql_dbg_disc, vha, 0x20e9, "%s %d %s post gnl\n", - __func__, __LINE__, wwn_to_str(fcport->port_name)); - + ql_dbg(ql_dbg_disc, vha, 0x20e9, "%s %d %8phC post gnl\n", + __func__, __LINE__, fcport->port_name); qla24xx_post_gnl_work(vha, fcport); return; } @@ -1834,8 +1831,9 @@ qla24xx_handle_prli_done_event(struct scsi_qla_host *vha, struct event_arg *ea) switch (ea->data[0]) { case MBS_COMMAND_COMPLETE: - ql_dbg(ql_dbg_disc, vha, 0x2118, "%s %d %s post gpdb\n", - __func__, __LINE__, wwn_to_str(ea->fcport->port_name)); + ql_dbg(ql_dbg_disc, vha, 0x2118, + "%s %d %8phC post gpdb\n", + __func__, __LINE__, ea->fcport->port_name); ea->fcport->chip_reset = vha->hw->base_qpair->chip_reset; ea->fcport->logout_on_delete = 1; @@ -1857,15 +1855,15 @@ qla24xx_handle_prli_done_event(struct scsi_qla_host *vha, struct event_arg *ea) if (ea->fcport->n2n_flag) { ql_dbg(ql_dbg_disc, vha, 0x2118, - "%s %d %s post fc4 prli\n", - __func__, __LINE__, wwn_to_str(ea->fcport->port_name)); + "%s %d %8phC post fc4 prli\n", + __func__, __LINE__, ea->fcport->port_name); ea->fcport->fc4f_nvme = 0; ea->fcport->n2n_flag = 0; qla24xx_post_prli_work(vha, ea->fcport); } ql_dbg(ql_dbg_disc, vha, 0x2119, - "%s %d %s unhandle event of %x\n", - __func__, __LINE__, wwn_to_str(ea->fcport->port_name), ea->data[0]); + "%s %d %8phC unhandle event of %x\n", + __func__, __LINE__, ea->fcport->port_name, ea->data[0]); break; } } @@ -1880,8 +1878,8 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) struct fc_port *fcport = ea->fcport; ql_dbg(ql_dbg_disc, vha, 0xffff, - "%s %s DS %d LS %d rc %d login %d|%d rscn %d|%d data %x|%x iop %x|%x\n", - __func__, wwn_to_str(fcport->port_name), fcport->disc_state, + "%s %8phC DS %d LS %d rc %d login %d|%d rscn %d|%d data %x|%x iop %x|%x\n", + __func__, fcport->port_name, fcport->disc_state, fcport->fw_login_state, ea->rc, ea->sp->gen2, fcport->login_gen, ea->sp->gen1, fcport->rscn_gen, ea->data[0], ea->data[1], ea->iop[0], ea->iop[1]); @@ -1889,8 +1887,8 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) if ((fcport->fw_login_state == DSC_LS_PLOGI_PEND) || (fcport->fw_login_state == DSC_LS_PRLI_PEND)) { ql_dbg(ql_dbg_disc, vha, 0x20ea, - "%s %d %s Remote is trying to login\n", - __func__, __LINE__, wwn_to_str(fcport->port_name)); + "%s %d %8phC Remote is trying to login\n", + __func__, __LINE__, fcport->port_name); return; } @@ -1903,14 +1901,14 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) if (ea->sp->gen2 != fcport->login_gen) { /* target side must have changed it. */ ql_dbg(ql_dbg_disc, vha, 0x20d3, - "%s %s generation changed\n", - __func__, wwn_to_str(fcport->port_name)); + "%s %8phC generation changed\n", + __func__, fcport->port_name); set_bit(RELOGIN_NEEDED, &vha->dpc_flags); return; } else if (ea->sp->gen1 != fcport->rscn_gen) { ql_dbg(ql_dbg_disc, vha, 0x20d3, - "%s %s RSCN generation changed\n", - __func__, wwn_to_str(fcport->port_name)); + "%s %8phC RSCN generation changed\n", + __func__, fcport->port_name); qla_rscn_replay(fcport); qlt_schedule_sess_for_deletion(fcport); return; @@ -1928,13 +1926,13 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) */ if (ea->fcport->fc4f_nvme) { ql_dbg(ql_dbg_disc, vha, 0x2117, - "%s %d %s post prli\n", - __func__, __LINE__, wwn_to_str(ea->fcport->port_name)); + "%s %d %8phC post prli\n", + __func__, __LINE__, ea->fcport->port_name); qla24xx_post_prli_work(vha, ea->fcport); } else { ql_dbg(ql_dbg_disc, vha, 0x20ea, - "%s %d %s LoopID 0x%x in use with %06x. post gnl\n", - __func__, __LINE__, wwn_to_str(ea->fcport->port_name), + "%s %d %8phC LoopID 0x%x in use with %06x. post gnl\n", + __func__, __LINE__, ea->fcport->port_name, ea->fcport->loop_id, ea->fcport->d_id.b24); set_bit(ea->fcport->loop_id, vha->hw->loop_id_map); @@ -1949,8 +1947,8 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) } break; case MBS_COMMAND_ERROR: - ql_dbg(ql_dbg_disc, vha, 0x20eb, "%s %d %s cmd error %x\n", - __func__, __LINE__, wwn_to_str(ea->fcport->port_name), ea->data[1]); + ql_dbg(ql_dbg_disc, vha, 0x20eb, "%s %d %8phC cmd error %x\n", + __func__, __LINE__, ea->fcport->port_name, ea->data[1]); ea->fcport->flags &= ~FCF_ASYNC_SENT; ea->fcport->disc_state = DSC_LOGIN_FAILED; @@ -1967,8 +1965,8 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) cid.b.rsvd_1 = 0; ql_dbg(ql_dbg_disc, vha, 0x20ec, - "%s %d %s lid %#x in use with pid %06x post gnl\n", - __func__, __LINE__, wwn_to_str(ea->fcport->port_name), + "%s %d %8phC lid %#x in use with pid %06x post gnl\n", + __func__, __LINE__, ea->fcport->port_name, ea->fcport->loop_id, cid.b24); set_bit(ea->fcport->loop_id, vha->hw->loop_id_map); @@ -1991,13 +1989,13 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) ea->fcport->login_pause = 1; ql_dbg(ql_dbg_disc, vha, 0x20ed, - "%s %d %s NPortId %06x inuse with loopid 0x%x. post gidpn\n", - __func__, __LINE__, wwn_to_str(ea->fcport->port_name), + "%s %d %8phC NPortId %06x inuse with loopid 0x%x. post gidpn\n", + __func__, __LINE__, ea->fcport->port_name, ea->fcport->d_id.b24, lid); } else { ql_dbg(ql_dbg_disc, vha, 0x20ed, - "%s %d %s NPortId %06x inuse with loopid 0x%x. sched delete\n", - __func__, __LINE__, wwn_to_str(ea->fcport->port_name), + "%s %d %8phC NPortId %06x inuse with loopid 0x%x. sched delete\n", + __func__, __LINE__, ea->fcport->port_name, ea->fcport->d_id.b24, lid); qla2x00_clear_loop_id(ea->fcport); @@ -4745,7 +4743,7 @@ qla2x00_rport_del(void *data) if (rport) { ql_dbg(ql_dbg_disc, fcport->vha, 0x210b, "%s %8phN. rport %p roles %x\n", - __func__, wwn_to_str(fcport->port_name), rport, + __func__, fcport->port_name, rport, rport->roles); fc_remote_port_delete(rport); @@ -5184,9 +5182,9 @@ qla2x00_configure_local_loop(scsi_qla_host_t *vha) fcport->port_type != FCT_INITIATOR && fcport->port_type != FCT_BROADCAST) { ql_dbg(ql_dbg_disc, vha, 0x20f0, - "%s %d %s post del sess\n", + "%s %d %8phC post del sess\n", __func__, __LINE__, - wwn_to_str(fcport->port_name)); + fcport->port_name); qlt_schedule_sess_for_deletion(fcport); continue; @@ -5237,7 +5235,7 @@ qla2x00_iidma_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) ql_dbg(ql_dbg_disc, vha, 0x2005, "iIDMA adjusted to %s GB/s (%X) on %8phN.\n", qla2x00_get_link_speed_str(ha, fcport->fp_speed), - fcport->fp_speed, wwn_to_str(fcport->port_name)); + fcport->fp_speed, fcport->port_name); } } @@ -5300,8 +5298,9 @@ qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport) if (fcport->port_type & FCT_NVME_DISCOVERY) rport_ids.roles |= FC_PORT_ROLE_NVME_DISCOVERY; - ql_dbg(ql_dbg_disc, vha, 0x20ee, "%s %s. rport %p is %s mode\n", - __func__, wwn_to_str(fcport->port_name), rport, + ql_dbg(ql_dbg_disc, vha, 0x20ee, + "%s %8phN. rport %p is %s mode\n", + __func__, fcport->port_name, rport, (fcport->port_type == FCT_TARGET) ? "tgt" : ((fcport->port_type & FCT_NVME) ? "nvme" : "ini")); @@ -5329,8 +5328,8 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) if (IS_SW_RESV_ADDR(fcport->d_id)) return; - ql_dbg(ql_dbg_disc, vha, 0x20ef, "%s %s\n", - __func__, wwn_to_str(fcport->port_name)); + ql_dbg(ql_dbg_disc, vha, 0x20ef, "%s %8phC\n", + __func__, fcport->port_name); fcport->disc_state = DSC_UPD_FCPORT; fcport->login_retry = vha->hw->login_retry_count; @@ -5384,14 +5383,14 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) if (fcport->id_changed) { fcport->id_changed = 0; ql_dbg(ql_dbg_disc, vha, 0x20d7, - "%s %d %s post gfpnid fcp_cnt %d\n", - __func__, __LINE__, wwn_to_str(fcport->port_name), + "%s %d %8phC post gfpnid fcp_cnt %d\n", + __func__, __LINE__, fcport->port_name, vha->fcport_count); qla24xx_post_gfpnid_work(vha, fcport); } else { ql_dbg(ql_dbg_disc, vha, 0x20d7, - "%s %d %s post gpsc fcp_cnt %d\n", - __func__, __LINE__, wwn_to_str(fcport->port_name), + "%s %d %8phC post gpsc fcp_cnt %d\n", + __func__, __LINE__, fcport->port_name, vha->fcport_count); qla24xx_post_gpsc_work(vha, fcport); } @@ -5684,8 +5683,8 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha) new_fcport->fc4f_nvme = swl[swl_idx].fc4f_nvme; ql_log(ql_log_info, vha, 0x2131, - "FOUND: NVME port %s as FC Type 28h\n", - wwn_to_str(new_fcport->port_name)); + "FOUND: NVME port %8phC as FC Type 28h\n", + new_fcport->port_name); } if (swl[swl_idx].d_id.b.rsvd_1 != 0) { @@ -5788,9 +5787,9 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha) */ if (qla_tgt_mode_enabled(base_vha)) { ql_dbg(ql_dbg_tgt_mgt, vha, 0xf080, - "port changed FC ID, %s" + "port changed FC ID, %8phC" " old %x:%x:%x (loop_id 0x%04x)-> new %x:%x:%x\n", - wwn_to_str(fcport->port_name), + fcport->port_name, fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa, @@ -5862,9 +5861,9 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha) fcport->port_type != FCT_INITIATOR && fcport->port_type != FCT_BROADCAST) { ql_dbg(ql_dbg_disc, vha, 0x20f0, - "%s %d %s post del sess\n", + "%s %d %8phC post del sess\n", __func__, __LINE__, - wwn_to_str(fcport->port_name)); + fcport->port_name); qlt_schedule_sess_for_deletion(fcport); continue; } diff --git a/qla2x00t-32gbit/qla_inline.h b/qla2x00t-32gbit/qla_inline.h index c1bae436c..94eac1ab6 100644 --- a/qla2x00t-32gbit/qla_inline.h +++ b/qla2x00t-32gbit/qla_inline.h @@ -113,20 +113,6 @@ qla2x00_clean_dsd_pool(struct qla_hw_data *ha, struct crc_context *ctx) INIT_LIST_HEAD(&ctx->dsd_list); } -/* - * Convert a WWN into a string, just like the %8phC format specification. - * Not thread-safe so use this function from debug code only. - */ -static inline const char *wwn_to_str(const u8 port_name[8]) -{ - static char wwn[24]; - - snprintf(wwn, sizeof(wwn), "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", - port_name[0], port_name[1], port_name[2], port_name[3], - port_name[4], port_name[5], port_name[6], port_name[7]); - return wwn; -} - static inline int qla2x00_hba_err_chk_enabled(srb_t *sp) { diff --git a/qla2x00t-32gbit/qla_iocb.c b/qla2x00t-32gbit/qla_iocb.c index 4a14f20fc..a7eebc7a5 100644 --- a/qla2x00t-32gbit/qla_iocb.c +++ b/qla2x00t-32gbit/qla_iocb.c @@ -2709,8 +2709,8 @@ qla2x00_els_dcmd2_iocb_timeout(void *data) int res; ql_dbg(ql_dbg_io + ql_dbg_disc, vha, 0x3069, - "%s hdl=%x ELS Timeout, %s portid=%06x\n", - sp->name, sp->handle, wwn_to_str(fcport->port_name), fcport->d_id.b24); + "%s hdl=%x ELS Timeout, %8phC portid=%06x\n", + sp->name, sp->handle, fcport->port_name, fcport->d_id.b24); /* Abort the exchange */ spin_lock_irqsave(&ha->hardware_lock, flags); @@ -2747,8 +2747,8 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) struct qla_work_evt *e; ql_dbg(ql_dbg_disc, vha, 0x3072, - "%s ELS done rc %d hdl=%x, portid=%06x %s\n", - sp->name, res, sp->handle, fcport->d_id.b24, wwn_to_str(fcport->port_name)); + "%s ELS done rc %d hdl=%x, portid=%06x %8phC\n", + sp->name, res, sp->handle, fcport->d_id.b24, fcport->port_name); fcport->flags &= ~(FCF_ASYNC_SENT|FCF_ASYNC_ACTIVE); del_timer(&sp->u.iocb_cmd.timer); diff --git a/qla2x00t-32gbit/qla_isr.c b/qla2x00t-32gbit/qla_isr.c index e8cc7d202..e5520911c 100644 --- a/qla2x00t-32gbit/qla_isr.c +++ b/qla2x00t-32gbit/qla_isr.c @@ -1724,9 +1724,9 @@ qla24xx_logio_entry(scsi_qla_host_t *vha, struct req_que *req, QLA_LOGIO_LOGIN_RETRIED : 0; if (logio->entry_status) { ql_log(ql_log_warn, fcport->vha, 0x5034, - "Async-%s error entry - %s hdl=%x" + "Async-%s error entry - %8phC hdl=%x" "portid=%02x%02x%02x entry-status=%x.\n", - type, wwn_to_str(fcport->port_name), sp->handle, fcport->d_id.b.domain, + type, fcport->port_name, sp->handle, fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa, logio->entry_status); ql_dump_buffer(ql_dbg_async + ql_dbg_buffer, vha, 0x504d, @@ -1737,8 +1737,8 @@ qla24xx_logio_entry(scsi_qla_host_t *vha, struct req_que *req, if (le16_to_cpu(logio->comp_status) == CS_COMPLETE) { ql_dbg(ql_dbg_async, fcport->vha, 0x5036, - "Async-%s complete - %s hdl=%x portid=%02x%02x%02x " - "iop0=%x.\n", type, wwn_to_str(fcport->port_name), sp->handle, + "Async-%s complete - %8phC hdl=%x portid=%02x%02x%02x " + "iop0=%x.\n", type, fcport->port_name, sp->handle, fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa, le32_to_cpu(logio->io_parameter[0])); @@ -1820,8 +1820,8 @@ qla24xx_logio_entry(scsi_qla_host_t *vha, struct req_que *req, } ql_dbg(ql_dbg_async, fcport->vha, 0x5037, - "Async-%s failed - %s hdl=%x portid=%02x%02x%02x comp=%x " - "iop0=%x iop1=%x.\n", type, wwn_to_str(fcport->port_name), + "Async-%s failed - %8phC hdl=%x portid=%02x%02x%02x comp=%x " + "iop0=%x iop1=%x.\n", type, fcport->port_name, sp->handle, fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa, le16_to_cpu(logio->comp_status), diff --git a/qla2x00t-32gbit/qla_mbx.c b/qla2x00t-32gbit/qla_mbx.c index 675a2565d..a82b6db2f 100644 --- a/qla2x00t-32gbit/qla_mbx.c +++ b/qla2x00t-32gbit/qla_mbx.c @@ -3883,11 +3883,13 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, rptid_entry->vp_status, rptid_entry->port_id[2], rptid_entry->port_id[1], rptid_entry->port_id[0]); - ql_dbg(ql_dbg_async, vha, 0x5075, "Format 1: Remote WWPN %s.\n", - wwn_to_str(rptid_entry->u.f1.port_name)); + ql_dbg(ql_dbg_async, vha, 0x5075, + "Format 1: Remote WWPN %8phC.\n", + rptid_entry->u.f1.port_name); - ql_dbg(ql_dbg_async, vha, 0x5075, "Format 1: WWPN %s.\n", - wwn_to_str(vha->port_name)); + ql_dbg(ql_dbg_async, vha, 0x5075, + "Format 1: WWPN %8phC.\n", + vha->port_name); switch (rptid_entry->u.f1.flags & TOPO_MASK) { case TOPO_N2N: @@ -3926,8 +3928,8 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, vha->d_id.b24, id.b24); } else { ql_dbg(ql_dbg_async, vha, 0x5075, - "Format 1: Remote login - Waiting for WWPN %s.\n", - wwn_to_str(rptid_entry->u.f1.port_name)); + "Format 1: Remote login - Waiting for WWPN %8phC.\n", + rptid_entry->u.f1.port_name); ha->flags.n2n_bigger = 0; } qla24xx_post_newsess_work(vha, &id, @@ -4015,8 +4017,9 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, rptid_entry->port_id[2], rptid_entry->port_id[1], rptid_entry->port_id[0]); - ql_dbg(ql_dbg_async, vha, 0x5075, "N2N: Remote WWPN %s.\n", - wwn_to_str(rptid_entry->u.f2.port_name)); + ql_dbg(ql_dbg_async, vha, 0x5075, + "N2N: Remote WWPN %8phC.\n", + rptid_entry->u.f2.port_name); /* N2N. direct connect */ ha->current_topology = ISP_CFG_N; @@ -6327,15 +6330,15 @@ int qla24xx_gpdb_wait(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt) rval = qla24xx_send_mb_cmd(vha, &mc); if (rval != QLA_SUCCESS) { - ql_dbg(ql_dbg_mbx, vha, 0x1193, "%s: %s fail\n", __func__, - wwn_to_str(fcport->port_name)); + ql_dbg(ql_dbg_mbx, vha, 0x1193, + "%s: %8phC fail\n", __func__, fcport->port_name); goto done_free_sp; } rval = __qla24xx_parse_gpdb(vha, fcport, pd); - ql_dbg(ql_dbg_mbx, vha, 0x1197, "%s: %s done\n", - __func__, wwn_to_str(fcport->port_name)); + ql_dbg(ql_dbg_mbx, vha, 0x1197, "%s: %8phC done\n", + __func__, fcport->port_name); done_free_sp: if (pd) diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index f6d2c3ff6..758f68965 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -5046,8 +5046,8 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) uint8_t free_fcport = 0; ql_dbg(ql_dbg_disc, vha, 0xffff, - "%s %d %s enter\n", - __func__, __LINE__, wwn_to_str(e->u.new_sess.port_name)); + "%s %d %8phC enter\n", + __func__, __LINE__, e->u.new_sess.port_name); spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); fcport = qla2x00_find_fcport_by_wwpn(vha, e->u.new_sess.port_name, 1); @@ -5083,8 +5083,8 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) WWN_SIZE); } else { ql_dbg(ql_dbg_disc, vha, 0xffff, - "%s %s mem alloc fail.\n", - __func__, wwn_to_str(e->u.new_sess.port_name)); + "%s %8phC mem alloc fail.\n", + __func__, e->u.new_sess.port_name); if (pla) { list_del(&pla->list); @@ -5100,9 +5100,9 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) if (tfcp) { /* should rarily happen */ ql_dbg(ql_dbg_disc, vha, 0xffff, - "%s %s found existing fcport b4 add. DS %d LS %d\n", - __func__, wwn_to_str(tfcp->port_name), - tfcp->disc_state, tfcp->fw_login_state); + "%s %8phC found existing fcport b4 add. DS %d LS %d\n", + __func__, tfcp->port_name, tfcp->disc_state, + tfcp->fw_login_state); free_fcport = 1; } else { @@ -5157,8 +5157,8 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) * We have a conflict fcport with same NportID. */ ql_dbg(ql_dbg_disc, vha, 0xffff, - "%s %s found conflict b4 add. DS %d LS %d\n", - __func__, wwn_to_str(tfcp->port_name), tfcp->disc_state, + "%s %8phC found conflict b4 add. DS %d LS %d\n", + __func__, tfcp->port_name, tfcp->disc_state, tfcp->fw_login_state); switch (tfcp->disc_state) { diff --git a/qla2x00t-32gbit/qla_target.c b/qla2x00t-32gbit/qla_target.c index b57dfda98..b9b673cab 100644 --- a/qla2x00t-32gbit/qla_target.c +++ b/qla2x00t-32gbit/qla_target.c @@ -577,8 +577,9 @@ static void qla2x00_async_nack_sp_done(srb_t *sp, int res) struct scsi_qla_host *vha = sp->vha; unsigned long flags; - ql_dbg(ql_dbg_disc, vha, 0x20f2, "Async done-%s res %x %s type %d\n", - sp->name, res, wwn_to_str(sp->fcport->port_name), sp->type); + ql_dbg(ql_dbg_disc, vha, 0x20f2, + "Async done-%s res %x %8phC type %d\n", + sp->name, res, sp->fcport->port_name, sp->type); spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); sp->fcport->flags &= ~FCF_ASYNC_SENT; @@ -663,8 +664,8 @@ int qla24xx_async_notify_ack(scsi_qla_host_t *vha, fc_port_t *fcport, sp->done = qla2x00_async_nack_sp_done; ql_dbg(ql_dbg_disc, vha, 0x20f4, - "Async-%s %s hndl %x %s\n", - sp->name, wwn_to_str(fcport->port_name), sp->handle, c); + "Async-%s %8phC hndl %x %s\n", + sp->name, fcport->port_name, sp->handle, c); rval = qla2x00_start_sp(sp); if (rval != QLA_SUCCESS) @@ -756,16 +757,16 @@ void qlt_fc_port_added(struct scsi_qla_host *vha, fc_port_t *fcport) if (!kref_get_unless_zero(&sess->sess_kref)) { ql_dbg(ql_dbg_disc, vha, 0x2107, - "%s: kref_get fail sess %s \n", - __func__, wwn_to_str(sess->port_name)); + "%s: kref_get fail sess %8phC \n", + __func__, sess->port_name); spin_unlock_irqrestore(&ha->tgt.sess_lock, flags); return; } ql_dbg(ql_dbg_tgt_mgt, vha, 0xf04c, - "qla_target(%u): %ssession for port %s " + "qla_target(%u): %ssession for port %8phC " "(loop ID %d) reappeared\n", vha->vp_idx, - sess->local ? "local " : "", wwn_to_str(sess->port_name), sess->loop_id); + sess->local ? "local " : "", sess->port_name, sess->loop_id); ql_dbg(ql_dbg_tgt_mgt, vha, 0xf007, "Reappeared sess %p\n", sess); @@ -777,8 +778,9 @@ void qlt_fc_port_added(struct scsi_qla_host *vha, fc_port_t *fcport) if (sess && sess->local) { ql_dbg(ql_dbg_tgt_mgt, vha, 0xf04d, - "qla_target(%u): local session for port %s (loop ID %d) became global\n", - vha->vp_idx, wwn_to_str(fcport->port_name), sess->loop_id); + "qla_target(%u): local session for " + "port %8phC (loop ID %d) became global\n", vha->vp_idx, + fcport->port_name, sess->loop_id); sess->local = 0; } spin_unlock_irqrestore(&ha->tgt.sess_lock, flags); @@ -802,9 +804,9 @@ qlt_plogi_ack_find_add(struct scsi_qla_host *vha, port_id_t *id, list_for_each_entry(pla, &vha->plogi_ack_list, list) { if (pla->id.b24 == id->b24) { ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0x210d, - "%s %d %s Term INOT due to new INOT", + "%s %d %8phC Term INOT due to new INOT", __func__, __LINE__, - wwn_to_str(pla->iocb.u.isp24.port_name)); + pla->iocb.u.isp24.port_name); qlt_send_term_imm_notif(vha, &pla->iocb, 1); memcpy(&pla->iocb, iocb, sizeof(pla->iocb)); return pla; @@ -841,8 +843,8 @@ void qlt_plogi_ack_unref(struct scsi_qla_host *vha, return; ql_dbg(ql_dbg_disc, vha, 0x5089, - "Sending PLOGI ACK to wwn %s s_id %02x:%02x:%02x loop_id %#04x" - " exch %#x ox_id %#x\n", wwn_to_str(iocb->u.isp24.port_name), + "Sending PLOGI ACK to wwn %8phC s_id %02x:%02x:%02x loop_id %#04x" + " exch %#x ox_id %#x\n", iocb->u.isp24.port_name, iocb->u.isp24.port_id[2], iocb->u.isp24.port_id[1], iocb->u.isp24.port_id[0], le16_to_cpu(iocb->u.isp24.nport_handle), @@ -882,10 +884,10 @@ qlt_plogi_ack_link(struct scsi_qla_host *vha, struct qlt_plogi_ack_t *pla, pla->ref_count++; ql_dbg(ql_dbg_tgt_mgt, vha, 0xf097, - "Linking sess %p [%d] wwn %s with PLOGI ACK to wwn %s" + "Linking sess %p [%d] wwn %8phC with PLOGI ACK to wwn %8phC" " s_id %02x:%02x:%02x, ref=%d pla %p link %d\n", - sess, link, wwn_to_str(sess->port_name), - wwn_to_str(iocb->u.isp24.port_name), iocb->u.isp24.port_id[2], + sess, link, sess->port_name, + iocb->u.isp24.port_name, iocb->u.isp24.port_id[2], iocb->u.isp24.port_id[1], iocb->u.isp24.port_id[0], pla->ref_count, pla, link); @@ -969,10 +971,9 @@ void qlt_free_session_done(struct work_struct *work) sess->plogi_link[QLT_PLOGI_LINK_SAME_WWN]; ql_dbg(ql_dbg_tgt_mgt, vha, 0xf084, - "%s: se_sess %p / sess %p from port %s loop_id %#04x" + "%s: se_sess %p / sess %p from port %8phC loop_id %#04x" " s_id %02x:%02x:%02x logout %d keep %d els_logo %d\n", - __func__, sess->se_sess, sess, wwn_to_str(sess->port_name), - sess->loop_id, + __func__, sess->se_sess, sess, sess->port_name, sess->loop_id, sess->d_id.b.domain, sess->d_id.b.area, sess->d_id.b.al_pa, sess->logout_on_delete, sess->keep_nport_handle, sess->send_els_logo); @@ -1088,20 +1089,18 @@ void qlt_free_session_done(struct work_struct *work) if (con) { iocb = &con->iocb; ql_dbg(ql_dbg_tgt_mgt, vha, 0xf099, - "se_sess %p / sess %p port %s is gone," - " %s (ref=%d), releasing PLOGI for %s (ref=%d)\n", - sess->se_sess, sess, - wwn_to_str(sess->port_name), + "se_sess %p / sess %p port %8phC is gone," + " %s (ref=%d), releasing PLOGI for %8phC (ref=%d)\n", + sess->se_sess, sess, sess->port_name, own ? "releasing own PLOGI" : "no own PLOGI pending", own ? own->ref_count : -1, - wwn_to_str(iocb->u.isp24.port_name), - con->ref_count); + iocb->u.isp24.port_name, con->ref_count); qlt_plogi_ack_unref(vha, con); sess->plogi_link[QLT_PLOGI_LINK_CONFLICT] = NULL; } else { ql_dbg(ql_dbg_tgt_mgt, vha, 0xf09a, - "se_sess %p / sess %p port %s is gone, %s (ref=%d)\n", - sess->se_sess, sess, wwn_to_str(sess->port_name), + "se_sess %p / sess %p port %8phC is gone, %s (ref=%d)\n", + sess->se_sess, sess, sess->port_name, own ? "releasing own PLOGI" : "no own PLOGI pending", own ? own->ref_count : -1); @@ -1117,8 +1116,8 @@ void qlt_free_session_done(struct work_struct *work) spin_unlock_irqrestore(&ha->tgt.sess_lock, flags); ql_dbg(ql_dbg_tgt_mgt, vha, 0xf001, - "Unregistration of sess %p %s finished fcp_cnt %d\n", - sess, wwn_to_str(sess->port_name), vha->fcport_count); + "Unregistration of sess %p %8phC finished fcp_cnt %d\n", + sess, sess->port_name, vha->fcport_count); if (tgt && (tgt->sess_count == 0)) wake_up_all(&tgt->waitQ); @@ -1155,8 +1154,8 @@ void qlt_unreg_sess(struct fc_port *sess) unsigned long flags; ql_dbg(ql_dbg_disc, sess->vha, 0x210a, - "%s sess %p for deletion %s\n", - __func__, sess, wwn_to_str(sess->port_name)); + "%s sess %p for deletion %8phC\n", + __func__, sess, sess->port_name); spin_lock_irqsave(&sess->vha->work_lock, flags); if (sess->free_pending) { @@ -1174,7 +1173,6 @@ void qlt_unreg_sess(struct fc_port *sess) sess->last_rscn_gen = sess->rscn_gen; sess->last_login_gen = sess->login_gen; - INIT_WORK(&sess->free_work, qlt_free_session_done); schedule_work(&sess->free_work); } EXPORT_SYMBOL(qlt_unreg_sess); @@ -1209,8 +1207,8 @@ static int qlt_reset(struct scsi_qla_host *vha, void *iocb, int mcmd) } ql_dbg(ql_dbg_tgt, vha, 0xe047, - "scsi(%ld): resetting (session %p from port %s mcmd %x, " - "loop_id %d)\n", vha->host_no, sess, wwn_to_str(sess->port_name), + "scsi(%ld): resetting (session %p from port %8phC mcmd %x, " + "loop_id %d)\n", vha->host_no, sess, sess->port_name, mcmd, loop_id); return qlt_issue_task_mgmt(sess, 0, mcmd, iocb, QLA24XX_MGMT_SEND_NACK); @@ -1255,8 +1253,8 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess) if (sess->sec_since_registration < sec && sec && !(sec % 5)) { sess->sec_since_registration = sec; ql_dbg(ql_dbg_disc, sess->vha, 0xffff, - "%s %s : Slow Rport registration(%d Sec)\n", - __func__, wwn_to_str(sess->port_name), sec); + "%s %8phC : Slow Rport registration(%d Sec)\n", + __func__, sess->port_name, sec); } return; default: @@ -1276,10 +1274,9 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess) qla24xx_chk_fcp_state(sess); ql_dbg(ql_dbg_tgt, sess->vha, 0xe001, - "Scheduling sess %p for deletion %s\n", - sess, wwn_to_str(sess->port_name)); + "Scheduling sess %p for deletion %8phC\n", + sess, sess->port_name); - INIT_WORK(&sess->del_work, qla24xx_delete_sess_fn); WARN_ON(!queue_work(sess->vha->hw->wq, &sess->del_work)); } @@ -1362,8 +1359,8 @@ static struct fc_port *qlt_create_sess( if (fcport->se_sess) { if (!kref_get_unless_zero(&sess->sess_kref)) { ql_dbg(ql_dbg_disc, vha, 0x20f6, - "%s: kref_get_unless_zero failed for %s\n", - __func__, wwn_to_str(sess->port_name)); + "%s: kref_get_unless_zero failed for %8phC\n", + __func__, sess->port_name); return NULL; } return fcport; @@ -1384,8 +1381,8 @@ static struct fc_port *qlt_create_sess( if (ha->tgt.tgt_ops->check_initiator_node_acl(vha, &fcport->port_name[0], sess) < 0) { ql_dbg(ql_dbg_tgt_mgt, vha, 0xf015, - "(%d) %s check_initiator_node_acl failed\n", - vha->vp_idx, wwn_to_str(fcport->port_name)); + "(%d) %8phC check_initiator_node_acl failed\n", + vha->vp_idx, fcport->port_name); return NULL; } else { kref_init(&fcport->sess_kref); @@ -1395,11 +1392,14 @@ static struct fc_port *qlt_create_sess( */ if (!kref_get_unless_zero(&sess->sess_kref)) { ql_dbg(ql_dbg_disc, vha, 0x20f7, - "%s: kref_get_unless_zero failed for %s\n", - __func__, wwn_to_str(sess->port_name)); + "%s: kref_get_unless_zero failed for %8phC\n", + __func__, sess->port_name); return NULL; } + INIT_WORK(&sess->del_work, qla24xx_delete_sess_fn); + INIT_WORK(&sess->free_work, qlt_free_session_done); + spin_lock_irqsave(&ha->tgt.sess_lock, flags); if (!IS_SW_RESV_ADDR(sess->d_id)) vha->vha_tgt.qla_tgt->sess_count++; @@ -1414,9 +1414,9 @@ static struct fc_port *qlt_create_sess( vha->vha_tgt.qla_tgt->sess_count); ql_dbg(ql_dbg_tgt_mgt, vha, 0xf04b, - "qla_target(%d): %ssession for wwn %s (loop_id %d, " + "qla_target(%d): %ssession for wwn %8phC (loop_id %d, " "s_id %x:%x:%x, confirmed completion %ssupported) added\n", - vha->vp_idx, local ? "local " : "", wwn_to_str(fcport->port_name), + vha->vp_idx, local ? "local " : "", fcport->port_name, fcport->loop_id, sess->d_id.b.domain, sess->d_id.b.area, sess->d_id.b.al_pa, sess->conf_compl_supported ? "" : "not "); @@ -1454,8 +1454,8 @@ qlt_fc_port_deleted(struct scsi_qla_host *vha, fc_port_t *fcport, int max_gen) spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); ql_dbg(ql_dbg_tgt_mgt, vha, 0xf092, "Ignoring stale deletion request for se_sess %p / sess %p" - " for port %s, req_gen %d, sess_gen %d\n", - sess->se_sess, sess, wwn_to_str(sess->port_name), max_gen, + " for port %8phC, req_gen %d, sess_gen %d\n", + sess->se_sess, sess, sess->port_name, max_gen, sess->generation); return; } @@ -2369,8 +2369,8 @@ void qlt_xmit_tm_rsp(struct qla_tgt_mgmt_cmd *mcmd) case ELS_PRLO: case ELS_TPRLO: ql_dbg(ql_dbg_disc, vha, 0x2106, - "TM response logo %s status %#x state %#x", - wwn_to_str(mcmd->sess->port_name), mcmd->fc_tm_rsp, + "TM response logo %8phC status %#x state %#x", + mcmd->sess->port_name, mcmd->fc_tm_rsp, mcmd->flags); qlt_schedule_sess_for_deletion(mcmd->sess); break; @@ -4018,9 +4018,8 @@ static void qlt_do_ctio_completion(struct scsi_qla_host *vha, */ cmd->sess->send_els_logo = 1; ql_dbg(ql_dbg_disc, vha, 0x20f8, - "%s %d %s post del sess\n", - __func__, __LINE__, - wwn_to_str(cmd->sess->port_name)); + "%s %d %8phC post del sess\n", + __func__, __LINE__, cmd->sess->port_name); qlt_schedule_sess_for_deletion(cmd->sess); } @@ -4386,8 +4385,8 @@ static int qlt_handle_cmd_for_atio(struct scsi_qla_host *vha, */ if (!kref_get_unless_zero(&sess->sess_kref)) { ql_dbg(ql_dbg_tgt_mgt, vha, 0xf004, - "%s: kref_get fail, %s oxid %x \n", - __func__, wwn_to_str(sess->port_name), + "%s: kref_get fail, %8phC oxid %x \n", + __func__, sess->port_name, be16_to_cpu(atio->u.isp24.fcp_hdr.ox_id)); return -EFAULT; } @@ -4600,12 +4599,12 @@ void qlt_logo_completion_handler(fc_port_t *fcport, int rc) if (rc != MBS_COMMAND_COMPLETE) { ql_dbg(ql_dbg_tgt_mgt, fcport->vha, 0xf093, "%s: se_sess %p / sess %p from" - " port %s loop_id %#04x s_id %02x:%02x:%02x" + " port %8phC loop_id %#04x s_id %02x:%02x:%02x" " LOGO failed: %#x\n", __func__, fcport->se_sess, fcport, - wwn_to_str(fcport->port_name), fcport->loop_id, + fcport->port_name, fcport->loop_id, fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa, rc); } @@ -4777,9 +4776,9 @@ static int qlt_handle_login(struct scsi_qla_host *vha, pla = qlt_plogi_ack_find_add(vha, &port_id, iocb); if (!pla) { ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0xffff, - "%s %d %s Term INOT due to mem alloc fail", + "%s %d %8phC Term INOT due to mem alloc fail", __func__, __LINE__, - wwn_to_str(iocb->u.isp24.port_name)); + iocb->u.isp24.port_name); qlt_send_term_imm_notif(vha, iocb, 1); goto out; } @@ -4793,8 +4792,8 @@ static int qlt_handle_login(struct scsi_qla_host *vha, if (!sess) { pla->ref_count++; ql_dbg(ql_dbg_disc, vha, 0xffff, - "%s %d %s post new sess\n", - __func__, __LINE__, wwn_to_str(iocb->u.isp24.port_name)); + "%s %d %8phC post new sess\n", + __func__, __LINE__, iocb->u.isp24.port_name); if (iocb->u.isp24.status_subcode == ELS_PLOGI) qla24xx_post_newsess_work(vha, &port_id, iocb->u.isp24.port_name, @@ -4823,8 +4822,8 @@ static int qlt_handle_login(struct scsi_qla_host *vha, !(sec % 5)) { sess->sec_since_registration = sec; ql_dbg(ql_dbg_disc, vha, 0xffff, - "%s %s - Slow Rport registration (%d Sec)\n", - __func__, wwn_to_str(sess->port_name), sec); + "%s %8phC - Slow Rport registration (%d Sec)\n", + __func__, sess->port_name, sec); } if (!conflict_sess) { @@ -4861,8 +4860,8 @@ static int qlt_handle_login(struct scsi_qla_host *vha, ql_dbg(ql_dbg_disc, vha, 0x20f9, - "%s %d %s DS %d\n", - __func__, __LINE__, wwn_to_str(sess->port_name), sess->disc_state); + "%s %d %8phC DS %d\n", + __func__, __LINE__, sess->port_name, sess->disc_state); switch (sess->disc_state) { case DSC_DELETED: @@ -4891,8 +4890,9 @@ static int qlt_handle_login(struct scsi_qla_host *vha, sess->keep_nport_handle = ((sess->loop_id == loop_id) && (sess->d_id.b24 == port_id.b24)); - ql_dbg(ql_dbg_disc, vha, 0x20f9, "%s %d %s post del sess\n", - __func__, __LINE__, wwn_to_str(sess->port_name)); + ql_dbg(ql_dbg_disc, vha, 0x20f9, + "%s %d %8phC post del sess\n", + __func__, __LINE__, sess->port_name); qlt_schedule_sess_for_deletion(sess); @@ -4930,11 +4930,11 @@ static int qlt_24xx_handle_els(struct scsi_qla_host *vha, loop_id = le16_to_cpu(iocb->u.isp24.nport_handle); ql_dbg(ql_dbg_disc, vha, 0xf026, - "qla_target(%d): Port ID: %02x:%02x:%02x ELS opcode: 0x%02x lid %d %s\n", - vha->vp_idx, iocb->u.isp24.port_id[2], - iocb->u.isp24.port_id[1], iocb->u.isp24.port_id[0], - iocb->u.isp24.status_subcode, loop_id, - wwn_to_str(iocb->u.isp24.port_name)); + "qla_target(%d): Port ID: %02x:%02x:%02x ELS opcode: 0x%02x lid %d %8phC\n", + vha->vp_idx, iocb->u.isp24.port_id[2], + iocb->u.isp24.port_id[1], iocb->u.isp24.port_id[0], + iocb->u.isp24.status_subcode, loop_id, + iocb->u.isp24.port_name); /* res = 1 means ack at the end of thread * res = 0 means ack async/later. @@ -4951,9 +4951,9 @@ static int qlt_24xx_handle_els(struct scsi_qla_host *vha, if (sess && sess->plogi_link[QLT_PLOGI_LINK_SAME_WWN]) { ql_dbg(ql_dbg_disc, vha, 0xffff, - "%s %d %s Term PRLI due to PLOGI ACK not completed\n", + "%s %d %8phC Term PRLI due to PLOGI ACK not completed\n", __func__, __LINE__, - wwn_to_str(iocb->u.isp24.port_name)); + iocb->u.isp24.port_name); qlt_send_term_imm_notif(vha, iocb, 1); break; } @@ -4983,9 +4983,8 @@ static int qlt_24xx_handle_els(struct scsi_qla_host *vha, break; default: ql_dbg(ql_dbg_tgt_mgt, vha, 0xf09b, - "PRLI with conflicting sess %p port %s\n", - conflict_sess, - wwn_to_str(conflict_sess->port_name)); + "PRLI with conflicting sess %p port %8phC\n", + conflict_sess, conflict_sess->port_name); conflict_sess->fw_login_state = DSC_LS_PORT_UNAVAIL; qlt_send_term_imm_notif(vha, iocb, 1); @@ -5020,8 +5019,8 @@ static int qlt_24xx_handle_els(struct scsi_qla_host *vha, !(sec % 5)) { sess->sec_since_registration = sec; ql_dbg(ql_dbg_disc, sess->vha, 0xffff, - "%s %s : Slow Rport registration(%d Sec)\n", - __func__, wwn_to_str(sess->port_name), sec); + "%s %8phC : Slow Rport registration(%d Sec)\n", + __func__, sess->port_name, sec); } qlt_send_term_imm_notif(vha, iocb, 1); return 0; @@ -5081,8 +5080,8 @@ static int qlt_24xx_handle_els(struct scsi_qla_host *vha, if (ha->current_topology != ISP_CFG_F) { if (sess) { ql_dbg(ql_dbg_disc, vha, 0x20fa, - "%s %d %s post nack\n", - __func__, __LINE__, wwn_to_str(sess->port_name)); + "%s %d %8phC post nack\n", + __func__, __LINE__, sess->port_name); qla24xx_post_nack_work(vha, sess, iocb, SRB_NACK_PRLI); res = 0; @@ -5094,8 +5093,8 @@ static int qlt_24xx_handle_els(struct scsi_qla_host *vha, } else { if (sess) { ql_dbg(ql_dbg_disc, vha, 0x20fb, - "%s %d %s post nack\n", - __func__, __LINE__, wwn_to_str(sess->port_name)); + "%s %d %8phC post nack\n", + __func__, __LINE__, sess->port_name); qla24xx_post_nack_work(vha, sess, iocb, SRB_NACK_PRLI); res = 0; @@ -6125,8 +6124,8 @@ static fc_port_t *qlt_get_port_database(struct scsi_qla_host *vha, qla24xx_sched_upd_fcport(fcport); } else { ql_dbg(ql_dbg_disc, vha, 0x20ff, - "%s %d %s post gpsc fcp_cnt %d\n", - __func__, __LINE__, wwn_to_str(fcport->port_name), vha->fcport_count); + "%s %d %8phC post gpsc fcp_cnt %d\n", + __func__, __LINE__, fcport->port_name, vha->fcport_count); qla24xx_post_gpsc_work(vha, fcport); } } @@ -6247,8 +6246,8 @@ static void qlt_abort_work(struct qla_tgt *tgt, if (!kref_get_unless_zero(&sess->sess_kref)) { ql_dbg(ql_dbg_tgt_tmr, vha, 0xf01c, - "%s: kref_get fail %s \n", - __func__, wwn_to_str(sess->port_name)); + "%s: kref_get fail %8phC \n", + __func__, sess->port_name); sess = NULL; goto out_term2; } @@ -6310,8 +6309,8 @@ static void qlt_tmr_work(struct qla_tgt *tgt, if (!kref_get_unless_zero(&sess->sess_kref)) { ql_dbg(ql_dbg_tgt_tmr, vha, 0xf020, - "%s: kref_get fail %s\n", - __func__, wwn_to_str(sess->port_name)); + "%s: kref_get fail %8phC\n", + __func__, sess->port_name); goto out_term2; } } diff --git a/scripts/blockdev-perftest b/scripts/blockdev-perftest index db240ef36..a00212cc3 100755 --- a/scripts/blockdev-perftest +++ b/scripts/blockdev-perftest @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash ############################################################################ # diff --git a/scripts/generate-kernel-patch b/scripts/generate-kernel-patch index 19b7589ee..8040f73fc 100755 --- a/scripts/generate-kernel-patch +++ b/scripts/generate-kernel-patch @@ -173,8 +173,6 @@ generating_upstream_patch="false" mpt_scst="false" multiple_patches="false" patchdir="" -qla2x00t="false" -qla2x00t_32gbit="true" replace_sbug_by_bug="true" specialize_patch_options=(-v "delete_disabled_code=1") srpt="true" @@ -226,6 +224,16 @@ else include_fcst="false" fi +# See also commit 89d9a567952b ("[SCSI] add support for per-host cmd pools"; +# v3.15). +if kernel_version_lt "$kver" 3.15; then + qla2x00t="true" + qla2x00t_32gbit="false" +else + qla2x00t="false" + qla2x00t_32gbit="true" +fi + if [ -e "scst/kernel/in-tree/Makefile.scst-${kver}" ]; then scst_makefile="Makefile.scst-${kver}" else diff --git a/scripts/generate-patched-kernel b/scripts/generate-patched-kernel index a42990bcc..f24fc534d 100755 --- a/scripts/generate-patched-kernel +++ b/scripts/generate-patched-kernel @@ -24,13 +24,14 @@ function usage { } -script_dir="$(dirname $0)" +script_dir="$(dirname "$0")" if [ "${script_dir#/}" = "${script_dir}" ]; then script_dir="$PWD/$script_dir" fi scriptdir="${scriptdir%/.}" scst_dir="$(dirname "${script_dir}")" +# shellcheck source=./kernel-functions source "${script_dir}/kernel-functions" if [ "$1" = "" ]; then @@ -49,9 +50,9 @@ cd "${target}" || exit $? "${script_dir}/list-source-files" "${scst_dir}" | grep -- "-${kernel_version}.*.patch$" | grep -v /in-tree/ | - while read p; do - if [ "${p/readahead-2.6.32.below11.patch//}" = "$p" \ - -o "${patchlevel:-0}" -lt 11 ]; then + while read -r p; do + if [ "${p/readahead-2.6.32.below11.patch//}" = "$p" ] || + [ "${patchlevel:-0}" -lt 11 ]; then echo "==== $p" patch -p1 <"${scst_dir}/$p" fi diff --git a/scripts/kernel-functions b/scripts/kernel-functions index 0d19ae115..1b2ff8cff 100644 --- a/scripts/kernel-functions +++ b/scripts/kernel-functions @@ -1,4 +1,4 @@ -# -*- mode: shell-script -*- +#!/bin/bash # Shell functions for parsing the Linux kernel version and for downloading # from kernel.org. @@ -11,6 +11,10 @@ function kernel_version_le { awk -v "v1=$1" -v "v2=$2" 'BEGIN { n1 = split(v1, v1a, "."); n2 = split(v2, v2a, "."); for (i=1;;i++) { e1 = i <= n1 ? v1a[i] : 0; e2 = i <= n2 ? v2a[i] : 0; if (e1 < e2 || i > n1 && i > n2) exit 0; if (e1 > e2) exit 1; }}' } +function kernel_version_lt { + [ "$1" != "$2" ] && kernel_version_le "$1" "$2" +} + # Kernel version number. function kernel_version { if [ "${1#2.}" != "$1" ]; then @@ -45,8 +49,8 @@ function download_file { # Make sure the kernel tarball and patch file are present in directory # ${kernel_downloads}. Download any missing files from ${kernel_mirror}. function download_kernel { - local kver="$(kernel_version $1)" - local plevel="$(patchlevel $1)" + local kver="$(kernel_version "$1")" + local plevel="$(patchlevel "$1")" local series="$1" case "${series:0:2}" in @@ -57,7 +61,7 @@ function download_kernel { test -w "${kernel_downloads}" || return $? ( cd "${kernel_downloads}" || return $? - if [ "$plevel" = "" -o "$plevel" = "0" ] || + if [ "$plevel" = "" ] || [ "$plevel" = "0" ] || download_file "${kernel_mirror}/v$series/patch-$1.xz" then download_file "${kernel_mirror}/v$series/linux-${kver}.tar.xz" || @@ -70,20 +74,20 @@ function download_kernel { } function extract_kernel_archive { - local kver="$(kernel_version $1)" - local plevel="$(patchlevel $1)" + local kver="$(kernel_version "$1")" + local plevel="$(patchlevel "$1")" local series="$1" if [ -e "${kernel_downloads}/linux-$1.tar.xz" ]; then xz -cd "${kernel_downloads}/linux-$1.tar.xz" | tar xf - elif [ -e "${kernel_downloads}/linux-$kver.tar.xz" ]; then xz -cd "${kernel_downloads}/linux-$kver.tar.xz" | tar xf - && - mv linux-$kver linux-$1 + mv "linux-$kver" "linux-$1" elif [ -e "${kernel_downloads}/linux-$1.tar.bz2" ]; then tar xjf "${kernel_downloads}/linux-$1.tar.bz2" elif [ -e "${kernel_downloads}/linux-$kver.tar.bz2" ]; then tar xjf "${kernel_downloads}/linux-$kver.tar.bz2" && - mv linux-$kver linux-$1 + mv "linux-$kver" "linux-$1" else return 1 fi @@ -92,24 +96,24 @@ function extract_kernel_archive { # Create a linux-$1 tree in the current directory, where $1 is a kernel # version number with either three or four components. function extract_kernel_tree { - local kver="$(kernel_version $1)" - local plevel="$(patchlevel $1)" + local kver="$(kernel_version "$1")" + local plevel="$(patchlevel "$1")" local tmpdir=kernel-tree-tmp-$$ rm -rf "linux-$1" "${tmpdir}" mkdir "${tmpdir}" || return $? ( cd "${tmpdir}" || return $? - if [ "$plevel" != "" -a "$plevel" != "0" -a \ - -e "${kernel_downloads}/patch-$1.xz" ]; then - extract_kernel_archive $kver || return $? - mv linux-$kver linux-$1 - ( cd linux-$1 && xz -cd "${kernel_downloads}/patch-$1.xz" \ + if [ "$plevel" != "" ] && [ "$plevel" != "0" ] && + [ -e "${kernel_downloads}/patch-$1.xz" ]; then + extract_kernel_archive "$kver" || return $? + mv "linux-$kver" "linux-$1" + ( cd "linux-$1" && xz -cd "${kernel_downloads}/patch-$1.xz" \ | patch -p1 -f -s; ) \ || return $? else - extract_kernel_archive $1 || - { extract_kernel_archive $kver && mv linux-$kver linux-$1; } || + extract_kernel_archive "$1" || + { extract_kernel_archive "$kver" && mv "linux-$kver" "linux-$1"; } || return $? fi mv "linux-$1" ".." || return $? @@ -120,7 +124,7 @@ function extract_kernel_tree { # Patch a kernel tree where $1 is the kernel version. function patch_kernel { - if [ "$1" = "2.6.29" -o "$1" = "2.6.29.1" -o "$1" = "2.6.29.2" -o "$1" = "2.6.29.3" ] + if [ "$1" = "2.6.29" ] || [ "$1" = "2.6.29.1" ] || [ "$1" = "2.6.29.2" ] || [ "$1" = "2.6.29.3" ] then patch -f -s -p1 <<'EOF' Make sure that branch profiling does not trigger sparse warnings. @@ -177,7 +181,7 @@ See also http://lkml.org/lkml/2009/9/26/51 do { \ EOF fi - if [ "${1#2.6.32}" != "$1" -o "${1#2.6.33}" != "$1" ] + if [ "${1#2.6.32}" != "$1" ] || [ "${1#2.6.33}" != "$1" ] then patch -f -s -p1 <<'EOF' Get rid of sparse errors on sk_buff.protocol. @@ -451,5 +455,10 @@ function download_and_extract_kernel_tree { else download_kernel "$1" && extract_kernel_tree "$1" fi && - (cd linux-$1 && patch_kernel "$1") + (cd "linux-$1" && patch_kernel "$1") } + +# For shellcheck +if false; then + quiet_download=true +fi diff --git a/scripts/list-source-files b/scripts/list-source-files index f4f00f80d..09550eed8 100755 --- a/scripts/list-source-files +++ b/scripts/list-source-files @@ -17,7 +17,7 @@ list_source_files() { grep -vE '^[D?]|^Performing|^$' | \ cut -c3- | \ while read -r a b c f; do - if [ -f "$f" -o -h "$f" ]; then + if [ -f "$f" ] || [ -h "$f" ]; then echo "$a $b $c" >/dev/null echo "$f" fi @@ -39,7 +39,7 @@ list_source_files() { hg manifest fi else - ( cd "$d" && find -type f -o -type l | sed 's|^\./||' ) + ( cd "$d" && find . -type f -o -type l | sed 's|^\./||' ) fi } diff --git a/scripts/monitor-interrupt-rate b/scripts/monitor-interrupt-rate index cd47a181f..7e81ed9a5 100755 --- a/scripts/monitor-interrupt-rate +++ b/scripts/monitor-interrupt-rate @@ -6,11 +6,11 @@ echo "Interrupts per second:" while true do sum=0 - while read line + while read -r line do for word in $line do - if [ "${word#[0-9]}" != "$word" -a "${word%[0-9]}" != "$word" ]; then + if [ "${word#[0-9]}" != "$word" ] && [ "${word%[0-9]}" != "$word" ]; then sum="$((sum + word))" fi done diff --git a/scripts/monitor-memory-usage b/scripts/monitor-memory-usage index e43cd6b12..eabb74dba 100755 --- a/scripts/monitor-memory-usage +++ b/scripts/monitor-memory-usage @@ -50,7 +50,7 @@ do esac done -if [ "$#" != 0 -o "${interval}" -le 0 ]; then +if [ "$#" != 0 ] || [ "${interval}" -le 0 ]; then usage exit 1 fi @@ -61,20 +61,20 @@ fi #################### printf "%-10s " "Time" -cat /proc/meminfo \ -| while read label number unit +cat /proc/meminfo | + while read -r label number unit do - printf " %10s" ${label%:} + printf " %10s" "${label%:}" done echo while true do - printf "%-10d" $(date +%s) - cat /proc/meminfo \ - | while read label number unit + printf "%-10d" "$(date +%s)" + cat /proc/meminfo | + while read -r label number unit do - printf " %10d" ${number} + printf " %10d" "${number}" done echo sleep "${interval}" diff --git a/scripts/run-regression-tests b/scripts/run-regression-tests index 5b1f34452..4cb024949 100755 --- a/scripts/run-regression-tests +++ b/scripts/run-regression-tests @@ -55,7 +55,7 @@ ######################## # shellcheck source=./kernel-functions -source $(dirname $0)/kernel-functions +source "$(dirname "$0")/kernel-functions" function usage { echo "Usage: $0 [-c ] [-d ] [-f] [-h] [-j ] [-p ] [-q] ..." @@ -675,8 +675,16 @@ do 2.*|3.*) # Tell the kernel that we are using gcc 4.6. KCFLAGS="-U__GNUC__ -U__GNUC_MINOR__ -D__GNUC__=4 -D__GNUC_MINOR__=6" - export KCFLAGS;; esac + # See also commit bd664f6b3e37 ("disable new gcc-7.1.1 warnings for now"; + # v4.13) and commit 6f303d60534c ("gcc-9: silence 'address-of-packed-member' + # warning"; v5.1). + for w in -Wno-format-truncation -Wno-format-overflow -Wno-int-in-bool-context -Wno-address-of-packed-member; do + if gcc -c -xc - "$w" &/dev/null; then + KCFLAGS+=" $w" + fi + done + export KCFLAGS subdirs=(drivers/scst) if [ "${run_sparse}" = "true" ]; then run_sparse "$k" "${subdirs[@]}" @@ -697,7 +705,7 @@ do if [ "${run_smatch}" = "true" ]; then run_smatch "$k" "${subdirs[@]}" fi - if [ "${qla2x00t}" = "true" ] && $(kernel_version_le 2.6.37 $k); then + if [ "${qla2x00t}" = "true" ] && kernel_version_le 2.6.37 "$k"; then subdirs+=(drivers/scsi/qla2xxx) fi compile_kernel "$k" "${subdirs[@]}" diff --git a/scripts/update-version b/scripts/update-version index 7735be978..ab2310ccc 100755 --- a/scripts/update-version +++ b/scripts/update-version @@ -2,11 +2,11 @@ # Update the version number in SCST source files. usage() { - echo "Usage: $(basename $0) []" + echo "Usage: $(basename "$0") []" exit 1 } -if [ $# != 3 -a $# != 4 ]; then +if [ $# != 3 ] && [ $# != 4 ]; then usage fi diff --git a/scst/include/backport.h b/scst/include/backport.h index 5f3be247d..112c8dc98 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1586,6 +1586,14 @@ static inline int scsi_bidi_cmnd(struct scsi_cmnd *cmd) } #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0) +/* See also commit b54197c43db8 ("virtio_scsi: use cmd_size") # v3.16. */ +static inline void *scsi_cmd_priv(struct scsi_cmnd *cmd) +{ + return cmd + 1; +} +#endif + /* */ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index b9ae11c78..30ad0aa5b 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -1825,7 +1825,7 @@ static int vdisk_unmap_file_range(struct scst_cmd *cmd, } static int vdisk_unmap_range(struct scst_cmd *cmd, - struct scst_vdisk_dev *virt_dev, uint64_t start_lba, uint32_t blocks) + struct scst_vdisk_dev *virt_dev, uint64_t start_lba, uint64_t blocks) { #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 27) int res, err; @@ -1850,7 +1850,7 @@ static int vdisk_unmap_range(struct scst_cmd *cmd, } TRACE_DBG("Unmapping lba %lld (blocks %lld)", - (unsigned long long)start_lba, (unsigned long long)blocks); + (unsigned long long)start_lba, blocks); if (virt_dev->blockio) { #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 27) @@ -1874,7 +1874,7 @@ static int vdisk_unmap_range(struct scst_cmd *cmd, #endif if (unlikely(err != 0)) { PRINT_ERROR("blkdev_issue_discard() for " - "LBA %lld, blocks %d failed: %d", + "LBA %lld, blocks %lld failed: %d", (unsigned long long)start_lba, blocks, err); scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_write_error)); @@ -1888,7 +1888,7 @@ static int vdisk_unmap_range(struct scst_cmd *cmd, #endif } else { loff_t off = start_lba << cmd->dev->block_shift; - loff_t len = (u64)blocks << cmd->dev->block_shift; + loff_t len = blocks << cmd->dev->block_shift; res = vdisk_unmap_file_range(cmd, virt_dev, off, len, fd); if (unlikely(res != 0)) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 62a7197ed..ffc78e827 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -8650,7 +8650,8 @@ int scst_scsi_exec_async(struct scst_cmd *cmd, void *data, } rq->next_rq = next_rq; #else - return -EOPNOTSUPP; + res = -EOPNOTSUPP; + goto out_free_sioc; #endif } else { rq = blk_map_kern_sg(q, cmd->sg, cmd->sg_cnt, gfp, reading);