• Frank Wunderlich's avatar
    net: ethernet: mtk_eth_soc: handle dma buffer size soc specific · c57e5581
    Frank Wunderlich authored
    The mainline MTK ethernet driver suffers long time from rarly but
    annoying tx queue timeouts. We think that this is caused by fixed
    dma sizes hardcoded for all SoCs.
    
    We suspect this problem arises from a low level of free TX DMADs,
    the TX Ring alomost full.
    
    The transmit timeout is caused by the Tx queue not waking up. The
    Tx queue stops when the free counter is less than ring->thres, and
    it will wake up once the free counter is greater than ring->thres.
    If the CPU is too late to wake up the Tx queues, it may cause a
    transmit timeout.
    Therefore, we increased the TX and RX DMADs to improve this error
    situation.
    
    Use the dma-size implementation from SDK in a per SoC manner. In
    difference to SDK we have no RSS feature yet, so all RX/TX sizes
    should be raised from 512 to 2048 byte except fqdma on mt7988 to
    avoid the tx timeout issue.
    
    Fixes: 656e7052 ("net-next: mediatek: add support for MT7623 ethernet")
    Suggested-by: default avatarDaniel Golle <daniel@makrotopia.org>
    Signed-off-by: default avatarFrank Wunderlich <frank-w@public-files.de>
    Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c57e5581
mtk_eth_soc.c 131 KB