diff options
author | Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com> | 2009-11-23 01:32:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-23 13:44:35 -0500 |
commit | 94b982b2e4be9661fe1c3893aa780a711b09cd30 (patch) | |
tree | 5971d1a319805376569c944b78d19801725f3331 /drivers/net | |
parent | 713d039426a80ed78e71294cfb5d0a009bb20b42 (diff) |
ixgbe: Modify 82599 HWRSC statistics counters
Divide 82599 HWRSC counters into aggregated and flushed to count number of
packets getting coalesced per TCP connection.
Signed-off-by: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ixgbe/ixgbe.h | 4 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 3 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 25 |
3 files changed, 24 insertions, 8 deletions
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index 7eb08a6d3f99..76b052fa3643 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h | |||
@@ -159,6 +159,7 @@ struct ixgbe_ring { | |||
159 | struct ixgbe_queue_stats stats; | 159 | struct ixgbe_queue_stats stats; |
160 | unsigned long reinit_state; | 160 | unsigned long reinit_state; |
161 | u64 rsc_count; /* stat for coalesced packets */ | 161 | u64 rsc_count; /* stat for coalesced packets */ |
162 | u64 rsc_flush; /* stats for flushed packets */ | ||
162 | 163 | ||
163 | unsigned int size; /* length in bytes */ | 164 | unsigned int size; /* length in bytes */ |
164 | dma_addr_t dma; /* phys. address of descriptor ring */ | 165 | dma_addr_t dma; /* phys. address of descriptor ring */ |
@@ -375,7 +376,8 @@ struct ixgbe_adapter { | |||
375 | #ifdef IXGBE_FCOE | 376 | #ifdef IXGBE_FCOE |
376 | struct ixgbe_fcoe fcoe; | 377 | struct ixgbe_fcoe fcoe; |
377 | #endif /* IXGBE_FCOE */ | 378 | #endif /* IXGBE_FCOE */ |
378 | u64 rsc_count; | 379 | u64 rsc_total_count; |
380 | u64 rsc_total_flush; | ||
379 | u32 wol; | 381 | u32 wol; |
380 | u16 eeprom_version; | 382 | u16 eeprom_version; |
381 | }; | 383 | }; |
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 74f04e183545..84ab4db7074f 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -79,7 +79,8 @@ static struct ixgbe_stats ixgbe_gstrings_stats[] = { | |||
79 | {"rx_over_errors", IXGBE_NETDEV_STAT(stats.rx_over_errors)}, | 79 | {"rx_over_errors", IXGBE_NETDEV_STAT(stats.rx_over_errors)}, |
80 | {"rx_crc_errors", IXGBE_NETDEV_STAT(stats.rx_crc_errors)}, | 80 | {"rx_crc_errors", IXGBE_NETDEV_STAT(stats.rx_crc_errors)}, |
81 | {"rx_frame_errors", IXGBE_NETDEV_STAT(stats.rx_frame_errors)}, | 81 | {"rx_frame_errors", IXGBE_NETDEV_STAT(stats.rx_frame_errors)}, |
82 | {"hw_rsc_count", IXGBE_STAT(rsc_count)}, | 82 | {"hw_rsc_aggregated", IXGBE_STAT(rsc_total_count)}, |
83 | {"hw_rsc_flushed", IXGBE_STAT(rsc_total_flush)}, | ||
83 | {"fdir_match", IXGBE_STAT(stats.fdirmatch)}, | 84 | {"fdir_match", IXGBE_STAT(stats.fdirmatch)}, |
84 | {"fdir_miss", IXGBE_STAT(stats.fdirmiss)}, | 85 | {"fdir_miss", IXGBE_STAT(stats.fdirmiss)}, |
85 | {"rx_fifo_errors", IXGBE_NETDEV_STAT(stats.rx_fifo_errors)}, | 86 | {"rx_fifo_errors", IXGBE_NETDEV_STAT(stats.rx_fifo_errors)}, |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index ebcec30e0783..ffd1f1639706 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -729,12 +729,14 @@ static inline u32 ixgbe_get_rsc_count(union ixgbe_adv_rx_desc *rx_desc) | |||
729 | /** | 729 | /** |
730 | * ixgbe_transform_rsc_queue - change rsc queue into a full packet | 730 | * ixgbe_transform_rsc_queue - change rsc queue into a full packet |
731 | * @skb: pointer to the last skb in the rsc queue | 731 | * @skb: pointer to the last skb in the rsc queue |
732 | * @count: pointer to number of packets coalesced in this context | ||
732 | * | 733 | * |
733 | * This function changes a queue full of hw rsc buffers into a completed | 734 | * This function changes a queue full of hw rsc buffers into a completed |
734 | * packet. It uses the ->prev pointers to find the first packet and then | 735 | * packet. It uses the ->prev pointers to find the first packet and then |
735 | * turns it into the frag list owner. | 736 | * turns it into the frag list owner. |
736 | **/ | 737 | **/ |
737 | static inline struct sk_buff *ixgbe_transform_rsc_queue(struct sk_buff *skb) | 738 | static inline struct sk_buff *ixgbe_transform_rsc_queue(struct sk_buff *skb, |
739 | u64 *count) | ||
738 | { | 740 | { |
739 | unsigned int frag_list_size = 0; | 741 | unsigned int frag_list_size = 0; |
740 | 742 | ||
@@ -743,6 +745,7 @@ static inline struct sk_buff *ixgbe_transform_rsc_queue(struct sk_buff *skb) | |||
743 | frag_list_size += skb->len; | 745 | frag_list_size += skb->len; |
744 | skb->prev = NULL; | 746 | skb->prev = NULL; |
745 | skb = prev; | 747 | skb = prev; |
748 | *count += 1; | ||
746 | } | 749 | } |
747 | 750 | ||
748 | skb_shinfo(skb)->frag_list = skb->next; | 751 | skb_shinfo(skb)->frag_list = skb->next; |
@@ -845,14 +848,20 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
845 | u32 nextp = (staterr & IXGBE_RXDADV_NEXTP_MASK) >> | 848 | u32 nextp = (staterr & IXGBE_RXDADV_NEXTP_MASK) >> |
846 | IXGBE_RXDADV_NEXTP_SHIFT; | 849 | IXGBE_RXDADV_NEXTP_SHIFT; |
847 | next_buffer = &rx_ring->rx_buffer_info[nextp]; | 850 | next_buffer = &rx_ring->rx_buffer_info[nextp]; |
848 | rx_ring->rsc_count += (rsc_count - 1); | ||
849 | } else { | 851 | } else { |
850 | next_buffer = &rx_ring->rx_buffer_info[i]; | 852 | next_buffer = &rx_ring->rx_buffer_info[i]; |
851 | } | 853 | } |
852 | 854 | ||
853 | if (staterr & IXGBE_RXD_STAT_EOP) { | 855 | if (staterr & IXGBE_RXD_STAT_EOP) { |
854 | if (skb->prev) | 856 | if (skb->prev) |
855 | skb = ixgbe_transform_rsc_queue(skb); | 857 | skb = ixgbe_transform_rsc_queue(skb, &(rx_ring->rsc_count)); |
858 | if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) { | ||
859 | if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED) | ||
860 | rx_ring->rsc_count += skb_shinfo(skb)->nr_frags; | ||
861 | else | ||
862 | rx_ring->rsc_count++; | ||
863 | rx_ring->rsc_flush++; | ||
864 | } | ||
856 | rx_ring->stats.packets++; | 865 | rx_ring->stats.packets++; |
857 | rx_ring->stats.bytes += skb->len; | 866 | rx_ring->stats.bytes += skb->len; |
858 | } else { | 867 | } else { |
@@ -4474,14 +4483,18 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter) | |||
4474 | u64 total_mpc = 0; | 4483 | u64 total_mpc = 0; |
4475 | u32 i, missed_rx = 0, mpc, bprc, lxon, lxoff, xon_off_tot; | 4484 | u32 i, missed_rx = 0, mpc, bprc, lxon, lxoff, xon_off_tot; |
4476 | 4485 | ||
4477 | if (hw->mac.type == ixgbe_mac_82599EB) { | 4486 | if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) { |
4478 | u64 rsc_count = 0; | 4487 | u64 rsc_count = 0; |
4488 | u64 rsc_flush = 0; | ||
4479 | for (i = 0; i < 16; i++) | 4489 | for (i = 0; i < 16; i++) |
4480 | adapter->hw_rx_no_dma_resources += | 4490 | adapter->hw_rx_no_dma_resources += |
4481 | IXGBE_READ_REG(hw, IXGBE_QPRDC(i)); | 4491 | IXGBE_READ_REG(hw, IXGBE_QPRDC(i)); |
4482 | for (i = 0; i < adapter->num_rx_queues; i++) | 4492 | for (i = 0; i < adapter->num_rx_queues; i++) { |
4483 | rsc_count += adapter->rx_ring[i].rsc_count; | 4493 | rsc_count += adapter->rx_ring[i].rsc_count; |
4484 | adapter->rsc_count = rsc_count; | 4494 | rsc_flush += adapter->rx_ring[i].rsc_flush; |
4495 | } | ||
4496 | adapter->rsc_total_count = rsc_count; | ||
4497 | adapter->rsc_total_flush = rsc_flush; | ||
4485 | } | 4498 | } |
4486 | 4499 | ||
4487 | adapter->stats.crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS); | 4500 | adapter->stats.crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS); |