mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-29 21:16:40 +07:00
[SCSI] libfcoe: Host doesnt handle CVL to NPIV ports
Clear virtual link for NPIV ports is now handled by resetting the matching vnport. Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This commit is contained in:
parent
0a9c5d344d
commit
5550fda73d
@ -989,7 +989,9 @@ static void fcoe_ctlr_recv_clr_vlink(struct fcoe_ctlr *fip,
|
|||||||
size_t dlen;
|
size_t dlen;
|
||||||
struct fcoe_fcf *fcf = fip->sel_fcf;
|
struct fcoe_fcf *fcf = fip->sel_fcf;
|
||||||
struct fc_lport *lport = fip->lp;
|
struct fc_lport *lport = fip->lp;
|
||||||
u32 desc_mask;
|
struct fc_lport *vn_port = NULL;
|
||||||
|
u32 desc_mask;
|
||||||
|
int is_vn_port = 0;
|
||||||
|
|
||||||
LIBFCOE_FIP_DBG(fip, "Clear Virtual Link received\n");
|
LIBFCOE_FIP_DBG(fip, "Clear Virtual Link received\n");
|
||||||
|
|
||||||
@ -1038,8 +1040,26 @@ static void fcoe_ctlr_recv_clr_vlink(struct fcoe_ctlr *fip,
|
|||||||
if (compare_ether_addr(vp->fd_mac,
|
if (compare_ether_addr(vp->fd_mac,
|
||||||
fip->get_src_addr(lport)) == 0 &&
|
fip->get_src_addr(lport)) == 0 &&
|
||||||
get_unaligned_be64(&vp->fd_wwpn) == lport->wwpn &&
|
get_unaligned_be64(&vp->fd_wwpn) == lport->wwpn &&
|
||||||
ntoh24(vp->fd_fc_id) == lport->port_id)
|
ntoh24(vp->fd_fc_id) == lport->port_id) {
|
||||||
desc_mask &= ~BIT(FIP_DT_VN_ID);
|
desc_mask &= ~BIT(FIP_DT_VN_ID);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* check if clr_vlink is for NPIV port */
|
||||||
|
mutex_lock(&lport->lp_mutex);
|
||||||
|
list_for_each_entry(vn_port, &lport->vports, list) {
|
||||||
|
if (compare_ether_addr(vp->fd_mac,
|
||||||
|
fip->get_src_addr(vn_port)) == 0 &&
|
||||||
|
(get_unaligned_be64(&vp->fd_wwpn)
|
||||||
|
== vn_port->wwpn) &&
|
||||||
|
(ntoh24(vp->fd_fc_id) ==
|
||||||
|
fc_host_port_id(vn_port->host))) {
|
||||||
|
desc_mask &= ~BIT(FIP_DT_VN_ID);
|
||||||
|
is_vn_port = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mutex_unlock(&lport->lp_mutex);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* standard says ignore unknown descriptors >= 128 */
|
/* standard says ignore unknown descriptors >= 128 */
|
||||||
@ -1060,14 +1080,18 @@ static void fcoe_ctlr_recv_clr_vlink(struct fcoe_ctlr *fip,
|
|||||||
} else {
|
} else {
|
||||||
LIBFCOE_FIP_DBG(fip, "performing Clear Virtual Link\n");
|
LIBFCOE_FIP_DBG(fip, "performing Clear Virtual Link\n");
|
||||||
|
|
||||||
spin_lock_bh(&fip->lock);
|
if (is_vn_port)
|
||||||
per_cpu_ptr(lport->dev_stats,
|
fc_lport_reset(vn_port);
|
||||||
smp_processor_id())->VLinkFailureCount++;
|
else {
|
||||||
fcoe_ctlr_reset(fip);
|
spin_lock_bh(&fip->lock);
|
||||||
spin_unlock_bh(&fip->lock);
|
per_cpu_ptr(lport->dev_stats,
|
||||||
|
smp_processor_id())->VLinkFailureCount++;
|
||||||
|
fcoe_ctlr_reset(fip);
|
||||||
|
spin_unlock_bh(&fip->lock);
|
||||||
|
|
||||||
fc_lport_reset(fip->lp);
|
fc_lport_reset(fip->lp);
|
||||||
fcoe_ctlr_solicit(fip, NULL);
|
fcoe_ctlr_solicit(fip, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user