linux/net/core
Paolo Abeni d3ed6dee73 net: harmonize tstats and dstats
After the blamed commits below, some UDP tunnel use dstats for
accounting. On the xmit path, all the UDP-base tunnels ends up
using iptunnel_xmit_stats() for stats accounting, and the latter
assumes the relevant (tunnel) network device uses tstats.

The end result is some 'funny' stat report for the mentioned UDP
tunnel, e.g. when no packet is actually dropped and a bunch of
packets are transmitted:

gnv2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue \
		state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether ee:7d:09:87:90:ea brd ff:ff:ff:ff:ff:ff
    RX:  bytes packets errors dropped  missed   mcast
         14916      23      0      15       0       0
    TX:  bytes packets errors dropped carrier collsns
             0    1566      0       0       0       0

Address the issue ensuring the same binary layout for the overlapping
fields of dstats and tstats. While this solution is a bit hackish, is
smaller and with no performance pitfall compared to other alternatives
i.e. supporting both dstat and tstat in iptunnel_xmit_stats() or
reverting the blamed commit.

With time we should possibly move all the IP-based tunnel (and virtual
devices) to dstats.

Fixes: c77200c074 ("bareudp: Handle stats using NETDEV_PCPU_STAT_DSTATS.")
Fixes: 6fa6de3022 ("geneve: Handle stats using NETDEV_PCPU_STAT_DSTATS.")
Fixes: be226352e8 ("vxlan: Handle stats using NETDEV_PCPU_STAT_DSTATS.")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Link: https://patch.msgid.link/2e1c444cf0f63ae472baff29862c4c869be17031.1738432804.git.pabeni@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-02-03 18:39:59 -08:00
..
Makefile net: Implement fault injection forcing skb reallocation 2024-11-12 12:05:33 +01:00
bpf_sk_storage.c bpf: Disable migration when cloning sock storage 2025-01-08 18:06:36 -08:00
datagram.c
dev.c net: harmonize tstats and dstats 2025-02-03 18:39:59 -08:00
dev.h net: make netdev netlink ops hold netdev_lock() 2025-01-15 19:13:34 -08:00
dev_addr_lists.c net: ti: icssg-prueth: Add Multicast Filtering support for VLAN in MAC mode 2025-01-14 12:17:27 +01:00
dev_addr_lists_test.c
dev_ioctl.c dev: Hold rtnl_net_lock() for dev_ifsioc(). 2025-01-16 17:20:50 -08:00
devmem.c net: move HDS config from ethtool state 2025-01-20 11:44:57 -08:00
devmem.h
drop_monitor.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
dst.c net: do not delay dst_entries_add() in dst_release() 2024-10-10 11:28:17 +02:00
dst_cache.c
failover.c
fib_notifier.c net: do not acquire rtnl in fib_seq_sum() 2024-10-11 15:35:05 -07:00
fib_rules.c net: fib_rules: Enable flow label selector usage 2024-12-19 16:02:22 +01:00
filter.c bpf-next-6.14 2025-01-23 08:04:07 -08:00
flow_dissector.c
flow_offload.c
gen_estimator.c
gen_stats.c
gro.c net: Add netif_get_gro_max_size helper for GRO 2024-10-01 10:48:51 +02:00
gro_cells.c
gso.c
hotdata.c
hwbm.c
ieee8021q_helpers.c
link_watch.c ipvlan: Fix use-after-free in ipvlan_get_iflink(). 2025-01-07 17:50:49 -08:00
lwt_bpf.c bpf: lwtunnel: Prepare bpf_lwt_xmit_reroute() to future .flowi4_tos conversion. 2024-11-14 19:07:49 -08:00
lwtunnel.c
mp_dmabuf_devmem.h
neighbour.c net/neighbor: clear error in case strict check is not set 2024-11-18 18:42:21 -08:00
net-procfs.c
net-sysfs.c net: protect NAPI config fields with netdev_lock() 2025-01-15 19:13:34 -08:00
net-sysfs.h
net-traces.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
net_namespace.c net: expedite synchronize_net() for cleanup_net() 2025-01-15 19:17:03 -08:00
net_test.c
netclassid_cgroup.c
netdev-genl-gen.c netdev: avoid CFI problems with sock priv helpers 2025-01-16 13:15:40 +01:00
netdev-genl-gen.h netdev-genl: Support setting per-NAPI config values 2024-10-14 17:54:29 -07:00
netdev-genl.c netdev-genl: remove rtnl_lock protection from NAPI ops 2025-01-15 19:13:35 -08:00
netdev_rx_queue.c netdev: define NETDEV_INTERNAL 2025-01-09 15:33:08 +01:00
netevent.c
netmem_priv.h
netpoll.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-01-16 10:34:59 -08:00
netprio_cgroup.c
of_net.c
page_pool.c First batch of fixes for 6.14. Nothing really stands out, 2025-01-30 12:24:20 -08:00
page_pool_priv.h net: page_pool: don't try to stash the napi id 2025-01-27 14:37:41 -08:00
page_pool_user.c net: page_pool: don't try to stash the napi id 2025-01-27 14:37:41 -08:00
pktgen.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-01-16 10:34:59 -08:00
ptp_classifier.c
request_sock.c
rtnetlink.c rtnetlink: Add rtnl_net_lock_killable(). 2025-01-07 13:45:53 +01:00
rtnl_net_debug.c dev: Hold rtnl_net_lock() for dev_ifsioc(). 2025-01-16 17:20:50 -08:00
scm.c
secure_seq.c
selftests.c
skb_fault_injection.c net: Implement fault injection forcing skb reallocation 2024-11-12 12:05:33 +01:00
skbuff.c bpf, xdp: constify some bpf_prog * function arguments 2024-12-05 18:41:06 -08:00
skmsg.c skmsg: Return copied bytes in sk_msg_memcopy_from_iter 2024-12-20 22:53:36 +01:00
sock.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-01-03 16:29:29 -08:00
sock_destructor.h
sock_diag.c
sock_map.c bpf, sockmap: Fix race between element replace and close() 2024-12-10 17:38:05 +01:00
sock_reuseport.c
stream.c
sysctl_net_core.c net: let net.core.dev_weight always be non-zero 2025-01-17 19:00:11 -08:00
timestamping.c net: Add the possibility to support a selected hwtstamp in netdevice 2024-12-16 12:51:40 +00:00
tso.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
utils.c
xdp.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-01-16 10:34:59 -08:00