[RFC PATCH 09/10] dmaengine: add DMA_PREP_CACHE_CONTROL

From: Daniel Byrne

Date: Tue Dec 01 2026 - 09:20:01 EST


Let clients request the provider's cache-control hint per descriptor.
On DSA, IDXD_OP_FLAG_CC steers the copied data toward the LLC on
write. This helps a consumer that reads the data immediately and
hurts one that does not. Since the right setting is workload
dependent, we expose it as a prep flag instead of hard-coding it in
the driver.

The flag is advisory, and no provider acts on it yet. The idxd side,
which maps it to IDXD_OP_FLAG_CC on MEMMOVE descriptors, needs idxd
changes that are not posted yet.

Signed-off-by: Daniel Byrne <daniel1.byrne@xxxxxxxxx>
---
No provider acts on the flag in this series.

include/linux/dmaengine.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 5df4bfc000a6..0b9235bd493a 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -201,6 +201,9 @@ struct dma_vec {
* transaction is marked with DMA_PREP_REPEAT will cause the new transaction
* to never be processed and stay in the issued queue forever. The flag is
* ignored if the previous transaction is not a repeated transaction.
+ * @DMA_PREP_CACHE_CONTROL: tell the driver to direct destination writes into
+ * cache (cache-allocating) rather than bypassing it. The flag is advisory
+ * and drivers that cannot honour it will ignore it.
*/
enum dma_ctrl_flags {
DMA_PREP_INTERRUPT = (1 << 0),
@@ -213,6 +216,7 @@ enum dma_ctrl_flags {
DMA_PREP_CMD = (1 << 7),
DMA_PREP_REPEAT = (1 << 8),
DMA_PREP_LOAD_EOT = (1 << 9),
+ DMA_PREP_CACHE_CONTROL = (1 << 10),
};

/**
--
2.43.0