]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/funeth: Fix fun_xdp_tx() and XDP packet reclaim
authorDimitris Michailidis <d.michailidis@fungible.com>
Tue, 26 Jul 2022 21:59:23 +0000 (14:59 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Aug 2022 10:05:28 +0000 (12:05 +0200)
commit48bea0d21d4b15064ea467ba14dcd5a54f2ea772
tree21a0690c0f828030f8acf2e8c121adcb1c1cc106
parentd99f144acc3b4b27ab91f78fd6d7085385ccd654
net/funeth: Fix fun_xdp_tx() and XDP packet reclaim

[ Upstream commit 51a83391d77bb0f7ff0aef06ca4c7f5aa9e80b4c ]

The current implementation of fun_xdp_tx(), used for XPD_TX, is
incorrect in that it takes an address/length pair and later releases it
with page_frag_free(). It is OK for XDP_TX but the same code is used by
ndo_xdp_xmit. In that case it loses the XDP memory type and releases the
packet incorrectly for some of the types. Assorted breakage follows.

Change fun_xdp_tx() to take xdp_frame and rely on xdp_return_frame() in
reclaim.

Fixes: db37bc177dae ("net/funeth: add the data path")
Signed-off-by: Dimitris Michailidis <dmichail@fungible.com>
Link: https://lore.kernel.org/r/20220726215923.7887-1-dmichail@fungible.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/fungible/funeth/funeth_rx.c
drivers/net/ethernet/fungible/funeth/funeth_tx.c
drivers/net/ethernet/fungible/funeth/funeth_txrx.h