net: systemport: Turn on ACB at the SYSTEMPORT level
authorFlorian Fainelli <f.fainelli@gmail.com>
Wed, 11 Oct 2017 17:57:52 +0000 (10:57 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Oct 2017 19:10:02 +0000 (12:10 -0700)
Now that we have established the queue mapping between the switch port
egress queues and the SYSTEMPORT egress queues, we can turn on Advanced
Congestion Buffering (ACB) at the SYSTEMPORT level. This enables the
Ethernet MAC controller to get out of band flow control information
directly from the switch port and queue that it monitors such that its
internal TDMA can be appropriately backpressured.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bcmsysport.c

index 78bed9a..dafc266 100644 (file)
@@ -1422,10 +1422,14 @@ static int bcm_sysport_init_tx_ring(struct bcm_sysport_priv *priv,
        reg &= ~(RING_QID_MASK | RING_PORT_ID_MASK << RING_PORT_ID_SHIFT);
        reg |= ring->switch_queue & RING_QID_MASK;
        reg |= ring->switch_port << RING_PORT_ID_SHIFT;
-       reg |= RING_IGNORE_STATUS;
        tdma_writel(priv, reg, TDMA_DESC_RING_MAPPING(index));
        tdma_writel(priv, 0, TDMA_DESC_RING_PCP_DEI_VID(index));
 
+       /* Enable ACB algorithm 2 */
+       reg = tdma_readl(priv, TDMA_CONTROL);
+       reg |= tdma_control_bit(priv, ACB_ALGO);
+       tdma_writel(priv, reg, TDMA_CONTROL);
+
        /* Do not use tdma_control_bit() here because TSB_SWAP1 collides
         * with the original definition of ACB_ALGO
         */