From: Jakub Kicinski Date: Tue, 2 Jun 2026 19:57:50 +0000 (-0700) Subject: Merge branch 'netdevsim-psp-fix-issues-with-stats-collection' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9f2d4607403a2b0d20b71a784455463e132d3d0;p=thirdparty%2Flinux.git Merge branch 'netdevsim-psp-fix-issues-with-stats-collection' Daniel Zahka says: ==================== netdevsim: psp: fix issues with stats collection It has come to my attention via a sashiko review of my net-next series for aes-gcm in netdevsim [1] that there were preexisting issues with netdevsim's implementation of psp statistics. API usage issues: 1. not calling u64_stats_init() on the u64_stats_sync object during init 2. not serializing usage of the writer side API during stats update Logical Bugs: 1. We were incrementing rx stats on the sending devices stats counters. Fix the first set of issues by removing the u64_stats_t api entirely, and keep track of stats with atomics. Fix the second issue by charging events to the right netdevsim object. [1]: https://sashiko.dev/#/patchset/20260508-nsim-psp-crypto-v1-0-4b50ed09b794%40gmail.com TAP version 13 1..28 ok 1 psp.data_basic_send_v0_ip4 ok 2 psp.data_basic_send_v0_ip6 ok 3 psp.data_basic_send_v1_ip4 ok 4 psp.data_basic_send_v1_ip6 ok 5 psp.data_basic_send_v2_ip4 ok 6 psp.data_basic_send_v2_ip6 ok 7 psp.data_basic_send_v3_ip4 ok 8 psp.data_basic_send_v3_ip6 ok 9 psp.data_mss_adjust_ip4 ok 10 psp.data_mss_adjust_ip6 ok 11 psp.dev_list_devices ok 12 psp.dev_get_device ok 13 psp.dev_get_device_bad ok 14 psp.dev_rotate ok 15 psp.dev_rotate_spi ok 16 psp.assoc_basic ok 17 psp.assoc_bad_dev ok 18 psp.assoc_sk_only_conn ok 19 psp.assoc_sk_only_mismatch ok 20 psp.assoc_sk_only_mismatch_tx ok 21 psp.assoc_sk_only_unconn ok 22 psp.assoc_version_mismatch ok 23 psp.assoc_twice ok 24 psp.data_send_bad_key ok 25 psp.data_send_disconnect ok 26 psp.data_stale_key ok 27 psp.removal_device_rx ok 28 psp.removal_device_bi # Totals: pass:28 fail:0 xfail:0 xpass:0 skip:0 error:0 Dump stats on both devs tx on one should match rx on other: local dev: id=5 ifindex=2 stats={'dev-id': 5, 'key-rotations': 0, 'stale-events': 0, 'rx-packets': 1226, 'rx-bytes': 39244, 'rx-auth-fail': 0, 'rx-error': 0, 'rx-bad': 0, 'tx-packets': 1931, 'tx-bytes': 2478908, 'tx-error': 0} remote dev: id=3 ifindex=2 stats={'dev-id': 3, 'key-rotations': 0, 'stale-events': 0, 'rx-packets': 1931, 'rx-bytes': 2478908, 'rx-auth-fail': 0, 'rx-error': 0, 'rx-bad': 0, 'tx-packets': 1226, 'tx-bytes': 39244, 'tx-error': 0} ==================== Link: https://patch.msgid.link/20260529-fix-psp-stats-v2-0-3a194eacf18e@gmail.com Signed-off-by: Jakub Kicinski --- a9f2d4607403a2b0d20b71a784455463e132d3d0