]> git.ipfire.org Git - people/arne_f/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Dec 2020 07:51:57 +0000 (08:51 +0100)
commitaafcf7aa949aec61ee5e32e310656da0da8ff0fc
treec405f477511a47ab097693d8e1bd3f1542c899ca
parent9b58e355ccf6c495b131d0e20677d0b620b5f983
net: ena: fix packet's addresses for rx_offset feature

[ Upstream commit 1396d3148bd250db880573f9ed0abe5d6fba1fce ]

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: 68f236df93a9 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/amazon/ena/ena_netdev.c