[PATCH] dma/idxd: mark portal pointer as volatile

Bruce Richardson
2026-01-26T10:14:07Z

The portal pointer for writing descriptors to the idxd device should be
volatile for consistency with how it is used. Only time we need to cast
away the volatility is when unmapping it.

Bugzilla ID: 1871
Fixes: e888bb1278c6 ("dma/idxd: add bus device probing")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/dma/idxd/idxd_bus.c | 2 +-
drivers/dma/idxd/idxd_internal.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/idxd/idxd_bus.c b/drivers/dma/idxd/idxd_bus.c
index 5ae42151e6..9a8213bbbe 100644
--- a/drivers/dma/idxd/idxd_bus.c
+++ b/drivers/dma/idxd/idxd_bus.c
@@ -93,7 +93,7 @@ static int
idxd_dev_close(struct rte_dma_dev *dev)
{
struct idxd_dmadev *idxd = dev->data->dev_private;
- munmap(idxd->portal, 0x1000);
+ munmap(RTE_CAST_PTR(void *, idxd->portal), 0x1000);
return 0;
}

diff --git a/drivers/dma/idxd/idxd_internal.h b/drivers/dma/idxd/idxd_internal.h
index b80a113455..d409213148 100644
--- a/drivers/dma/idxd/idxd_internal.h
+++ b/drivers/dma/idxd/idxd_internal.h
@@ -56,7 +56,7 @@ struct idxd_dmadev {
unsigned short batch_start; /* start+size == write pointer for hdls/desc */
unsigned short batch_size;

- void *portal; /* address to write the batch descriptor */
+ volatile void *portal; /* address to write the batch descriptor */

struct idxd_completion *batch_comp_ring;
unsigned short *batch_idx_ring; /* store where each batch ends */
--
2.51.0