Skip to content

Commit

Permalink
SDN-5393: eBPF agent intg with bpfman for ebpf progs life cycle mgmts
Browse files Browse the repository at this point in the history
Signed-off-by: Mohamed Mahmoud <[email protected]>
  • Loading branch information
msherif1234 committed Dec 12, 2024
1 parent 839a237 commit c8ad4e6
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/push_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ jobs:
- name: get short sha
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: build and push bytecode image
<<<<<<< HEAD
run: |
IMAGE_NOO_BC=quay.io/netobserv/ebpf-bytecode:${{ env.WF_VERSION }} make build-and-push-bc-image
IMAGE_NOO_BC=quay.io/netobserv/ebpf-bytecode:${{ env.short_sha }} OCI_BUILD_OPTS="--label quay.expires-after=2w" make build-and-push-bc-image
=======
run: make build-and-push-bc-image
>>>>>>> 4b73d662 (SDN-5393: eBPF agent intg with bpfman for ebpf progs life cycle mgmts)
- name: build and push manifest with images
run: |
MULTIARCH_TARGETS="${{ env.WF_MULTIARCH_TARGETS }}" IMAGE_ORG=${{ env.WF_ORG }} VERSION=${{ env.WF_VERSION }} CLEAN_BUILD=1 make images
Expand Down
1 change: 1 addition & 0 deletions bpf/maps_definition.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct {
__type(value, additional_metrics);
__uint(max_entries, 1 << 24);
__uint(map_flags, BPF_F_NO_PREALLOC);
__uint(pinning, LIBBPF_PIN_BY_NAME);
} additional_flow_metrics SEC(".maps");

//PerfEvent Array for Packet Payloads
Expand Down
3 changes: 2 additions & 1 deletion hack/build-bytecode-images-multi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ PROGRAMS='{
# MAPS is a list of <map name>:<map type> tuples
MAPS='{
"direct_flows":"ringbuf",
"aggregated_flows":"per_cpu_hash",
"aggregated_flows":"hash",
"additional_flow_metrics":"per_cpu_hash",
"packets_record":"perf_event_array",
"dns_flows":"hash",
"global_counters":"per_cpu_array",
Expand Down
Binary file modified pkg/ebpf/bpf_arm64_bpfel.o
Binary file not shown.
Binary file modified pkg/ebpf/bpf_powerpc_bpfel.o
Binary file not shown.
Binary file modified pkg/ebpf/bpf_s390_bpfeb.o
Binary file not shown.
Binary file modified pkg/ebpf/bpf_x86_bpfel.o
Binary file not shown.
13 changes: 6 additions & 7 deletions pkg/tracer/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ func NewFlowFetcher(cfg *FlowFetcherConfig) (*FlowFetcher, error) {
} else {
spec.Maps[additionalFlowMetrics].MaxEntries = 1
}
// remove pinning from all maps
maps2Name := []string{"aggregated_flows", "additional_flow_metrics", "direct_flows", "dns_flows", "filter_map", "global_counters", "packet_record"}

for _, m := range maps2Name {
spec.Maps[m].Pinning = 0
}

traceMsgs := 0
if cfg.Debug {
Expand All @@ -148,13 +154,6 @@ func NewFlowFetcher(cfg *FlowFetcherConfig) (*FlowFetcher, error) {
}
}

// remove pinning from all maps
maps2Name := []string{"aggregated_flows", "additional_flow_metrics", "direct_flows", "dns_flows", "filter_map", "global_counters", "packet_record"}

for _, m := range maps2Name {
spec.Maps[m].Pinning = 0
}

enableFlowFiltering := 0
if cfg.EnableFlowFilter {
enableFlowFiltering = 1
Expand Down

0 comments on commit c8ad4e6

Please sign in to comment.