]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
selftests: bpf: introduce a common routine for reading procfs
authorMaciej Fijalkowski <maciej.fijalkowski@intel.com>
Thu, 2 Apr 2026 15:49:55 +0000 (17:49 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 7 Apr 2026 01:43:51 +0000 (18:43 -0700)
commitc5866a6be47207b05c6eead6292c8551c8a91669
treeea50de7a33d028744f205dea8ccd8113e608f4b6
parent36ee60b569ba0dfb6f961333b90d19ab5b323fa9
selftests: bpf: introduce a common routine for reading procfs

Parametrize current way of getting MAX_SKB_FRAGS value from {sys,proc}fs
so that it can be re-used to get cache line size of system's CPU. All
that just to mimic and compute size of kernel's struct skb_shared_info
which for xsk and test suite interpret as tailroom.

Introduce two variables to ifobject struct that will carry count of skb
frags and tailroom size. Do the reading and computing once, at the
beginning of test suite execution in xskxceiver, but for test_progs such
way is not possible as in this environment each test setups and torns
down ifobject structs.

Reviewed-by: Björn Töpel <bjorn@kernel.org>
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Link: https://patch.msgid.link/20260402154958.562179-6-maciej.fijalkowski@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/bpf/prog_tests/test_xsk.c
tools/testing/selftests/bpf/prog_tests/test_xsk.h
tools/testing/selftests/bpf/prog_tests/xsk.c
tools/testing/selftests/bpf/xskxceiver.c