-
Notifications
You must be signed in to change notification settings - Fork 16
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 GetBPFmapInfo method to support PIN_NONE where pinpath does not… #96
Conversation
if err != nil { | ||
return nil, fmt.Errorf("map '%s' doesn't exist", mapNameStr) | ||
if loadedMaps.PinOptions.Type == constdef.PIN_NONE.Index() { | ||
mapInfo, err := (e.bpfMapApi).GetBPFmapInfo(bpfMap.MapFD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we can just use FD for both scenarios. But using pin path will get additional validation. It is fine for now and we can later optimize this..
@@ -668,3 +671,87 @@ func TestProgType(t *testing.T) { | |||
}) | |||
} | |||
} | |||
|
|||
func TestLoadMap(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
* Use default error formating instead of wrap when errors.Wrap isn't implemented. Use default error formatting when the error wrap isn't available. The error message that was seen was ```{"level":"error","ts":"2024-06-30T10:52:42.597Z","caller":"ebpf/bpf_client.go:563","msg":"failed to find device by name eni3d4ff16416b: %!w(netlink.LinkNotFoundError={0xc0007ae7c0})"} ``` * Fixup update flow (#88) * Bump golang.org/x/sys from 0.20.0 to 0.24.0 (#89) Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.20.0 to 0.24.0. - [Commits](golang/sys@v0.20.0...v0.24.0) --- updated-dependencies: - dependency-name: golang.org/x/sys dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix test on rel-branch * Log the return error no from syscall * Fix PR checks Fix PR checks * fix go dependencies. * fix go.sum dependencies. * Bump github.com/vishvananda/netlink from 1.1.0 to 1.3.0 Bumps [github.com/vishvananda/netlink](https://github.com/vishvananda/netlink) from 1.1.0 to 1.3.0. - [Release notes](https://github.com/vishvananda/netlink/releases) - [Commits](vishvananda/netlink@v1.1.0...v1.3.0) --- updated-dependencies: - dependency-name: github.com/vishvananda/netlink dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Updated go.mod dependencies. * Bump golang.org/x/sys from 0.24.0 to 0.26.0 Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.24.0 to 0.26.0. - [Commits](golang/sys@v0.24.0...v0.26.0) --- updated-dependencies: - dependency-name: golang.org/x/sys dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * updated go mod and go sum. * added GetBPFmapInfo method to support PIN_NONE where pinpath does not exist (#96) Co-authored-by: Nithish Kumar Murcherla <nithmu@amazon.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Senthil Kumaran <senthilx@amazon.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jay Deokar <jsdeokar@amazon.com> Co-authored-by: Yash Thakkar <ythakkar97@gmail.com> Co-authored-by: Senthil Kumaran <orsenthil@gmail.com> Co-authored-by: Nithish Murcherla <murcherla.kumar@gmail.com> Co-authored-by: Nithish Kumar Murcherla <nithmu@amazon.com>
… exist
Issue #, if available: We use containers to create probes. While loading our elf file we found that we cannot create map under
/sys/fs/bpf
directory as it is set to read only. When we tried to setPIN_NONE
, we found that code path is still looking at pinPath reading in mapLoad run time exception. This change helps to load maps with create an pinPath -Description of changes: This change helps to load maps with create an pinPath when PINNING is set PIN_NONE
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.