Repository navigation
xfrm: parse state direction and IP-TFS counters from xfrm_stat - #906
Open
isleofgeorge wants to merge 1 commit into
Open
isleofgeorge wants to merge 1 commit into
isleofgeorge wants to merge 1 commit into
Conversation
Linux 6.10 added XfrmInStateDirError and XfrmOutStateDirError, and Linux 6.14 added XfrmInIptfsError and XfrmOutNoQueueSpace to /proc/net/xfrm_stat. NewXfrmStat silently dropped them. Add them so XfrmStat covers every counter in the kernel's xfrm_mib_list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: George Rubin <george.rubin@island.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add the four
/proc/net/xfrm_statcounters thatXfrmStatdoes not model yet:XfrmInStateDirErrorXfrmOutStateDirErrorXfrmInIptfsErrorXfrmOutNoQueueSpaceWith these,
XfrmStatcovers all 32 entries ofxfrm_mib_listin mainlinenet/xfrm/xfrm_proc.c.Why
NewXfrmStatignores names it does not know, so on 6.10+ kernels these drops are read and thrown away. We hit this exporting per-reason xfrm drops from IPsec gateways on a 6.18 kernel: 32 counters in the file, 28 in the struct.Behavior
Purely additive. The new fields are
intlike the existing ones and stay0on kernels that do not print them, which is how every other field in the struct already behaves.Tests
Extended the
net/xfrm_statfixture with the four lines and asserted them inTestXfrmStats.make fixtures,make update_fixtures(no diff),make test,make style,make check_licenseandmake lintall pass.Disclosure: AI-assisted. I prepared this with an AI assistant and checked the kernel sources and test runs myself.
🤖 Generated with Claude Code