Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] net: bcmgenet: add BQL support
@ 2016-04-06  0:50 Petri Gynther
  2016-04-06 20:25 ` Florian Fainelli
  2016-04-08 20:36 ` David Miller
  0 siblings, 2 replies; 10+ messages in thread
From: Petri Gynther @ 2016-04-06  0:50 UTC (permalink / raw)
  To: netdev; +Cc: davem, f.fainelli, opendmb, jaedon.shin, Petri Gynther

Add Byte Queue Limits (BQL) support to bcmgenet driver.

Signed-off-by: Petri Gynther <pgynther@google.com>
---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index f7b42b9..9fcd514 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -1221,8 +1221,10 @@ static unsigned int __bcmgenet_tx_reclaim(struct net_device *dev,
 	dev->stats.tx_packets += pkts_compl;
 	dev->stats.tx_bytes += bytes_compl;
 
+	txq = netdev_get_tx_queue(dev, ring->queue);
+	netdev_tx_completed_queue(txq, pkts_compl, bytes_compl);
+
 	if (ring->free_bds > (MAX_SKB_FRAGS + 1)) {
-		txq = netdev_get_tx_queue(dev, ring->queue);
 		if (netif_tx_queue_stopped(txq))
 			netif_tx_wake_queue(txq);
 	}
@@ -1516,6 +1518,8 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
 	ring->prod_index += nr_frags + 1;
 	ring->prod_index &= DMA_P_INDEX_MASK;
 
+	netdev_tx_sent_queue(txq, GENET_CB(skb)->bytes_sent);
+
 	if (ring->free_bds <= (MAX_SKB_FRAGS + 1))
 		netif_tx_stop_queue(txq);
 
@@ -2809,6 +2813,8 @@ static void bcmgenet_hfb_init(struct bcmgenet_priv *priv)
 static void bcmgenet_netif_start(struct net_device *dev)
 {
 	struct bcmgenet_priv *priv = netdev_priv(dev);
+	int i;
+	struct netdev_queue *txq;
 
 	/* Start the network engine */
 	bcmgenet_enable_rx_napi(priv);
@@ -2816,6 +2822,14 @@ static void bcmgenet_netif_start(struct net_device *dev)
 
 	umac_enable_set(priv, CMD_TX_EN | CMD_RX_EN, true);
 
+	for (i = 0; i < priv->hw_params->tx_queues; i++) {
+		txq = netdev_get_tx_queue(dev, priv->tx_rings[i].queue);
+		netdev_tx_reset_queue(txq);
+	}
+
+	txq = netdev_get_tx_queue(dev, priv->tx_rings[DESC_INDEX].queue);
+	netdev_tx_reset_queue(txq);
+
 	netif_tx_start_all_queues(dev);
 
 	/* Monitor link interrupts now */
-- 
2.8.0.rc3.226.g39d4020

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

end of thread, other threads:[~2016-04-09  4:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-06  0:50 [PATCH net-next] net: bcmgenet: add BQL support Petri Gynther
2016-04-06 20:25 ` Florian Fainelli
2016-04-08 16:54   ` Petri Gynther
2016-04-08 18:23     ` Eric Dumazet
2016-04-08 20:36 ` David Miller
2016-04-09  1:39   ` Petri Gynther
2016-04-09  1:56     ` Eric Dumazet
2016-04-09  2:26       ` Alexander Duyck
2016-04-09  4:13       ` Petri Gynther
2016-04-09  4:53         ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox