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

Sock addr hook #871

Merged
merged 15 commits into from
Apr 5, 2022
Merged

Sock addr hook #871

merged 15 commits into from
Apr 5, 2022

Conversation

shankarseal
Copy link
Collaborator

Description

This is the second part of changes for #847 .

This change adds net_ebpf_ext_sock_addr.c file that holds the program info and hook NPI providers for sock_addr hook. It also has an empty implementation of the classify callback for WFP callouts added for this hook.

net_ebpf_extension_xdp_on_client_attach was refactored into a utility function net_ebpf_extension_hook_check_attach_parameter that is common to sock_addr hook type as well.

Testing

No new tests have been added. They will be added in the next iteration of the changes.

Documentation

Doxygen comments.

@codecov-commenter
Copy link

codecov-commenter commented Apr 1, 2022

Codecov Report

Merging #871 (29b6e48) into main (68a7402) will increase coverage by 0.04%.
The diff coverage is n/a.

❗ Current head 29b6e48 differs from pull request most recent head 0805949. Consider uploading reports for the commit 0805949 to get more accurate results

@@            Coverage Diff             @@
##             main     #871      +/-   ##
==========================================
+ Coverage   75.28%   75.32%   +0.04%     
==========================================
  Files          83       83              
  Lines       14614    14606       -8     
  Branches      488      482       -6     
==========================================
  Hits        11002    11002              
+ Misses       3321     3313       -8     
  Partials      291      291              
Impacted Files Coverage Δ
tools/bpf2c/bpf_code_generator.cpp 36.98% <0.00%> (+0.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 68a7402...0805949. Read the comment docs.

@shankarseal shankarseal force-pushed the sock_addr_hook branch 2 times, most recently from dfc5972 to 2e69dd0 Compare April 1, 2022 21:48
include/ebpf_program_attach_type_guids.h Outdated Show resolved Hide resolved
netebpfext/net_ebpf_ext.c Show resolved Hide resolved
netebpfext/net_ebpf_ext_hook_provider.c Outdated Show resolved Hide resolved
netebpfext/net_ebpf_ext_hook_provider.h Outdated Show resolved Hide resolved
netebpfext/net_ebpf_ext_hook_provider.h Show resolved Hide resolved
netebpfext/net_ebpf_ext_sock_addr.c Outdated Show resolved Hide resolved
include/ebpf_program_attach_type_guids.h Outdated Show resolved Hide resolved
include/ebpf_program_attach_type_guids.h Show resolved Hide resolved
netebpfext/net_ebpf_ext_hook_provider.h Outdated Show resolved Hide resolved
netebpfext/net_ebpf_ext_sock_addr.c Outdated Show resolved Hide resolved
netebpfext/net_ebpf_ext_sock_addr.c Show resolved Hide resolved
Copy link
Collaborator

@dthaler dthaler left a comment

Choose a reason for hiding this comment

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

I won't block this one, but in general it is bad practice to put tests in a separate PR. Instead, in the future look for other ways to factor the PR into smaller pieces where each smaller piece contains a test. For example, the function signature changes could have been in a separate PR from the sock addr additions.

@shankarseal
Copy link
Collaborator Author

I won't block this one, but in general it is bad practice to put tests in a separate PR. Instead, in the future look for other ways to factor the PR into smaller pieces where each smaller piece contains a test. For example, the function signature changes could have been in a separate PR from the sock addr additions.

Understood. This was indeed tested but the automation was not made part of this PR as otherwise I would have to pull in other code and would make it a long PR to review. There is still an unresolved comment where I have asked a question to you. Please answer and/or resolve.

dthaler
dthaler previously approved these changes Apr 5, 2022
Alan-Jowett
Alan-Jowett previously approved these changes Apr 5, 2022
@dthaler dthaler merged commit 04582d3 into microsoft:main Apr 5, 2022
@shankarseal shankarseal deleted the sock_addr_hook branch April 6, 2022 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants