OSDN Git Service

net/smc: do not call dma sync for unmapped memory
authorKarsten Graul <kgraul@linux.ibm.com>
Sat, 18 Jul 2020 13:06:16 +0000 (15:06 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 19 Jul 2020 22:30:22 +0000 (15:30 -0700)
commit741a49a4dc5fd7e61b37b259dde915083c2c5327
tree5374b7d0dbfdf53b87904e2660b2c71afc7f2ec5
parentb9979c2e837926c87358024a95c67988477909b1
net/smc: do not call dma sync for unmapped memory

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: Ursula Braun <ubraun@linux.ibm.com>
Fixes: d854fcbfaeda ("net/smc: add new link state and related helpers")
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/af_smc.c
net/smc/smc_core.c
net/smc/smc_core.h
net/smc/smc_llc.c