diff options
author | Roger Quadros <rogerq@kernel.org> | 2025-02-10 17:52:15 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2025-02-13 07:12:38 +0300 |
commit | 5db843258de1e4e6b1ef1cbd1797923c9e3de548 (patch) | |
tree | 99946fcf2d0372a0e56c4aa8d985a83923d84e52 /lib/mpi/mpi-inline.c | |
parent | b698b9a8acc804e1b777aece0b3699850d736087 (diff) | |
download | linux-5db843258de1e4e6b1ef1cbd1797923c9e3de548.tar.xz |
net: ethernet: ti: am65-cpsw: fix memleak in certain XDP cases
If the XDP program doesn't result in XDP_PASS then we leak the
memory allocated by am65_cpsw_build_skb().
It is pointless to allocate SKB memory before running the XDP
program as we would be wasting CPU cycles for cases other than XDP_PASS.
Move the SKB allocation after evaluating the XDP program result.
This fixes the memleak. A performance boost is seen for XDP_DROP test.
XDP_DROP test:
Before: 460256 rx/s 0 err/s
After: 784130 rx/s 0 err/s
Fixes: 8acacc40f733 ("net: ethernet: ti: am65-cpsw: Add minimal XDP support")
Signed-off-by: Roger Quadros <rogerq@kernel.org>
Link: https://patch.msgid.link/20250210-am65-cpsw-xdp-fixes-v1-1-ec6b1f7f1aca@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'lib/mpi/mpi-inline.c')
0 files changed, 0 insertions, 0 deletions