aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fcoe
diff options
context:
space:
mode:
authorBhanu Prakash Gollapudi <bprakash@broadcom.com>2010-06-11 19:44:31 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-27 13:01:49 -0400
commit5550fda73d8bd3bed454e28c46f5a4e5288769bb (patch)
treef93fe89292524836fe0ecb7107533e546c100aab /drivers/scsi/fcoe
parent0a9c5d344dbd983af59865f9880621e5cbbda899 (diff)
[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>
Diffstat (limited to 'drivers/scsi/fcoe')
-rw-r--r--drivers/scsi/fcoe/libfcoe.c42
1 files changed, 33 insertions, 9 deletions
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
index db7185c0b964..ce651ca2a4bc 100644
--- a/drivers/scsi/fcoe/libfcoe.c
+++ b/drivers/scsi/fcoe/libfcoe.c
@@ -989,7 +989,9 @@ static void fcoe_ctlr_recv_clr_vlink(struct fcoe_ctlr *fip,
989 size_t dlen; 989 size_t dlen;
990 struct fcoe_fcf *fcf = fip->sel_fcf; 990 struct fcoe_fcf *fcf = fip->sel_fcf;
991 struct fc_lport *lport = fip->lp; 991 struct fc_lport *lport = fip->lp;
992 u32 desc_mask; 992 struct fc_lport *vn_port = NULL;
993 u32 desc_mask;
994 int is_vn_port = 0;
993 995
994 LIBFCOE_FIP_DBG(fip, "Clear Virtual Link received\n"); 996 LIBFCOE_FIP_DBG(fip, "Clear Virtual Link received\n");
995 997
@@ -1038,8 +1040,26 @@ static void fcoe_ctlr_recv_clr_vlink(struct fcoe_ctlr *fip,
1038 if (compare_ether_addr(vp->fd_mac, 1040 if (compare_ether_addr(vp->fd_mac,
1039 fip->get_src_addr(lport)) == 0 && 1041 fip->get_src_addr(lport)) == 0 &&
1040 get_unaligned_be64(&vp->fd_wwpn) == lport->wwpn && 1042 get_unaligned_be64(&vp->fd_wwpn) == lport->wwpn &&
1041 ntoh24(vp->fd_fc_id) == lport->port_id) 1043 ntoh24(vp->fd_fc_id) == lport->port_id) {
1042 desc_mask &= ~BIT(FIP_DT_VN_ID); 1044 desc_mask &= ~BIT(FIP_DT_VN_ID);
1045 break;
1046 }
1047 /* check if clr_vlink is for NPIV port */
1048 mutex_lock(&lport->lp_mutex);
1049 list_for_each_entry(vn_port, &lport->vports, list) {
1050 if (compare_ether_addr(vp->fd_mac,
1051 fip->get_src_addr(vn_port)) == 0 &&
1052 (get_unaligned_be64(&vp->fd_wwpn)
1053 == vn_port->wwpn) &&
1054 (ntoh24(vp->fd_fc_id) ==
1055 fc_host_port_id(vn_port->host))) {
1056 desc_mask &= ~BIT(FIP_DT_VN_ID);
1057 is_vn_port = 1;
1058 break;
1059 }
1060 }
1061 mutex_unlock(&lport->lp_mutex);
1062
1043 break; 1063 break;
1044 default: 1064 default:
1045 /* standard says ignore unknown descriptors >= 128 */ 1065 /* standard says ignore unknown descriptors >= 128 */
@@ -1060,14 +1080,18 @@ static void fcoe_ctlr_recv_clr_vlink(struct fcoe_ctlr *fip,
1060 } else { 1080 } else {
1061 LIBFCOE_FIP_DBG(fip, "performing Clear Virtual Link\n"); 1081 LIBFCOE_FIP_DBG(fip, "performing Clear Virtual Link\n");
1062 1082
1063 spin_lock_bh(&fip->lock); 1083 if (is_vn_port)
1064 per_cpu_ptr(lport->dev_stats, 1084 fc_lport_reset(vn_port);
1065 smp_processor_id())->VLinkFailureCount++; 1085 else {
1066 fcoe_ctlr_reset(fip); 1086 spin_lock_bh(&fip->lock);
1067 spin_unlock_bh(&fip->lock); 1087 per_cpu_ptr(lport->dev_stats,
1088 smp_processor_id())->VLinkFailureCount++;
1089 fcoe_ctlr_reset(fip);
1090 spin_unlock_bh(&fip->lock);
1068 1091
1069 fc_lport_reset(fip->lp); 1092 fc_lport_reset(fip->lp);
1070 fcoe_ctlr_solicit(fip, NULL); 1093 fcoe_ctlr_solicit(fip, NULL);
1094 }
1071 } 1095 }
1072} 1096}
1073 1097