-
Notifications
You must be signed in to change notification settings - Fork 39
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 two apis for adding and removing given ebpf programs #76
Conversation
This PR is adding two granular apis
issue #57 |
It doesn’t make any sense to test all the functions in this PR because they are eventually calling other functions which are already tested. |
when api payload files merged in l3af-arch repository then docs link will work pull request : l3af-project/l3af-arch#41 |
return fmt.Errorf("failed to chain XDP BPF programs: %w", err) | ||
} | ||
log.Info().Msgf("Push Back and Start XDP program : %s seq_id : %d", bpfProg.Name, bpfProg.SeqID) | ||
if err := c.PushBackAndStartBPF(bpfProg, ifaceName, models.XDPIngressType); err != nil { |
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.
if err := c.PushBackAndStartBPF(bpfProg, ifaceName, models.XDPIngressType); err != nil { | |
if err := c.PushBackAndStartEbpfProgram(bpfProg, ifaceName, models.XDPIngressType); err != nil { |
it doesn't start ebpf per se, it starts an ebpf program, if I understand correctly, hence the suggested rename
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 this we can do it in a separate PR because we need to do lot of changes
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
I only have one pending unresolved issue above on this and will approve when that is fixed. Please squash all the commits down to a single commit prior to merging, once everything is settled. |
|
||
defer func(mesg *string, statusCode *int) { | ||
w.WriteHeader(*statusCode) | ||
_, err := w.Write([]byte(*mesg)) |
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.
If we cannot write, should we continue to limp along? I don't quite understand what would happen here after it logs the message?
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.
just return from function because defer functions will execute in the end of parent function
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 added a bunch of comments. Please check
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 the support for chaining disabled. I suggested a few minor changes for your updates.
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 with the changes. The only request I have is to squash into a single commit prior to merging.
Signed-off-by: Atul-source <[email protected]>
return nil | ||
} | ||
|
||
switch direction { |
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.
Since we want l3afd to be able to work with arbitrary prog types in the future, I think it will be necessary in the future, and "direction" will be a poor label at that point.
Signed-off-by: Atul-source <[email protected]>
Signed-off-by: Atul-source <[email protected]>
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
Fix name Co-authored-by: Dave Thaler <[email protected]>
fix name Co-authored-by: Dave Thaler <[email protected]>
Signed-off-by: Atul [email protected]