* Re: NETIF_F_HIGHDMA?
2014-02-12 23:00 NETIF_F_HIGHDMA? Sergei Shtylyov
@ 2014-02-12 22:51 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-02-12 22:51 UTC (permalink / raw)
To: sergei.shtylyov; +Cc: netdev
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Thu, 13 Feb 2014 02:00:19 +0300
> 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.
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
* NETIF_F_HIGHDMA?
@ 2014-02-12 23:00 Sergei Shtylyov
2014-02-12 22:51 ` NETIF_F_HIGHDMA? David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Sergei Shtylyov @ 2014-02-12 23:00 UTC (permalink / raw)
To: David Miller, netdev
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-12 22:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-12 23:00 NETIF_F_HIGHDMA? Sergei Shtylyov
2014-02-12 22:51 ` NETIF_F_HIGHDMA? David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).