diff options
author | Vasu Dev <vasu.dev@intel.com> | 2012-05-25 13:26:43 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-07-20 03:31:47 -0400 |
commit | 1bd49b482077e231842352621169dedff1f41931 (patch) | |
tree | 7505af722b6391c6199b153527b1d777105277a7 /drivers/scsi/fcoe | |
parent | e58abb0ca423fc7adcf70bee018723b87c9e38c2 (diff) |
[SCSI] libfc, fcoe, bnx2fc: cleanup fcoe_dev_stats
The libfc is used by fcoe but fcoe agnostic,
and therefore should not have any fcoe references.
So renaming fcoe_dev_stats from libfc as its for fc_stats.
After that libfc is fcoe string free except some strings for
Open-FCoE.org.
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Acked-by : Robert Love <robert.w.love@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Acked-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/fcoe')
-rw-r--r-- | drivers/scsi/fcoe/fcoe.c | 18 | ||||
-rw-r--r-- | drivers/scsi/fcoe/fcoe_ctlr.c | 13 | ||||
-rw-r--r-- | drivers/scsi/fcoe/fcoe_transport.c | 10 |
3 files changed, 20 insertions, 21 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index fe30b1b65e1d..2b065d26a5ae 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c | |||
@@ -1529,7 +1529,7 @@ static int fcoe_rcv(struct sk_buff *skb, struct net_device *netdev, | |||
1529 | 1529 | ||
1530 | return 0; | 1530 | return 0; |
1531 | err: | 1531 | err: |
1532 | per_cpu_ptr(lport->dev_stats, get_cpu())->ErrorFrames++; | 1532 | per_cpu_ptr(lport->stats, get_cpu())->ErrorFrames++; |
1533 | put_cpu(); | 1533 | put_cpu(); |
1534 | err2: | 1534 | err2: |
1535 | kfree_skb(skb); | 1535 | kfree_skb(skb); |
@@ -1569,7 +1569,7 @@ static int fcoe_xmit(struct fc_lport *lport, struct fc_frame *fp) | |||
1569 | struct ethhdr *eh; | 1569 | struct ethhdr *eh; |
1570 | struct fcoe_crc_eof *cp; | 1570 | struct fcoe_crc_eof *cp; |
1571 | struct sk_buff *skb; | 1571 | struct sk_buff *skb; |
1572 | struct fcoe_dev_stats *stats; | 1572 | struct fc_stats *stats; |
1573 | struct fc_frame_header *fh; | 1573 | struct fc_frame_header *fh; |
1574 | unsigned int hlen; /* header length implies the version */ | 1574 | unsigned int hlen; /* header length implies the version */ |
1575 | unsigned int tlen; /* trailer length */ | 1575 | unsigned int tlen; /* trailer length */ |
@@ -1680,7 +1680,7 @@ static int fcoe_xmit(struct fc_lport *lport, struct fc_frame *fp) | |||
1680 | skb_shinfo(skb)->gso_size = 0; | 1680 | skb_shinfo(skb)->gso_size = 0; |
1681 | } | 1681 | } |
1682 | /* update tx stats: regardless if LLD fails */ | 1682 | /* update tx stats: regardless if LLD fails */ |
1683 | stats = per_cpu_ptr(lport->dev_stats, get_cpu()); | 1683 | stats = per_cpu_ptr(lport->stats, get_cpu()); |
1684 | stats->TxFrames++; | 1684 | stats->TxFrames++; |
1685 | stats->TxWords += wlen; | 1685 | stats->TxWords += wlen; |
1686 | put_cpu(); | 1686 | put_cpu(); |
@@ -1714,7 +1714,7 @@ static inline int fcoe_filter_frames(struct fc_lport *lport, | |||
1714 | struct fcoe_interface *fcoe; | 1714 | struct fcoe_interface *fcoe; |
1715 | struct fc_frame_header *fh; | 1715 | struct fc_frame_header *fh; |
1716 | struct sk_buff *skb = (struct sk_buff *)fp; | 1716 | struct sk_buff *skb = (struct sk_buff *)fp; |
1717 | struct fcoe_dev_stats *stats; | 1717 | struct fc_stats *stats; |
1718 | 1718 | ||
1719 | /* | 1719 | /* |
1720 | * We only check CRC if no offload is available and if it is | 1720 | * We only check CRC if no offload is available and if it is |
@@ -1745,7 +1745,7 @@ static inline int fcoe_filter_frames(struct fc_lport *lport, | |||
1745 | return 0; | 1745 | return 0; |
1746 | } | 1746 | } |
1747 | 1747 | ||
1748 | stats = per_cpu_ptr(lport->dev_stats, get_cpu()); | 1748 | stats = per_cpu_ptr(lport->stats, get_cpu()); |
1749 | stats->InvalidCRCCount++; | 1749 | stats->InvalidCRCCount++; |
1750 | if (stats->InvalidCRCCount < 5) | 1750 | if (stats->InvalidCRCCount < 5) |
1751 | printk(KERN_WARNING "fcoe: dropping frame with CRC error\n"); | 1751 | printk(KERN_WARNING "fcoe: dropping frame with CRC error\n"); |
@@ -1762,7 +1762,7 @@ static void fcoe_recv_frame(struct sk_buff *skb) | |||
1762 | u32 fr_len; | 1762 | u32 fr_len; |
1763 | struct fc_lport *lport; | 1763 | struct fc_lport *lport; |
1764 | struct fcoe_rcv_info *fr; | 1764 | struct fcoe_rcv_info *fr; |
1765 | struct fcoe_dev_stats *stats; | 1765 | struct fc_stats *stats; |
1766 | struct fcoe_crc_eof crc_eof; | 1766 | struct fcoe_crc_eof crc_eof; |
1767 | struct fc_frame *fp; | 1767 | struct fc_frame *fp; |
1768 | struct fcoe_port *port; | 1768 | struct fcoe_port *port; |
@@ -1793,7 +1793,7 @@ static void fcoe_recv_frame(struct sk_buff *skb) | |||
1793 | */ | 1793 | */ |
1794 | hp = (struct fcoe_hdr *) skb_network_header(skb); | 1794 | hp = (struct fcoe_hdr *) skb_network_header(skb); |
1795 | 1795 | ||
1796 | stats = per_cpu_ptr(lport->dev_stats, get_cpu()); | 1796 | stats = per_cpu_ptr(lport->stats, get_cpu()); |
1797 | if (unlikely(FC_FCOE_DECAPS_VER(hp) != FC_FCOE_VER)) { | 1797 | if (unlikely(FC_FCOE_DECAPS_VER(hp) != FC_FCOE_VER)) { |
1798 | if (stats->ErrorFrames < 5) | 1798 | if (stats->ErrorFrames < 5) |
1799 | printk(KERN_WARNING "fcoe: FCoE version " | 1799 | printk(KERN_WARNING "fcoe: FCoE version " |
@@ -1970,7 +1970,7 @@ static int fcoe_device_notification(struct notifier_block *notifier, | |||
1970 | struct fcoe_ctlr *ctlr; | 1970 | struct fcoe_ctlr *ctlr; |
1971 | struct fcoe_interface *fcoe; | 1971 | struct fcoe_interface *fcoe; |
1972 | struct fcoe_port *port; | 1972 | struct fcoe_port *port; |
1973 | struct fcoe_dev_stats *stats; | 1973 | struct fc_stats *stats; |
1974 | u32 link_possible = 1; | 1974 | u32 link_possible = 1; |
1975 | u32 mfs; | 1975 | u32 mfs; |
1976 | int rc = NOTIFY_OK; | 1976 | int rc = NOTIFY_OK; |
@@ -2024,7 +2024,7 @@ static int fcoe_device_notification(struct notifier_block *notifier, | |||
2024 | if (link_possible && !fcoe_link_ok(lport)) | 2024 | if (link_possible && !fcoe_link_ok(lport)) |
2025 | fcoe_ctlr_link_up(ctlr); | 2025 | fcoe_ctlr_link_up(ctlr); |
2026 | else if (fcoe_ctlr_link_down(ctlr)) { | 2026 | else if (fcoe_ctlr_link_down(ctlr)) { |
2027 | stats = per_cpu_ptr(lport->dev_stats, get_cpu()); | 2027 | stats = per_cpu_ptr(lport->stats, get_cpu()); |
2028 | stats->LinkFailureCount++; | 2028 | stats->LinkFailureCount++; |
2029 | put_cpu(); | 2029 | put_cpu(); |
2030 | fcoe_clean_pending_queue(lport); | 2030 | fcoe_clean_pending_queue(lport); |
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c index d68d57241ee6..2ebe03a4b51d 100644 --- a/drivers/scsi/fcoe/fcoe_ctlr.c +++ b/drivers/scsi/fcoe/fcoe_ctlr.c | |||
@@ -788,11 +788,11 @@ static unsigned long fcoe_ctlr_age_fcfs(struct fcoe_ctlr *fip) | |||
788 | unsigned long deadline; | 788 | unsigned long deadline; |
789 | unsigned long sel_time = 0; | 789 | unsigned long sel_time = 0; |
790 | struct list_head del_list; | 790 | struct list_head del_list; |
791 | struct fcoe_dev_stats *stats; | 791 | struct fc_stats *stats; |
792 | 792 | ||
793 | INIT_LIST_HEAD(&del_list); | 793 | INIT_LIST_HEAD(&del_list); |
794 | 794 | ||
795 | stats = per_cpu_ptr(fip->lp->dev_stats, get_cpu()); | 795 | stats = per_cpu_ptr(fip->lp->stats, get_cpu()); |
796 | 796 | ||
797 | list_for_each_entry_safe(fcf, next, &fip->fcfs, list) { | 797 | list_for_each_entry_safe(fcf, next, &fip->fcfs, list) { |
798 | deadline = fcf->time + fcf->fka_period + fcf->fka_period / 2; | 798 | deadline = fcf->time + fcf->fka_period + fcf->fka_period / 2; |
@@ -1104,8 +1104,8 @@ static void fcoe_ctlr_recv_els(struct fcoe_ctlr *fip, struct sk_buff *skb) | |||
1104 | struct fc_frame_header *fh = NULL; | 1104 | struct fc_frame_header *fh = NULL; |
1105 | struct fip_desc *desc; | 1105 | struct fip_desc *desc; |
1106 | struct fip_encaps *els; | 1106 | struct fip_encaps *els; |
1107 | struct fcoe_dev_stats *stats; | ||
1108 | struct fcoe_fcf *sel; | 1107 | struct fcoe_fcf *sel; |
1108 | struct fc_stats *stats; | ||
1109 | enum fip_desc_type els_dtype = 0; | 1109 | enum fip_desc_type els_dtype = 0; |
1110 | u8 els_op; | 1110 | u8 els_op; |
1111 | u8 sub; | 1111 | u8 sub; |
@@ -1249,7 +1249,7 @@ static void fcoe_ctlr_recv_els(struct fcoe_ctlr *fip, struct sk_buff *skb) | |||
1249 | fr_dev(fp) = lport; | 1249 | fr_dev(fp) = lport; |
1250 | fr_encaps(fp) = els_dtype; | 1250 | fr_encaps(fp) = els_dtype; |
1251 | 1251 | ||
1252 | stats = per_cpu_ptr(lport->dev_stats, get_cpu()); | 1252 | stats = per_cpu_ptr(lport->stats, get_cpu()); |
1253 | stats->RxFrames++; | 1253 | stats->RxFrames++; |
1254 | stats->RxWords += skb->len / FIP_BPW; | 1254 | stats->RxWords += skb->len / FIP_BPW; |
1255 | put_cpu(); | 1255 | put_cpu(); |
@@ -1353,7 +1353,7 @@ static void fcoe_ctlr_recv_clr_vlink(struct fcoe_ctlr *fip, | |||
1353 | ntoh24(vp->fd_fc_id)); | 1353 | ntoh24(vp->fd_fc_id)); |
1354 | if (vn_port && (vn_port == lport)) { | 1354 | if (vn_port && (vn_port == lport)) { |
1355 | mutex_lock(&fip->ctlr_mutex); | 1355 | mutex_lock(&fip->ctlr_mutex); |
1356 | per_cpu_ptr(lport->dev_stats, | 1356 | per_cpu_ptr(lport->stats, |
1357 | get_cpu())->VLinkFailureCount++; | 1357 | get_cpu())->VLinkFailureCount++; |
1358 | put_cpu(); | 1358 | put_cpu(); |
1359 | fcoe_ctlr_reset(fip); | 1359 | fcoe_ctlr_reset(fip); |
@@ -1383,8 +1383,7 @@ static void fcoe_ctlr_recv_clr_vlink(struct fcoe_ctlr *fip, | |||
1383 | * followed by physical port | 1383 | * followed by physical port |
1384 | */ | 1384 | */ |
1385 | mutex_lock(&fip->ctlr_mutex); | 1385 | mutex_lock(&fip->ctlr_mutex); |
1386 | per_cpu_ptr(lport->dev_stats, | 1386 | per_cpu_ptr(lport->stats, get_cpu())->VLinkFailureCount++; |
1387 | get_cpu())->VLinkFailureCount++; | ||
1388 | put_cpu(); | 1387 | put_cpu(); |
1389 | fcoe_ctlr_reset(fip); | 1388 | fcoe_ctlr_reset(fip); |
1390 | mutex_unlock(&fip->ctlr_mutex); | 1389 | mutex_unlock(&fip->ctlr_mutex); |
diff --git a/drivers/scsi/fcoe/fcoe_transport.c b/drivers/scsi/fcoe/fcoe_transport.c index b46f43dced78..861c09f72b85 100644 --- a/drivers/scsi/fcoe/fcoe_transport.c +++ b/drivers/scsi/fcoe/fcoe_transport.c | |||
@@ -89,7 +89,7 @@ void __fcoe_get_lesb(struct fc_lport *lport, | |||
89 | { | 89 | { |
90 | unsigned int cpu; | 90 | unsigned int cpu; |
91 | u32 lfc, vlfc, mdac; | 91 | u32 lfc, vlfc, mdac; |
92 | struct fcoe_dev_stats *devst; | 92 | struct fc_stats *stats; |
93 | struct fcoe_fc_els_lesb *lesb; | 93 | struct fcoe_fc_els_lesb *lesb; |
94 | struct rtnl_link_stats64 temp; | 94 | struct rtnl_link_stats64 temp; |
95 | 95 | ||
@@ -99,10 +99,10 @@ void __fcoe_get_lesb(struct fc_lport *lport, | |||
99 | lesb = (struct fcoe_fc_els_lesb *)fc_lesb; | 99 | lesb = (struct fcoe_fc_els_lesb *)fc_lesb; |
100 | memset(lesb, 0, sizeof(*lesb)); | 100 | memset(lesb, 0, sizeof(*lesb)); |
101 | for_each_possible_cpu(cpu) { | 101 | for_each_possible_cpu(cpu) { |
102 | devst = per_cpu_ptr(lport->dev_stats, cpu); | 102 | stats = per_cpu_ptr(lport->stats, cpu); |
103 | lfc += devst->LinkFailureCount; | 103 | lfc += stats->LinkFailureCount; |
104 | vlfc += devst->VLinkFailureCount; | 104 | vlfc += stats->VLinkFailureCount; |
105 | mdac += devst->MissDiscAdvCount; | 105 | mdac += stats->MissDiscAdvCount; |
106 | } | 106 | } |
107 | lesb->lesb_link_fail = htonl(lfc); | 107 | lesb->lesb_link_fail = htonl(lfc); |
108 | lesb->lesb_vlink_fail = htonl(vlfc); | 108 | lesb->lesb_vlink_fail = htonl(vlfc); |