• Karsten Graul's avatar
    net/smc: do not call dma sync for unmapped memory · 741a49a4
    Karsten Graul authored
    The dma related ...sync_sg... functions check the link state before the
    dma function is actually called. But the check in smc_link_usable()
    allows links in ACTIVATING state which are not yet mapped to dma memory.
    Under high load it may happen that the sync_sg functions are called for
    such a link which results in an debug output like
       DMA-API: mlx5_core 0002:00:00.0: device driver tries to sync
       DMA memory it has not allocated [device address=0x0000000103370000]
       [size=65536 bytes]
    To fix that introduce a helper to check for the link state ACTIVE and
    use it where appropriate. And move the link state update to ACTIVATING
    to the end of smcr_link_init() when most initial setup is done.
    Reviewed-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
    Fixes: d854fcbf ("net/smc: add new link state and related helpers")
    Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    741a49a4
smc_core.h 13.2 KB