]> git.baikalelectronics.ru Git - kernel.git/commit
net: ena: fix packet's addresses for rx_offset feature
authorShay Agroskin <shayagr@amazon.com>
Mon, 23 Nov 2020 19:08:59 +0000 (21:08 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 25 Nov 2020 00:07:13 +0000 (16:07 -0800)
commitc8b423284b89fb9fc6361e6349ae97bf64fb40f2
tree2abd124473db9dc180dffd9d97fd69fd1f091cb5
parent111ddc04cbeb6d11a8753780738a9aad9ea12867
net: ena: fix packet's addresses for rx_offset feature

This patch fixes two lines in which the rx_offset received by the device
wasn't taken into account:

- prefetch function:
In our driver the copied data would reside in
rx_info->page + rx_headroom + rx_offset

so the prefetch function is changed accordingly.

- setting page_offset to zero for descriptors > 1:
for every descriptor but the first, the rx_offset is zero. Hence
the page_offset value should be set to rx_headroom.

The previous implementation changed the value of rx_info after
the descriptor was added to the SKB (essentially providing wrong
page offset).

Fixes: 217b7aa136c1 ("net: ena: add support for the rx offset feature")
Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/amazon/ena/ena_netdev.c