mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
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>
This commit is contained in:
committed by
Martin K. Petersen
parent
a8650a5eaa
commit
7e6886b705
+332
-332
File diff suppressed because it is too large
Load Diff
+46
-46
@@ -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);
|
||||
}
|
||||
|
||||
+121
-120
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user