diff mbox

[net-next] r8169: Support for byte queue limits

Message ID 1323162824-3196-1-git-send-email-igorm@etf.rs
State Rejected, archived
Delegated to: David Miller
Headers show

Commit Message

Igor Maravić Dec. 6, 2011, 9:13 a.m. UTC
From: Igor Maravic <igorm@etf.rs>

Changes to r8169 to use byte queue limits.

Signed-off-by: Igor Maravic <igorm@etf.rs>
---
 drivers/net/ethernet/realtek/r8169.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

Comments

Igor Maravić Dec. 6, 2011, 9:15 a.m. UTC | #1
I'm resubmiting this patch, because Francois have fixed Rx FIFO
overflowing and  Rx index race between FIFO overflow recovery and NAPI
handler.
BR
Igor
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Dec. 6, 2011, 6:13 p.m. UTC | #2
From: igorm@etf.rs
Date: Tue,  6 Dec 2011 10:13:44 +0100

> From: Igor Maravic <igorm@etf.rs>
> 
> Changes to r8169 to use byte queue limits.
> 
> Signed-off-by: Igor Maravic <igorm@etf.rs>

Your change is only valid after Francois's fixes right?  That's what you
say in another email.

Well, you're targetting this change to the net-next tree, are Francois's
fixes there?

They aren't, so you need to be patient and not be so eager like a rabbit
to keep mindlessly pumping this patch to the list.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Igor Maravić Dec. 6, 2011, 9:36 p.m. UTC | #3
> Well, you're targetting this change to the net-next tree, are Francois's
> fixes there?

I thought when You say "Applied" in reply, you push patches to net-next tree.
My mistake. Still learning :)
I'l wait.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Dec. 6, 2011, 9:41 p.m. UTC | #4
From: Igor Maravić <igorm@etf.rs>
Date: Tue, 6 Dec 2011 22:36:21 +0100

>> Well, you're targetting this change to the net-next tree, are Francois's
>> fixes there?
> 
> I thought when You say "Applied" in reply, you push patches to net-next tree.

They were bug fixes, so they went to the 'net' tree.  So you have to wait
until I merge the net tree into net-next.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 36b2a4b..bfdb5fd 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -5326,6 +5326,7 @@  static void rtl8169_tx_clear(struct rtl8169_private *tp)
 {
 	rtl8169_tx_clear_range(tp, tp->dirty_tx, NUM_TX_DESC);
 	tp->cur_tx = tp->dirty_tx = 0;
+	netdev_reset_queue(tp->dev);
 }
 
 static void rtl8169_schedule_work(struct net_device *dev, work_func_t task)
@@ -5460,6 +5461,8 @@  static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
 		txd->opts1 |= cpu_to_le32(LastFrag);
 	}
 
+	netdev_sent_queue(tp->dev, skb->len);
+
 	return cur_frag;
 
 err_out:
@@ -5624,6 +5627,8 @@  static void rtl8169_tx_interrupt(struct net_device *dev,
 				 void __iomem *ioaddr)
 {
 	unsigned int dirty_tx, tx_left;
+	unsigned int bytes_compl = 0;
+	int tx_compl = 0;
 
 	dirty_tx = tp->dirty_tx;
 	smp_rmb();
@@ -5642,14 +5647,18 @@  static void rtl8169_tx_interrupt(struct net_device *dev,
 		rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb,
 				     tp->TxDescArray + entry);
 		if (status & LastFrag) {
-			dev->stats.tx_packets++;
-			dev->stats.tx_bytes += tx_skb->skb->len;
+			tx_compl++;
+			bytes_compl += tx_skb->skb->len;
 			dev_kfree_skb(tx_skb->skb);
 			tx_skb->skb = NULL;
 		}
 		dirty_tx++;
 		tx_left--;
 	}
+	dev->stats.tx_packets += tx_compl;
+	dev->stats.tx_bytes += bytes_compl;
+
+	netdev_completed_queue(dev, tx_compl, bytes_compl);
 
 	if (tp->dirty_tx != dirty_tx) {
 		tp->dirty_tx = dirty_tx;