[dpdk-dev] [PATCH] igb_uio: fix mmap failure

Thomas Monjalon thomas.monjalon at 6wind.com
Fri Jul 1 16:54:13 CEST 2016


2016-07-01 15:39, Ferruh Yigit:
> On 7/1/2016 1:47 PM, Thomas Monjalon wrote:
> >> As a workaround igb_uio can stop reserving PCI memory resources, from
> >> kernel point of view io-memory region looks like idle and mmap works
> >> again.
> >>
> >> With this update device io-memory range is not protected against any
> >> other kernel driver claim ownership on those resources, which shouldn't
> >> be a problem for dpdk usage module.
> > 
> > Why it should not be a problem?
> 
> request_mem_region() is a way for driver informing the rest of the
> kernel that memory region is used.
> And with CONFIG_IO_STRICT_DEVMEM=y, userspace also prevented to touch
> that ares.
> But for igb_uio, we explicitly want userspace to access that memory range.
> 
> > Please could you give an example of what could happen?
> 
> Technically device lost a protection of its memory region against any
> other driver, but I am not sure if this is real threat in practical life.
> Also this is same in uio_pci_generic, it doesn't reserve the memory.

OK thanks for the explanations.
So we are not sure how this memory region can be stolen and
we assume it won't.

> > This patch fixes a problem with recent kernels (not mentioned above)
> > which offer the uio_pci_generic alternative.
> 
> Will give kernel version information.
> 
> > That's why I think we should fix it only if there is absolutely no
> > regression for older kernels.
> 
> Totally agreed, that is why I expressed my concern, let this patch hang
> around a little.

It may be valuable to have in 16.07.
I suggest to wait RC3 (mid-July) to integrate it.
We will have a RC4 to test it.


More information about the dev mailing list