-
Notifications
You must be signed in to change notification settings - Fork 685
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
Fixed #1635 - xsk.h should be taken from libxdp #1703
Open
hoxnox
wants to merge
1
commit into
seladb:dev
Choose a base branch
from
hoxnox:fix/1635
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# ~~~ | ||
# - Try to find libxdp | ||
# | ||
# Once done this will define | ||
# | ||
# XDP_FOUND - System has libxdp | ||
# XDP_INCLUDE_DIRS - The libxdp include directories | ||
# XDP_LIBRARIES - The libraries needed to use libxdp | ||
# ~~~ | ||
|
||
find_package(PkgConfig QUIET) | ||
pkg_check_modules(PC_LIBBPF libxdp) | ||
|
||
find_path( | ||
XDP_INCLUDE_DIRS | ||
NAMES xdp/xsk.h | ||
HINTS ${PC_LIBXDP_INCLUDE_DIRS}) | ||
|
||
find_library( | ||
XDP | ||
NAMES xdp | ||
HINTS ${PC_LIBXDP_LIBRARY_DIRS}) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args( | ||
XDP | ||
REQUIRED_VARS XDP XDP_INCLUDE_DIRS | ||
VERSION_VAR XDP_VERSION | ||
FAIL_MESSAGE "libxdp not found!") | ||
|
||
if(XDP_FOUND AND NOT TARGET XDP::XDP) | ||
add_library(XDP::XDP INTERFACE IMPORTED) | ||
set_target_properties(XDP::XDP PROPERTIES INTERFACE_LINK_LIBRARIES "${XDP_LIBRARIES}" INTERFACE_INCLUDE_DIRECTORIES "${XDP_INCLUDE_DIRS}") | ||
endif() |
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.
Can you explain why we need "xdp" instead of "bpf" here?
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.
On my systems there is no such header. Same is here: #1635.
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.
@hoxnox I think we may need to add some conditions here instead of changing the code directly. What's your system? Maybe just add a special case for handling your system?
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 don't understand why in your system "xsk.h" present. There is no such at https://github.com/libbpf/libbpf and no such in kernel tree https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/lib/bpf?h=v6.14-rc1
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 think it might based on how and where you install it. I saw people using
<bpf/xsk.h>
,<xdp/xsk.h>
, and<linux/xsk.h>
. Maybe we need a better way to find the corret one for the user system.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 try to figure it out and return with more accurate patch.
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.
Between 5.15.178 and 6.1.128 xsk.h was moved from
tools/lib/bpf/xsk.h
totools/testing/selftests/bpf/xsk.h
and it is not part of linux-headers. So regular user with kernel 6+ doesn't have that header.