Skip to content

Add flowtable counter support - #47

Merged
kubernetes-prow[bot] merged 1 commit into
kubernetes-sigs:masterfrom
caseydavenport:casey-flowtable-counter
Sep 3, 2026
Merged

kubernetes-prow[bot] merged 1 commit into
kubernetes-sigs:masterfrom
caseydavenport:casey-flowtable-counter

Conversation

@caseydavenport

Copy link
Copy Markdown
Contributor

Hopefully not contentious!

We're getting around to flowtable support in Calico, and would like access to counter metrics for offloaded flows.

Lets callers keep conntrack accounting up to date for offloaded flows.
@kubernetes-prow
kubernetes-prow Bot requested review from aojea and danwinship August 31, 2026 18:57
@kubernetes-prow kubernetes-prow Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 31, 2026
Comment thread objects.go

// nft add flowtable inet example_table example_flowtable { hook ingress priority filter ; devices = { eth0 }; }
// nft add flowtable inet example_table example_flowtable { hook ingress priority filter ; devices = { eth0 } ; counter ; }
// Every property is optional, so a flowtable may have a counter and no devices.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that true? The man page claims devices is required.

Though, I guess, my nft man page doesn't mention flowtable counters...

@caseydavenport caseydavenport Sep 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! At least in my local verification, I was able to create tables without devices but with counter set. Not sure why that would be useful, though.

Comment thread types.go

// Counter enables packet and byte accounting for offloaded flows.
// (Optional; requires kernel 5.13 or later)
Counter *bool

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you read the counter?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The flowtable counter just indicates that conntrack metrics should continue to be updated based on the offloaded flows (whereas normally they are not) - so we read them from there.

@danwinship

Copy link
Copy Markdown
Collaborator

I was going to say "you need to update ListFlowtables" but I guess that doesn't exist. OK then.

/lgtm
/approve

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 3, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: caseydavenport, danwinship

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 3, 2026
@kubernetes-prow
kubernetes-prow Bot merged commit 0087e9e into kubernetes-sigs:master Sep 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants