netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] e1000: add byte queue limits
@ 2012-08-23  9:28 Otto Estuardo Solares Cabrera
  2012-08-24  0:00 ` Jeff Kirsher
  0 siblings, 1 reply; 2+ messages in thread
From: Otto Estuardo Solares Cabrera @ 2012-08-23  9:28 UTC (permalink / raw)
  To: netdev

Signed-off-by: Otto Estuardo Solares Cabrera <solca@galileo.edu>
---
 Copied from e1000e.
 Cc me please.

 drivers/net/ethernet/intel/e1000/e1000_main.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 7483ca0..208bc78 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -2016,6 +2016,7 @@ static void e1000_clean_tx_ring(struct e1000_adapter *adapter,
 		e1000_unmap_and_free_tx_resource(adapter, buffer_info);
 	}
 
+	netdev_reset_queue(adapter->netdev);
 	size = sizeof(struct e1000_buffer) * tx_ring->count;
 	memset(tx_ring->buffer_info, 0, size);
 
@@ -3265,6 +3266,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
 	                     nr_frags, mss);
 
 	if (count) {
+		netdev_sent_queue(netdev, skb->len);
 		skb_tx_timestamp(skb);
 
 		e1000_tx_queue(adapter, tx_ring, tx_flags, count);
@@ -3852,6 +3854,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
 	unsigned int i, eop;
 	unsigned int count = 0;
 	unsigned int total_tx_bytes=0, total_tx_packets=0;
+	unsigned int bytes_compl = 0, pkts_compl = 0;
 
 	i = tx_ring->next_to_clean;
 	eop = tx_ring->buffer_info[i].next_to_watch;
@@ -3869,6 +3872,11 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
 			if (cleaned) {
 				total_tx_packets += buffer_info->segs;
 				total_tx_bytes += buffer_info->bytecount;
+				if (buffer_info->skb) {
+					bytes_compl += buffer_info->skb->len;
+					pkts_compl++;
+				}
+
 			}
 			e1000_unmap_and_free_tx_resource(adapter, buffer_info);
 			tx_desc->upper.data = 0;
@@ -3882,6 +3890,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
 
 	tx_ring->next_to_clean = i;
 
+	netdev_completed_queue(netdev, pkts_compl, bytes_compl);
+
 #define TX_WAKE_THRESHOLD 32
 	if (unlikely(count && netif_carrier_ok(netdev) &&
 		     E1000_DESC_UNUSED(tx_ring) >= TX_WAKE_THRESHOLD)) {
-- 
1.7.10.4

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

* Re: [PATCH] e1000: add byte queue limits
  2012-08-23  9:28 [PATCH] e1000: add byte queue limits Otto Estuardo Solares Cabrera
@ 2012-08-24  0:00 ` Jeff Kirsher
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Kirsher @ 2012-08-24  0:00 UTC (permalink / raw)
  To: Otto Estuardo Solares Cabrera; +Cc: netdev

On 08/23/2012 02:28 AM, Otto Estuardo Solares Cabrera wrote:
> Signed-off-by: Otto Estuardo Solares Cabrera<solca@galileo.edu>
> ---
>   Copied from e1000e.
>   Cc me please.
>
>   drivers/net/ethernet/intel/e1000/e1000_main.c |   10 ++++++++++
>   1 file changed, 10 insertions(+)
Added to my queue of patches, thanks!

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

end of thread, other threads:[~2012-08-24  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-23  9:28 [PATCH] e1000: add byte queue limits Otto Estuardo Solares Cabrera
2012-08-24  0:00 ` Jeff Kirsher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).