diff options
author | Sieng Piaw Liew <liew.s.piaw@gmail.com> | 2022-06-29 16:18:12 +0800 |
---|---|---|
committer | Álvaro Fernández Rojas <noltari@gmail.com> | 2023-03-04 19:28:16 +0100 |
commit | cbc1fcf0e4e21cf331cbd92dd7802b8f40c31107 (patch) | |
tree | 36b47b8828dccce0bd446f3ffa121c6c953ae898 /target/linux/bmips/files | |
parent | 85d403a5790cc1f0942800cee352bc0990d25d95 (diff) | |
download | upstream-cbc1fcf0e4e21cf331cbd92dd7802b8f40c31107.tar.gz upstream-cbc1fcf0e4e21cf331cbd92dd7802b8f40c31107.tar.bz2 upstream-cbc1fcf0e4e21cf331cbd92dd7802b8f40c31107.zip |
bmips: add BQL support
Add Byte Queue Limits support to reduce/remove bufferbloat.
Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com>
Diffstat (limited to 'target/linux/bmips/files')
-rw-r--r-- | target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c b/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c index 9b7c21c019..b3dc53c20f 100644 --- a/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c +++ b/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c @@ -445,6 +445,7 @@ static int bcm6368_enetsw_receive_queue(struct net_device *dev, int budget) static int bcm6368_enetsw_tx_reclaim(struct net_device *dev, int force) { struct bcm6368_enetsw *priv = netdev_priv(dev); + unsigned int bytes = 0; int released = 0; while (priv->tx_desc_count < priv->tx_ring_size) { @@ -481,10 +482,13 @@ static int bcm6368_enetsw_tx_reclaim(struct net_device *dev, int force) if (desc->len_stat & DMADESC_UNDER_MASK) dev->stats.tx_errors++; + bytes += skb->len; napi_consume_skb(skb, !force); released++; } + netdev_completed_queue(dev, released, bytes); + if (netif_queue_stopped(dev) && released) netif_wake_queue(dev); @@ -617,6 +621,8 @@ bcm6368_enetsw_start_xmit(struct sk_buff *skb, struct net_device *dev) desc->len_stat = len_stat; wmb(); + netdev_sent_queue(dev, skb->len); + /* kick tx dma */ dmac_writel(priv, priv->dma_chan_en_mask, DMAC_CHANCFG_REG, priv->tx_chan); @@ -876,6 +882,8 @@ static int bcm6368_enetsw_stop(struct net_device *dev) free_irq(priv->irq_tx, dev); free_irq(priv->irq_rx, dev); + netdev_reset_queue(dev); + return 0; } |