Skip to content

Commit

Permalink
update latest cilium ebpf version
Browse files Browse the repository at this point in the history
Signed-off-by: Santhosh Fernandes <santhosh.fernandes@gmail.com>
  • Loading branch information
sanfern committed Jul 12, 2023
1 parent e42a7d2 commit d4f6395
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
6 changes: 5 additions & 1 deletion kf/bpf.go
Expand Up @@ -13,6 +13,7 @@ import (
"context"
"errors"
"fmt"
"github.com/cilium/ebpf/link"
"io"
"net"
"net/http"
Expand Down Expand Up @@ -1142,7 +1143,10 @@ func (b *BPF) LoadXDPRootProgram(ifaceName string, eBPFProgram *BPF) error {
return fmt.Errorf("%s:failed to pin the map", rootArrayMapFileName)
}

err = AttachXDP(bpfRootProg, iface.Index)
_, err = link.AttachXDP(link.XDPOptions{
Program: bpfRootProg,
Interface: iface.Index,
})
if err != nil {
return fmt.Errorf("could not attach XDP program: %s", err)
}
Expand Down
11 changes: 0 additions & 11 deletions kf/kf_unix.go
Expand Up @@ -21,7 +21,6 @@ import (
"github.com/l3af-project/l3afd/models"

"github.com/cilium/ebpf"
"github.com/cilium/ebpf/link"
"github.com/florianl/go-tc"
"github.com/florianl/go-tc/core"
"github.com/rs/zerolog/log"
Expand Down Expand Up @@ -203,16 +202,6 @@ func VerifyNCreateTCDirs() error {
return nil
}

func AttachXDP(bpfRootProg *ebpf.Program, index int) error {
// Attach the program
_, err := link.AttachXDP(link.XDPOptions{
Program: bpfRootProg,
Interface: index,
})

return err
}

// LoadTCRootProgram - Load and add tc filters
func (b *BPF) LoadTCRootProgram(ifaceName, direction string, eBPFProgram *BPF) error {
iface, err := net.InterfaceByName(ifaceName)
Expand Down
7 changes: 0 additions & 7 deletions kf/kf_windows.go
Expand Up @@ -11,8 +11,6 @@ import (
"errors"
"fmt"
"os"

"github.com/cilium/ebpf"
)

// DisableLRO - XDP programs are failing when Large Receive Offload is enabled, to fix this we use to manually disable.
Expand Down Expand Up @@ -58,11 +56,6 @@ func VerifyNCreateTCDirs() error {
return nil
}

// AttachXDP - Attach BPF Program
func AttachXDP(bpfRootProg *ebpf.Program, index int) error {
return fmt.Errorf("AttachXDP - Unsupported on windows")
}

// LoadTCRootProgram - not implemented in windows
func (b *BPF) LoadTCRootProgram(ifaceName, direction string, eBPFProgram *BPF) error {
// not implement nothing todo
Expand Down
1 change: 0 additions & 1 deletion kf/nfconfig_test.go
Expand Up @@ -24,7 +24,6 @@ var (
hostInterfaces map[string]bool
pMon *pCheck
mMon *kfMetrics
// val []byte
valVerChange *models.BPFPrograms
valStatusChange *models.BPFPrograms
ingressXDPBpfs map[string]*list.List
Expand Down

0 comments on commit d4f6395

Please sign in to comment.