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 | |
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>
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 10 | ||||
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_io.c | 4 | ||||
-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 | ||||
-rw-r--r-- | drivers/scsi/libfc/fc_exch.c | 4 | ||||
-rw-r--r-- | drivers/scsi/libfc/fc_fcp.c | 8 | ||||
-rw-r--r-- | drivers/scsi/libfc/fc_frame.c | 2 | ||||
-rw-r--r-- | drivers/scsi/libfc/fc_lport.c | 54 | ||||
-rw-r--r-- | include/scsi/libfc.h | 17 |
10 files changed, 69 insertions, 71 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index f52f668fd247..49bd99e49c64 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c | |||
@@ -286,7 +286,7 @@ static int bnx2fc_xmit(struct fc_lport *lport, struct fc_frame *fp) | |||
286 | struct fcoe_port *port; | 286 | struct fcoe_port *port; |
287 | struct fcoe_hdr *hp; | 287 | struct fcoe_hdr *hp; |
288 | struct bnx2fc_rport *tgt; | 288 | struct bnx2fc_rport *tgt; |
289 | struct fcoe_dev_stats *stats; | 289 | struct fc_stats *stats; |
290 | u8 sof, eof; | 290 | u8 sof, eof; |
291 | u32 crc; | 291 | u32 crc; |
292 | unsigned int hlen, tlen, elen; | 292 | unsigned int hlen, tlen, elen; |
@@ -412,7 +412,7 @@ static int bnx2fc_xmit(struct fc_lport *lport, struct fc_frame *fp) | |||
412 | } | 412 | } |
413 | 413 | ||
414 | /*update tx stats */ | 414 | /*update tx stats */ |
415 | stats = per_cpu_ptr(lport->dev_stats, get_cpu()); | 415 | stats = per_cpu_ptr(lport->stats, get_cpu()); |
416 | stats->TxFrames++; | 416 | stats->TxFrames++; |
417 | stats->TxWords += wlen; | 417 | stats->TxWords += wlen; |
418 | put_cpu(); | 418 | put_cpu(); |
@@ -522,7 +522,7 @@ static void bnx2fc_recv_frame(struct sk_buff *skb) | |||
522 | u32 fr_len; | 522 | u32 fr_len; |
523 | struct fc_lport *lport; | 523 | struct fc_lport *lport; |
524 | struct fcoe_rcv_info *fr; | 524 | struct fcoe_rcv_info *fr; |
525 | struct fcoe_dev_stats *stats; | 525 | struct fc_stats *stats; |
526 | struct fc_frame_header *fh; | 526 | struct fc_frame_header *fh; |
527 | struct fcoe_crc_eof crc_eof; | 527 | struct fcoe_crc_eof crc_eof; |
528 | struct fc_frame *fp; | 528 | struct fc_frame *fp; |
@@ -551,7 +551,7 @@ static void bnx2fc_recv_frame(struct sk_buff *skb) | |||
551 | skb_pull(skb, sizeof(struct fcoe_hdr)); | 551 | skb_pull(skb, sizeof(struct fcoe_hdr)); |
552 | fr_len = skb->len - sizeof(struct fcoe_crc_eof); | 552 | fr_len = skb->len - sizeof(struct fcoe_crc_eof); |
553 | 553 | ||
554 | stats = per_cpu_ptr(lport->dev_stats, get_cpu()); | 554 | stats = per_cpu_ptr(lport->stats, get_cpu()); |
555 | stats->RxFrames++; | 555 | stats->RxFrames++; |
556 | stats->RxWords += fr_len / FCOE_WORD_TO_BYTE; | 556 | stats->RxWords += fr_len / FCOE_WORD_TO_BYTE; |
557 | 557 | ||
@@ -942,7 +942,7 @@ static void bnx2fc_indicate_netevent(void *context, unsigned long event, | |||
942 | FC_PORTTYPE_UNKNOWN; | 942 | FC_PORTTYPE_UNKNOWN; |
943 | mutex_unlock(&lport->lp_mutex); | 943 | mutex_unlock(&lport->lp_mutex); |
944 | fc_host_port_type(lport->host) = FC_PORTTYPE_UNKNOWN; | 944 | fc_host_port_type(lport->host) = FC_PORTTYPE_UNKNOWN; |
945 | per_cpu_ptr(lport->dev_stats, | 945 | per_cpu_ptr(lport->stats, |
946 | get_cpu())->LinkFailureCount++; | 946 | get_cpu())->LinkFailureCount++; |
947 | put_cpu(); | 947 | put_cpu(); |
948 | fcoe_clean_pending_queue(lport); | 948 | fcoe_clean_pending_queue(lport); |
diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c index 4f7453b9e41e..a4fdc3d47f44 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_io.c +++ b/drivers/scsi/bnx2fc/bnx2fc_io.c | |||
@@ -1980,7 +1980,7 @@ int bnx2fc_post_io_req(struct bnx2fc_rport *tgt, | |||
1980 | struct bnx2fc_interface *interface = port->priv; | 1980 | struct bnx2fc_interface *interface = port->priv; |
1981 | struct bnx2fc_hba *hba = interface->hba; | 1981 | struct bnx2fc_hba *hba = interface->hba; |
1982 | struct fc_lport *lport = port->lport; | 1982 | struct fc_lport *lport = port->lport; |
1983 | struct fcoe_dev_stats *stats; | 1983 | struct fc_stats *stats; |
1984 | int task_idx, index; | 1984 | int task_idx, index; |
1985 | u16 xid; | 1985 | u16 xid; |
1986 | 1986 | ||
@@ -1991,7 +1991,7 @@ int bnx2fc_post_io_req(struct bnx2fc_rport *tgt, | |||
1991 | io_req->data_xfer_len = scsi_bufflen(sc_cmd); | 1991 | io_req->data_xfer_len = scsi_bufflen(sc_cmd); |
1992 | sc_cmd->SCp.ptr = (char *)io_req; | 1992 | sc_cmd->SCp.ptr = (char *)io_req; |
1993 | 1993 | ||
1994 | stats = per_cpu_ptr(lport->dev_stats, get_cpu()); | 1994 | stats = per_cpu_ptr(lport->stats, get_cpu()); |
1995 | if (sc_cmd->sc_data_direction == DMA_FROM_DEVICE) { | 1995 | if (sc_cmd->sc_data_direction == DMA_FROM_DEVICE) { |
1996 | io_req->io_req_flags = BNX2FC_READ; | 1996 | io_req->io_req_flags = BNX2FC_READ; |
1997 | stats->InputRequests++; | 1997 | stats->InputRequests++; |
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); |
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c index aceffadb21c7..1d0334f83f78 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c | |||
@@ -124,7 +124,7 @@ struct fc_exch_mgr { | |||
124 | * for each anchor to determine if that EM should be used. The last | 124 | * for each anchor to determine if that EM should be used. The last |
125 | * anchor in the list will always match to handle any exchanges not | 125 | * anchor in the list will always match to handle any exchanges not |
126 | * handled by other EMs. The non-default EMs would be added to the | 126 | * handled by other EMs. The non-default EMs would be added to the |
127 | * anchor list by HW that provides FCoE offloads. | 127 | * anchor list by HW that provides offloads. |
128 | */ | 128 | */ |
129 | struct fc_exch_mgr_anchor { | 129 | struct fc_exch_mgr_anchor { |
130 | struct list_head ema_list; | 130 | struct list_head ema_list; |
@@ -986,7 +986,7 @@ static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_lport *lport, | |||
986 | /* | 986 | /* |
987 | * Update sequence_id based on incoming last | 987 | * Update sequence_id based on incoming last |
988 | * frame of sequence exchange. This is needed | 988 | * frame of sequence exchange. This is needed |
989 | * for FCoE target where DDP has been used | 989 | * for FC target where DDP has been used |
990 | * on target where, stack is indicated only | 990 | * on target where, stack is indicated only |
991 | * about last frame's (payload _header) header. | 991 | * about last frame's (payload _header) header. |
992 | * Whereas "seq_id" which is part of | 992 | * Whereas "seq_id" which is part of |
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index f7357308655a..5c4c504fc105 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c | |||
@@ -434,7 +434,7 @@ static void fc_fcp_recv_data(struct fc_fcp_pkt *fsp, struct fc_frame *fp) | |||
434 | { | 434 | { |
435 | struct scsi_cmnd *sc = fsp->cmd; | 435 | struct scsi_cmnd *sc = fsp->cmd; |
436 | struct fc_lport *lport = fsp->lp; | 436 | struct fc_lport *lport = fsp->lp; |
437 | struct fcoe_dev_stats *stats; | 437 | struct fc_stats *stats; |
438 | struct fc_frame_header *fh; | 438 | struct fc_frame_header *fh; |
439 | size_t start_offset; | 439 | size_t start_offset; |
440 | size_t offset; | 440 | size_t offset; |
@@ -496,7 +496,7 @@ static void fc_fcp_recv_data(struct fc_fcp_pkt *fsp, struct fc_frame *fp) | |||
496 | 496 | ||
497 | if (~crc != le32_to_cpu(fr_crc(fp))) { | 497 | if (~crc != le32_to_cpu(fr_crc(fp))) { |
498 | crc_err: | 498 | crc_err: |
499 | stats = per_cpu_ptr(lport->dev_stats, get_cpu()); | 499 | stats = per_cpu_ptr(lport->stats, get_cpu()); |
500 | stats->ErrorFrames++; | 500 | stats->ErrorFrames++; |
501 | /* per cpu count, not total count, but OK for limit */ | 501 | /* per cpu count, not total count, but OK for limit */ |
502 | if (stats->InvalidCRCCount++ < FC_MAX_ERROR_CNT) | 502 | if (stats->InvalidCRCCount++ < FC_MAX_ERROR_CNT) |
@@ -1786,7 +1786,7 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd) | |||
1786 | struct fc_rport_libfc_priv *rpriv; | 1786 | struct fc_rport_libfc_priv *rpriv; |
1787 | int rval; | 1787 | int rval; |
1788 | int rc = 0; | 1788 | int rc = 0; |
1789 | struct fcoe_dev_stats *stats; | 1789 | struct fc_stats *stats; |
1790 | 1790 | ||
1791 | rval = fc_remote_port_chkready(rport); | 1791 | rval = fc_remote_port_chkready(rport); |
1792 | if (rval) { | 1792 | if (rval) { |
@@ -1835,7 +1835,7 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd) | |||
1835 | /* | 1835 | /* |
1836 | * setup the data direction | 1836 | * setup the data direction |
1837 | */ | 1837 | */ |
1838 | stats = per_cpu_ptr(lport->dev_stats, get_cpu()); | 1838 | stats = per_cpu_ptr(lport->stats, get_cpu()); |
1839 | if (sc_cmd->sc_data_direction == DMA_FROM_DEVICE) { | 1839 | if (sc_cmd->sc_data_direction == DMA_FROM_DEVICE) { |
1840 | fsp->req_flags = FC_SRB_READ; | 1840 | fsp->req_flags = FC_SRB_READ; |
1841 | stats->InputRequests++; | 1841 | stats->InputRequests++; |
diff --git a/drivers/scsi/libfc/fc_frame.c b/drivers/scsi/libfc/fc_frame.c index 981329a17c48..0382ac06906e 100644 --- a/drivers/scsi/libfc/fc_frame.c +++ b/drivers/scsi/libfc/fc_frame.c | |||
@@ -49,7 +49,7 @@ u32 fc_frame_crc_check(struct fc_frame *fp) | |||
49 | EXPORT_SYMBOL(fc_frame_crc_check); | 49 | EXPORT_SYMBOL(fc_frame_crc_check); |
50 | 50 | ||
51 | /* | 51 | /* |
52 | * Allocate a frame intended to be sent via fcoe_xmit. | 52 | * Allocate a frame intended to be sent. |
53 | * Get an sk_buff for the frame and set the length. | 53 | * Get an sk_buff for the frame and set the length. |
54 | */ | 54 | */ |
55 | struct fc_frame *_fc_frame_alloc(size_t len) | 55 | struct fc_frame *_fc_frame_alloc(size_t len) |
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c index c1402fb499ab..3e8c48dfa42f 100644 --- a/drivers/scsi/libfc/fc_lport.c +++ b/drivers/scsi/libfc/fc_lport.c | |||
@@ -299,47 +299,47 @@ EXPORT_SYMBOL(fc_get_host_speed); | |||
299 | */ | 299 | */ |
300 | struct fc_host_statistics *fc_get_host_stats(struct Scsi_Host *shost) | 300 | struct fc_host_statistics *fc_get_host_stats(struct Scsi_Host *shost) |
301 | { | 301 | { |
302 | struct fc_host_statistics *fcoe_stats; | 302 | struct fc_host_statistics *fc_stats; |
303 | struct fc_lport *lport = shost_priv(shost); | 303 | struct fc_lport *lport = shost_priv(shost); |
304 | struct timespec v0, v1; | 304 | struct timespec v0, v1; |
305 | unsigned int cpu; | 305 | unsigned int cpu; |
306 | u64 fcp_in_bytes = 0; | 306 | u64 fcp_in_bytes = 0; |
307 | u64 fcp_out_bytes = 0; | 307 | u64 fcp_out_bytes = 0; |
308 | 308 | ||
309 | fcoe_stats = &lport->host_stats; | 309 | fc_stats = &lport->host_stats; |
310 | memset(fcoe_stats, 0, sizeof(struct fc_host_statistics)); | 310 | memset(fc_stats, 0, sizeof(struct fc_host_statistics)); |
311 | 311 | ||
312 | jiffies_to_timespec(jiffies, &v0); | 312 | jiffies_to_timespec(jiffies, &v0); |
313 | jiffies_to_timespec(lport->boot_time, &v1); | 313 | jiffies_to_timespec(lport->boot_time, &v1); |
314 | fcoe_stats->seconds_since_last_reset = (v0.tv_sec - v1.tv_sec); | 314 | fc_stats->seconds_since_last_reset = (v0.tv_sec - v1.tv_sec); |
315 | 315 | ||
316 | for_each_possible_cpu(cpu) { | 316 | for_each_possible_cpu(cpu) { |
317 | struct fcoe_dev_stats *stats; | 317 | struct fc_stats *stats; |
318 | 318 | ||
319 | stats = per_cpu_ptr(lport->dev_stats, cpu); | 319 | stats = per_cpu_ptr(lport->stats, cpu); |
320 | 320 | ||
321 | fcoe_stats->tx_frames += stats->TxFrames; | 321 | fc_stats->tx_frames += stats->TxFrames; |
322 | fcoe_stats->tx_words += stats->TxWords; | 322 | fc_stats->tx_words += stats->TxWords; |
323 | fcoe_stats->rx_frames += stats->RxFrames; | 323 | fc_stats->rx_frames += stats->RxFrames; |
324 | fcoe_stats->rx_words += stats->RxWords; | 324 | fc_stats->rx_words += stats->RxWords; |
325 | fcoe_stats->error_frames += stats->ErrorFrames; | 325 | fc_stats->error_frames += stats->ErrorFrames; |
326 | fcoe_stats->invalid_crc_count += stats->InvalidCRCCount; | 326 | fc_stats->invalid_crc_count += stats->InvalidCRCCount; |
327 | fcoe_stats->fcp_input_requests += stats->InputRequests; | 327 | fc_stats->fcp_input_requests += stats->InputRequests; |
328 | fcoe_stats->fcp_output_requests += stats->OutputRequests; | 328 | fc_stats->fcp_output_requests += stats->OutputRequests; |
329 | fcoe_stats->fcp_control_requests += stats->ControlRequests; | 329 | fc_stats->fcp_control_requests += stats->ControlRequests; |
330 | fcp_in_bytes += stats->InputBytes; | 330 | fcp_in_bytes += stats->InputBytes; |
331 | fcp_out_bytes += stats->OutputBytes; | 331 | fcp_out_bytes += stats->OutputBytes; |
332 | fcoe_stats->link_failure_count += stats->LinkFailureCount; | 332 | fc_stats->link_failure_count += stats->LinkFailureCount; |
333 | } | 333 | } |
334 | fcoe_stats->fcp_input_megabytes = div_u64(fcp_in_bytes, 1000000); | 334 | fc_stats->fcp_input_megabytes = div_u64(fcp_in_bytes, 1000000); |
335 | fcoe_stats->fcp_output_megabytes = div_u64(fcp_out_bytes, 1000000); | 335 | fc_stats->fcp_output_megabytes = div_u64(fcp_out_bytes, 1000000); |
336 | fcoe_stats->lip_count = -1; | 336 | fc_stats->lip_count = -1; |
337 | fcoe_stats->nos_count = -1; | 337 | fc_stats->nos_count = -1; |
338 | fcoe_stats->loss_of_sync_count = -1; | 338 | fc_stats->loss_of_sync_count = -1; |
339 | fcoe_stats->loss_of_signal_count = -1; | 339 | fc_stats->loss_of_signal_count = -1; |
340 | fcoe_stats->prim_seq_protocol_err_count = -1; | 340 | fc_stats->prim_seq_protocol_err_count = -1; |
341 | fcoe_stats->dumped_frames = -1; | 341 | fc_stats->dumped_frames = -1; |
342 | return fcoe_stats; | 342 | return fc_stats; |
343 | } | 343 | } |
344 | EXPORT_SYMBOL(fc_get_host_stats); | 344 | EXPORT_SYMBOL(fc_get_host_stats); |
345 | 345 | ||
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 8f9dfba3fcf0..ea52ca203c95 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h | |||
@@ -224,7 +224,7 @@ struct fc_rport_priv { | |||
224 | }; | 224 | }; |
225 | 225 | ||
226 | /** | 226 | /** |
227 | * struct fcoe_dev_stats - fcoe stats structure | 227 | * struct fc_stats - fc stats structure |
228 | * @SecondsSinceLastReset: Seconds since the last reset | 228 | * @SecondsSinceLastReset: Seconds since the last reset |
229 | * @TxFrames: Number of transmitted frames | 229 | * @TxFrames: Number of transmitted frames |
230 | * @TxWords: Number of transmitted words | 230 | * @TxWords: Number of transmitted words |
@@ -244,7 +244,7 @@ struct fc_rport_priv { | |||
244 | * @VLinkFailureCount: Number of virtual link failures | 244 | * @VLinkFailureCount: Number of virtual link failures |
245 | * @MissDiscAdvCount: Number of missing FIP discovery advertisement | 245 | * @MissDiscAdvCount: Number of missing FIP discovery advertisement |
246 | */ | 246 | */ |
247 | struct fcoe_dev_stats { | 247 | struct fc_stats { |
248 | u64 SecondsSinceLastReset; | 248 | u64 SecondsSinceLastReset; |
249 | u64 TxFrames; | 249 | u64 TxFrames; |
250 | u64 TxWords; | 250 | u64 TxWords; |
@@ -510,7 +510,7 @@ struct libfc_function_template { | |||
510 | int (*ddp_done)(struct fc_lport *, u16); | 510 | int (*ddp_done)(struct fc_lport *, u16); |
511 | /* | 511 | /* |
512 | * Sets up the DDP context for a given exchange id on the given | 512 | * Sets up the DDP context for a given exchange id on the given |
513 | * scatterlist if LLD supports DDP for FCoE target. | 513 | * scatterlist if LLD supports DDP for target. |
514 | * | 514 | * |
515 | * STATUS: OPTIONAL | 515 | * STATUS: OPTIONAL |
516 | */ | 516 | */ |
@@ -817,8 +817,7 @@ enum fc_lport_event { | |||
817 | * @state: Identifies the state | 817 | * @state: Identifies the state |
818 | * @boot_time: Timestamp indicating when the local port came online | 818 | * @boot_time: Timestamp indicating when the local port came online |
819 | * @host_stats: SCSI host statistics | 819 | * @host_stats: SCSI host statistics |
820 | * @dev_stats: FCoE device stats (TODO: libfc should not be | 820 | * @stats: FC local port stats (TODO separate libfc LLD stats) |
821 | * FCoE aware) | ||
822 | * @retry_count: Number of retries in the current state | 821 | * @retry_count: Number of retries in the current state |
823 | * @port_id: FC Port ID | 822 | * @port_id: FC Port ID |
824 | * @wwpn: World Wide Port Name | 823 | * @wwpn: World Wide Port Name |
@@ -867,7 +866,7 @@ struct fc_lport { | |||
867 | enum fc_lport_state state; | 866 | enum fc_lport_state state; |
868 | unsigned long boot_time; | 867 | unsigned long boot_time; |
869 | struct fc_host_statistics host_stats; | 868 | struct fc_host_statistics host_stats; |
870 | struct fcoe_dev_stats __percpu *dev_stats; | 869 | struct fc_stats __percpu *stats; |
871 | u8 retry_count; | 870 | u8 retry_count; |
872 | 871 | ||
873 | /* Fabric information */ | 872 | /* Fabric information */ |
@@ -980,8 +979,8 @@ static inline void fc_lport_state_enter(struct fc_lport *lport, | |||
980 | */ | 979 | */ |
981 | static inline int fc_lport_init_stats(struct fc_lport *lport) | 980 | static inline int fc_lport_init_stats(struct fc_lport *lport) |
982 | { | 981 | { |
983 | lport->dev_stats = alloc_percpu(struct fcoe_dev_stats); | 982 | lport->stats = alloc_percpu(struct fc_stats); |
984 | if (!lport->dev_stats) | 983 | if (!lport->stats) |
985 | return -ENOMEM; | 984 | return -ENOMEM; |
986 | return 0; | 985 | return 0; |
987 | } | 986 | } |
@@ -992,7 +991,7 @@ static inline int fc_lport_init_stats(struct fc_lport *lport) | |||
992 | */ | 991 | */ |
993 | static inline void fc_lport_free_stats(struct fc_lport *lport) | 992 | static inline void fc_lport_free_stats(struct fc_lport *lport) |
994 | { | 993 | { |
995 | free_percpu(lport->dev_stats); | 994 | free_percpu(lport->stats); |
996 | } | 995 | } |
997 | 996 | ||
998 | /** | 997 | /** |