All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next-2.6 PATCH 1/3] ixgbe: Modify 82599 HWRSC statistics counters
@ 2009-11-23 16:32 Jeff Kirsher
  2009-11-23 16:32 ` [net-next-2.6 PATCH 3/3] ixgbe: Only set/clear VFE in ixgbe_set_rx_mode Jeff Kirsher
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jeff Kirsher @ 2009-11-23 16:32 UTC (permalink / raw)
  To: davem
  Cc: netdev, gospo, Mallikarjuna R Chilakala, Peter P Waskiewicz Jr,
	Jeff Kirsher

From: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>

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>
---

 drivers/net/ixgbe/ixgbe.h         |    4 +++-
 drivers/net/ixgbe/ixgbe_ethtool.c |    3 ++-
 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 7eb08a6..76b052f 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -159,6 +159,7 @@ struct ixgbe_ring {
 	struct ixgbe_queue_stats stats;
 	unsigned long reinit_state;
 	u64 rsc_count;			/* stat for coalesced packets */
+	u64 rsc_flush;			/* stats for flushed packets */
 
 	unsigned int size;		/* length in bytes */
 	dma_addr_t dma;			/* phys. address of descriptor ring */
@@ -375,7 +376,8 @@ struct ixgbe_adapter {
 #ifdef IXGBE_FCOE
 	struct ixgbe_fcoe fcoe;
 #endif /* IXGBE_FCOE */
-	u64 rsc_count;
+	u64 rsc_total_count;
+	u64 rsc_total_flush;
 	u32 wol;
 	u16 eeprom_version;
 };
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 74f04e1..84ab4db 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[] = {
 	{"rx_over_errors", IXGBE_NETDEV_STAT(stats.rx_over_errors)},
 	{"rx_crc_errors", IXGBE_NETDEV_STAT(stats.rx_crc_errors)},
 	{"rx_frame_errors", IXGBE_NETDEV_STAT(stats.rx_frame_errors)},
-	{"hw_rsc_count", IXGBE_STAT(rsc_count)},
+	{"hw_rsc_aggregated", IXGBE_STAT(rsc_total_count)},
+	{"hw_rsc_flushed", IXGBE_STAT(rsc_total_flush)},
 	{"fdir_match", IXGBE_STAT(stats.fdirmatch)},
 	{"fdir_miss", IXGBE_STAT(stats.fdirmiss)},
 	{"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 ebcec30..ffd1f16 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)
 /**
  * ixgbe_transform_rsc_queue - change rsc queue into a full packet
  * @skb: pointer to the last skb in the rsc queue
+ * @count: pointer to number of packets coalesced in this context
  *
  * This function changes a queue full of hw rsc buffers into a completed
  * packet.  It uses the ->prev pointers to find the first packet and then
  * turns it into the frag list owner.
  **/
-static inline struct sk_buff *ixgbe_transform_rsc_queue(struct sk_buff *skb)
+static inline struct sk_buff *ixgbe_transform_rsc_queue(struct sk_buff *skb,
+                                                        u64 *count)
 {
 	unsigned int frag_list_size = 0;
 
@@ -743,6 +745,7 @@ static inline struct sk_buff *ixgbe_transform_rsc_queue(struct sk_buff *skb)
 		frag_list_size += skb->len;
 		skb->prev = NULL;
 		skb = prev;
+		*count += 1;
 	}
 
 	skb_shinfo(skb)->frag_list = skb->next;
@@ -845,14 +848,20 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
 			u32 nextp = (staterr & IXGBE_RXDADV_NEXTP_MASK) >>
 				     IXGBE_RXDADV_NEXTP_SHIFT;
 			next_buffer = &rx_ring->rx_buffer_info[nextp];
-			rx_ring->rsc_count += (rsc_count - 1);
 		} else {
 			next_buffer = &rx_ring->rx_buffer_info[i];
 		}
 
 		if (staterr & IXGBE_RXD_STAT_EOP) {
 			if (skb->prev)
-				skb = ixgbe_transform_rsc_queue(skb);
+				skb = ixgbe_transform_rsc_queue(skb, &(rx_ring->rsc_count));
+			if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) {
+				if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED)
+					rx_ring->rsc_count += skb_shinfo(skb)->nr_frags;
+				else
+					rx_ring->rsc_count++;
+				rx_ring->rsc_flush++;
+			}
 			rx_ring->stats.packets++;
 			rx_ring->stats.bytes += skb->len;
 		} else {
@@ -4474,14 +4483,18 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)
 	u64 total_mpc = 0;
 	u32 i, missed_rx = 0, mpc, bprc, lxon, lxoff, xon_off_tot;
 
-	if (hw->mac.type == ixgbe_mac_82599EB) {
+	if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) {
 		u64 rsc_count = 0;
+		u64 rsc_flush = 0;
 		for (i = 0; i < 16; i++)
 			adapter->hw_rx_no_dma_resources +=
 			                     IXGBE_READ_REG(hw, IXGBE_QPRDC(i));
-		for (i = 0; i < adapter->num_rx_queues; i++)
+		for (i = 0; i < adapter->num_rx_queues; i++) {
 			rsc_count += adapter->rx_ring[i].rsc_count;
-		adapter->rsc_count = rsc_count;
+			rsc_flush += adapter->rx_ring[i].rsc_flush;
+		}
+		adapter->rsc_total_count = rsc_count;
+		adapter->rsc_total_flush = rsc_flush;
 	}
 
 	adapter->stats.crcerrs += IXGBE_READ_REG(hw, IXGBE_CRCERRS);


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [net-next-2.6 PATCH 3/3] ixgbe: Only set/clear VFE in ixgbe_set_rx_mode
  2009-11-23 16:32 [net-next-2.6 PATCH 1/3] ixgbe: Modify 82599 HWRSC statistics counters Jeff Kirsher
@ 2009-11-23 16:32 ` Jeff Kirsher
  2009-11-23 18:46   ` David Miller
  2009-11-23 18:46 ` [net-next-2.6 PATCH 1/3] ixgbe: Modify 82599 HWRSC statistics counters David Miller
       [not found] ` <20091123163230.19706.77806.stgit@localhost.localdomain>
  2 siblings, 1 reply; 5+ messages in thread
From: Jeff Kirsher @ 2009-11-23 16:32 UTC (permalink / raw)
  To: davem
  Cc: netdev, gospo, Mallikarjuna R Chilakala, Peter P Waskiewicz Jr,
	Jeff Kirsher

From: Alexander Duyck <alexander.h.duyck@intel.com>

There appears to be a stray setting of the VFE bit when registering vlans.
This should not be done as vlan filtering should be enabled any time the
interface is not in promiscous mode

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>
---

 drivers/net/ixgbe/ixgbe_main.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index a3a2a9a..5182b28 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -2336,23 +2336,25 @@ static void ixgbe_vlan_rx_register(struct net_device *netdev,
 	 * not in DCB mode.
 	 */
 	ctrl = IXGBE_READ_REG(&adapter->hw, IXGBE_VLNCTRL);
+
+	/* Disable CFI check */
+	ctrl &= ~IXGBE_VLNCTRL_CFIEN;
+
+	/* enable VLAN tag stripping */
 	if (adapter->hw.mac.type == ixgbe_mac_82598EB) {
-		ctrl |= IXGBE_VLNCTRL_VME | IXGBE_VLNCTRL_VFE;
-		ctrl &= ~IXGBE_VLNCTRL_CFIEN;
-		IXGBE_WRITE_REG(&adapter->hw, IXGBE_VLNCTRL, ctrl);
+		ctrl |= IXGBE_VLNCTRL_VME;
 	} else if (adapter->hw.mac.type == ixgbe_mac_82599EB) {
-		ctrl |= IXGBE_VLNCTRL_VFE;
-		/* enable VLAN tag insert/strip */
-		ctrl = IXGBE_READ_REG(&adapter->hw, IXGBE_VLNCTRL);
-		ctrl &= ~IXGBE_VLNCTRL_CFIEN;
-		IXGBE_WRITE_REG(&adapter->hw, IXGBE_VLNCTRL, ctrl);
 		for (i = 0; i < adapter->num_rx_queues; i++) {
+			u32 ctrl;
 			j = adapter->rx_ring[i].reg_idx;
 			ctrl = IXGBE_READ_REG(&adapter->hw, IXGBE_RXDCTL(j));
 			ctrl |= IXGBE_RXDCTL_VME;
 			IXGBE_WRITE_REG(&adapter->hw, IXGBE_RXDCTL(j), ctrl);
 		}
 	}
+
+	IXGBE_WRITE_REG(&adapter->hw, IXGBE_VLNCTRL, ctrl);
+
 	ixgbe_vlan_rx_add_vid(netdev, 0);
 
 	if (!test_bit(__IXGBE_DOWN, &adapter->state))


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [net-next-2.6 PATCH 1/3] ixgbe: Modify 82599 HWRSC statistics counters
  2009-11-23 16:32 [net-next-2.6 PATCH 1/3] ixgbe: Modify 82599 HWRSC statistics counters Jeff Kirsher
  2009-11-23 16:32 ` [net-next-2.6 PATCH 3/3] ixgbe: Only set/clear VFE in ixgbe_set_rx_mode Jeff Kirsher
