net: Move flush list retrieval to where it is used.
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Fri, 28 Jun 2024 10:18:56 +0000 (12:18 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 2 Jul 2024 13:26:57 +0000 (15:26 +0200)
commite3d69f585d651aba877e18866de7e8cfa2476caa
treea822126b33b57d6d3abde8196612806e49545f3f
parentd839a73179ae91c07f5f2f97ccb9c69b2b7c3306
net: Move flush list retrieval to where it is used.

The bpf_net_ctx_get_.*_flush_list() are used at the top of the function.
This means the variable is always assigned even if unused. By moving the
function to where it is used, it is possible to delay the initialisation
until it is unavoidable.
Not sure how much this gains in reality but by looking at bq_enqueue()
(in devmap.c) gcc pushes one register less to the stack. \o/.

 Move flush list retrieval to where it is used.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
kernel/bpf/cpumap.c
kernel/bpf/devmap.c
net/xdp/xsk.c