scsi: fnic: Code cleanup
Replace existing host structure with fnic host. Add headers from scsi to support new functionality. Remove unused code and declarations. Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Reviewed-by: Gian Carlo Boffa <gcboffa@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://lore.kernel.org/r/20241212020312.4786-14-kartilak@cisco.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>pull/1134/merge
parent
a8650a5eaa
commit
7e6886b705
File diff suppressed because it is too large
Load Diff
|
|
@ -29,7 +29,7 @@ void fnic_fcoe_reset_vlans(struct fnic *fnic)
|
|||
}
|
||||
|
||||
spin_unlock_irqrestore(&fnic->vlans_lock, flags);
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Reset vlan complete\n");
|
||||
}
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ void fnic_fcoe_send_vlan_req(struct fnic *fnic)
|
|||
|
||||
frame = fdls_alloc_frame(iport);
|
||||
if (frame == NULL) {
|
||||
FNIC_FIP_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"Failed to allocate frame to send VLAN req");
|
||||
return;
|
||||
}
|
||||
|
|
@ -56,10 +56,10 @@ void fnic_fcoe_send_vlan_req(struct fnic *fnic)
|
|||
fnic_fcoe_reset_vlans(fnic);
|
||||
|
||||
fnic->set_vlan(fnic, 0);
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"set vlan done\n");
|
||||
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"got MAC 0x%x:%x:%x:%x:%x:%x\n", iport->hwmac[0],
|
||||
iport->hwmac[1], iport->hwmac[2], iport->hwmac[3],
|
||||
iport->hwmac[4], iport->hwmac[5]);
|
||||
|
|
@ -83,13 +83,13 @@ void fnic_fcoe_send_vlan_req(struct fnic *fnic)
|
|||
|
||||
iport->fip.state = FDLS_FIP_VLAN_DISCOVERY_STARTED;
|
||||
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Send VLAN req\n");
|
||||
fnic_send_fip_frame(iport, frame, frame_size);
|
||||
|
||||
vlan_tov = jiffies + msecs_to_jiffies(FCOE_CTLR_FIPVLAN_TOV);
|
||||
mod_timer(&fnic->retry_fip_timer, round_jiffies(vlan_tov));
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"fip timer set\n");
|
||||
}
|
||||
|
||||
|
|
@ -113,11 +113,11 @@ void fnic_fcoe_process_vlan_resp(struct fnic *fnic, struct fip_header *fiph)
|
|||
struct fip_vlan_desc *vlan_desc;
|
||||
unsigned long flags;
|
||||
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"fnic 0x%p got vlan resp\n", fnic);
|
||||
|
||||
desc_len = be16_to_cpu(vlan_notif->fip.fip_dl_len);
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"desc_len %d\n", desc_len);
|
||||
|
||||
spin_lock_irqsave(&fnic->vlans_lock, flags);
|
||||
|
|
@ -130,7 +130,7 @@ void fnic_fcoe_process_vlan_resp(struct fnic *fnic, struct fip_header *fiph)
|
|||
|
||||
if (vlan_desc->fd_desc.fip_dtype == FIP_DT_VLAN) {
|
||||
if (vlan_desc->fd_desc.fip_dlen != 1) {
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host,
|
||||
fnic->fnic_num,
|
||||
"Invalid descriptor length(%x) in VLan response\n",
|
||||
vlan_desc->fd_desc.fip_dlen);
|
||||
|
|
@ -138,14 +138,14 @@ void fnic_fcoe_process_vlan_resp(struct fnic *fnic, struct fip_header *fiph)
|
|||
}
|
||||
num_vlan++;
|
||||
vid = be16_to_cpu(vlan_desc->fd_vlan);
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host,
|
||||
fnic->fnic_num,
|
||||
"process_vlan_resp: FIP VLAN %d\n", vid);
|
||||
vlan = kzalloc(sizeof(*vlan), GFP_KERNEL);
|
||||
|
||||
if (!vlan) {
|
||||
/* retry from timer */
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host,
|
||||
fnic->fnic_num,
|
||||
"Mem Alloc failure\n");
|
||||
spin_unlock_irqrestore(&fnic->vlans_lock,
|
||||
|
|
@ -157,7 +157,7 @@ void fnic_fcoe_process_vlan_resp(struct fnic *fnic, struct fip_header *fiph)
|
|||
list_add_tail(&vlan->list, &fnic->vlan_list);
|
||||
break;
|
||||
} else {
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host,
|
||||
fnic->fnic_num,
|
||||
"Invalid descriptor type(%x) in VLan response\n",
|
||||
vlan_desc->fd_desc.fip_dtype);
|
||||
|
|
@ -173,7 +173,7 @@ void fnic_fcoe_process_vlan_resp(struct fnic *fnic, struct fip_header *fiph)
|
|||
/* any VLAN descriptors present ? */
|
||||
if (num_vlan == 0) {
|
||||
atomic64_inc(&fnic_stats->vlan_stats.resp_withno_vlanID);
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"fnic 0x%p No VLAN descriptors in FIP VLAN response\n",
|
||||
fnic);
|
||||
}
|
||||
|
|
@ -198,7 +198,7 @@ void fnic_fcoe_start_fcf_discovery(struct fnic *fnic)
|
|||
|
||||
frame = fdls_alloc_frame(iport);
|
||||
if (frame == NULL) {
|
||||
FNIC_FIP_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"Failed to allocate frame to start FCF discovery");
|
||||
return;
|
||||
}
|
||||
|
|
@ -225,7 +225,7 @@ void fnic_fcoe_start_fcf_discovery(struct fnic *fnic)
|
|||
|
||||
FNIC_STD_SET_NODE_NAME(&pdisc_sol->name_desc.fd_wwn, iport->wwnn);
|
||||
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Start FCF discovery\n");
|
||||
fnic_send_fip_frame(iport, frame, frame_size);
|
||||
|
||||
|
|
@ -260,7 +260,7 @@ void fnic_fcoe_fip_discovery_resp(struct fnic *fnic, struct fip_header *fiph)
|
|||
switch (iport->fip.state) {
|
||||
case FDLS_FIP_FCF_DISCOVERY_STARTED:
|
||||
if (be16_to_cpu(disc_adv->fip.fip_flags) & FIP_FL_SOL) {
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host,
|
||||
fnic->fnic_num,
|
||||
"fnic 0x%p Solicited adv\n", fnic);
|
||||
|
||||
|
|
@ -268,7 +268,7 @@ void fnic_fcoe_fip_discovery_resp(struct fnic *fnic, struct fip_header *fiph)
|
|||
iport->selected_fcf.fcf_priority)
|
||||
&& (be16_to_cpu(disc_adv->fip.fip_flags) & FIP_FL_AVAIL)) {
|
||||
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host,
|
||||
fnic->fnic_num,
|
||||
"fnic 0x%p FCF Available\n", fnic);
|
||||
memcpy(iport->selected_fcf.fcf_mac,
|
||||
|
|
@ -277,7 +277,7 @@ void fnic_fcoe_fip_discovery_resp(struct fnic *fnic, struct fip_header *fiph)
|
|||
disc_adv->prio_desc.fd_pri;
|
||||
iport->selected_fcf.fka_adv_period =
|
||||
be32_to_cpu(disc_adv->fka_adv_desc.fd_fka_period);
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host,
|
||||
fnic->fnic_num, "adv time %d",
|
||||
iport->selected_fcf.fka_adv_period);
|
||||
iport->selected_fcf.ka_disabled =
|
||||
|
|
@ -297,7 +297,7 @@ void fnic_fcoe_fip_discovery_resp(struct fnic *fnic, struct fip_header *fiph)
|
|||
iport->selected_fcf.fka_adv_period =
|
||||
be32_to_cpu(disc_adv->fka_adv_desc.fd_fka_period);
|
||||
FNIC_FIP_DBG(KERN_INFO,
|
||||
fnic->lport->host,
|
||||
fnic->host,
|
||||
fnic->fnic_num,
|
||||
"change fka to %d",
|
||||
iport->selected_fcf.fka_adv_period);
|
||||
|
|
@ -365,7 +365,7 @@ void fnic_fcoe_start_flogi(struct fnic *fnic)
|
|||
|
||||
frame = fdls_alloc_frame(iport);
|
||||
if (frame == NULL) {
|
||||
FNIC_FIP_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"Failed to allocate frame to start FIP FLOGI");
|
||||
return;
|
||||
}
|
||||
|
|
@ -418,7 +418,7 @@ void fnic_fcoe_start_flogi(struct fnic *fnic)
|
|||
oxid = fdls_alloc_oxid(iport, FNIC_FRAME_TYPE_FABRIC_FLOGI,
|
||||
&iport->active_oxid_fabric_req);
|
||||
if (oxid == FNIC_UNASSIGNED_OXID) {
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Failed to allocate OXID to send FIP FLOGI");
|
||||
mempool_free(frame, fnic->frame_pool);
|
||||
return;
|
||||
|
|
@ -430,7 +430,7 @@ void fnic_fcoe_start_flogi(struct fnic *fnic)
|
|||
FNIC_STD_SET_NODE_NAME(&pflogi_req->flogi_desc.flogi.els.fl_wwnn,
|
||||
iport->wwnn);
|
||||
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"FIP start FLOGI\n");
|
||||
fnic_send_fip_frame(iport, frame, frame_size);
|
||||
iport->fip.flogi_retry++;
|
||||
|
|
@ -460,11 +460,11 @@ void fnic_fcoe_process_flogi_resp(struct fnic *fnic, struct fip_header *fiph)
|
|||
struct fnic_stats *fnic_stats = &fnic->fnic_stats;
|
||||
struct fc_frame_header *fchdr = &flogi_rsp->rsp_desc.flogi.fchdr;
|
||||
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"fnic 0x%p FIP FLOGI rsp\n", fnic);
|
||||
desc_len = be16_to_cpu(flogi_rsp->fip.fip_dl_len);
|
||||
if (desc_len != 38) {
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Invalid Descriptor List len (%x). Dropping frame\n",
|
||||
desc_len);
|
||||
return;
|
||||
|
|
@ -474,7 +474,7 @@ void fnic_fcoe_process_flogi_resp(struct fnic *fnic, struct fip_header *fiph)
|
|||
&& (flogi_rsp->rsp_desc.fd_desc.fip_dlen == 36))
|
||||
|| !((flogi_rsp->mac_desc.fd_desc.fip_dtype == 2)
|
||||
&& (flogi_rsp->mac_desc.fd_desc.fip_dlen == 2))) {
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Dropping frame invalid type and len mix\n");
|
||||
return;
|
||||
}
|
||||
|
|
@ -487,7 +487,7 @@ void fnic_fcoe_process_flogi_resp(struct fnic *fnic, struct fip_header *fiph)
|
|||
|| (s_id != FC_FID_FLOGI)
|
||||
|| (frame_type != FNIC_FABRIC_FLOGI_RSP)
|
||||
|| (fchdr->fh_type != 0x01)) {
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Dropping invalid frame: s_id %x F %x R %x t %x OX_ID %x\n",
|
||||
s_id, fchdr->fh_f_ctl[0], fchdr->fh_r_ctl,
|
||||
fchdr->fh_type, FNIC_STD_GET_OX_ID(fchdr));
|
||||
|
|
@ -495,7 +495,7 @@ void fnic_fcoe_process_flogi_resp(struct fnic *fnic, struct fip_header *fiph)
|
|||
}
|
||||
|
||||
if (iport->fip.state == FDLS_FIP_FLOGI_STARTED) {
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"fnic 0x%p rsp for pending FLOGI\n", fnic);
|
||||
|
||||
oxid = FNIC_STD_GET_OX_ID(fchdr);
|
||||
|
|
@ -505,7 +505,7 @@ void fnic_fcoe_process_flogi_resp(struct fnic *fnic, struct fip_header *fiph)
|
|||
if ((be16_to_cpu(flogi_rsp->fip.fip_dl_len) == FIP_FLOGI_LEN)
|
||||
&& (flogi_rsp->rsp_desc.flogi.els.fl_cmd == ELS_LS_ACC)) {
|
||||
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host,
|
||||
fnic->fnic_num,
|
||||
"fnic 0x%p FLOGI success\n", fnic);
|
||||
memcpy(iport->fpma, flogi_rsp->mac_desc.fd_mac, ETH_ALEN);
|
||||
|
|
@ -522,7 +522,7 @@ void fnic_fcoe_process_flogi_resp(struct fnic *fnic, struct fip_header *fiph)
|
|||
|
||||
if (fnic_fdls_register_portid(iport, iport->fcid, NULL)
|
||||
!= 0) {
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host,
|
||||
fnic->fnic_num,
|
||||
"fnic 0x%p flogi registration failed\n",
|
||||
fnic);
|
||||
|
|
@ -531,7 +531,7 @@ void fnic_fcoe_process_flogi_resp(struct fnic *fnic, struct fip_header *fiph)
|
|||
|
||||
iport->fip.state = FDLS_FIP_FLOGI_COMPLETE;
|
||||
iport->state = FNIC_IPORT_STATE_FABRIC_DISC;
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host,
|
||||
fnic->fnic_num, "iport->state:%d\n",
|
||||
iport->state);
|
||||
fnic_fdls_disc_start(iport);
|
||||
|
|
@ -578,7 +578,7 @@ void fnic_common_fip_cleanup(struct fnic *fnic)
|
|||
|
||||
if (!iport->usefip)
|
||||
return;
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"fnic 0x%p fip cleanup\n", fnic);
|
||||
|
||||
iport->fip.state = FDLS_FIP_INIT;
|
||||
|
|
@ -620,7 +620,7 @@ void fnic_fcoe_process_cvl(struct fnic *fnic, struct fip_header *fiph)
|
|||
int found = false;
|
||||
int max_count = 0;
|
||||
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"fnic 0x%p clear virtual link handler\n", fnic);
|
||||
|
||||
if (!((cvl_msg->fcf_mac_desc.fd_desc.fip_dtype == 2)
|
||||
|
|
@ -628,7 +628,7 @@ void fnic_fcoe_process_cvl(struct fnic *fnic, struct fip_header *fiph)
|
|||
|| !((cvl_msg->name_desc.fd_desc.fip_dtype == 4)
|
||||
&& (cvl_msg->name_desc.fd_desc.fip_dlen == 3))) {
|
||||
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"invalid mix: ft %x fl %x ndt %x ndl %x",
|
||||
cvl_msg->fcf_mac_desc.fd_desc.fip_dtype,
|
||||
cvl_msg->fcf_mac_desc.fd_desc.fip_dlen,
|
||||
|
|
@ -643,7 +643,7 @@ void fnic_fcoe_process_cvl(struct fnic *fnic, struct fip_header *fiph)
|
|||
if (!((cvl_msg->vn_ports_desc[i].fd_desc.fip_dtype == 11)
|
||||
&& (cvl_msg->vn_ports_desc[i].fd_desc.fip_dlen == 5))) {
|
||||
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host,
|
||||
fnic->fnic_num,
|
||||
"Invalid type and len mix type: %d len: %d\n",
|
||||
cvl_msg->vn_ports_desc[i].fd_desc.fip_dtype,
|
||||
|
|
@ -667,12 +667,12 @@ void fnic_fcoe_process_cvl(struct fnic *fnic, struct fip_header *fiph)
|
|||
spin_lock_irqsave(&fnic->fnic_lock, fnic->lock_flags);
|
||||
max_count++;
|
||||
if (max_count >= FIP_FNIC_RESET_WAIT_COUNT) {
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Rthr waited too long. Skipping handle link event %p\n",
|
||||
fnic);
|
||||
return;
|
||||
}
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"fnic reset in progress. Link event needs to wait %p",
|
||||
fnic);
|
||||
}
|
||||
|
|
@ -717,7 +717,7 @@ int fdls_fip_recv_frame(struct fnic *fnic, void *frame)
|
|||
return true;
|
||||
}
|
||||
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Not a FIP Frame");
|
||||
return false;
|
||||
}
|
||||
|
|
@ -727,7 +727,7 @@ void fnic_work_on_fip_timer(struct work_struct *work)
|
|||
struct fnic *fnic = container_of(work, struct fnic, fip_timer_work);
|
||||
struct fnic_iport_s *iport = &fnic->iport;
|
||||
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"FIP timeout\n");
|
||||
|
||||
if (iport->fip.state == FDLS_FIP_VLAN_DISCOVERY_STARTED) {
|
||||
|
|
@ -735,7 +735,7 @@ void fnic_work_on_fip_timer(struct work_struct *work)
|
|||
} else if (iport->fip.state == FDLS_FIP_FCF_DISCOVERY_STARTED) {
|
||||
u8 zmac[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"FCF Discovery timeout\n");
|
||||
if (memcmp(iport->selected_fcf.fcf_mac, zmac, ETH_ALEN) != 0) {
|
||||
|
||||
|
|
@ -757,13 +757,13 @@ void fnic_work_on_fip_timer(struct work_struct *work)
|
|||
round_jiffies(fcf_tov));
|
||||
}
|
||||
} else {
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host,
|
||||
fnic->fnic_num, "FCF Discovery timeout\n");
|
||||
fnic_vlan_discovery_timeout(fnic);
|
||||
}
|
||||
} else if (iport->fip.state == FDLS_FIP_FLOGI_STARTED) {
|
||||
fdls_schedule_oxid_free(iport, &iport->active_oxid_fabric_req);
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"FLOGI timeout\n");
|
||||
if (iport->fip.flogi_retry < fnic->config.flogi_retries)
|
||||
fnic_fcoe_start_flogi(fnic);
|
||||
|
|
@ -810,7 +810,7 @@ void fnic_handle_enode_ka_timer(struct timer_list *t)
|
|||
|
||||
frame = fdls_alloc_frame(iport);
|
||||
if (frame == NULL) {
|
||||
FNIC_FIP_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"Failed to allocate frame to send enode ka");
|
||||
return;
|
||||
}
|
||||
|
|
@ -831,7 +831,7 @@ void fnic_handle_enode_ka_timer(struct timer_list *t)
|
|||
memcpy(penode_ka->eth.h_dest, iport->selected_fcf.fcf_mac, ETH_ALEN);
|
||||
memcpy(penode_ka->mac_desc.fd_mac, iport->hwmac, ETH_ALEN);
|
||||
|
||||
FNIC_FIP_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"Handle enode KA timer\n");
|
||||
fnic_send_fip_frame(iport, frame, frame_size);
|
||||
enode_ka_tov = jiffies
|
||||
|
|
@ -864,7 +864,7 @@ void fnic_handle_vn_ka_timer(struct timer_list *t)
|
|||
|
||||
frame = fdls_alloc_frame(iport);
|
||||
if (frame == NULL) {
|
||||
FNIC_FIP_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"Failed to allocate frame to send vn ka");
|
||||
return;
|
||||
}
|
||||
|
|
@ -890,7 +890,7 @@ void fnic_handle_vn_ka_timer(struct timer_list *t)
|
|||
memcpy(pvn_port_ka->vn_port_desc.fd_fc_id, fcid, 3);
|
||||
FNIC_STD_SET_NPORT_NAME(&pvn_port_ka->vn_port_desc.fd_wwpn, iport->wwpn);
|
||||
|
||||
FNIC_FIP_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"Handle vnport KA timer\n");
|
||||
fnic_send_fip_frame(iport, frame, frame_size);
|
||||
vn_ka_tov = jiffies + msecs_to_jiffies(FIP_VN_KA_PERIOD);
|
||||
|
|
@ -980,7 +980,7 @@ void fnic_work_on_fcs_ka_timer(struct work_struct *work)
|
|||
*fnic = container_of(work, struct fnic, fip_timer_work);
|
||||
struct fnic_iport_s *iport = &fnic->iport;
|
||||
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FIP_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"fnic 0x%p fcs ka timeout\n", fnic);
|
||||
|
||||
fnic_common_fip_cleanup(fnic);
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ fnic_debug_dump_fip_frame(struct fnic *fnic, struct ethhdr *eth,
|
|||
u16 op = be16_to_cpu(fiph->fip_op);
|
||||
u8 sub = fiph->fip_subcode;
|
||||
|
||||
FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"FIP %s packet contents: op: 0x%x sub: 0x%x (len = %d)",
|
||||
pfx, op, sub, len);
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@
|
|||
#include <linux/netdevice.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <scsi/libfc.h>
|
||||
#include <scsi/libfcoe.h>
|
||||
#include <scsi/scsi_cmnd.h>
|
||||
#include <scsi/scsi_transport.h>
|
||||
#include <scsi/scsi_transport_fc.h>
|
||||
|
|
@ -346,8 +344,6 @@ struct fnic {
|
|||
enum fnic_role_e role;
|
||||
struct fnic_iport_s iport;
|
||||
struct Scsi_Host *host;
|
||||
struct fc_lport *lport;
|
||||
struct fcoe_ctlr ctlr; /* FIP FCoE controller structure */
|
||||
struct vnic_dev_bar bar0;
|
||||
|
||||
struct fnic_msix_entry msix[FNIC_MSIX_INTR_MAX];
|
||||
|
|
@ -380,9 +376,6 @@ struct fnic {
|
|||
u32 vlan_hw_insert:1; /* let hw insert the tag */
|
||||
u32 in_remove:1; /* fnic device in removal */
|
||||
u32 stop_rx_link_events:1; /* stop proc. rx frames, link events */
|
||||
u32 link_events:1; /* set when we get any link event*/
|
||||
|
||||
struct completion *remove_wait; /* device remove thread blocks */
|
||||
|
||||
struct completion *fw_reset_done;
|
||||
u32 reset_in_progress;
|
||||
|
|
@ -572,7 +565,7 @@ fnic_scsi_io_iter(struct fnic *fnic,
|
|||
.data1 = data1,
|
||||
.data2 = data2,
|
||||
};
|
||||
scsi_host_busy_iter(fnic->lport->host, fnic_io_iter_handler, &iter_data);
|
||||
scsi_host_busy_iter(fnic->host, fnic_io_iter_handler, &iter_data);
|
||||
}
|
||||
|
||||
#ifdef FNIC_DEBUG
|
||||
|
|
@ -582,7 +575,7 @@ fnic_debug_dump(struct fnic *fnic, uint8_t *u8arr, int len)
|
|||
int i;
|
||||
|
||||
for (i = 0; i < len; i = i+8) {
|
||||
FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"%d: %02x %02x %02x %02x %02x %02x %02x %02x", i / 8,
|
||||
u8arr[i + 0], u8arr[i + 1], u8arr[i + 2], u8arr[i + 3],
|
||||
u8arr[i + 4], u8arr[i + 5], u8arr[i + 6], u8arr[i + 7]);
|
||||
|
|
@ -597,7 +590,7 @@ fnic_debug_dump_fc_frame(struct fnic *fnic, struct fc_frame_header *fchdr,
|
|||
|
||||
s_id = ntoh24(fchdr->fh_s_id);
|
||||
d_id = ntoh24(fchdr->fh_d_id);
|
||||
FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"%s packet contents: sid/did/type/oxid = 0x%x/0x%x/0x%x/0x%x (len = %d)\n",
|
||||
pfx, s_id, d_id, fchdr->fh_type,
|
||||
FNIC_STD_GET_OX_ID(fchdr), len);
|
||||
|
|
|
|||
|
|
@ -682,7 +682,7 @@ int fnic_stats_debugfs_init(struct fnic *fnic)
|
|||
int rc = -1;
|
||||
char name[16];
|
||||
|
||||
snprintf(name, sizeof(name), "host%d", fnic->lport->host->host_no);
|
||||
snprintf(name, sizeof(name), "host%d", fnic->host->host_no);
|
||||
|
||||
if (!fnic_stats_debugfs_root) {
|
||||
pr_debug("fnic_stats root doesn't exist\n");
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
#include <scsi/fc/fc_fip.h>
|
||||
#include <scsi/fc/fc_els.h>
|
||||
#include <scsi/fc_frame.h>
|
||||
#include <scsi/libfc.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <scsi/scsi_transport_fc.h>
|
||||
#include "fnic_io.h"
|
||||
#include "fnic.h"
|
||||
|
|
@ -40,7 +40,7 @@ static uint8_t FCOE_ALL_FCF_MAC[6] = FC_FCOE_FLOGI_MAC;
|
|||
static inline void fnic_fdls_set_fcoe_srcmac(struct fnic *fnic,
|
||||
uint8_t *src_mac)
|
||||
{
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Setting src mac: %02x:%02x:%02x:%02x:%02x:%02x",
|
||||
src_mac[0], src_mac[1], src_mac[2], src_mac[3],
|
||||
src_mac[4], src_mac[5]);
|
||||
|
|
@ -55,7 +55,7 @@ static inline void fnic_fdls_set_fcoe_srcmac(struct fnic *fnic,
|
|||
static inline void fnic_fdls_set_fcoe_dstmac(struct fnic *fnic,
|
||||
uint8_t *dst_mac)
|
||||
{
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Setting dst mac: %02x:%02x:%02x:%02x:%02x:%02x",
|
||||
dst_mac[0], dst_mac[1], dst_mac[2], dst_mac[3],
|
||||
dst_mac[4], dst_mac[5]);
|
||||
|
|
@ -83,7 +83,7 @@ void fnic_fdls_link_status_change(struct fnic *fnic, int linkup)
|
|||
{
|
||||
struct fnic_iport_s *iport = &fnic->iport;
|
||||
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"link up: %d, usefip: %d", linkup, iport->usefip);
|
||||
|
||||
spin_lock_irqsave(&fnic->fnic_lock, fnic->lock_flags);
|
||||
|
|
@ -91,12 +91,12 @@ void fnic_fdls_link_status_change(struct fnic *fnic, int linkup)
|
|||
if (linkup) {
|
||||
if (iport->usefip) {
|
||||
iport->state = FNIC_IPORT_STATE_FIP;
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"link up: %d, usefip: %d", linkup, iport->usefip);
|
||||
fnic_fcoe_send_vlan_req(fnic);
|
||||
} else {
|
||||
iport->state = FNIC_IPORT_STATE_FABRIC_DISC;
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"iport->state: %d", iport->state);
|
||||
fnic_fdls_disc_start(iport);
|
||||
}
|
||||
|
|
@ -126,13 +126,13 @@ void fnic_fdls_learn_fcoe_macs(struct fnic_iport_s *iport, void *rx_frame,
|
|||
|
||||
memcpy(&fcmac[3], fcid, 3);
|
||||
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"learn fcoe: dst_mac: %02x:%02x:%02x:%02x:%02x:%02x",
|
||||
ethhdr->h_dest[0], ethhdr->h_dest[1],
|
||||
ethhdr->h_dest[2], ethhdr->h_dest[3],
|
||||
ethhdr->h_dest[4], ethhdr->h_dest[5]);
|
||||
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"learn fcoe: fc_mac: %02x:%02x:%02x:%02x:%02x:%02x",
|
||||
fcmac[0], fcmac[1], fcmac[2], fcmac[3], fcmac[4],
|
||||
fcmac[5]);
|
||||
|
|
@ -150,7 +150,7 @@ void fnic_fdls_init(struct fnic *fnic, int usefip)
|
|||
iport->fnic = fnic;
|
||||
iport->usefip = usefip;
|
||||
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"iportsrcmac: %02x:%02x:%02x:%02x:%02x:%02x",
|
||||
iport->hwmac[0], iport->hwmac[1], iport->hwmac[2],
|
||||
iport->hwmac[3], iport->hwmac[4], iport->hwmac[5]);
|
||||
|
|
@ -169,14 +169,14 @@ void fnic_handle_link(struct work_struct *work)
|
|||
int max_count = 0;
|
||||
|
||||
if (vnic_dev_get_intr_mode(fnic->vdev) != VNIC_DEV_INTR_MODE_MSI)
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Interrupt mode is not MSI\n");
|
||||
|
||||
spin_lock_irqsave(&fnic->fnic_lock, fnic->lock_flags);
|
||||
|
||||
if (fnic->stop_rx_link_events) {
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Stop link rx events\n");
|
||||
return;
|
||||
}
|
||||
|
|
@ -185,10 +185,10 @@ void fnic_handle_link(struct work_struct *work)
|
|||
if ((fnic->state != FNIC_IN_ETH_MODE)
|
||||
&& (fnic->state != FNIC_IN_FC_MODE)) {
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"fnic in transitional state: %d. link up: %d ignored",
|
||||
fnic->state, vnic_dev_link_status(fnic->vdev));
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Current link status: %d iport state: %d\n",
|
||||
fnic->link_status, fnic->iport.state);
|
||||
return;
|
||||
|
|
@ -200,36 +200,36 @@ void fnic_handle_link(struct work_struct *work)
|
|||
fnic->link_down_cnt = vnic_dev_link_down_cnt(fnic->vdev);
|
||||
|
||||
while (fnic->reset_in_progress == IN_PROGRESS) {
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"fnic reset in progress. Link event needs to wait\n");
|
||||
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"waiting for reset completion\n");
|
||||
wait_for_completion_timeout(&fnic->reset_completion_wait,
|
||||
msecs_to_jiffies(5000));
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"woken up from reset completion wait\n");
|
||||
spin_lock_irqsave(&fnic->fnic_lock, fnic->lock_flags);
|
||||
|
||||
max_count++;
|
||||
if (max_count >= MAX_RESET_WAIT_COUNT) {
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Rstth waited for too long. Skipping handle link event\n");
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
|
||||
return;
|
||||
}
|
||||
}
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Marking fnic reset in progress\n");
|
||||
fnic->reset_in_progress = IN_PROGRESS;
|
||||
|
||||
if ((vnic_dev_get_intr_mode(fnic->vdev) != VNIC_DEV_INTR_MODE_MSI) ||
|
||||
(fnic->link_status != old_link_status)) {
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"old link status: %d link status: %d\n",
|
||||
old_link_status, (int) fnic->link_status);
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"old down count %d down count: %d\n",
|
||||
old_link_down_cnt, (int) fnic->link_down_cnt);
|
||||
}
|
||||
|
|
@ -238,36 +238,36 @@ void fnic_handle_link(struct work_struct *work)
|
|||
if (!fnic->link_status) {
|
||||
/* DOWN -> DOWN */
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"down->down\n");
|
||||
} else {
|
||||
if (old_link_down_cnt != fnic->link_down_cnt) {
|
||||
/* UP -> DOWN -> UP */
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"up->down. Link down\n");
|
||||
fnic_fdls_link_status_change(fnic, 0);
|
||||
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"down->up. Link up\n");
|
||||
fnic_fdls_link_status_change(fnic, 1);
|
||||
} else {
|
||||
/* UP -> UP */
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"up->up\n");
|
||||
}
|
||||
}
|
||||
} else if (fnic->link_status) {
|
||||
/* DOWN -> UP */
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"down->up. Link up\n");
|
||||
fnic_fdls_link_status_change(fnic, 1);
|
||||
} else {
|
||||
/* UP -> DOWN */
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"up->down. Link down\n");
|
||||
fnic_fdls_link_status_change(fnic, 0);
|
||||
}
|
||||
|
|
@ -276,14 +276,11 @@ void fnic_handle_link(struct work_struct *work)
|
|||
fnic->reset_in_progress = NOT_IN_PROGRESS;
|
||||
complete(&fnic->reset_completion_wait);
|
||||
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Marking fnic reset completion\n");
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function passes incoming fabric frames to libFC
|
||||
*/
|
||||
void fnic_handle_frame(struct work_struct *work)
|
||||
{
|
||||
struct fnic *fnic = container_of(work, struct fnic, frame_work);
|
||||
|
|
@ -306,7 +303,7 @@ void fnic_handle_frame(struct work_struct *work)
|
|||
*/
|
||||
if (fnic->state != FNIC_IN_FC_MODE &&
|
||||
fnic->state != FNIC_IN_ETH_MODE) {
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Cannot process frame in transitional state\n");
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
|
||||
return;
|
||||
|
|
@ -332,7 +329,7 @@ void fnic_handle_fip_frame(struct work_struct *work)
|
|||
struct fnic_frame_list *cur_frame, *next;
|
||||
struct fnic *fnic = container_of(work, struct fnic, fip_frame_work);
|
||||
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Processing FIP frame\n");
|
||||
|
||||
spin_lock_irqsave(&fnic->fnic_lock, fnic->lock_flags);
|
||||
|
|
@ -411,7 +408,7 @@ void fnic_update_mac_locked(struct fnic *fnic, u8 *new)
|
|||
if (ether_addr_equal(data, new))
|
||||
return;
|
||||
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Update MAC: %u\n", *new);
|
||||
|
||||
if (!is_zero_ether_addr(data) && !ether_addr_equal(data, ctl))
|
||||
|
|
@ -481,7 +478,7 @@ static void fnic_rq_cmpl_frame_recv(struct vnic_rq *rq, struct cq_desc
|
|||
|
||||
if (!fcs_ok) {
|
||||
atomic64_inc(&fnic_stats->misc_stats.frame_errors);
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"fnic 0x%p fcs error. Dropping packet.\n", fnic);
|
||||
goto drop;
|
||||
}
|
||||
|
|
@ -491,21 +488,21 @@ static void fnic_rq_cmpl_frame_recv(struct vnic_rq *rq, struct cq_desc
|
|||
if (fnic_import_rq_eth_pkt(fnic, fp))
|
||||
return;
|
||||
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Dropping h_proto 0x%x",
|
||||
be16_to_cpu(eh->h_proto));
|
||||
goto drop;
|
||||
}
|
||||
} else {
|
||||
/* wrong CQ type */
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"fnic rq_cmpl wrong cq type x%x\n", type);
|
||||
goto drop;
|
||||
}
|
||||
|
||||
if (!fcs_ok || packet_error || !fcoe_fnic_crc_ok || fcoe_enc_error) {
|
||||
atomic64_inc(&fnic_stats->misc_stats.frame_errors);
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"fcoe %x fcsok %x pkterr %x ffco %x fee %x\n",
|
||||
fcoe, fcs_ok, packet_error,
|
||||
fcoe_fnic_crc_ok, fcoe_enc_error);
|
||||
|
|
@ -515,7 +512,7 @@ static void fnic_rq_cmpl_frame_recv(struct vnic_rq *rq, struct cq_desc
|
|||
spin_lock_irqsave(&fnic->fnic_lock, flags);
|
||||
if (fnic->stop_rx_link_events) {
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"fnic->stop_rx_link_events: %d\n",
|
||||
fnic->stop_rx_link_events);
|
||||
goto drop;
|
||||
|
|
@ -526,7 +523,7 @@ static void fnic_rq_cmpl_frame_recv(struct vnic_rq *rq, struct cq_desc
|
|||
frame_elem = mempool_alloc(fnic->frame_elem_pool,
|
||||
GFP_ATOMIC | __GFP_ZERO);
|
||||
if (!frame_elem) {
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Failed to allocate memory for frame elem");
|
||||
goto drop;
|
||||
}
|
||||
|
|
@ -571,7 +568,7 @@ int fnic_rq_cmpl_handler(struct fnic *fnic, int rq_work_to_do)
|
|||
if (cur_work_done && fnic->stop_rx_link_events != 1) {
|
||||
err = vnic_rq_fill(&fnic->rq[i], fnic_alloc_rq_frame);
|
||||
if (err)
|
||||
shost_printk(KERN_ERR, fnic->lport->host,
|
||||
shost_printk(KERN_ERR, fnic->host,
|
||||
"fnic_alloc_rq_frame can't alloc"
|
||||
" frame\n");
|
||||
}
|
||||
|
|
@ -597,7 +594,7 @@ int fnic_alloc_rq_frame(struct vnic_rq *rq)
|
|||
len = FNIC_FRAME_HT_ROOM;
|
||||
buf = kmalloc(len, GFP_ATOMIC);
|
||||
if (!buf) {
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Unable to allocate RQ buffer of size: %d\n", len);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
|
@ -605,7 +602,7 @@ int fnic_alloc_rq_frame(struct vnic_rq *rq)
|
|||
pa = dma_map_single(&fnic->pdev->dev, buf, len, DMA_FROM_DEVICE);
|
||||
if (dma_mapping_error(&fnic->pdev->dev, pa)) {
|
||||
ret = -ENOMEM;
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"PCI mapping failed with error %d\n", ret);
|
||||
goto free_buf;
|
||||
}
|
||||
|
|
@ -644,7 +641,7 @@ static int fnic_send_frame(struct fnic *fnic, void *frame, int frame_len)
|
|||
if ((fnic_fc_trace_set_data(fnic->fnic_num,
|
||||
FNIC_FC_SEND | 0x80, (char *) frame,
|
||||
frame_len)) != 0) {
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"fnic ctlr frame trace error");
|
||||
}
|
||||
|
||||
|
|
@ -652,7 +649,7 @@ static int fnic_send_frame(struct fnic *fnic, void *frame, int frame_len)
|
|||
|
||||
if (!vnic_wq_desc_avail(wq)) {
|
||||
dma_unmap_single(&fnic->pdev->dev, pa, frame_len, DMA_TO_DEVICE);
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"vnic work queue descriptor is not available");
|
||||
ret = -1;
|
||||
goto fnic_send_frame_end;
|
||||
|
|
@ -694,7 +691,6 @@ fdls_send_fcoe_frame(struct fnic *fnic, void *frame, int frame_size,
|
|||
|
||||
pethhdr = (struct ethhdr *) frame;
|
||||
pethhdr->h_proto = cpu_to_be16(ETH_P_FCOE);
|
||||
|
||||
memcpy(pethhdr->h_source, srcmac, ETH_ALEN);
|
||||
memcpy(pethhdr->h_dest, dstmac, ETH_ALEN);
|
||||
|
||||
|
|
@ -710,16 +706,15 @@ fdls_send_fcoe_frame(struct fnic *fnic, void *frame, int frame_size,
|
|||
frame_elem = mempool_alloc(fnic->frame_elem_pool,
|
||||
GFP_ATOMIC | __GFP_ZERO);
|
||||
if (!frame_elem) {
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Failed to allocate memory for frame elem");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"Queueing FC frame: sid/did/type/oxid = 0x%x/0x%x/0x%x/0x%x\n",
|
||||
ntoh24(fchdr->fh_s_id), ntoh24(fchdr->fh_d_id),
|
||||
fchdr->fh_type, FNIC_STD_GET_OX_ID(fchdr));
|
||||
|
||||
frame_elem->fp = frame;
|
||||
frame_elem->frame_len = len;
|
||||
list_add_tail(&frame_elem->links, &fnic->tx_queue);
|
||||
|
|
@ -782,7 +777,7 @@ void fnic_flush_tx(struct work_struct *work)
|
|||
struct fc_frame *fp;
|
||||
struct fnic_frame_list *cur_frame, *next;
|
||||
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Flush queued frames");
|
||||
|
||||
list_for_each_entry_safe(cur_frame, next, &fnic->tx_queue, links) {
|
||||
|
|
@ -801,7 +796,7 @@ fnic_fdls_register_portid(struct fnic_iport_s *iport, u32 port_id,
|
|||
struct ethhdr *ethhdr;
|
||||
int ret;
|
||||
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Setting port id: 0x%x fp: 0x%p fnic state: %d", port_id,
|
||||
fp, fnic->state);
|
||||
|
||||
|
|
@ -814,7 +809,7 @@ fnic_fdls_register_portid(struct fnic_iport_s *iport, u32 port_id,
|
|||
if (fnic->state == FNIC_IN_ETH_MODE || fnic->state == FNIC_IN_FC_MODE)
|
||||
fnic->state = FNIC_IN_ETH_TRANS_FC_MODE;
|
||||
else {
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Unexpected fnic state while processing FLOGI response\n");
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -825,7 +820,7 @@ fnic_fdls_register_portid(struct fnic_iport_s *iport, u32 port_id,
|
|||
*/
|
||||
ret = fnic_flogi_reg_handler(fnic, port_id);
|
||||
if (ret < 0) {
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"FLOGI registration error ret: %d fnic state: %d\n",
|
||||
ret, fnic->state);
|
||||
if (fnic->state == FNIC_IN_ETH_TRANS_FC_MODE)
|
||||
|
|
@ -835,7 +830,7 @@ fnic_fdls_register_portid(struct fnic_iport_s *iport, u32 port_id,
|
|||
}
|
||||
iport->fabric.flags |= FNIC_FDLS_FPMA_LEARNT;
|
||||
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"FLOGI registration success\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -915,7 +910,7 @@ fnic_fdls_add_tport(struct fnic_iport_s *iport, struct fnic_tport_s *tport,
|
|||
struct fc_rport_identifiers ids;
|
||||
struct rport_dd_data_s *rdd_data;
|
||||
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Adding rport fcid: 0x%x", tport->fcid);
|
||||
|
||||
ids.node_name = tport->wwnn;
|
||||
|
|
@ -924,15 +919,15 @@ fnic_fdls_add_tport(struct fnic_iport_s *iport, struct fnic_tport_s *tport,
|
|||
ids.roles = FC_RPORT_ROLE_FCP_TARGET;
|
||||
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
|
||||
rport = fc_remote_port_add(fnic->lport->host, 0, &ids);
|
||||
rport = fc_remote_port_add(fnic->host, 0, &ids);
|
||||
spin_lock_irqsave(&fnic->fnic_lock, flags);
|
||||
if (!rport) {
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Failed to add rport for tport: 0x%x", tport->fcid);
|
||||
return;
|
||||
}
|
||||
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Added rport fcid: 0x%x", tport->fcid);
|
||||
|
||||
/* Mimic these assignments in queuecommand to avoid timing issues */
|
||||
|
|
@ -971,7 +966,7 @@ fnic_fdls_remove_tport(struct fnic_iport_s *iport,
|
|||
fc_remote_port_delete(rport);
|
||||
|
||||
spin_lock_irqsave(&fnic->fnic_lock, flags);
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Deregistered and freed tport fcid: 0x%x from scsi transport fc",
|
||||
tport->fcid);
|
||||
|
||||
|
|
@ -998,7 +993,7 @@ void fnic_delete_fcp_tports(struct fnic *fnic)
|
|||
|
||||
spin_lock_irqsave(&fnic->fnic_lock, flags);
|
||||
list_for_each_entry_safe(tport, next, &fnic->iport.tport_list, links) {
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"removing fcp rport fcid: 0x%x", tport->fcid);
|
||||
fdls_set_tport_state(tport, FDLS_TGT_STATE_OFFLINING);
|
||||
fnic_del_tport_timer_sync(fnic, tport);
|
||||
|
|
@ -1025,36 +1020,36 @@ void fnic_tport_event_handler(struct work_struct *work)
|
|||
tport = cur_evt->arg1;
|
||||
switch (cur_evt->event) {
|
||||
case TGT_EV_RPORT_ADD:
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Add rport event");
|
||||
if (tport->state == FDLS_TGT_STATE_READY) {
|
||||
fnic_fdls_add_tport(&fnic->iport,
|
||||
(struct fnic_tport_s *) cur_evt->arg1, flags);
|
||||
} else {
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Target not ready. Add rport event dropped: 0x%x",
|
||||
tport->fcid);
|
||||
}
|
||||
break;
|
||||
case TGT_EV_RPORT_DEL:
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Remove rport event");
|
||||
if (tport->state == FDLS_TGT_STATE_OFFLINING) {
|
||||
fnic_fdls_remove_tport(&fnic->iport,
|
||||
(struct fnic_tport_s *) cur_evt->arg1, flags);
|
||||
} else {
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"remove rport event dropped tport fcid: 0x%x",
|
||||
tport->fcid);
|
||||
}
|
||||
break;
|
||||
case TGT_EV_TPORT_DELETE:
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Delete tport event");
|
||||
fdls_delete_tport(tport->iport, tport);
|
||||
break;
|
||||
default:
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_FCS_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Unknown tport event");
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include <linux/errno.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <scsi/libfc.h>
|
||||
#include <scsi/scsi_transport_fc.h>
|
||||
#include <scsi/fc_frame.h>
|
||||
#include "vnic_dev.h"
|
||||
#include "vnic_intr.h"
|
||||
|
|
@ -222,7 +222,7 @@ int fnic_request_intr(struct fnic *fnic)
|
|||
fnic->msix[i].devname,
|
||||
fnic->msix[i].devid);
|
||||
if (err) {
|
||||
FNIC_ISR_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_ISR_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"request_irq failed with error: %d\n",
|
||||
err);
|
||||
fnic_free_intr(fnic);
|
||||
|
|
@ -250,10 +250,10 @@ int fnic_set_intr_mode_msix(struct fnic *fnic)
|
|||
* We need n RQs, m WQs, o Copy WQs, n+m+o CQs, and n+m+o+1 INTRs
|
||||
* (last INTR is used for WQ/RQ errors and notification area)
|
||||
*/
|
||||
FNIC_ISR_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_ISR_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"rq-array size: %d wq-array size: %d copy-wq array size: %d\n",
|
||||
n, m, o);
|
||||
FNIC_ISR_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_ISR_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"rq_count: %d raw_wq_count: %d wq_copy_count: %d cq_count: %d\n",
|
||||
fnic->rq_count, fnic->raw_wq_count,
|
||||
fnic->wq_copy_count, fnic->cq_count);
|
||||
|
|
@ -265,17 +265,17 @@ int fnic_set_intr_mode_msix(struct fnic *fnic)
|
|||
|
||||
vec_count = pci_alloc_irq_vectors(fnic->pdev, min_irqs, vecs,
|
||||
PCI_IRQ_MSIX | PCI_IRQ_AFFINITY);
|
||||
FNIC_ISR_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_ISR_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"allocated %d MSI-X vectors\n",
|
||||
vec_count);
|
||||
|
||||
if (vec_count > 0) {
|
||||
if (vec_count < vecs) {
|
||||
FNIC_ISR_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_ISR_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"interrupts number mismatch: vec_count: %d vecs: %d\n",
|
||||
vec_count, vecs);
|
||||
if (vec_count < min_irqs) {
|
||||
FNIC_ISR_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_ISR_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"no interrupts for copy wq\n");
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -287,7 +287,7 @@ int fnic_set_intr_mode_msix(struct fnic *fnic)
|
|||
fnic->wq_copy_count = vec_count - n - m - 1;
|
||||
fnic->wq_count = fnic->raw_wq_count + fnic->wq_copy_count;
|
||||
if (fnic->cq_count != vec_count - 1) {
|
||||
FNIC_ISR_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_ISR_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"CQ count: %d does not match MSI-X vector count: %d\n",
|
||||
fnic->cq_count, vec_count);
|
||||
fnic->cq_count = vec_count - 1;
|
||||
|
|
@ -295,23 +295,23 @@ int fnic_set_intr_mode_msix(struct fnic *fnic)
|
|||
fnic->intr_count = vec_count;
|
||||
fnic->err_intr_offset = fnic->rq_count + fnic->wq_count;
|
||||
|
||||
FNIC_ISR_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_ISR_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"rq_count: %d raw_wq_count: %d copy_wq_base: %d\n",
|
||||
fnic->rq_count,
|
||||
fnic->raw_wq_count, fnic->copy_wq_base);
|
||||
|
||||
FNIC_ISR_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_ISR_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"wq_copy_count: %d wq_count: %d cq_count: %d\n",
|
||||
fnic->wq_copy_count,
|
||||
fnic->wq_count, fnic->cq_count);
|
||||
|
||||
FNIC_ISR_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_ISR_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"intr_count: %d err_intr_offset: %u",
|
||||
fnic->intr_count,
|
||||
fnic->err_intr_offset);
|
||||
|
||||
vnic_dev_set_intr_mode(fnic->vdev, VNIC_DEV_INTR_MODE_MSIX);
|
||||
FNIC_ISR_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_ISR_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"fnic using MSI-X\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -351,7 +351,7 @@ int fnic_set_intr_mode(struct fnic *fnic)
|
|||
fnic->intr_count = 1;
|
||||
fnic->err_intr_offset = 0;
|
||||
|
||||
FNIC_ISR_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_ISR_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"Using MSI Interrupts\n");
|
||||
vnic_dev_set_intr_mode(fnic->vdev, VNIC_DEV_INTR_MODE_MSI);
|
||||
|
||||
|
|
@ -377,7 +377,7 @@ int fnic_set_intr_mode(struct fnic *fnic)
|
|||
fnic->cq_count = 3;
|
||||
fnic->intr_count = 3;
|
||||
|
||||
FNIC_ISR_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_ISR_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"Using Legacy Interrupts\n");
|
||||
vnic_dev_set_intr_mode(fnic->vdev, VNIC_DEV_INTR_MODE_INTX);
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
#include <scsi/scsi_transport.h>
|
||||
#include <scsi/scsi_transport_fc.h>
|
||||
#include <scsi/scsi_tcq.h>
|
||||
#include <scsi/libfc.h>
|
||||
#include <scsi/fc_frame.h>
|
||||
|
||||
#include "vnic_dev.h"
|
||||
|
|
@ -176,7 +175,7 @@ static void fnic_get_host_speed(struct Scsi_Host *shost)
|
|||
u32 port_speed = vnic_dev_port_speed(fnic->vdev);
|
||||
struct fnic_stats *fnic_stats = &fnic->fnic_stats;
|
||||
|
||||
FNIC_MAIN_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_MAIN_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"port_speed: %d Mbps", port_speed);
|
||||
atomic64_set(&fnic_stats->misc_stats.port_speed_in_mbps, port_speed);
|
||||
|
||||
|
|
@ -226,7 +225,7 @@ static void fnic_get_host_speed(struct Scsi_Host *shost)
|
|||
fc_host_speed(shost) = FC_PORTSPEED_128GBIT;
|
||||
break;
|
||||
default:
|
||||
FNIC_MAIN_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_MAIN_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Unknown FC speed: %d Mbps", port_speed);
|
||||
fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
|
||||
break;
|
||||
|
|
@ -252,7 +251,7 @@ static struct fc_host_statistics *fnic_get_stats(struct Scsi_Host *host)
|
|||
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
|
||||
|
||||
if (ret) {
|
||||
FNIC_MAIN_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_MAIN_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"fnic: Get vnic stats failed: 0x%x", ret);
|
||||
return stats;
|
||||
}
|
||||
|
|
@ -361,7 +360,7 @@ static void fnic_reset_host_stats(struct Scsi_Host *host)
|
|||
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
|
||||
|
||||
if (ret) {
|
||||
FNIC_MAIN_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_MAIN_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"fnic: Reset vnic stats failed"
|
||||
" 0x%x", ret);
|
||||
return;
|
||||
|
|
@ -565,7 +564,7 @@ static void fnic_set_vlan(struct fnic *fnic, u16 vlan_id)
|
|||
|
||||
static void fnic_scsi_init(struct fnic *fnic)
|
||||
{
|
||||
struct Scsi_Host *host = fnic->lport->host;
|
||||
struct Scsi_Host *host = fnic->host;
|
||||
|
||||
snprintf(fnic->name, sizeof(fnic->name) - 1, "%s%d", DRV_NAME,
|
||||
host->host_no);
|
||||
|
|
@ -575,7 +574,7 @@ static void fnic_scsi_init(struct fnic *fnic)
|
|||
|
||||
static int fnic_scsi_drv_init(struct fnic *fnic)
|
||||
{
|
||||
struct Scsi_Host *host = fnic->lport->host;
|
||||
struct Scsi_Host *host = fnic->host;
|
||||
int err;
|
||||
struct pci_dev *pdev = fnic->pdev;
|
||||
struct fnic_iport_s *iport = &fnic->iport;
|
||||
|
|
@ -612,41 +611,41 @@ static int fnic_scsi_drv_init(struct fnic *fnic)
|
|||
|
||||
fnic_scsi_init(fnic);
|
||||
|
||||
err = scsi_add_host(fnic->lport->host, &pdev->dev);
|
||||
err = scsi_add_host(fnic->host, &pdev->dev);
|
||||
if (err) {
|
||||
dev_err(&fnic->pdev->dev, "fnic: scsi add host failed: aborting\n");
|
||||
return -1;
|
||||
}
|
||||
fc_host_maxframe_size(fnic->lport->host) = iport->max_payload_size;
|
||||
fc_host_dev_loss_tmo(fnic->lport->host) =
|
||||
fc_host_maxframe_size(fnic->host) = iport->max_payload_size;
|
||||
fc_host_dev_loss_tmo(fnic->host) =
|
||||
fnic->config.port_down_timeout / 1000;
|
||||
sprintf(fc_host_symbolic_name(fnic->lport->host),
|
||||
sprintf(fc_host_symbolic_name(fnic->host),
|
||||
DRV_NAME " v" DRV_VERSION " over %s", fnic->name);
|
||||
fc_host_port_type(fnic->lport->host) = FC_PORTTYPE_NPORT;
|
||||
fc_host_node_name(fnic->lport->host) = iport->wwnn;
|
||||
fc_host_port_name(fnic->lport->host) = iport->wwpn;
|
||||
fc_host_supported_classes(fnic->lport->host) = FC_COS_CLASS3;
|
||||
memset(fc_host_supported_fc4s(fnic->lport->host), 0,
|
||||
sizeof(fc_host_supported_fc4s(fnic->lport->host)));
|
||||
fc_host_supported_fc4s(fnic->lport->host)[2] = 1;
|
||||
fc_host_supported_fc4s(fnic->lport->host)[7] = 1;
|
||||
fc_host_supported_speeds(fnic->lport->host) = 0;
|
||||
fc_host_supported_speeds(fnic->lport->host) |= FC_PORTSPEED_8GBIT;
|
||||
fc_host_port_type(fnic->host) = FC_PORTTYPE_NPORT;
|
||||
fc_host_node_name(fnic->host) = iport->wwnn;
|
||||
fc_host_port_name(fnic->host) = iport->wwpn;
|
||||
fc_host_supported_classes(fnic->host) = FC_COS_CLASS3;
|
||||
memset(fc_host_supported_fc4s(fnic->host), 0,
|
||||
sizeof(fc_host_supported_fc4s(fnic->host)));
|
||||
fc_host_supported_fc4s(fnic->host)[2] = 1;
|
||||
fc_host_supported_fc4s(fnic->host)[7] = 1;
|
||||
fc_host_supported_speeds(fnic->host) = 0;
|
||||
fc_host_supported_speeds(fnic->host) |= FC_PORTSPEED_8GBIT;
|
||||
|
||||
dev_info(&fnic->pdev->dev, "shost_data: 0x%p\n", fnic->lport->host->shost_data);
|
||||
if (fnic->lport->host->shost_data != NULL) {
|
||||
dev_info(&fnic->pdev->dev, "shost_data: 0x%p\n", fnic->host->shost_data);
|
||||
if (fnic->host->shost_data != NULL) {
|
||||
if (fnic_tgt_id_binding == 0) {
|
||||
dev_info(&fnic->pdev->dev, "Setting target binding to NONE\n");
|
||||
fc_host_tgtid_bind_type(fnic->lport->host) = FC_TGTID_BIND_NONE;
|
||||
fc_host_tgtid_bind_type(fnic->host) = FC_TGTID_BIND_NONE;
|
||||
} else {
|
||||
dev_info(&fnic->pdev->dev, "Setting target binding to WWPN\n");
|
||||
fc_host_tgtid_bind_type(fnic->lport->host) = FC_TGTID_BIND_BY_WWPN;
|
||||
fc_host_tgtid_bind_type(fnic->host) = FC_TGTID_BIND_BY_WWPN;
|
||||
}
|
||||
}
|
||||
|
||||
fnic->io_req_pool = mempool_create_slab_pool(2, fnic_io_req_cache);
|
||||
if (!fnic->io_req_pool) {
|
||||
scsi_remove_host(fnic->lport->host);
|
||||
scsi_remove_host(fnic->host);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
|
@ -661,16 +660,16 @@ void fnic_mq_map_queues_cpus(struct Scsi_Host *host)
|
|||
struct blk_mq_queue_map *qmap = &host->tag_set.map[HCTX_TYPE_DEFAULT];
|
||||
|
||||
if (intr_mode == VNIC_DEV_INTR_MODE_MSI || intr_mode == VNIC_DEV_INTR_MODE_INTX) {
|
||||
FNIC_MAIN_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_MAIN_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"intr_mode is not msix\n");
|
||||
return;
|
||||
}
|
||||
|
||||
FNIC_MAIN_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_MAIN_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"qmap->nr_queues: %d\n", qmap->nr_queues);
|
||||
|
||||
if (l_pdev == NULL) {
|
||||
FNIC_MAIN_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_MAIN_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"l_pdev is null\n");
|
||||
return;
|
||||
}
|
||||
|
|
@ -832,7 +831,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
}
|
||||
*((struct fnic **) shost_priv(host)) = fnic;
|
||||
|
||||
fnic->lport->host = host;
|
||||
fnic->host = host;
|
||||
fnic->role = FNIC_ROLE_FCP_INITIATOR;
|
||||
dev_info(&fnic->pdev->dev, "fnic: %d is scsi initiator\n",
|
||||
fnic->fnic_num);
|
||||
|
|
@ -1042,7 +1041,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
|
||||
err_out_free_stats_debugfs:
|
||||
fnic_stats_debugfs_remove(fnic);
|
||||
scsi_remove_host(fnic->lport->host);
|
||||
scsi_remove_host(fnic->host);
|
||||
err_out_scsi_drv_init:
|
||||
fnic_free_intr(fnic);
|
||||
err_out_fnic_request_intr:
|
||||
|
|
@ -1067,7 +1066,7 @@ err_out_fnic_alloc_vnic_res:
|
|||
fnic_clear_intr_mode(fnic);
|
||||
err_out_fnic_set_intr_mode:
|
||||
if (IS_FNIC_FCP_INITIATOR(fnic))
|
||||
scsi_host_put(fnic->lport->host);
|
||||
scsi_host_put(fnic->host);
|
||||
err_out_fnic_role:
|
||||
err_out_scsi_host_alloc:
|
||||
err_out_fnic_get_config:
|
||||
|
|
@ -1164,7 +1163,7 @@ static void fnic_remove(struct pci_dev *pdev)
|
|||
ida_free(&fnic_ida, fnic->fnic_num);
|
||||
if (IS_FNIC_FCP_INITIATOR(fnic)) {
|
||||
fnic_scsi_unload_cleanup(fnic);
|
||||
scsi_host_put(fnic->lport->host);
|
||||
scsi_host_put(fnic->host);
|
||||
}
|
||||
kfree(fnic);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
#include <scsi/scsi_tcq.h>
|
||||
#include <scsi/fc/fc_els.h>
|
||||
#include <scsi/fc/fc_fcoe.h>
|
||||
#include <scsi/libfc.h>
|
||||
#include <scsi/fc_frame.h>
|
||||
#include <scsi/scsi_transport_fc.h>
|
||||
#include "fnic_io.h"
|
||||
|
|
@ -149,7 +148,7 @@ unsigned int fnic_count_ioreqs(struct fnic *fnic, u32 portid)
|
|||
fnic_scsi_io_iter(fnic, fnic_count_portid_ioreqs_iter,
|
||||
&portid, &count);
|
||||
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"portid = 0x%x count = %u\n", portid, count);
|
||||
return count;
|
||||
}
|
||||
|
|
@ -181,7 +180,7 @@ fnic_count_lun_ioreqs(struct fnic *fnic, struct scsi_device *scsi_device)
|
|||
fnic_scsi_io_iter(fnic, fnic_count_lun_ioreqs_iter,
|
||||
scsi_device, &count);
|
||||
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"lun = %p count = %u\n", scsi_device, count);
|
||||
return count;
|
||||
}
|
||||
|
|
@ -269,7 +268,7 @@ int fnic_fw_reset_handler(struct fnic *fnic)
|
|||
if (!vnic_wq_copy_desc_avail(wq))
|
||||
ret = -EAGAIN;
|
||||
else {
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"ioreq_count: %u\n", ioreq_count);
|
||||
fnic_queue_wq_copy_desc_fw_reset(wq, SCSI_NO_TAG);
|
||||
atomic64_inc(&fnic->fnic_stats.fw_stats.active_fw_reqs);
|
||||
|
|
@ -284,11 +283,11 @@ int fnic_fw_reset_handler(struct fnic *fnic)
|
|||
|
||||
if (!ret) {
|
||||
atomic64_inc(&fnic->fnic_stats.reset_stats.fw_resets);
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Issued fw reset\n");
|
||||
} else {
|
||||
fnic_clear_state_flags(fnic, FNIC_FLAGS_FWRESET);
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"Failed to issue fw reset\n");
|
||||
}
|
||||
|
||||
|
|
@ -327,13 +326,13 @@ int fnic_flogi_reg_handler(struct fnic *fnic, u32 fc_id)
|
|||
fc_id, gw_mac,
|
||||
fnic->iport.fpma,
|
||||
iport->r_a_tov, iport->e_d_tov);
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"FLOGI FIP reg issued fcid: 0x%x src %p dest %p\n",
|
||||
fc_id, fnic->iport.fpma, gw_mac);
|
||||
} else {
|
||||
fnic_queue_wq_copy_desc_flogi_reg(wq, SCSI_NO_TAG,
|
||||
format, fc_id, gw_mac);
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"FLOGI reg issued fcid 0x%x dest %p\n",
|
||||
fc_id, gw_mac);
|
||||
}
|
||||
|
|
@ -414,7 +413,7 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,
|
|||
free_wq_copy_descs(fnic, wq, hwq);
|
||||
|
||||
if (unlikely(!vnic_wq_copy_desc_avail(wq))) {
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"fnic_queue_wq_copy_desc failure - no descriptors\n");
|
||||
atomic64_inc(&misc_stats->io_cpwq_alloc_failures);
|
||||
return SCSI_MLQUEUE_HOST_BUSY;
|
||||
|
|
@ -479,7 +478,7 @@ int fnic_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc)
|
|||
|
||||
rport = starget_to_rport(scsi_target(sc->device));
|
||||
if (!rport) {
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"returning DID_NO_CONNECT for IO as rport is NULL\n");
|
||||
sc->result = DID_NO_CONNECT << 16;
|
||||
done(sc);
|
||||
|
|
@ -488,7 +487,7 @@ int fnic_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc)
|
|||
|
||||
ret = fc_remote_port_chkready(rport);
|
||||
if (ret) {
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"rport is not ready\n");
|
||||
atomic64_inc(&fnic_stats->misc_stats.tport_not_ready);
|
||||
sc->result = ret;
|
||||
|
|
@ -502,7 +501,7 @@ int fnic_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc)
|
|||
|
||||
if (iport->state != FNIC_IPORT_STATE_READY) {
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"returning DID_NO_CONNECT for IO as iport state: %d\n",
|
||||
iport->state);
|
||||
sc->result = DID_NO_CONNECT << 16;
|
||||
|
|
@ -516,13 +515,13 @@ int fnic_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc)
|
|||
rdd_data = rport->dd_data;
|
||||
tport = rdd_data->tport;
|
||||
if (!tport || (rdd_data->iport != iport)) {
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"dd_data not yet set in SCSI for rport portid: 0x%x\n",
|
||||
rport->port_id);
|
||||
tport = fnic_find_tport_by_fcid(iport, rport->port_id);
|
||||
if (!tport) {
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"returning DID_BUS_BUSY for IO as tport not found for: 0x%x\n",
|
||||
rport->port_id);
|
||||
sc->result = DID_BUS_BUSY << 16;
|
||||
|
|
@ -545,7 +544,7 @@ int fnic_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc)
|
|||
if ((tport->state != FDLS_TGT_STATE_READY)
|
||||
&& (tport->state != FDLS_TGT_STATE_ADISC)) {
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"returning DID_NO_CONNECT for IO as tport state: %d\n",
|
||||
tport->state);
|
||||
sc->result = DID_NO_CONNECT << 16;
|
||||
|
|
@ -565,7 +564,7 @@ int fnic_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc)
|
|||
|
||||
if (unlikely(fnic_chk_state_flags_locked(fnic, FNIC_FLAGS_FWRESET))) {
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"fnic flags FW reset: 0x%lx. Returning SCSI_MLQUEUE_HOST_BUSY\n",
|
||||
fnic->state_flags);
|
||||
return SCSI_MLQUEUE_HOST_BUSY;
|
||||
|
|
@ -707,7 +706,7 @@ out:
|
|||
atomic_dec(&tport->in_flight);
|
||||
|
||||
if (lun0_delay) {
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"LUN0 delay\n");
|
||||
mdelay(LUN0_DELAY_TIME);
|
||||
}
|
||||
|
|
@ -747,12 +746,12 @@ static int fnic_fcpio_fw_reset_cmpl_handler(struct fnic *fnic,
|
|||
if (fnic->state == FNIC_IN_FC_TRANS_ETH_MODE) {
|
||||
/* Check status of reset completion */
|
||||
if (!hdr_status) {
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"reset cmpl success\n");
|
||||
/* Ready to send flogi out */
|
||||
fnic->state = FNIC_IN_ETH_MODE;
|
||||
} else {
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"reset failed with header status: %s\n",
|
||||
fnic_fcpio_status_to_str(hdr_status));
|
||||
|
||||
|
|
@ -761,7 +760,7 @@ static int fnic_fcpio_fw_reset_cmpl_handler(struct fnic *fnic,
|
|||
ret = -1;
|
||||
}
|
||||
} else {
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"Unexpected state while processing reset completion: %s\n",
|
||||
fnic_state_to_str(fnic->state));
|
||||
atomic64_inc(&reset_stats->fw_reset_failures);
|
||||
|
|
@ -813,19 +812,19 @@ static int fnic_fcpio_flogi_reg_cmpl_handler(struct fnic *fnic,
|
|||
|
||||
/* Check flogi registration completion status */
|
||||
if (!hdr_status) {
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"FLOGI reg succeeded\n");
|
||||
fnic->state = FNIC_IN_FC_MODE;
|
||||
} else {
|
||||
FNIC_SCSI_DBG(KERN_DEBUG,
|
||||
fnic->lport->host, fnic->fnic_num,
|
||||
fnic->host, fnic->fnic_num,
|
||||
"fnic flogi reg failed: %s\n",
|
||||
fnic_fcpio_status_to_str(hdr_status));
|
||||
fnic->state = FNIC_IN_ETH_MODE;
|
||||
ret = -1;
|
||||
}
|
||||
} else {
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"Unexpected fnic state %s while"
|
||||
" processing flogi reg completion\n",
|
||||
fnic_state_to_str(fnic->state));
|
||||
|
|
@ -898,7 +897,7 @@ static inline void fnic_fcpio_ack_handler(struct fnic *fnic,
|
|||
|
||||
spin_unlock_irqrestore(&fnic->wq_copy_lock[wq_index], flags);
|
||||
FNIC_TRACE(fnic_fcpio_ack_handler,
|
||||
fnic->lport->host->host_no, 0, 0, ox_id_tag[2], ox_id_tag[3],
|
||||
fnic->host->host_no, 0, 0, ox_id_tag[2], ox_id_tag[3],
|
||||
ox_id_tag[4], ox_id_tag[5]);
|
||||
}
|
||||
|
||||
|
|
@ -936,36 +935,36 @@ static void fnic_fcpio_icmnd_cmpl_handler(struct fnic *fnic, unsigned int cq_ind
|
|||
hwq = blk_mq_unique_tag_to_hwq(mqtag);
|
||||
|
||||
if (hwq != cq_index) {
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"hwq: %d mqtag: 0x%x tag: 0x%x cq index: %d ",
|
||||
hwq, mqtag, tag, cq_index);
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"hdr status: %s icmnd completion on the wrong queue\n",
|
||||
fnic_fcpio_status_to_str(hdr_status));
|
||||
}
|
||||
|
||||
if (tag >= fnic->fnic_max_tag_id) {
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"hwq: %d mqtag: 0x%x tag: 0x%x cq index: %d ",
|
||||
hwq, mqtag, tag, cq_index);
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"hdr status: %s Out of range tag\n",
|
||||
fnic_fcpio_status_to_str(hdr_status));
|
||||
return;
|
||||
}
|
||||
spin_lock_irqsave(&fnic->wq_copy_lock[hwq], flags);
|
||||
|
||||
sc = scsi_host_find_tag(fnic->lport->host, id);
|
||||
sc = scsi_host_find_tag(fnic->host, id);
|
||||
WARN_ON_ONCE(!sc);
|
||||
if (!sc) {
|
||||
atomic64_inc(&fnic_stats->io_stats.sc_null);
|
||||
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
|
||||
shost_printk(KERN_ERR, fnic->lport->host,
|
||||
shost_printk(KERN_ERR, fnic->host,
|
||||
"icmnd_cmpl sc is null - "
|
||||
"hdr status = %s tag = 0x%x desc = 0x%p\n",
|
||||
fnic_fcpio_status_to_str(hdr_status), id, desc);
|
||||
FNIC_TRACE(fnic_fcpio_icmnd_cmpl_handler,
|
||||
fnic->lport->host->host_no, id,
|
||||
fnic->host->host_no, id,
|
||||
((u64)icmnd_cmpl->_resvd0[1] << 16 |
|
||||
(u64)icmnd_cmpl->_resvd0[0]),
|
||||
((u64)hdr_status << 16 |
|
||||
|
|
@ -988,7 +987,7 @@ static void fnic_fcpio_icmnd_cmpl_handler(struct fnic *fnic, unsigned int cq_ind
|
|||
atomic64_inc(&fnic_stats->io_stats.ioreq_null);
|
||||
fnic_priv(sc)->flags |= FNIC_IO_REQ_NULL;
|
||||
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
|
||||
shost_printk(KERN_ERR, fnic->lport->host,
|
||||
shost_printk(KERN_ERR, fnic->host,
|
||||
"icmnd_cmpl io_req is null - "
|
||||
"hdr status = %s tag = 0x%x sc 0x%p\n",
|
||||
fnic_fcpio_status_to_str(hdr_status), id, sc);
|
||||
|
|
@ -1015,7 +1014,7 @@ static void fnic_fcpio_icmnd_cmpl_handler(struct fnic *fnic, unsigned int cq_ind
|
|||
if(FCPIO_ABORTED == hdr_status)
|
||||
fnic_priv(sc)->flags |= FNIC_IO_ABORTED;
|
||||
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"icmnd_cmpl abts pending "
|
||||
"hdr status = %s tag = 0x%x sc = 0x%p "
|
||||
"scsi_status = %x residual = %d\n",
|
||||
|
|
@ -1047,7 +1046,7 @@ static void fnic_fcpio_icmnd_cmpl_handler(struct fnic *fnic, unsigned int cq_ind
|
|||
if (icmnd_cmpl->scsi_status == SAM_STAT_TASK_SET_FULL)
|
||||
atomic64_inc(&fnic_stats->misc_stats.queue_fulls);
|
||||
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"xfer_len: %llu", xfer_len);
|
||||
break;
|
||||
|
||||
|
|
@ -1110,7 +1109,7 @@ static void fnic_fcpio_icmnd_cmpl_handler(struct fnic *fnic, unsigned int cq_ind
|
|||
|
||||
if (hdr_status != FCPIO_SUCCESS) {
|
||||
atomic64_inc(&fnic_stats->io_stats.io_failures);
|
||||
shost_printk(KERN_ERR, fnic->lport->host, "hdr status = %s\n",
|
||||
shost_printk(KERN_ERR, fnic->host, "hdr status = %s\n",
|
||||
fnic_fcpio_status_to_str(hdr_status));
|
||||
}
|
||||
|
||||
|
|
@ -1203,27 +1202,27 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic *fnic, unsigned int cq_inde
|
|||
hwq = blk_mq_unique_tag_to_hwq(id & FNIC_TAG_MASK);
|
||||
|
||||
if (hwq != cq_index) {
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"hwq: %d mqtag: 0x%x tag: 0x%x cq index: %d ",
|
||||
hwq, mqtag, tag, cq_index);
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"hdr status: %s ITMF completion on the wrong queue\n",
|
||||
fnic_fcpio_status_to_str(hdr_status));
|
||||
}
|
||||
|
||||
if (tag > fnic->fnic_max_tag_id) {
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"hwq: %d mqtag: 0x%x tag: 0x%x cq index: %d ",
|
||||
hwq, mqtag, tag, cq_index);
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"hdr status: %s Tag out of range\n",
|
||||
fnic_fcpio_status_to_str(hdr_status));
|
||||
return;
|
||||
} else if ((tag == fnic->fnic_max_tag_id) && !(id & FNIC_TAG_DEV_RST)) {
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"hwq: %d mqtag: 0x%x tag: 0x%x cq index: %d ",
|
||||
hwq, mqtag, tag, cq_index);
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"hdr status: %s Tag out of range\n",
|
||||
fnic_fcpio_status_to_str(hdr_status));
|
||||
return;
|
||||
|
|
@ -1239,14 +1238,14 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic *fnic, unsigned int cq_inde
|
|||
if (io_req)
|
||||
sc = io_req->sc;
|
||||
} else {
|
||||
sc = scsi_host_find_tag(fnic->lport->host, id & FNIC_TAG_MASK);
|
||||
sc = scsi_host_find_tag(fnic->host, id & FNIC_TAG_MASK);
|
||||
}
|
||||
|
||||
WARN_ON_ONCE(!sc);
|
||||
if (!sc) {
|
||||
atomic64_inc(&fnic_stats->io_stats.sc_null);
|
||||
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
|
||||
shost_printk(KERN_ERR, fnic->lport->host,
|
||||
shost_printk(KERN_ERR, fnic->host,
|
||||
"itmf_cmpl sc is null - hdr status = %s tag = 0x%x\n",
|
||||
fnic_fcpio_status_to_str(hdr_status), tag);
|
||||
return;
|
||||
|
|
@ -1258,7 +1257,7 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic *fnic, unsigned int cq_inde
|
|||
atomic64_inc(&fnic_stats->io_stats.ioreq_null);
|
||||
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
|
||||
fnic_priv(sc)->flags |= FNIC_IO_ABT_TERM_REQ_NULL;
|
||||
shost_printk(KERN_ERR, fnic->lport->host,
|
||||
shost_printk(KERN_ERR, fnic->host,
|
||||
"itmf_cmpl io_req is null - "
|
||||
"hdr status = %s tag = 0x%x sc 0x%p\n",
|
||||
fnic_fcpio_status_to_str(hdr_status), tag, sc);
|
||||
|
|
@ -1269,7 +1268,7 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic *fnic, unsigned int cq_inde
|
|||
if ((id & FNIC_TAG_ABORT) && (id & FNIC_TAG_DEV_RST)) {
|
||||
/* Abort and terminate completion of device reset req */
|
||||
/* REVISIT : Add asserts about various flags */
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"hwq: %d mqtag: 0x%x tag: 0x%x hst: %s Abt/term completion received\n",
|
||||
hwq, mqtag, tag,
|
||||
fnic_fcpio_status_to_str(hdr_status));
|
||||
|
|
@ -1281,7 +1280,7 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic *fnic, unsigned int cq_inde
|
|||
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
|
||||
} else if (id & FNIC_TAG_ABORT) {
|
||||
/* Completion of abort cmd */
|
||||
shost_printk(KERN_DEBUG, fnic->lport->host,
|
||||
shost_printk(KERN_DEBUG, fnic->host,
|
||||
"hwq: %d mqtag: 0x%x tag: 0x%x Abort header status: %s\n",
|
||||
hwq, mqtag, tag,
|
||||
fnic_fcpio_status_to_str(hdr_status));
|
||||
|
|
@ -1296,7 +1295,7 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic *fnic, unsigned int cq_inde
|
|||
&term_stats->terminate_fw_timeouts);
|
||||
break;
|
||||
case FCPIO_ITMF_REJECTED:
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"abort reject recd. id %d\n",
|
||||
(int)(id & FNIC_TAG_MASK));
|
||||
break;
|
||||
|
|
@ -1331,7 +1330,7 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic *fnic, unsigned int cq_inde
|
|||
if (!(fnic_priv(sc)->flags & (FNIC_IO_ABORTED | FNIC_IO_DONE)))
|
||||
atomic64_inc(&misc_stats->no_icmnd_itmf_cmpls);
|
||||
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"abts cmpl recd. id %d status %s\n",
|
||||
(int)(id & FNIC_TAG_MASK),
|
||||
fnic_fcpio_status_to_str(hdr_status));
|
||||
|
|
@ -1344,11 +1343,11 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic *fnic, unsigned int cq_inde
|
|||
if (io_req->abts_done) {
|
||||
complete(io_req->abts_done);
|
||||
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
|
||||
shost_printk(KERN_INFO, fnic->lport->host,
|
||||
shost_printk(KERN_INFO, fnic->host,
|
||||
"hwq: %d mqtag: 0x%x tag: 0x%x Waking up abort thread\n",
|
||||
hwq, mqtag, tag);
|
||||
} else {
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"hwq: %d mqtag: 0x%x tag: 0x%x hst: %s Completing IO\n",
|
||||
hwq, mqtag,
|
||||
tag, fnic_fcpio_status_to_str(hdr_status));
|
||||
|
|
@ -1379,7 +1378,7 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic *fnic, unsigned int cq_inde
|
|||
}
|
||||
} else if (id & FNIC_TAG_DEV_RST) {
|
||||
/* Completion of device reset */
|
||||
shost_printk(KERN_INFO, fnic->lport->host,
|
||||
shost_printk(KERN_INFO, fnic->host,
|
||||
"hwq: %d mqtag: 0x%x tag: 0x%x DR hst: %s\n",
|
||||
hwq, mqtag,
|
||||
tag, fnic_fcpio_status_to_str(hdr_status));
|
||||
|
|
@ -1391,7 +1390,7 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic *fnic, unsigned int cq_inde
|
|||
sc->device->host->host_no, id, sc,
|
||||
jiffies_to_msecs(jiffies - start_time),
|
||||
desc, 0, fnic_flags_and_state(sc));
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"hwq: %d mqtag: 0x%x tag: 0x%x hst: %s Terminate pending\n",
|
||||
hwq, mqtag,
|
||||
tag, fnic_fcpio_status_to_str(hdr_status));
|
||||
|
|
@ -1404,7 +1403,7 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic *fnic, unsigned int cq_inde
|
|||
sc->device->host->host_no, id, sc,
|
||||
jiffies_to_msecs(jiffies - start_time),
|
||||
desc, 0, fnic_flags_and_state(sc));
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"dev reset cmpl recd after time out. "
|
||||
"id %d status %s\n",
|
||||
(int)(id & FNIC_TAG_MASK),
|
||||
|
|
@ -1413,7 +1412,7 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic *fnic, unsigned int cq_inde
|
|||
}
|
||||
fnic_priv(sc)->state = FNIC_IOREQ_CMD_COMPLETE;
|
||||
fnic_priv(sc)->flags |= FNIC_DEV_RST_DONE;
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"hwq: %d mqtag: 0x%x tag: 0x%x hst: %s DR completion received\n",
|
||||
hwq, mqtag,
|
||||
tag, fnic_fcpio_status_to_str(hdr_status));
|
||||
|
|
@ -1422,7 +1421,7 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic *fnic, unsigned int cq_inde
|
|||
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
|
||||
|
||||
} else {
|
||||
shost_printk(KERN_ERR, fnic->lport->host,
|
||||
shost_printk(KERN_ERR, fnic->host,
|
||||
"%s: Unexpected itmf io state: hwq: %d tag 0x%x %s\n",
|
||||
__func__, hwq, id, fnic_ioreq_state_to_str(fnic_priv(sc)->state));
|
||||
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
|
||||
|
|
@ -1477,7 +1476,7 @@ static int fnic_fcpio_cmpl_handler(struct vnic_dev *vdev,
|
|||
break;
|
||||
|
||||
default:
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"firmware completion type %d\n",
|
||||
desc->hdr.type);
|
||||
break;
|
||||
|
|
@ -1538,7 +1537,7 @@ static bool fnic_cleanup_io_iter(struct scsi_cmnd *sc, void *data)
|
|||
io_req = fnic_priv(sc)->io_req;
|
||||
if (!io_req) {
|
||||
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"hwq: %d mqtag: 0x%x tag: 0x%x flags: 0x%x No ioreq. Returning\n",
|
||||
hwq, mqtag, tag, fnic_priv(sc)->flags);
|
||||
return true;
|
||||
|
|
@ -1576,7 +1575,7 @@ static bool fnic_cleanup_io_iter(struct scsi_cmnd *sc, void *data)
|
|||
mempool_free(io_req, fnic->io_req_pool);
|
||||
|
||||
sc->result = DID_TRANSPORT_DISRUPTED << 16;
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"mqtag: 0x%x tag: 0x%x sc: 0x%p duration = %lu DID_TRANSPORT_DISRUPTED\n",
|
||||
mqtag, tag, sc, (jiffies - start_time));
|
||||
|
||||
|
|
@ -1608,12 +1607,12 @@ static void fnic_cleanup_io(struct fnic *fnic, int exclude_id)
|
|||
struct scsi_cmnd *sc = NULL;
|
||||
|
||||
io_count = fnic_count_all_ioreqs(fnic);
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"Outstanding ioreq count: %d active io count: %lld Waiting\n",
|
||||
io_count,
|
||||
atomic64_read(&fnic->fnic_stats.io_stats.active_ios));
|
||||
|
||||
scsi_host_busy_iter(fnic->lport->host,
|
||||
scsi_host_busy_iter(fnic->host,
|
||||
fnic_cleanup_io_iter, fnic);
|
||||
|
||||
/* with sg3utils device reset, SC needs to be retrieved from ioreq */
|
||||
|
|
@ -1633,7 +1632,7 @@ static void fnic_cleanup_io(struct fnic *fnic, int exclude_id)
|
|||
spin_unlock_irqrestore(&fnic->wq_copy_lock[0], flags);
|
||||
|
||||
while ((io_count = fnic_count_all_ioreqs(fnic))) {
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"Outstanding ioreq count: %d active io count: %lld Waiting\n",
|
||||
io_count,
|
||||
atomic64_read(&fnic->fnic_stats.io_stats.active_ios));
|
||||
|
|
@ -1660,7 +1659,7 @@ void fnic_wq_copy_cleanup_handler(struct vnic_wq_copy *wq,
|
|||
if (id >= fnic->fnic_max_tag_id)
|
||||
return;
|
||||
|
||||
sc = scsi_host_find_tag(fnic->lport->host, id);
|
||||
sc = scsi_host_find_tag(fnic->host, id);
|
||||
if (!sc)
|
||||
return;
|
||||
|
||||
|
|
@ -1689,7 +1688,7 @@ void fnic_wq_copy_cleanup_handler(struct vnic_wq_copy *wq,
|
|||
|
||||
wq_copy_cleanup_scsi_cmd:
|
||||
sc->result = DID_NO_CONNECT << 16;
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num, "wq_copy_cleanup_handler:"
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num, "wq_copy_cleanup_handler:"
|
||||
" DID_NO_CONNECT\n");
|
||||
|
||||
FNIC_TRACE(fnic_wq_copy_cleanup_handler,
|
||||
|
|
@ -1733,7 +1732,7 @@ static inline int fnic_queue_abort_io_req(struct fnic *fnic, int tag,
|
|||
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
|
||||
atomic_dec(&fnic->in_flight);
|
||||
atomic_dec(&tport->in_flight);
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"fnic_queue_abort_io_req: failure: no descriptors\n");
|
||||
atomic64_inc(&misc_stats->abts_cpwq_alloc_failures);
|
||||
return 1;
|
||||
|
|
@ -1778,7 +1777,7 @@ static bool fnic_rport_abort_io_iter(struct scsi_cmnd *sc, void *data)
|
|||
hwq = blk_mq_unique_tag_to_hwq(abt_tag);
|
||||
|
||||
if (!sc) {
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"sc is NULL abt_tag: 0x%x hwq: %d\n", abt_tag, hwq);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1792,7 +1791,7 @@ static bool fnic_rport_abort_io_iter(struct scsi_cmnd *sc, void *data)
|
|||
|
||||
if ((fnic_priv(sc)->flags & FNIC_DEVICE_RESET) &&
|
||||
!(fnic_priv(sc)->flags & FNIC_DEV_RST_ISSUED)) {
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"hwq: %d abt_tag: 0x%x flags: 0x%x Device reset is not pending\n",
|
||||
hwq, abt_tag, fnic_priv(sc)->flags);
|
||||
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
|
||||
|
|
@ -1809,16 +1808,16 @@ static bool fnic_rport_abort_io_iter(struct scsi_cmnd *sc, void *data)
|
|||
}
|
||||
|
||||
if (io_req->abts_done) {
|
||||
shost_printk(KERN_ERR, fnic->lport->host,
|
||||
shost_printk(KERN_ERR, fnic->host,
|
||||
"fnic_rport_exch_reset: io_req->abts_done is set state is %s\n",
|
||||
fnic_ioreq_state_to_str(fnic_priv(sc)->state));
|
||||
}
|
||||
|
||||
if (!(fnic_priv(sc)->flags & FNIC_IO_ISSUED)) {
|
||||
shost_printk(KERN_ERR, fnic->lport->host,
|
||||
shost_printk(KERN_ERR, fnic->host,
|
||||
"rport_exch_reset IO not yet issued %p abt_tag 0x%x",
|
||||
sc, abt_tag);
|
||||
shost_printk(KERN_ERR, fnic->lport->host,
|
||||
shost_printk(KERN_ERR, fnic->host,
|
||||
"flags %x state %d\n", fnic_priv(sc)->flags,
|
||||
fnic_priv(sc)->state);
|
||||
}
|
||||
|
|
@ -1829,11 +1828,13 @@ static bool fnic_rport_abort_io_iter(struct scsi_cmnd *sc, void *data)
|
|||
if (fnic_priv(sc)->flags & FNIC_DEVICE_RESET) {
|
||||
atomic64_inc(&reset_stats->device_reset_terminates);
|
||||
abt_tag |= FNIC_TAG_DEV_RST;
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"dev reset sc 0x%p\n", sc);
|
||||
}
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"fnic_rport_exch_reset: dev rst sc 0x%p\n", sc);
|
||||
WARN_ON_ONCE(io_req->abts_done);
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"fnic_rport_reset_exch: Issuing abts\n");
|
||||
|
||||
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
|
||||
|
|
@ -1851,7 +1852,7 @@ static bool fnic_rport_abort_io_iter(struct scsi_cmnd *sc, void *data)
|
|||
* lun reset
|
||||
*/
|
||||
spin_lock_irqsave(&fnic->wq_copy_lock[hwq], flags);
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"hwq: %d abt_tag: 0x%x flags: 0x%x Queuing abort failed\n",
|
||||
hwq, abt_tag, fnic_priv(sc)->flags);
|
||||
if (fnic_priv(sc)->state == FNIC_IOREQ_ABTS_PENDING)
|
||||
|
|
@ -1882,7 +1883,7 @@ void fnic_rport_exch_reset(struct fnic *fnic, u32 port_id)
|
|||
.term_cnt = 0,
|
||||
};
|
||||
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"fnic rport exchange reset for tport: 0x%06x\n",
|
||||
port_id);
|
||||
|
||||
|
|
@ -1890,7 +1891,7 @@ void fnic_rport_exch_reset(struct fnic *fnic, u32 port_id)
|
|||
return;
|
||||
|
||||
io_count = fnic_count_ioreqs(fnic, port_id);
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"Starting terminates: rport:0x%x portid-io-count: %d active-io-count: %lld\n",
|
||||
port_id, io_count,
|
||||
atomic64_read(&fnic->fnic_stats.io_stats.active_ios));
|
||||
|
|
@ -1905,7 +1906,7 @@ void fnic_rport_exch_reset(struct fnic *fnic, u32 port_id)
|
|||
}
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
|
||||
|
||||
scsi_host_busy_iter(fnic->lport->host, fnic_rport_abort_io_iter,
|
||||
scsi_host_busy_iter(fnic->host, fnic_rport_abort_io_iter,
|
||||
&iter_data);
|
||||
|
||||
if (iter_data.term_cnt > atomic64_read(&term_stats->max_terminates))
|
||||
|
|
@ -1916,7 +1917,7 @@ void fnic_rport_exch_reset(struct fnic *fnic, u32 port_id)
|
|||
while ((io_count = fnic_count_ioreqs(fnic, port_id)))
|
||||
schedule_timeout(msecs_to_jiffies(1000));
|
||||
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"rport: 0x%x remaining portid-io-count: %d ",
|
||||
port_id, io_count);
|
||||
}
|
||||
|
|
@ -1987,8 +1988,8 @@ void fnic_scsi_unload_cleanup(struct fnic *fnic)
|
|||
{
|
||||
int hwq = 0;
|
||||
|
||||
fc_remove_host(fnic->lport->host);
|
||||
scsi_remove_host(fnic->lport->host);
|
||||
fc_remove_host(fnic->host);
|
||||
scsi_remove_host(fnic->host);
|
||||
for (hwq = 0; hwq < fnic->wq_copy_count; hwq++)
|
||||
kfree(fnic->sw_copy_wq[hwq].io_req_table);
|
||||
}
|
||||
|
|
@ -2045,10 +2046,10 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
|
|||
tport = rdd_data->tport;
|
||||
|
||||
if (!tport) {
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"Abort cmd called after tport delete! rport fcid: 0x%x",
|
||||
rport->port_id);
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"lun: %llu hwq: 0x%x mqtag: 0x%x Op: 0x%x flags: 0x%x\n",
|
||||
sc->device->lun, hwq, mqtag,
|
||||
sc->cmnd[0], fnic_priv(sc)->flags);
|
||||
|
|
@ -2057,18 +2058,18 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
|
|||
goto fnic_abort_cmd_end;
|
||||
}
|
||||
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Abort cmd called rport fcid: 0x%x lun: %llu hwq: 0x%x mqtag: 0x%x",
|
||||
rport->port_id, sc->device->lun, hwq, mqtag);
|
||||
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Op: 0x%x flags: 0x%x\n",
|
||||
sc->cmnd[0],
|
||||
fnic_priv(sc)->flags);
|
||||
|
||||
if (iport->state != FNIC_IPORT_STATE_READY) {
|
||||
atomic64_inc(&fnic_stats->misc_stats.iport_not_ready);
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"iport NOT in READY state");
|
||||
ret = FAILED;
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
|
||||
|
|
@ -2077,7 +2078,7 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
|
|||
|
||||
if ((tport->state != FDLS_TGT_STATE_READY) &&
|
||||
(tport->state != FDLS_TGT_STATE_ADISC)) {
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"tport state: %d\n", tport->state);
|
||||
ret = FAILED;
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
|
||||
|
|
@ -2128,7 +2129,7 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
|
|||
else
|
||||
atomic64_inc(&abts_stats->abort_issued_greater_than_60_sec);
|
||||
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"CDB Opcode: 0x%02x Abort issued time: %lu msec\n",
|
||||
sc->cmnd[0], abt_issued_time);
|
||||
/*
|
||||
|
|
@ -2219,7 +2220,7 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
|
|||
|
||||
if (!(fnic_priv(sc)->flags & (FNIC_IO_ABORTED | FNIC_IO_DONE))) {
|
||||
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"Issuing host reset due to out of order IO\n");
|
||||
|
||||
ret = FAILED;
|
||||
|
|
@ -2267,7 +2268,7 @@ fnic_abort_cmd_end:
|
|||
(u64)sc->cmnd[4] << 8 | sc->cmnd[5]),
|
||||
fnic_flags_and_state(sc));
|
||||
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"Returning from abort cmd type %x %s\n", task_req,
|
||||
(ret == SUCCESS) ?
|
||||
"SUCCESS" : "FAILED");
|
||||
|
|
@ -2308,7 +2309,7 @@ static inline int fnic_queue_dr_io_req(struct fnic *fnic,
|
|||
free_wq_copy_descs(fnic, wq, hwq);
|
||||
|
||||
if (!vnic_wq_copy_desc_avail(wq)) {
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"queue_dr_io_req failure - no descriptors\n");
|
||||
atomic64_inc(&misc_stats->devrst_cpwq_alloc_failures);
|
||||
ret = -EAGAIN;
|
||||
|
|
@ -2376,7 +2377,7 @@ static bool fnic_pending_aborts_iter(struct scsi_cmnd *sc, void *data)
|
|||
* Found IO that is still pending with firmware and
|
||||
* belongs to the LUN that we are resetting
|
||||
*/
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"Found IO in %s on lun\n",
|
||||
fnic_ioreq_state_to_str(fnic_priv(sc)->state));
|
||||
|
||||
|
|
@ -2386,14 +2387,14 @@ static bool fnic_pending_aborts_iter(struct scsi_cmnd *sc, void *data)
|
|||
}
|
||||
if ((fnic_priv(sc)->flags & FNIC_DEVICE_RESET) &&
|
||||
(!(fnic_priv(sc)->flags & FNIC_DEV_RST_ISSUED))) {
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"dev rst not pending sc 0x%p\n", sc);
|
||||
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (io_req->abts_done)
|
||||
shost_printk(KERN_ERR, fnic->lport->host,
|
||||
shost_printk(KERN_ERR, fnic->host,
|
||||
"%s: io_req->abts_done is set state is %s\n",
|
||||
__func__, fnic_ioreq_state_to_str(fnic_priv(sc)->state));
|
||||
old_ioreq_state = fnic_priv(sc)->state;
|
||||
|
|
@ -2409,7 +2410,7 @@ static bool fnic_pending_aborts_iter(struct scsi_cmnd *sc, void *data)
|
|||
BUG_ON(io_req->abts_done);
|
||||
|
||||
if (fnic_priv(sc)->flags & FNIC_DEVICE_RESET) {
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"dev rst sc 0x%p\n", sc);
|
||||
}
|
||||
|
||||
|
|
@ -2431,7 +2432,7 @@ static bool fnic_pending_aborts_iter(struct scsi_cmnd *sc, void *data)
|
|||
fnic_priv(sc)->state = old_ioreq_state;
|
||||
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
|
||||
iter_data->ret = FAILED;
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"hwq: %d abt_tag: 0x%lx Abort could not be queued\n",
|
||||
hwq, abt_tag);
|
||||
return false;
|
||||
|
|
@ -2510,7 +2511,7 @@ static int fnic_clean_pending_aborts(struct fnic *fnic,
|
|||
|
||||
iter_data.lr_sc = lr_sc;
|
||||
|
||||
scsi_host_busy_iter(fnic->lport->host,
|
||||
scsi_host_busy_iter(fnic->host,
|
||||
fnic_pending_aborts_iter, &iter_data);
|
||||
if (iter_data.ret == FAILED) {
|
||||
ret = iter_data.ret;
|
||||
|
|
@ -2523,7 +2524,7 @@ static int fnic_clean_pending_aborts(struct fnic *fnic,
|
|||
ret = 1;
|
||||
|
||||
clean_pending_aborts_end:
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"exit status: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -2573,7 +2574,7 @@ int fnic_device_reset(struct scsi_cmnd *sc)
|
|||
rport = starget_to_rport(scsi_target(sc->device));
|
||||
|
||||
spin_lock_irqsave(&fnic->fnic_lock, flags);
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"fcid: 0x%x lun: %llu hwq: %d mqtag: 0x%x flags: 0x%x Device reset\n",
|
||||
rport->port_id, sc->device->lun, hwq, mqtag,
|
||||
fnic_priv(sc)->flags);
|
||||
|
|
@ -2581,7 +2582,7 @@ int fnic_device_reset(struct scsi_cmnd *sc)
|
|||
rdd_data = rport->dd_data;
|
||||
tport = rdd_data->tport;
|
||||
if (!tport) {
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"Dev rst called after tport delete! rport fcid: 0x%x lun: %llu\n",
|
||||
rport->port_id, sc->device->lun);
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
|
||||
|
|
@ -2590,7 +2591,7 @@ int fnic_device_reset(struct scsi_cmnd *sc)
|
|||
|
||||
if (iport->state != FNIC_IPORT_STATE_READY) {
|
||||
atomic64_inc(&fnic_stats->misc_stats.iport_not_ready);
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"iport NOT in READY state");
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
|
||||
goto fnic_device_reset_end;
|
||||
|
|
@ -2598,7 +2599,7 @@ int fnic_device_reset(struct scsi_cmnd *sc)
|
|||
|
||||
if ((tport->state != FDLS_TGT_STATE_READY) &&
|
||||
(tport->state != FDLS_TGT_STATE_ADISC)) {
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"tport state: %d\n", tport->state);
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
|
||||
goto fnic_device_reset_end;
|
||||
|
|
@ -2661,7 +2662,7 @@ int fnic_device_reset(struct scsi_cmnd *sc)
|
|||
fnic_priv(sc)->lr_status = FCPIO_INVALID_CODE;
|
||||
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
|
||||
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num, "TAG %x\n", mqtag);
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num, "TAG %x\n", mqtag);
|
||||
|
||||
/*
|
||||
* issue the device reset, if enqueue failed, clean up the ioreq
|
||||
|
|
@ -2712,13 +2713,13 @@ int fnic_device_reset(struct scsi_cmnd *sc)
|
|||
io_req = fnic_priv(sc)->io_req;
|
||||
if (!io_req) {
|
||||
spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags);
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"io_req is null mqtag 0x%x sc 0x%p\n", mqtag, sc);
|
||||
goto fnic_device_reset_end;
|
||||
}
|
||||
|
||||
if (exit_dr) {
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"Host reset called for fnic. Exit device reset\n");
|
||||
io_req->dr_done = NULL;
|
||||
goto fnic_device_reset_clean;
|
||||
|
|
@ -2733,7 +2734,7 @@ int fnic_device_reset(struct scsi_cmnd *sc)
|
|||
*/
|
||||
if (status == FCPIO_INVALID_CODE) {
|
||||
atomic64_inc(&reset_stats->device_reset_timeouts);
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"Device reset timed out\n");
|
||||
fnic_priv(sc)->flags |= FNIC_DEV_RST_TIMED_OUT;
|
||||
int_to_scsilun(sc->device->lun, &fc_lun);
|
||||
|
|
@ -2746,7 +2747,7 @@ int fnic_device_reset(struct scsi_cmnd *sc)
|
|||
if (status != FCPIO_SUCCESS) {
|
||||
spin_lock_irqsave(&fnic->wq_copy_lock[hwq], flags);
|
||||
FNIC_SCSI_DBG(KERN_DEBUG,
|
||||
fnic->lport->host, fnic->fnic_num,
|
||||
fnic->host, fnic->fnic_num,
|
||||
"Device reset completed - failed\n");
|
||||
io_req = fnic_priv(sc)->io_req;
|
||||
goto fnic_device_reset_clean;
|
||||
|
|
@ -2762,7 +2763,7 @@ int fnic_device_reset(struct scsi_cmnd *sc)
|
|||
if (fnic_clean_pending_aborts(fnic, sc, new_sc)) {
|
||||
spin_lock_irqsave(&fnic->wq_copy_lock[hwq], flags);
|
||||
io_req = fnic_priv(sc)->io_req;
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"Device reset failed: Cannot abort all IOs\n");
|
||||
goto fnic_device_reset_clean;
|
||||
}
|
||||
|
|
@ -2816,13 +2817,13 @@ fnic_device_reset_end:
|
|||
ret = FAILED;
|
||||
break;
|
||||
}
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"Cannot clean up all IOs for the LUN\n");
|
||||
schedule_timeout(msecs_to_jiffies(1000));
|
||||
count++;
|
||||
}
|
||||
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_DEBUG, fnic->host, fnic->fnic_num,
|
||||
"Returning from device reset %s\n",
|
||||
(ret == SUCCESS) ?
|
||||
"SUCCESS" : "FAILED");
|
||||
|
|
@ -2857,13 +2858,13 @@ void fnic_reset(struct Scsi_Host *shost)
|
|||
fnic = *((struct fnic **) shost_priv(shost));
|
||||
reset_stats = &fnic->fnic_stats.reset_stats;
|
||||
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Issuing fnic reset\n");
|
||||
|
||||
atomic64_inc(&reset_stats->fnic_resets);
|
||||
fnic_post_flogo_linkflap(fnic);
|
||||
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Returning from fnic reset");
|
||||
|
||||
atomic64_inc(&reset_stats->fnic_reset_completions);
|
||||
|
|
@ -2874,7 +2875,7 @@ int fnic_issue_fc_host_lip(struct Scsi_Host *shost)
|
|||
int ret = 0;
|
||||
struct fnic *fnic = *((struct fnic **) shost_priv(shost));
|
||||
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"FC host lip issued");
|
||||
|
||||
ret = fnic_host_reset(shost);
|
||||
|
|
@ -2900,7 +2901,7 @@ int fnic_host_reset(struct Scsi_Host *shost)
|
|||
spin_lock_irqsave(&fnic->fnic_lock, flags);
|
||||
if (fnic->reset_in_progress == IN_PROGRESS) {
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
|
||||
FNIC_SCSI_DBG(KERN_WARNING, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_WARNING, fnic->host, fnic->fnic_num,
|
||||
"Firmware reset in progress. Skipping another host reset\n");
|
||||
return SUCCESS;
|
||||
}
|
||||
|
|
@ -2938,7 +2939,7 @@ int fnic_host_reset(struct Scsi_Host *shost)
|
|||
}
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
|
||||
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"host reset return status: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -2978,7 +2979,7 @@ static bool fnic_abts_pending_iter(struct scsi_cmnd *sc, void *data)
|
|||
* Found IO that is still pending with firmware and
|
||||
* belongs to the LUN that we are resetting
|
||||
*/
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"hwq: %d tag: 0x%x Found IO in state: %s on lun\n",
|
||||
hwq, tag,
|
||||
fnic_ioreq_state_to_str(fnic_priv(sc)->state));
|
||||
|
|
@ -3011,7 +3012,7 @@ int fnic_is_abts_pending(struct fnic *fnic, struct scsi_cmnd *lr_sc)
|
|||
}
|
||||
|
||||
/* walk again to check, if IOs are still pending in fw */
|
||||
scsi_host_busy_iter(fnic->lport->host,
|
||||
scsi_host_busy_iter(fnic->host,
|
||||
fnic_abts_pending_iter, &iter_data);
|
||||
|
||||
return iter_data.ret;
|
||||
|
|
@ -3032,7 +3033,7 @@ int fnic_eh_host_reset_handler(struct scsi_cmnd *sc)
|
|||
struct Scsi_Host *shost = sc->device->host;
|
||||
struct fnic *fnic = *((struct fnic **) shost_priv(shost));
|
||||
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_ERR, fnic->host, fnic->fnic_num,
|
||||
"SCSI error handling: fnic host reset");
|
||||
|
||||
ret = fnic_host_reset(shost);
|
||||
|
|
@ -3053,7 +3054,7 @@ void fnic_scsi_fcpio_reset(struct fnic *fnic)
|
|||
if (unlikely(fnic->state == FNIC_IN_FC_TRANS_ETH_MODE)) {
|
||||
/* fw reset is in progress, poll for its completion */
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"fnic is in unexpected state: %d for fw_reset\n",
|
||||
fnic->state);
|
||||
return;
|
||||
|
|
@ -3066,7 +3067,7 @@ void fnic_scsi_fcpio_reset(struct fnic *fnic)
|
|||
fnic->fw_reset_done = &fw_reset_done;
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
|
||||
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Issuing fw reset\n");
|
||||
if (fnic_fw_reset_handler(fnic)) {
|
||||
spin_lock_irqsave(&fnic->fnic_lock, flags);
|
||||
|
|
@ -3074,14 +3075,14 @@ void fnic_scsi_fcpio_reset(struct fnic *fnic)
|
|||
fnic->state = old_state;
|
||||
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
|
||||
} else {
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Waiting for fw completion\n");
|
||||
time_remain = wait_for_completion_timeout(&fw_reset_done,
|
||||
msecs_to_jiffies(FNIC_FW_RESET_TIMEOUT));
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"Woken up after fw completion timeout\n");
|
||||
if (time_remain == 0) {
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host, fnic->fnic_num,
|
||||
FNIC_SCSI_DBG(KERN_INFO, fnic->host, fnic->fnic_num,
|
||||
"FW reset completion timed out after %d ms)\n",
|
||||
FNIC_FW_RESET_TIMEOUT);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue