Re: [dpdk-dev] [PATCH v7 2/2] bus/pci: support MMIO in PCI ioport accessors
From: David Marchand <hidden>
Date: 2021-03-02 13:14:52
On Mon, Mar 1, 2021 at 4:44 PM 谢华伟(此时此刻) [off-list ref] wrote:
quoted
quoted
quoted
What is the downside of using "pause until the I/O completes" versions?The downside in virtio PMD is a small performance penalty when we use it to notify backend. CPU executes unnecessary serializing IO instruction. I check kernel code, io wrapper for in/out doesn't use p version.This change is a fix/optimisation. This is a separate topic from adding MMIO support with x86 ioport. I would split as a separate patch.Hi David: Maybe there is confuse? There is no change. The out/in is added. I don't remove _p on purpose.
Looking at v8 and repeating previous mails:
+#if defined(RTE_ARCH_X86)
...
+static inline void iowrite8(uint8_t val, void *addr)
+{
+ (uint64_t)(uintptr_t)addr >= PIO_MAX ?
+ *(volatile uint8_t *)addr = val :
+ outb(val, (unsigned long)addr); <======
+}
[...]
-#if defined(RTE_ARCH_X86)
- outb_p(*s, reg); <======
-#else
- *(volatile uint8_t *)reg = *s;
-#endif
+ iowrite8(*s, (void *)reg);
This almost went unnoticed (thanks Ferruh for spotting).
Do we _need_ this change on outX_p -> outX?
I am not comfortable at touching such low level internal routines that
have been in dpdk since v1.5.0.
If there is a good reason, it has nothing to do with adding MMIO
support and must be split in a separate patch.
If there is no reason, please restore outX_p, since the safest is not to touch.
--
David Marchand