Commit 7e6886b7 authored by Karan Tilak Kumar's avatar Karan Tilak Kumar Committed by Martin K. Petersen
Browse files

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: default avatarSesidhar Baddela <sebaddel@cisco.com>
Reviewed-by: default avatarArulprabhu Ponnusamy <arulponn@cisco.com>
Reviewed-by: default avatarGian Carlo Boffa <gcboffa@cisco.com>
Signed-off-by: default avatarKaran Tilak Kumar <kartilak@cisco.com>
Link: https://lore.kernel.org/r/20241212020312.4786-14-kartilak@cisco.com


Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent a8650a5e
Loading
Loading
Loading
Loading
+332 −332

File changed.

Preview size limit exceeded, changes collapsed.

+46 −46
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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);

+3 −10
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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");
Loading