]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: enetc: refactor bulk flipping of RX buffers to separate function
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 17 Apr 2025 12:00:04 +0000 (15:00 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jun 2025 12:41:53 +0000 (14:41 +0200)
commit91ba964a752bb504b3902c286ae1f35ff27a2beb
tree94eaf185a2247fe32fc92353fe1a4be87afdfe50
parentc36f5f659ad9c3f3ee56ae2fb60b52a207481c48
net: enetc: refactor bulk flipping of RX buffers to separate function

[ Upstream commit 1d587faa5be7e9785b682cc5f58ba8f4100c13ea ]

This small snippet of code ensures that we do something with the array
of RX software buffer descriptor elements after passing the skb to the
stack. In this case, we see if the other half of the page is reusable,
and if so, we "turn around" the buffers, making them directly usable by
enetc_refill_rx_ring() without going to enetc_new_page().

We will need to perform this kind of buffer flipping from a new code
path, i.e. from XDP_PASS. Currently, enetc_build_skb() does it there
buffer by buffer, but in a subsequent change we will stop using
enetc_build_skb() for XDP_PASS.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Wei Fang <wei.fang@nxp.com>
Link: https://patch.msgid.link/20250417120005.3288549-3-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/freescale/enetc/enetc.c