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

invalid argument Error while running ebpf code having ring buffer using bee #56

Open
arayu05 opened this issue Jan 11, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@arayu05
Copy link

arayu05 commented Jan 11, 2022

Version

0.0.9

Linux Version

ubuntu 18.04 lts , Kernel version : 5.4.0-91-generic

Describe the bug

I successfully build tcpconnect example using bee build tcpconnect.c tcp:v2
But while running it using bee run tcp:v2 getting below error:

  SUCCESS  Fetching program from registry: tcp:v2                                                                                               
  ERROR   Loading BPF program and maps into Kernel                                                                                             
Error: map events_ring: map create: invalid argument
2022/01/11 14:42:58 exiting: map events_ring: map create: invalid argument

I also tested a hash map and ring buffer test ebpf codes separately. I saw that the code using hash_map ran successfully but the one with ring buffer is giving the same error while running.

Steps to reproduce the bug

  1. bee build tcpconnect.c tcp:v2
  2. bee run tcp:v2

Expected Behavior

It shall run successfully.

Additional Context

No response

@arayu05 arayu05 changed the title invalid argument Error while running ebpf code having ring buffer iwth bee invalid argument Error while running ebpf code having ring buffer using bee Jan 12, 2022
@lgadban
Copy link
Collaborator

lgadban commented Jan 13, 2022

Thanks for the report! I can reproduce it and will update this issue with my findings

@lgadban
Copy link
Collaborator

lgadban commented Jan 13, 2022

It should have been more obvious to me initially, but this is because the BPF_MAP_TYPE_RINGBUF is only available in Linux 5.8+.

We should probably fix the standard tcpconnect example to be able to run on older kernels.

@lgadban lgadban added the bug Something isn't working label Jan 13, 2022
@arayu05
Copy link
Author

arayu05 commented Jan 17, 2022

Ok. Thanks for the response.
Will track the progress on the bug and try again later.

@krisztianfekete
Copy link
Contributor

krisztianfekete commented Feb 28, 2023

The fix for issues like this should be to leverage the new compat layer that could fall back to legacy map types if the new ones are not supported in the kernel running the code, like this: iovisor/bcc#4282

For that, we should add support for perfbuf first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants