net: ethernet: xilinx: Adding highmem support
The driver issue was observed on Microblaze with Higmem enabled and 1GB
memory.
This patch adding highmem support for skb fragments to resolve it.
page_address() assumes to work with a lowmem page only but fragments
can be placed in highmem pages which has to be handled differently
then lomem pages.
This patch was inspired by:
"net: mv643xx_eth: Fix highmem support in non-TSO egress path"
(sha1:
9e91141)
where the highmem problem was observed.
skb_frag_dma_map() calls dma_map_page() that's why it is necessary to
distinguish if dma_map_simple() or dma_map_page() is called.
This is done by saving flag to every TX BD in tx_desc_mapping field.
There is also reference in Documentation/DMA-API-HOWTO.txt that
dma_map_single cannot be used with HIGMEM.
"Using CPU pointers like this for single mappings has a
disadvantage:
you cannot reference HIGHMEM memory in this way. Thus, there is a
map/unmap interface pair akin to dma_{map,unmap}_single(). These
interfaces deal with page/offset pairs instead of CPU pointers."
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>