diff options
Diffstat (limited to 'drivers/scsi/fnic/fnic_fcs.c')
| -rw-r--r-- | drivers/scsi/fnic/fnic_fcs.c | 61 |
1 files changed, 54 insertions, 7 deletions
diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic/fnic_fcs.c index 1671325aec7f..1b948f633fc5 100644 --- a/drivers/scsi/fnic/fnic_fcs.c +++ b/drivers/scsi/fnic/fnic_fcs.c | |||
| @@ -66,19 +66,35 @@ void fnic_handle_link(struct work_struct *work) | |||
| 66 | fnic->link_down_cnt = vnic_dev_link_down_cnt(fnic->vdev); | 66 | fnic->link_down_cnt = vnic_dev_link_down_cnt(fnic->vdev); |
| 67 | 67 | ||
| 68 | if (old_link_status == fnic->link_status) { | 68 | if (old_link_status == fnic->link_status) { |
| 69 | if (!fnic->link_status) | 69 | if (!fnic->link_status) { |
| 70 | /* DOWN -> DOWN */ | 70 | /* DOWN -> DOWN */ |
| 71 | spin_unlock_irqrestore(&fnic->fnic_lock, flags); | 71 | spin_unlock_irqrestore(&fnic->fnic_lock, flags); |
| 72 | else { | 72 | fnic_fc_trace_set_data(fnic->lport->host->host_no, |
| 73 | FNIC_FC_LE, "Link Status: DOWN->DOWN", | ||
| 74 | strlen("Link Status: DOWN->DOWN")); | ||
| 75 | } else { | ||
| 73 | if (old_link_down_cnt != fnic->link_down_cnt) { | 76 | if (old_link_down_cnt != fnic->link_down_cnt) { |
| 74 | /* UP -> DOWN -> UP */ | 77 | /* UP -> DOWN -> UP */ |
| 75 | fnic->lport->host_stats.link_failure_count++; | 78 | fnic->lport->host_stats.link_failure_count++; |
| 76 | spin_unlock_irqrestore(&fnic->fnic_lock, flags); | 79 | spin_unlock_irqrestore(&fnic->fnic_lock, flags); |
| 80 | fnic_fc_trace_set_data( | ||
| 81 | fnic->lport->host->host_no, | ||
| 82 | FNIC_FC_LE, | ||
| 83 | "Link Status:UP_DOWN_UP", | ||
| 84 | strlen("Link_Status:UP_DOWN_UP") | ||
| 85 | ); | ||
| 77 | FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host, | 86 | FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host, |
| 78 | "link down\n"); | 87 | "link down\n"); |
| 79 | fcoe_ctlr_link_down(&fnic->ctlr); | 88 | fcoe_ctlr_link_down(&fnic->ctlr); |
| 80 | if (fnic->config.flags & VFCF_FIP_CAPABLE) { | 89 | if (fnic->config.flags & VFCF_FIP_CAPABLE) { |
| 81 | /* start FCoE VLAN discovery */ | 90 | /* start FCoE VLAN discovery */ |
| 91 | fnic_fc_trace_set_data( | ||
| 92 | fnic->lport->host->host_no, | ||
| 93 | FNIC_FC_LE, | ||
| 94 | "Link Status: UP_DOWN_UP_VLAN", | ||
| 95 | strlen( | ||
| 96 | "Link Status: UP_DOWN_UP_VLAN") | ||
| 97 | ); | ||
| 82 | fnic_fcoe_send_vlan_req(fnic); | 98 | fnic_fcoe_send_vlan_req(fnic); |
| 83 | return; | 99 | return; |
| 84 | } | 100 | } |
| @@ -88,22 +104,36 @@ void fnic_handle_link(struct work_struct *work) | |||
| 88 | } else | 104 | } else |
| 89 | /* UP -> UP */ | 105 | /* UP -> UP */ |
| 90 | spin_unlock_irqrestore(&fnic->fnic_lock, flags); | 106 | spin_unlock_irqrestore(&fnic->fnic_lock, flags); |
| 107 | fnic_fc_trace_set_data( | ||
| 108 | fnic->lport->host->host_no, FNIC_FC_LE, | ||
| 109 | "Link Status: UP_UP", | ||
| 110 | strlen("Link Status: UP_UP")); | ||
| 91 | } | 111 | } |
| 92 | } else if (fnic->link_status) { | 112 | } else if (fnic->link_status) { |
| 93 | /* DOWN -> UP */ | 113 | /* DOWN -> UP */ |
| 94 | spin_unlock_irqrestore(&fnic->fnic_lock, flags); | 114 | spin_unlock_irqrestore(&fnic->fnic_lock, flags); |
| 95 | if (fnic->config.flags & VFCF_FIP_CAPABLE) { | 115 | if (fnic->config.flags & VFCF_FIP_CAPABLE) { |
| 96 | /* start FCoE VLAN discovery */ | 116 | /* start FCoE VLAN discovery */ |
| 117 | fnic_fc_trace_set_data( | ||
| 118 | fnic->lport->host->host_no, | ||
| 119 | FNIC_FC_LE, "Link Status: DOWN_UP_VLAN", | ||
| 120 | strlen("Link Status: DOWN_UP_VLAN")); | ||
| 97 | fnic_fcoe_send_vlan_req(fnic); | 121 | fnic_fcoe_send_vlan_req(fnic); |
| 98 | return; | 122 | return; |
| 99 | } | 123 | } |
| 100 | FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host, "link up\n"); | 124 | FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host, "link up\n"); |
| 125 | fnic_fc_trace_set_data(fnic->lport->host->host_no, FNIC_FC_LE, | ||
| 126 | "Link Status: DOWN_UP", strlen("Link Status: DOWN_UP")); | ||
| 101 | fcoe_ctlr_link_up(&fnic->ctlr); | 127 | fcoe_ctlr_link_up(&fnic->ctlr); |
| 102 | } else { | 128 | } else { |
| 103 | /* UP -> DOWN */ | 129 | /* UP -> DOWN */ |
| 104 | fnic->lport->host_stats.link_failure_count++; | 130 | fnic->lport->host_stats.link_failure_count++; |
| 105 | spin_unlock_irqrestore(&fnic->fnic_lock, flags); | 131 | spin_unlock_irqrestore(&fnic->fnic_lock, flags); |
| 106 | FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host, "link down\n"); | 132 | FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host, "link down\n"); |
| 133 | fnic_fc_trace_set_data( | ||
| 134 | fnic->lport->host->host_no, FNIC_FC_LE, | ||
| 135 | "Link Status: UP_DOWN", | ||
| 136 | strlen("Link Status: UP_DOWN")); | ||
| 107 | fcoe_ctlr_link_down(&fnic->ctlr); | 137 | fcoe_ctlr_link_down(&fnic->ctlr); |
| 108 | } | 138 | } |
| 109 | 139 | ||
| @@ -267,11 +297,6 @@ static inline int is_fnic_fip_flogi_reject(struct fcoe_ctlr *fip, | |||
| 267 | 297 | ||
| 268 | if (desc->fip_dtype == FIP_DT_FLOGI) { | 298 | if (desc->fip_dtype == FIP_DT_FLOGI) { |
| 269 | 299 | ||
| 270 | shost_printk(KERN_DEBUG, lport->host, | ||
| 271 | " FIP TYPE FLOGI: fab name:%llx " | ||
| 272 | "vfid:%d map:%x\n", | ||
| 273 | fip->sel_fcf->fabric_name, fip->sel_fcf->vfid, | ||
| 274 | fip->sel_fcf->fc_map); | ||
| 275 | if (dlen < sizeof(*els) + sizeof(*fh) + 1) | 300 | if (dlen < sizeof(*els) + sizeof(*fh) + 1) |
| 276 | return 0; | 301 | return 0; |
| 277 | 302 | ||
| @@ -616,6 +641,10 @@ static inline int fnic_import_rq_eth_pkt(struct fnic *fnic, struct sk_buff *skb) | |||
| 616 | "using UCSM\n"); | 641 | "using UCSM\n"); |
| 617 | goto drop; | 642 | goto drop; |
| 618 | } | 643 | } |
| 644 | if ((fnic_fc_trace_set_data(fnic->lport->host->host_no, | ||
| 645 | FNIC_FC_RECV|0x80, (char *)skb->data, skb->len)) != 0) { | ||
| 646 | printk(KERN_ERR "fnic ctlr frame trace error!!!"); | ||
| 647 | } | ||
| 619 | skb_queue_tail(&fnic->fip_frame_queue, skb); | 648 | skb_queue_tail(&fnic->fip_frame_queue, skb); |
| 620 | queue_work(fnic_fip_queue, &fnic->fip_frame_work); | 649 | queue_work(fnic_fip_queue, &fnic->fip_frame_work); |
| 621 | return 1; /* let caller know packet was used */ | 650 | return 1; /* let caller know packet was used */ |
| @@ -844,6 +873,10 @@ static void fnic_rq_cmpl_frame_recv(struct vnic_rq *rq, struct cq_desc | |||
| 844 | } | 873 | } |
| 845 | fr_dev(fp) = fnic->lport; | 874 | fr_dev(fp) = fnic->lport; |
| 846 | spin_unlock_irqrestore(&fnic->fnic_lock, flags); | 875 | spin_unlock_irqrestore(&fnic->fnic_lock, flags); |
| 876 | if ((fnic_fc_trace_set_data(fnic->lport->host->host_no, FNIC_FC_RECV, | ||
| 877 | (char *)skb->data, skb->len)) != 0) { | ||
| 878 | printk(KERN_ERR "fnic ctlr frame trace error!!!"); | ||
| 879 | } | ||
| 847 | 880 | ||
| 848 | skb_queue_tail(&fnic->frame_queue, skb); | 881 | skb_queue_tail(&fnic->frame_queue, skb); |
| 849 | queue_work(fnic_event_queue, &fnic->frame_work); | 882 | queue_work(fnic_event_queue, &fnic->frame_work); |
| @@ -951,6 +984,15 @@ void fnic_eth_send(struct fcoe_ctlr *fip, struct sk_buff *skb) | |||
| 951 | vlan_hdr->h_vlan_proto = htons(ETH_P_8021Q); | 984 | vlan_hdr->h_vlan_proto = htons(ETH_P_8021Q); |
| 952 | vlan_hdr->h_vlan_encapsulated_proto = eth_hdr->h_proto; | 985 | vlan_hdr->h_vlan_encapsulated_proto = eth_hdr->h_proto; |
| 953 | vlan_hdr->h_vlan_TCI = htons(fnic->vlan_id); | 986 | vlan_hdr->h_vlan_TCI = htons(fnic->vlan_id); |
| 987 | if ((fnic_fc_trace_set_data(fnic->lport->host->host_no, | ||
| 988 | FNIC_FC_SEND|0x80, (char *)eth_hdr, skb->len)) != 0) { | ||
| 989 | printk(KERN_ERR "fnic ctlr frame trace error!!!"); | ||
| 990 | } | ||
| 991 | } else { | ||
| 992 | if ((fnic_fc_trace_set_data(fnic->lport->host->host_no, | ||
| 993 | FNIC_FC_SEND|0x80, (char *)skb->data, skb->len)) != 0) { | ||
| 994 | printk(KERN_ERR "fnic ctlr frame trace error!!!"); | ||
| 995 | } | ||
| 954 | } | 996 | } |
| 955 | 997 | ||
| 956 | pa = pci_map_single(fnic->pdev, skb->data, skb->len, PCI_DMA_TODEVICE); | 998 | pa = pci_map_single(fnic->pdev, skb->data, skb->len, PCI_DMA_TODEVICE); |
| @@ -1023,6 +1065,11 @@ static int fnic_send_frame(struct fnic *fnic, struct fc_frame *fp) | |||
| 1023 | 1065 | ||
| 1024 | pa = pci_map_single(fnic->pdev, eth_hdr, tot_len, PCI_DMA_TODEVICE); | 1066 | pa = pci_map_single(fnic->pdev, eth_hdr, tot_len, PCI_DMA_TODEVICE); |
| 1025 | 1067 | ||
| 1068 | if ((fnic_fc_trace_set_data(fnic->lport->host->host_no, FNIC_FC_SEND, | ||
| 1069 | (char *)eth_hdr, tot_len)) != 0) { | ||
| 1070 | printk(KERN_ERR "fnic ctlr frame trace error!!!"); | ||
| 1071 | } | ||
| 1072 | |||
| 1026 | spin_lock_irqsave(&fnic->wq_lock[0], flags); | 1073 | spin_lock_irqsave(&fnic->wq_lock[0], flags); |
| 1027 | 1074 | ||
| 1028 | if (!vnic_wq_desc_avail(wq)) { | 1075 | if (!vnic_wq_desc_avail(wq)) { |
