summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/aeroflex
diff options
context:
space:
mode:
authorShay Agroskin <shayagr@amazon.com>2021-06-08 19:42:54 +0300
committerDavid S. Miller <davem@davemloft.net>2021-06-08 16:41:02 -0700
commit504fd6a5390c30b1b7670768e314dd5d473da06a (patch)
treeaf875de53886010b383d33a96f38b1d3deb70fbc /drivers/net/ethernet/aeroflex
parent1650bdb1c516c248fb06f6d076559ff6437a5853 (diff)
downloadlinux-stable-504fd6a5390c30b1b7670768e314dd5d473da06a.tar.gz
linux-stable-504fd6a5390c30b1b7670768e314dd5d473da06a.tar.bz2
linux-stable-504fd6a5390c30b1b7670768e314dd5d473da06a.zip
net: ena: fix DMA mapping function issues in XDP
This patch fixes several bugs found when (DMA/LLQ) mapping a packet for transmission. The mapping procedure makes the transmitted packet accessible by the device. When using LLQ, this requires copying the packet's header to push header (which would be passed to LLQ) and creating DMA mapping for the payload (if the packet doesn't fit the maximum push length). When not using LLQ, we map the whole packet with DMA. The following bugs are fixed in the code: 1. Add support for non-LLQ machines: The ena_xdp_tx_map_frame() function assumed that LLQ is supported, and never mapped the whole packet using DMA. On some instances, which don't support LLQ, this causes loss of traffic. 2. Wrong DMA buffer length passed to device: When using LLQ, the first 'tx_max_header_size' bytes of the packet would be copied to push header. The rest of the packet would be copied to a DMA'd buffer. 3. Freeing the XDP buffer twice in case of a mapping error: In case a buffer DMA mapping fails, the function uses xdp_return_frame_rx_napi() to free the RX buffer and returns from the function with an error. XDP frames that fail to xmit get freed by the kernel and so there is no need for this call. Fixes: 548c4940b9f1 ("net: ena: Implement XDP_TX action") Signed-off-by: Shay Agroskin <shayagr@amazon.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/aeroflex')
0 files changed, 0 insertions, 0 deletions