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

added LoadProgWithPinType method to support NONE pinType #98

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nithu0115
Copy link
Contributor

Issue #, if available: N/A

Description of changes: added LoadProgWithPinType method to support NONE pinType.
when PIN_NONE is set, we expect there is no pinPath and load the program. However, the existing code is looking for pinPath resulting in prog load failure

{"level":"info","ts":"2024-11-05T16:45:25.176Z","caller":"elfparser/elf.go:654","msg":"Sec 'tc_cls': found program 'handle_ingress' at insn offset 0 (0 bytes), code size 310 insns (2480 bytes)\n"}
{"level":"info","ts":"2024-11-05T16:45:25.178Z","caller":"elfparser/elf.go:290","msg":"Load prog done with fd : 11"}
{"level":"info","ts":"2024-11-05T16:45:25.178Z","caller":"progs/loader.go:247","msg":"error creating directory \"/sys/fs/bpf/globals/aws/programs\": mkdir /sys/fs/bpf/globals: no such file or directory"}
{"level":"error","ts":"2024-11-05T16:45:25.178Z","caller":"elfparser/elf.go:290","msg":"pin prog failed error creating directory \"/sys/fs/bpf/globals/aws/programs\": mkdir /sys/fs/bpf/globals: no such file or directory"}
{"level":"info","ts":"2024-11-05T16:45:25.178Z","caller":"elfparser/elf.go:660","msg":"Failed to load prog%!(EXTRA string=error, *errors.errorString=error creating directory \"/sys/fs/bpf/globals/aws/programs\": mkdir /sys/fs/bpf/globals: no such file or directory)"}
bash-4.2#

This pr will fix above issue.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@nithu0115 nithu0115 requested a review from a team as a code owner November 5, 2024 18:30
@@ -284,10 +284,21 @@ func (e *elfLoader) parseRelocationSection(reloSection *elf.Section, elfFile *el
func (e *elfLoader) loadProg(loadedProgData map[string]ebpf_progs.CreateEBPFProgInput, loadedMaps map[string]ebpf_maps.BpfMap) (map[string]BpfData, error) {

loadedprog := make(map[string]BpfData)
var pinType uint32
for mapName, bpfMap := range loadedMaps {
pinType = bpfMap.MapMetaData.PinOptions.Type
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like you are using maps pin option to decide if the program needs pinning? I think we should discuss this..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants