Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: export netkit and tcx probes #1602

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions link/syscalls.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@ var haveProgQuery = internal.NewFeatureTest("BPF_PROG_QUERY", func() error {
return errors.New("syscall succeeded unexpectedly")
}, "4.15")

// HaveTCX probes the running kernel for the availability of the tcx layer.
//
// Upstream commit e420bed0250 ("bpf: Add fd-based tcx multi-prog infra with link support")
//
// See the package documentation for the meaning of the error return value.
func HaveTCX() error {
return haveTCX()
}

var haveTCX = internal.NewFeatureTest("tcx", func() error {
prog, err := ebpf.NewProgram(&ebpf.ProgramSpec{
Type: ebpf.SchedCLS,
Expand Down Expand Up @@ -164,6 +173,15 @@ var haveTCX = internal.NewFeatureTest("tcx", func() error {
return errors.New("syscall succeeded unexpectedly")
}, "6.6")

// HaveNetkit probes the running kernel for the availability of netkit devices.
//
// Upstream commit 35dfaad7188c ("netkit, bpf: Add bpf programmable net device")
//
// See the package documentation for the meaning of the error return value.
func HaveNetkit() error {
return haveNetkit()
}

var haveNetkit = internal.NewFeatureTest("netkit", func() error {
prog, err := ebpf.NewProgram(&ebpf.ProgramSpec{
Type: ebpf.SchedCLS,
Expand Down
Loading