@ 2009-11-23 18:46 ` David Miller
       [not found] ` <20091123163230.19706.77806.stgit@localhost.localdomain>
  2 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2009-11-23 18:46 UTC (permalink / raw)
  To: jeffrey.t.kirsher
  Cc: netdev, gospo, mallikarjuna.chilakala, peter.p.waskiewicz.jr

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon, 23 Nov 2009 08:32:06 -0800

> From: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
> 
> 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>

Applied.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [net-next-2.6 PATCH 2/3] ixgbe: Use rx buffer length from rx ring for configuring rscctl
       [not found] ` <20091123163230.19706.77806.stgit@localhost.localdomain>
@ 2009-11-23 18:46   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2009-11-23 18:46 UTC (permalink / raw)
  To: jeffrey.t.kirsher
  Cc: netdev, gospo, mallikarjuna.chilakala, peter.p.waskiewicz.jr

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon, 23 Nov 2009 08:32:31 -0800

> From: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
> 
> While configuring rscctl use rx buffer length from rx ring structure
> instead of passing rx_buf_len to ixgbe_configure_rscctl
> 
> 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>

Applied.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [net-next-2.6 PATCH 3/3] ixgbe: Only set/clear VFE in ixgbe_set_rx_mode
  2009-11-23 16:32 ` [net-next-2.6 PATCH 3/3] ixgbe: Only set/clear VFE in ixgbe_set_rx_mode Jeff Kirsher
@ 2009-11-23 18:46   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2009-11-23 18:46 UTC (permalink / raw)
  To: jeffrey.t.kirsher
  Cc: netdev, gospo, mallikarjuna.chilakala, peter.p.waskiewicz.jr

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon, 23 Nov 2009 08:32:57 -0800

> From: Alexander Duyck <alexander.h.duyck@intel.com>
> 
> There appears to be a stray setting of the VFE bit when registering vlans.
> This should not be done as vlan filtering should be enabled any time the
> interface is not in promiscous mode
> 
> 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>

Applied.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-11-23 18:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-23 16:32 [net-next-2.6 PATCH 1/3] ixgbe: Modify 82599 HWRSC statistics counters Jeff Kirsher
2009-11-23 16:32 ` [net-next-2.6 PATCH 3/3] ixgbe: Only set/clear VFE in ixgbe_set_rx_mode Jeff Kirsher
2009-11-23 18:46   ` David Miller
2009-11-23 18:46 ` [net-next-2.6 PATCH 1/3] ixgbe: Modify 82599 HWRSC statistics counters David Miller
     [not found] ` <20091123163230.19706.77806.stgit@localhost.localdomain>
2009-11-23 18:46   ` [net-next-2.6 PATCH 2/3] ixgbe: Use rx buffer length from rx ring for configuring rscctl David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.