• Petri Gynther's avatar
    net: bcmgenet: rework Rx queue init · 6f5a272c
    Petri Gynther authored
    In preparation for supporting multiple Rx queues:
    1. Move the initialization of priv->num_rx_bds, priv->rx_bds, and
       priv->rx_cbs from bcmgenet_init_rx_ring() to bcmgenet_init_dma()
       since they are not specific to a single Rx queue. Mimics the Tx
       init model where priv->num_tx_bds, priv->tx_bds, and priv->tx_cbs
       are initialized in bcmgenet_init_dma().
    2. Program DMA_MBUF_DONE_THRESH = 1 so that future Rx queues Q0-Q15
       will get per-packet Rx interrupt.
    3. Group DMA_START_ADDR, RDMA_READ_PTR, RDMA_WRITE_PTR, and DMA_END_ADDR
       initialization together. Mimics the Tx init model.
    4. There is 1-to-1 mapping between RxCBs and RxBDs.
       Precalculate RxCB->bd_addr so that it can be used in the future.
    Signed-off-by: default avatarPetri Gynther <pgynther@google.com>
    Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    6f5a272c
bcmgenet.c 77.1 KB