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

feat(aya): return correct Option from bpf_map_lookup_elem_per_cpu #1182

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

Conversation

keskydi
Copy link

@keskydi keskydi commented Feb 26, 2025

bpf_map_lookup_elem_per_cpu doesn't check the Option inside the Result:Ok, thus when it receive a Ok(None), it returns a zeroed value PerCpuValues.


This change is Reviewable

Copy link

netlify bot commented Feb 26, 2025

Deploy Preview for aya-rs-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 9b21c85
🔍 Latest deploy log https://app.netlify.com/sites/aya-rs-docs/deploys/67c0cef7c17057000809ff55
😎 Deploy Preview https://deploy-preview-1182--aya-rs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mergify mergify bot added the aya This is about aya (userspace) label Feb 26, 2025
@tamird
Copy link
Member

tamird commented Feb 26, 2025

Thanks for the PR! Can you add a test?

@keskydi keskydi force-pushed the per_cpu_hashmap_key_not_found branch 3 times, most recently from 4e48e8c to fa79556 Compare February 27, 2025 17:43
@tamird
Copy link
Member

tamird commented Feb 27, 2025

You'll need to rebase on main to clear the lint errors.

@keskydi
Copy link
Author

keskydi commented Feb 27, 2025

I am already up to date tho

@tamird
Copy link
Member

tamird commented Feb 27, 2025

Try again - needed #1184. Sorry about that!

@keskydi keskydi force-pushed the per_cpu_hashmap_key_not_found branch from fa79556 to 70ffaf6 Compare February 27, 2025 19:01
@keskydi
Copy link
Author

keskydi commented Feb 27, 2025

Np, i'm a bit slow to respond

bpf_map_lookup_elem_per_cpu doesn't check the Option inside the Result:Ok,
thus when it receive a Ok(None), it returns a zeroed value PerCpuValues.
@keskydi keskydi force-pushed the per_cpu_hashmap_key_not_found branch from 70ffaf6 to 9b21c85 Compare February 27, 2025 20:45
Copy link
Member

@tamird tamird left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @keskydi)


-- commits line 2 at r2:
doesn't seem like a feature to me. it's fixing a bug, right?


-- commits line 2 at r2:
can you please get this down to 50 columns


-- commits line 4 at r2:
please use the imperative voice to describe what you did and why


aya/src/maps/hash_map/per_cpu_hash_map.rs line 189 at r2 (raw file):

    }
    #[test]
    #[cfg_attr(miri, ignore = "`open` not available when isolation is enabled")]

this is surprising. where is open used in this test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aya This is about aya (userspace)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants