Skip to content

Commit

Permalink
bpf/test: Get rid of 4.9 leftovers
Browse files Browse the repository at this point in the history
Misc cleanup which is part of [1].

[1]: #22116

Signed-off-by: Martynas Pumputis <m@lambda.lt>
  • Loading branch information
brb committed Feb 2, 2023
1 parent 3ed62d5 commit 6322212
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 35 deletions.
19 changes: 3 additions & 16 deletions bpf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ testdata:
BUILD_PERMUTATIONS ?= ""

BPF_SIMPLE_OPTIONS += \
-DENABLE_IPV4=1 -DENABLE_IPV6=1 -DENABLE_IPSEC=1 -DIP_POOLS=1
ifneq ("$(KERNEL)","49")
BPF_SIMPLE_OPTIONS += -DHAVE_LPM_TRIE_MAP_TYPE -DHAVE_LRU_HASH_MAP_TYPE
endif
-DENABLE_IPV4=1 -DENABLE_IPV6=1 -DENABLE_IPSEC=1 -DIP_POOLS=1 \
-DHAVE_LPM_TRIE_MAP_TYPE -DHAVE_LRU_HASH_MAP_TYPE

$(BPF_SIMPLE_LL): $(BPF_SIMPLE_C)
@$(ECHO_CC)
Expand Down Expand Up @@ -86,10 +84,6 @@ MAX_BASE_OPTIONS = -DSKIP_DEBUG=1 -DENABLE_IPV4=1 -DENABLE_IPV6=1 \
-DPOLICY_VERDICT_NOTIFY=1 -DALLOW_ICMP_FRAG_NEEDED=1 -DENABLE_IDENTITY_MARK=1 \
-DMONITOR_AGGREGATION=3 -DCT_REPORT_FLAGS=0x0002 -DENABLE_HOST_FIREWALL=1 \
-DENABLE_ICMP_RULE=1 -DENABLE_CUSTOM_CALLS=1 -DENABLE_SRV6=1 -DENABLE_L7_LB=1
ifeq ("$(KERNEL)","49")
# IPSec is incompatible with BPF NodePort so we only enable on 4.9.
MAX_BASE_OPTIONS += -DENABLE_IPSEC=1 -DIP_POOLS=1
else
MAX_BASE_OPTIONS += -DHAVE_LPM_TRIE_MAP_TYPE=1 -DHAVE_LRU_HASH_MAP_TYPE=1 \
-DENABLE_MASQUERADE=1 -DENABLE_SRC_RANGE_CHECK=1 -DENABLE_NODEPORT=1 \
-DENABLE_NODEPORT_ACCELERATION=1 -DENABLE_SESSION_AFFINITY=1 \
Expand All @@ -99,22 +93,19 @@ ifeq ("$(KERNEL)","54")
MAX_BASE_OPTIONS += -DENABLE_BANDWIDTH_MANAGER=1
else ifeq ("$(KERNEL)","netnext")
# We define ETH_HLEN only for net-next, as bpf_skb_change_head is non-available
# on 4.{9,19}.
# on 4.19.
MAX_BASE_OPTIONS += -DENABLE_TPROXY=1 -DENABLE_HOST_ROUTING=1 -DENABLE_BANDWIDTH_MANAGER=1 \
-DETH_HLEN=0 -DENABLE_WIREGUARD
endif
endif
# Egress Gateway should only be enabled for >= 5.2 kernels
ifneq (,$(filter $(KERNEL),"54" "netnext"))
MAX_BASE_OPTIONS += -DENABLE_EGRESS_GATEWAY=1
endif

ifndef MAX_LB_OPTIONS
MAX_LB_OPTIONS = $(MAX_BASE_OPTIONS) -DENABLE_NAT_46X64=1 -DENABLE_NAT_46X64_GATEWAY=1 -DENCAP_IFINDEX=1 -DTUNNEL_MODE=1
ifneq ("$(KERNEL)","49")
MAX_LB_OPTIONS += -DLB_SELECTION=1 -DLB_SELECTION_MAGLEV=1
endif
endif

bpf_sock.ll: bpf_sock.c $(LIB)
$(QUIET) set -e; \
Expand All @@ -133,9 +124,7 @@ bpf_sock.o: bpf_sock.ll

ifndef MAX_OVERLAY_OPTIONS
MAX_OVERLAY_OPTIONS = $(MAX_BASE_OPTIONS) -DENCAP_IFINDEX=1 -DTUNNEL_MODE=1
ifneq ("$(KERNEL)","49")
MAX_OVERLAY_OPTIONS += -DLB_SELECTION=1 -DLB_SELECTION_MAGLEV=1
endif
ifeq ("$(KERNEL)","54")
MAX_OVERLAY_OPTIONS+= -DENABLE_VTEP=1
else ifeq ("$(KERNEL)","netnext")
Expand Down Expand Up @@ -218,10 +207,8 @@ XDP_OPTIONS = $(LB_OPTIONS) \

ifndef MAX_XDP_OPTIONS
MAX_XDP_OPTIONS = $(MAX_BASE_OPTIONS) -DENABLE_PREFILTER=1
ifneq ("$(KERNEL)","49")
MAX_XDP_OPTIONS += -DLB_SELECTION=1 -DLB_SELECTION_MAGLEV=1
endif
endif

bpf_xdp.ll: bpf_xdp.c $(LIB)
$(QUIET) set -e; \
Expand Down
4 changes: 1 addition & 3 deletions bpf/Makefile.bpf
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ CLANG_FLAGS += -Wdeclaration-after-statement
CLANG_FLAGS += -Wimplicit-int-conversion -Wenum-conversion
LLC_FLAGS := -march=bpf
# Mimics the mcpu values set by cilium-agent. See GetBPFCPU().
ifeq ("$(KERNEL)","49")
LLC_FLAGS += -mcpu=v1
else ifeq ("$(KERNEL)","netnext")
ifeq ("$(KERNEL)","netnext")
LLC_FLAGS += -mcpu=v3
else
LLC_FLAGS += -mcpu=v2
Expand Down
3 changes: 0 additions & 3 deletions bpf/complexity-tests/49/bpf_host.txt

This file was deleted.

3 changes: 0 additions & 3 deletions bpf/complexity-tests/49/bpf_lxc.txt

This file was deleted.

1 change: 0 additions & 1 deletion bpf/complexity-tests/49/bpf_overlay.txt

This file was deleted.

1 change: 0 additions & 1 deletion bpf/complexity-tests/49/bpf_sock.txt

This file was deleted.

1 change: 0 additions & 1 deletion bpf/complexity-tests/49/bpf_xdp.txt

This file was deleted.

4 changes: 1 addition & 3 deletions bpf/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ CLANG_FLAGS += -Wno-gnu-variable-sized-type-not-at-end
CLANG_FLAGS += -Wimplicit-int-conversion -Wenum-conversion
LLC_FLAGS := -march=bpf
# Mimics the mcpu values set by cilium-agent. See GetBPFCPU().
ifeq ("$(KERNEL)","49")
LLC_FLAGS += -mcpu=v1
else ifeq ("$(KERNEL)","netnext")
ifeq ("$(KERNEL)","netnext")
LLC_FLAGS += -mcpu=v3
else
LLC_FLAGS += -mcpu=v2
Expand Down
2 changes: 1 addition & 1 deletion test/k8s/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ var _ = SkipDescribeIf(helpers.DoesNotRunOn419Kernel, "K8sDatapathVerifier", fun
}

getKernel := func() string {
kernel := "49"
kernel := "54"
switch {
case helpers.RunsOnNetNextKernel():
kernel = "netnext"
Expand Down
4 changes: 1 addition & 3 deletions test/verifier/verifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

var (
ciliumBasePath = flag.String("cilium-base-path", "", "Cilium checkout base path")
ciKernelVersion = flag.String("ci-kernel-version", "", "CI kernel version to assume for verifier tests (supported values: 49, 419, 54, netnext)")
ciKernelVersion = flag.String("ci-kernel-version", "", "CI kernel version to assume for verifier tests (supported values: 419, 54, netnext)")
)

func getCIKernelVersion(t *testing.T) string {
Expand All @@ -35,8 +35,6 @@ func getCIKernelVersion(t *testing.T) string {

var ciKernel string
switch {
case strings.HasPrefix(release, "4.9"):
ciKernel = "49"
case strings.HasPrefix(release, "4.19"):
ciKernel = "419"
case strings.HasPrefix(release, "5.4"):
Expand Down

0 comments on commit 6322212

Please sign in to comment.