Thread (15 messages) 15 messages, 4 authors, 2023-08-29

Re: [PATCH v11 5/6] iommu/dma: Allow a single FQ in addition to per-CPU FQs

From: Robin Murphy <robin.murphy@arm.com>
Date: 2023-08-29 15:40:45
Also in: asahi, linux-arm-kernel, linux-arm-msm, linux-doc, linux-iommu, linux-mediatek, linux-s390, linux-sunxi, linux-tegra, lkml

On 2023-08-23 15:21, Niklas Schnelle wrote:
[...]
quoted
quoted
+struct dma_iommu_options {
+#define IOMMU_DMA_OPTS_PER_CPU_QUEUE	0L
Nit: if the intent is to add more flags then that will no longer make
sense, and if not then we may as well just have a bool ;)
quoted
+#define IOMMU_DMA_OPTS_SINGLE_QUEUE	BIT(0)
My thinking was that the above two options are mutually exclusive with
per-CPU encoded as BIT(0) unset and single queue as set. Then other
options could still use the other bits. It's true though that the below
use of IOMMU_DMA_OPTS_PER_CPU_QUEUE is a nop so maybe just drop that?
Or we could use an enum even if I don't forsee more than these 2 queue
types.
My point was that the value 0 can only mean "all flags not set", so 
while we can very much have the semantic of "single queue flag not set 
means percpu queue", we cannot infer "0 means percpu queue" unless "all 
flags" and "single queue flag" are the same thing. As soon as any 
additional flag is defined, 0 then has a different meaning which may 
well not even be a combination that's useful to put a specific name to.

I'd like to hope it's sufficiently obvious from the implementation that 
the opposite of a single queue is multiple queues, since contextually 
this is already all happening in distinct paths from the case of no queue.

Thanks,
Robin.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help