diff options
author | Mark Rustad <mark.d.rustad@intel.com> | 2012-07-18 02:05:50 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2012-09-16 01:43:25 -0400 |
commit | 4ffdf91a5feae6f0f1486d038fcbba461345fa62 (patch) | |
tree | c816e66f5f51aff43ac916a9ef1f9e78385aab85 /drivers/net/ethernet/intel | |
parent | 91fbd8f081e22a3d296b45766eaf5045925f9313 (diff) |
ixgbe: Improve statistics accuracy for DDP traffic
Noticed that the byte and packet count statistics are under-
counting traffic handled by the DDP offload when there is more
than one DDP completion processed in a single call to
ixgbe_clean_rx_irq. This patch fixes that.
I tried to optimize the setting of the rss value so that it
only would have to be computed once, and only when there is
a DDP completion present.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index b3b846b32deb..2dc9d91e2b67 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -1785,7 +1785,8 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
1785 | unsigned int total_rx_bytes = 0, total_rx_packets = 0; | 1785 | unsigned int total_rx_bytes = 0, total_rx_packets = 0; |
1786 | #ifdef IXGBE_FCOE | 1786 | #ifdef IXGBE_FCOE |
1787 | struct ixgbe_adapter *adapter = q_vector->adapter; | 1787 | struct ixgbe_adapter *adapter = q_vector->adapter; |
1788 | int ddp_bytes = 0; | 1788 | int ddp_bytes; |
1789 | unsigned int mss = 0; | ||
1789 | #endif /* IXGBE_FCOE */ | 1790 | #endif /* IXGBE_FCOE */ |
1790 | u16 cleaned_count = ixgbe_desc_unused(rx_ring); | 1791 | u16 cleaned_count = ixgbe_desc_unused(rx_ring); |
1791 | 1792 | ||
@@ -1839,6 +1840,20 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
1839 | /* if ddp, not passing to ULD unless for FCP_RSP or error */ | 1840 | /* if ddp, not passing to ULD unless for FCP_RSP or error */ |
1840 | if (ixgbe_rx_is_fcoe(rx_ring, rx_desc)) { | 1841 | if (ixgbe_rx_is_fcoe(rx_ring, rx_desc)) { |
1841 | ddp_bytes = ixgbe_fcoe_ddp(adapter, rx_desc, skb); | 1842 | ddp_bytes = ixgbe_fcoe_ddp(adapter, rx_desc, skb); |
1843 | /* include DDPed FCoE data */ | ||
1844 | if (ddp_bytes > 0) { | ||
1845 | if (!mss) { | ||
1846 | mss = rx_ring->netdev->mtu - | ||
1847 | sizeof(struct fcoe_hdr) - | ||
1848 | sizeof(struct fc_frame_header) - | ||
1849 | sizeof(struct fcoe_crc_eof); | ||
1850 | if (mss > 512) | ||
1851 | mss &= ~511; | ||
1852 | } | ||
1853 | total_rx_bytes += ddp_bytes; | ||
1854 | total_rx_packets += DIV_ROUND_UP(ddp_bytes, | ||
1855 | mss); | ||
1856 | } | ||
1842 | if (!ddp_bytes) { | 1857 | if (!ddp_bytes) { |
1843 | dev_kfree_skb_any(skb); | 1858 | dev_kfree_skb_any(skb); |
1844 | continue; | 1859 | continue; |
@@ -1852,21 +1867,6 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
1852 | budget--; | 1867 | budget--; |
1853 | } while (likely(budget)); | 1868 | } while (likely(budget)); |
1854 | 1869 | ||
1855 | #ifdef IXGBE_FCOE | ||
1856 | /* include DDPed FCoE data */ | ||
1857 | if (ddp_bytes > 0) { | ||
1858 | unsigned int mss; | ||
1859 | |||
1860 | mss = rx_ring->netdev->mtu - sizeof(struct fcoe_hdr) - | ||
1861 | sizeof(struct fc_frame_header) - | ||
1862 | sizeof(struct fcoe_crc_eof); | ||
1863 | if (mss > 512) | ||
1864 | mss &= ~511; | ||
1865 | total_rx_bytes += ddp_bytes; | ||
1866 | total_rx_packets += DIV_ROUND_UP(ddp_bytes, mss); | ||
1867 | } | ||
1868 | |||
1869 | #endif /* IXGBE_FCOE */ | ||
1870 | u64_stats_update_begin(&rx_ring->syncp); | 1870 | u64_stats_update_begin(&rx_ring->syncp); |
1871 | rx_ring->stats.packets += total_rx_packets; | 1871 | rx_ring->stats.packets += total_rx_packets; |
1872 | rx_ring->stats.bytes += total_rx_bytes; | 1872 | rx_ring->stats.bytes += total_rx_bytes; |