NETIF_F_HIGHDMA?
Subsystems (2)
Hello.
I fail to understand why this flag is needed at all. netdev-features.txt says:
* Transmit DMA from high memory
On platforms where this is relevant, NETIF_F_HIGHDMA signals that ndo_start_xmit can handle skbs with frags in high memory.
TTBOMK, highmem is an area of the kernel *virtual* memory that maps
physical memory that can't be directly mapped unto the linear kernel space, i.e. in case when there's more memory in the system than the kernel memory can directly map. But what this has to do with DMA which deals with the physical memory? High memory doesn't have to be beyond 4 GiB limit -- it can exist even on 32-bit system (consider 4 GiB memory and 2/2 or 3/1 GiB user/kernel VM split), contrary to the belief of the many Ethernet PCI drivers which only set NETIF_F_HIGHDMA when the PCI dual address cycle is supported (i.e. the address on PCI can be 64-bit)...
So, in my opinion, each and every driver should set this flag (except
maybe those arch-specific drivers where CONFIG_HIGHMEM is not supported but even it this case the flag wouldn't hurt), and hence it's not needed at all. What am I missing in my picture?
WBR, Sergei
David Miller
maintainerFrom: Sergei Shtylyov <[email protected]>
Date: Thu, 13 Feb 2014 02:00:19 +0300
Quoted 9 lines
Hello.
I fail to understand why this flag is needed at all. netdev-features.txt says:
* Transmit DMA from high memory
On platforms where this is relevant,
NETIF_F_HIGHDMAsignals thatndo_start_xmitcan handle skbs with frags in high memory.
Back when this flag was created we had pretty much no infrastructure to deal with DMA masks, and furthermore it was not universal that code accessed high memory pages correctly.
So this was the hack we used, the flag meant that your driver was able to access high memory pages correctly (ie. didn't assume that all pages were identity mapped) and that you could handle pages that potentially had physical addresses above 4GB.
It was a big hammer handling a lack of proper APIs, that's all.