page_pool: add DMA-sync-for-CPU inline helper
authorAlexander Lobakin <aleksander.lobakin@intel.com>
Thu, 18 Apr 2024 11:36:12 +0000 (13:36 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Wed, 24 Apr 2024 18:06:25 +0000 (11:06 -0700)
commitce230f4f8981e2a7f06b71c22cc742cfe91a525d
tree5490ded8ed8aa2aff4a0f5ce9f04429be88ae590
parentef9226cd56b718c79184a3466d32984a51cb449c
page_pool: add DMA-sync-for-CPU inline helper

Each driver is responsible for syncing buffers written by HW for CPU
before accessing them. Almost each PP-enabled driver uses the same
pattern, which could be shorthanded into a static inline to make driver
code a little bit more compact.
Introduce a simple helper which performs DMA synchronization for the
size passed from the driver. It can be used even when the pool doesn't
manage DMA-syncs-for-device, just make sure the page has a correct DMA
address set via page_pool_set_dma_addr().

Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
include/net/page_pool/helpers.h