-
Notifications
You must be signed in to change notification settings - Fork 165
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
Support pidfd_open syscall #1187
Conversation
Signed-off-by: rohith-raju <rohithraju488@gmail.com>
Please double check driver/API_VERSION file. See versioning. |
Signed-off-by: rohith-raju <rohithraju488@gmail.com>
463b4b6
to
d732b41
Compare
Signed-off-by: rohith-raju <rohithraju488@gmail.com>
Signed-off-by: rohith-raju <rohithraju488@gmail.com>
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.
Thank you for this!
driver/bpf/fillers.h
Outdated
unsigned long flags; | ||
|
||
/* Parameter 1: ret (type: PT_FD) */ | ||
retval = bpf_syscall_get_retval(data->ctx); |
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.
retval = bpf_syscall_get_retval(data->ctx); | |
long retval = bpf_syscall_get_retval(data->ctx); |
driver/bpf/fillers.h
Outdated
|
||
/* Parameter 1: ret (type: PT_FD) */ | ||
retval = bpf_syscall_get_retval(data->ctx); | ||
res = bpf_push_s64_to_ring(data, retval); |
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.
res = bpf_push_s64_to_ring(data, retval); | |
int res = bpf_push_s64_to_ring(data, retval); |
////////////////////////// | ||
// pidfd_open flags | ||
////////////////////////// | ||
# define PIDFD_NONBLOCK 1U |
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.
why do we use 1U
here? In the kernel I found
#define PIDFD_NONBLOCK O_NONBLOCK
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.
Almost done :)
driver/ppm_fillers.c
Outdated
{ | ||
unsigned long val; | ||
int res; | ||
int retval; |
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.
we still need to address this
Signed-off-by: rohith-raju <rohithraju488@gmail.com>
@Andreagit97 We probably need to add a kernel check since the test is using |
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
I moved the flag checks in the failure case, this should solve our issues 🤞 |
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.
/approve
LGTM label has been added. Git tree hash: fe01ebc452b0d150696f4ad40c8382682b183259
|
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Andreagit97, jasondellaluce, Rohith-Raju The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/milestone 5.1.0+driver |
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area driver-kmod
/area driver-bpf
/area driver-modern-bpf
/area tests
Does this PR require a change in the driver versions?
What this PR does / why we need it:
This PR adds support for
pidfd_open
syscallWhich issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: