net: systemport: Add support for BQL
Subsystems (3)
PATCH 1/1 net: systemport: Add support for BQL
We had all the accounting done already, but we did not plumb BQL. In order to avoid fetching twice the netdev_queue pointer in the TX reclamation path, move the queue waking into __bcm_sysport_tx_reclaim() so we can update BQL and wake the TX queue there in one go.
--- drivers/net/ethernet/broadcom/bcmsysport.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/net/ethernet/broadcom/bcmsysport.c +10 -6
@@ -903,6 +903,7 @@ static unsigned int __bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv,struct net_device *ndev = priv->netdev;unsigned int txbds_processed =0 ;struct bcm_sysport_cb *cb; +struct netdev_queue *txq;unsigned int txbds_ready;unsigned int c_index;u32 hw_ind;
@@ -945,10 +946,16 @@ static unsigned int __bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv, ring->c_index = c_index; + txq =netdev_get_tx_queue (ndev, ring->index); +netdev_tx_completed_queue (txq, pkts_compl, bytes_compl); +netif_dbg (priv, tx_done, ndev,"ring=%d c_index=%d pkts_compl=%d, bytes_compl=%d\n" , ring->index, ring->c_index, pkts_compl, bytes_compl); +if (pkts_compl) +netif_tx_wake_queue (txq); +return pkts_compl; }
@@ -956,17 +963,11 @@ static unsigned int __bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv,static unsigned int bcm_sysport_tx_reclaim (struct bcm_sysport_priv *priv,struct bcm_sysport_tx_ring *ring) { -struct netdev_queue *txq;unsigned int released;unsigned long flags; - txq =netdev_get_tx_queue (priv->netdev, ring->index); -spin_lock_irqsave (&ring->lock, flags); released =__bcm_sysport_tx_reclaim (priv, ring); -if (released) -netif_tx_wake_queue (txq); -spin_unlock_irqrestore (&ring->lock, flags);return released;
@@ -1359,6 +1360,8 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb, desc->addr_status_len = len_status;wmb (); +netdev_tx_sent_queue (txq, skb->len); +/* Write this descriptor address to the RING write port */ tdma_port_write_desc_addr (priv, desc, ring->index);
@@ -1584,6 +1587,7 @@ static void bcm_sysport_fini_tx_ring(struct bcm_sysport_priv *priv,napi_disable (&ring->napi);cancel_work_sync (&ring->dim.dim.work);netif_napi_del (&ring->napi); +netdev_tx_reset_queue (netdev_get_tx_queue (priv->netdev, ring->index));bcm_sysport_tx_clean (priv, ring);
Signature · 1 line
2.14.1
Quoted 6 lines · Florian Fainelli
We had all the accounting done already, but we did not plumb BQL. In order to avoid fetching twice the
netdev_queuepointer in the TX reclamation path, move the queue waking into__bcm_sysport_tx_reclaim()so we can update BQL and wake the TX queue there in one go.Signed-off-by Florian Fainelli <[email protected]>
David, please disregard this patch, I found a bunch of issues, and it won't apply with the coalescing patch series.
Signature · 1 line
Florian
David Miller
maintainerFrom: Florian Fainelli <[email protected]>
Date: Thu, 29 Mar 2018 12:30:08 -0700
Quoted 10 lines · Florian Fainelli
Quoted 6 lines
We had all the accounting done already, but we did not plumb BQL. In order to avoid fetching twice the
netdev_queuepointer in the TX reclamation path, move the queue waking into__bcm_sysport_tx_reclaim()so we can update BQL and wake the TX queue there in one go.Signed-off-by Florian Fainelli <[email protected]>David, please disregard this patch, I found a bunch of issues, and it won't apply with the coalescing patch series.
Sure, no problem.