forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 2
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
[RFC] Generic metadata AF XDP #7
Closed
edersondisouza
wants to merge
24
commits into
alobakin:generic-metadata
from
edersondisouza:generic-metadata-af_xdp
Closed
Changes from 18 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
5b67c13
uapi: add metadata flag to xdp flags
mswiatko 2590b71
net: include xdp generic metadata definition
mswiatko c354ec1
ice: use xdp generic metadata
mswiatko d7691ff
libbpf: Return non-null error on failures in libbpf_find_prog_btf_id()
qmonnet caca8ad
libbpf: Rename btf__load() as btf__load_into_kernel()
qmonnet 10d0b3b
libbpf: Rename btf__get_from_id() as btf__load_from_kernel_by_id()
qmonnet 8f2e323
tools: Free BTF objects at various locations
qmonnet c0915ba
tools: Replace btf__get_from_id() with btf__load_from_kernel_by_id()
qmonnet 54e9c44
libbpf: Add split BTF support for btf__load_from_kernel_by_id()
qmonnet 59406b0
igc: Fix race condition in PTP Tx code
381d520
igc: Retrieve the TX timestamp directly (instead of in a interrupt)
vcgomes 363fe5d
igc: Add support for multiple in-flight TX timestamps
vcgomes 6e97273
igc: Use irq safe locks for timestamping
vcgomes 1a083b7
tools: Add XDP_FLAGS_USE_METADATA flag
edersondisouza f58530a
xdp, net: Allow XDP_FLAGS_USE_METADATA to be used for link XDP
edersondisouza 6b318b3
bpf: Export btf_obj_id and bpf_get_btf_vmlinux symbols
edersondisouza bcdbd55
bpf: Add btf_get_from_module function
edersondisouza f1f4fff
igc: XDP packet RX timestamp
edersondisouza 3acf07a
igc: XDP packet TX timestamp
edersondisouza 46d8aa0
ethtool,igc: Add "xdp_headroom" driver info
edersondisouza 01a8c28
libbpf: Helpers to access XDP frame metadata
edersondisouza fe782fa
libbpf: Helpers to access XDP hints based on BTF definitions
edersondisouza 613b86c
samples/bpf: XDP hints AF_XDP example
edersondisouza dd4f41b
libbpf,xdp,igc: Use union to split XDP TX and RX metadata
edersondisouza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Isn't this btf_id of whole definition for module or vmlinux? Maybe something like that to get id of used structure:
adapter->btf_id = btf_find_by_name_kind(btf, "xdp_meta_generic__igc", BTF_KIND_STRUCT);
What do You think?
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.
I tested here, it doesn't really help. I still need the base (vmlinux) and module btf to parse the btf for the struct. So, i'd need to send two ids instead of one. Following is a snippet of the code I ended up testing with:
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.
Can You try btf_get_type_id from this commit 36335fe ?
Why do You need btf? I thought type id will be enough in hints case.
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.
I'll take a look! I needed to also get btf, is because the type is, IIUC, relative to the module. So
btf__get_from_id(base)
fails.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.
Err, I mean,
btf__type_by_id
. I took a look at usingbtf_get_type_id
. It gives me the BTF type ID of thexdp_meta_generic
struct. But that alone is not useful on user space - I need the BTF ID for the module as well. Check Andrii's email to Jesper [1].So it's kinda pointless to include only the BTF type ID. If we include the BTF ID for the module, it's easy to check if any type there has prefix name "xdp_meta_generic". Unless I'm missing a way to get the BTF ID for the module - is there one?
[1]https://www.spinics.net/lists/bpf/msg45746.html