]> rtime.felk.cvut.cz Git - zynq/linux.git/commit
net: ethernet: xilinx: Adding highmem support
authorKedareswara rao Appana <appanad@xilinx.com>
Mon, 18 Sep 2017 07:37:31 +0000 (13:07 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 15 Mar 2018 14:17:49 +0000 (15:17 +0100)
commitb59679defdfae209d4f05862a29d64b66a34fb8a
tree30c804ee370aca5021f5af2370dd019574b3b83f
parent79954bb458f22a1071ebba35ad5c7b2f7a200fce
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>
drivers/net/ethernet/xilinx/xilinx_axienet.h
drivers/net/ethernet/xilinx/xilinx_axienet_main.c