diff options
Diffstat (limited to 'drivers/scsi/fcoe/fcoe.c')
-rw-r--r-- | drivers/scsi/fcoe/fcoe.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index fe30b1b65e1d..078d262ac7cc 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 " |
@@ -1851,23 +1851,25 @@ static int fcoe_percpu_receive_thread(void *arg) | |||
1851 | 1851 | ||
1852 | set_user_nice(current, -20); | 1852 | set_user_nice(current, -20); |
1853 | 1853 | ||
1854 | retry: | ||
1854 | while (!kthread_should_stop()) { | 1855 | while (!kthread_should_stop()) { |
1855 | 1856 | ||
1856 | spin_lock_bh(&p->fcoe_rx_list.lock); | 1857 | spin_lock_bh(&p->fcoe_rx_list.lock); |
1857 | skb_queue_splice_init(&p->fcoe_rx_list, &tmp); | 1858 | skb_queue_splice_init(&p->fcoe_rx_list, &tmp); |
1858 | spin_unlock_bh(&p->fcoe_rx_list.lock); | ||
1859 | |||
1860 | while ((skb = __skb_dequeue(&tmp)) != NULL) | ||
1861 | fcoe_recv_frame(skb); | ||
1862 | 1859 | ||
1863 | spin_lock_bh(&p->fcoe_rx_list.lock); | 1860 | if (!skb_queue_len(&tmp)) { |
1864 | if (!skb_queue_len(&p->fcoe_rx_list)) { | ||
1865 | set_current_state(TASK_INTERRUPTIBLE); | 1861 | set_current_state(TASK_INTERRUPTIBLE); |
1866 | spin_unlock_bh(&p->fcoe_rx_list.lock); | 1862 | spin_unlock_bh(&p->fcoe_rx_list.lock); |
1867 | schedule(); | 1863 | schedule(); |
1868 | set_current_state(TASK_RUNNING); | 1864 | set_current_state(TASK_RUNNING); |
1869 | } else | 1865 | goto retry; |
1870 | spin_unlock_bh(&p->fcoe_rx_list.lock); | 1866 | } |
1867 | |||
1868 | spin_unlock_bh(&p->fcoe_rx_list.lock); | ||
1869 | |||
1870 | while ((skb = __skb_dequeue(&tmp)) != NULL) | ||
1871 | fcoe_recv_frame(skb); | ||
1872 | |||
1871 | } | 1873 | } |
1872 | return 0; | 1874 | return 0; |
1873 | } | 1875 | } |
@@ -1970,7 +1972,7 @@ static int fcoe_device_notification(struct notifier_block *notifier, | |||
1970 | struct fcoe_ctlr *ctlr; | 1972 | struct fcoe_ctlr *ctlr; |
1971 | struct fcoe_interface *fcoe; | 1973 | struct fcoe_interface *fcoe; |
1972 | struct fcoe_port *port; | 1974 | struct fcoe_port *port; |
1973 | struct fcoe_dev_stats *stats; | 1975 | struct fc_stats *stats; |
1974 | u32 link_possible = 1; | 1976 | u32 link_possible = 1; |
1975 | u32 mfs; | 1977 | u32 mfs; |
1976 | int rc = NOTIFY_OK; | 1978 | int rc = NOTIFY_OK; |
@@ -2024,7 +2026,7 @@ static int fcoe_device_notification(struct notifier_block *notifier, | |||
2024 | if (link_possible && !fcoe_link_ok(lport)) | 2026 | if (link_possible && !fcoe_link_ok(lport)) |
2025 | fcoe_ctlr_link_up(ctlr); | 2027 | fcoe_ctlr_link_up(ctlr); |
2026 | else if (fcoe_ctlr_link_down(ctlr)) { | 2028 | else if (fcoe_ctlr_link_down(ctlr)) { |
2027 | stats = per_cpu_ptr(lport->dev_stats, get_cpu()); | 2029 | stats = per_cpu_ptr(lport->stats, get_cpu()); |
2028 | stats->LinkFailureCount++; | 2030 | stats->LinkFailureCount++; |
2029 | put_cpu(); | 2031 | put_cpu(); |
2030 | fcoe_clean_pending_queue(lport); | 2032 | fcoe_clean_pending_queue(lport); |