Commit 298376d3 authored by Tom Herbert's avatar Tom Herbert Committed by David S. Miller

tg3: Support for byte queue limits

Changes to tg3 to use byte queue limits.
Signed-off-by: default avatarTom Herbert <therbert@google.com>
Acked-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b8bfca94
...@@ -5302,6 +5302,7 @@ static void tg3_tx(struct tg3_napi *tnapi) ...@@ -5302,6 +5302,7 @@ static void tg3_tx(struct tg3_napi *tnapi)
u32 sw_idx = tnapi->tx_cons; u32 sw_idx = tnapi->tx_cons;
struct netdev_queue *txq; struct netdev_queue *txq;
int index = tnapi - tp->napi; int index = tnapi - tp->napi;
unsigned int pkts_compl = 0, bytes_compl = 0;
if (tg3_flag(tp, ENABLE_TSS)) if (tg3_flag(tp, ENABLE_TSS))
index--; index--;
...@@ -5352,6 +5353,9 @@ static void tg3_tx(struct tg3_napi *tnapi) ...@@ -5352,6 +5353,9 @@ static void tg3_tx(struct tg3_napi *tnapi)
sw_idx = NEXT_TX(sw_idx); sw_idx = NEXT_TX(sw_idx);
} }
pkts_compl++;
bytes_compl += skb->len;
dev_kfree_skb(skb); dev_kfree_skb(skb);
if (unlikely(tx_bug)) { if (unlikely(tx_bug)) {
...@@ -5360,6 +5364,8 @@ static void tg3_tx(struct tg3_napi *tnapi) ...@@ -5360,6 +5364,8 @@ static void tg3_tx(struct tg3_napi *tnapi)
} }
} }
netdev_completed_queue(tp->dev, pkts_compl, bytes_compl);
tnapi->tx_cons = sw_idx; tnapi->tx_cons = sw_idx;
/* Need to make the tx_cons update visible to tg3_start_xmit() /* Need to make the tx_cons update visible to tg3_start_xmit()
...@@ -6804,6 +6810,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -6804,6 +6810,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
} }
skb_tx_timestamp(skb); skb_tx_timestamp(skb);
netdev_sent_queue(tp->dev, skb->len);
/* Packets are ready, update Tx producer idx local and on card. */ /* Packets are ready, update Tx producer idx local and on card. */
tw32_tx_mbox(tnapi->prodmbox, entry); tw32_tx_mbox(tnapi->prodmbox, entry);
...@@ -7286,6 +7293,7 @@ static void tg3_free_rings(struct tg3 *tp) ...@@ -7286,6 +7293,7 @@ static void tg3_free_rings(struct tg3 *tp)
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
} }
} }
netdev_reset_queue(tp->dev);
} }
/* Initialize tx/rx rings for packet processing. /* Initialize tx/rx rings for packet processing.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment