net: Move {l,t,d}stats allocation to core and convert veth & vrf
authorDaniel Borkmann <daniel@iogearbox.net>
Tue, 14 Nov 2023 00:42:14 +0000 (01:42 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 Dec 2023 06:33:04 +0000 (07:33 +0100)
commit6ae7b3fc7ae8a8e9205043b3d966488d0a7cbb0a
tree903c30e8ceec799699944a940f1235b5b4ad9a90
parent95f068b0fd3668672e34ebeb8416f57aef27058b
net: Move {l,t,d}stats allocation to core and convert veth & vrf

[ Upstream commit 34d21de99cea9cb17967874313e5b0262527833c ]

Move {l,t,d}stats allocation to the core and let netdevs pick the stats
type they need. That way the driver doesn't have to bother with error
handling (allocation failure checking, making sure free happens in the
right spot, etc) - all happening in the core.

Co-developed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Cc: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20231114004220.6495-3-daniel@iogearbox.net
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Stable-dep-of: 024ee930cb3c ("bpf: Fix dev's rx stats for bpf_redirect_peer traffic")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/veth.c
drivers/net/vrf.c
include/linux/netdevice.h
net/core/dev.c