Skip to content

Commit

Permalink
Merge branch 'main' into hy2
Browse files Browse the repository at this point in the history
  • Loading branch information
mzz2017 authored Oct 30, 2024
2 parents 3cad122 + 382dc5c commit 748dd3e
Show file tree
Hide file tree
Showing 10 changed files with 561 additions and 495 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/kernel-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
strategy:
fail-fast: false
matrix:
kernel: [ '5.15-20240305.092417', '6.1-20240305.092417', '6.6-20240305.092417' ]
kernel: [ '6.1-20240305.092417', '6.6-20240305.092417' ]
timeout-minutes: 10
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ STRIP ?= llvm-strip
CFLAGS := -O2 -Wall -Werror $(CFLAGS)
TARGET ?= bpfel,bpfeb
OUTPUT ?= dae
MAX_MATCH_SET_LEN ?= 64
MAX_MATCH_SET_LEN ?= 1024
CFLAGS := -DMAX_MATCH_SET_LEN=$(MAX_MATCH_SET_LEN) $(CFLAGS)
NOSTRIP ?= n
STRIP_PATH := $(shell command -v $(STRIP) 2>/dev/null)
Expand Down
3 changes: 2 additions & 1 deletion common/consts/ebpf.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (i OutboundIndex) IsReserved() bool {

var (
MaxMatchSetLen_ = ""
MaxMatchSetLen = 32 * 2
MaxMatchSetLen = 32 * 32
)

func init() {
Expand Down Expand Up @@ -157,6 +157,7 @@ var (
UserspaceBatchUpdateLpmTrieFeatureVersion = internal.Version{5, 13, 0}
BpfTimerFeatureVersion = internal.Version{5, 15, 0}
HelperBpfGetFuncIpVersionFeatureVersion = internal.Version{5, 15, 0}
BpfLoopFeatureVersion = internal.Version{5, 17, 0}
)

const (
Expand Down
8 changes: 8 additions & 0 deletions control/control_plane.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (

"github.com/bits-and-blooms/bloom/v3"
"github.com/cilium/ebpf"
"github.com/cilium/ebpf/asm"
"github.com/cilium/ebpf/features"
"github.com/cilium/ebpf/rlimit"
"github.com/daeuniverse/dae/common"
"github.com/daeuniverse/dae/common/assets"
Expand Down Expand Up @@ -101,6 +103,12 @@ func NewControlPlane(
}
/// Check linux kernel requirements.
// Check version from high to low to reduce the number of user upgrading kernel.
if err := features.HaveProgramHelper(ebpf.SchedCLS, asm.FnLoop); err != nil {
return nil, fmt.Errorf("%w: your kernel version %v does not support bpf_loop (needed by routing); expect >=%v; upgrade your kernel and try again",
err,
kernelVersion.String(),
consts.BpfLoopFeatureVersion.String())
}
if requirement := consts.ChecksumFeatureVersion; kernelVersion.Less(requirement) {
return nil, fmt.Errorf("your kernel version %v does not support checksum related features; expect >=%v; upgrade your kernel and try again",
kernelVersion.String(),
Expand Down
Loading

0 comments on commit 748dd3e

Please sign in to comment.