Skip to content

Conversation

dylandreimerink
Copy link
Member

@dylandreimerink dylandreimerink commented Jan 16, 2024

This PR turns the eBPF loader in pkg/datapath/loader into a Hive cell. It also unexported all symbols where possible. Global functions which were called outside of the package have been moved to the Loader interface so we have a single clear API boundary, making it easier to improve upon in the future.

This step will also make it easier to move non-loader logic outside of the package by allowing us to then still depend on the logic via hive.

Part of #30024

@maintainer-s-little-helper
Copy link

Commits 4c7104b, 68e8cf8 do not match "(?m)^Signed-off-by:".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper maintainer-s-little-helper bot added dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Jan 16, 2024
@dylandreimerink dylandreimerink force-pushed the feature/loader-modularization branch from 68e8cf8 to ae50dbe Compare January 16, 2024 16:28
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Jan 16, 2024
@dylandreimerink dylandreimerink force-pushed the feature/loader-modularization branch 3 times, most recently from 22e49b7 to a65974a Compare January 17, 2024 09:38
@dylandreimerink dylandreimerink added area/loader Impacts the loading of BPF programs into the kernel. release-note/misc This PR makes changes that have no direct user impact. area/modularization Relates to code modularization and maintenance. labels Jan 17, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot removed dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Jan 17, 2024
@dylandreimerink
Copy link
Member Author

/test

@dylandreimerink dylandreimerink changed the title WIP: Feature/loader modularization Loader modularization Jan 17, 2024
@dylandreimerink dylandreimerink marked this pull request as ready for review January 17, 2024 11:34
@dylandreimerink dylandreimerink requested review from a team as code owners January 17, 2024 11:34
@rgo3 rgo3 requested a review from ti-mo January 18, 2024 09:49
@ti-mo ti-mo added this to the loader refactor milestone Jan 18, 2024
Copy link
Contributor

@rgo3 rgo3 left a comment

Choose a reason for hiding this comment

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

LGTM, pulled in Timo as well to have more loader 👀 on this change.

Copy link
Member

@asauber asauber left a comment

Choose a reason for hiding this comment

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

cilium-dbg related changes lgtm

Copy link
Contributor

@ti-mo ti-mo left a comment

Choose a reason for hiding this comment

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

Thanks! Left a few suggestions, but these can be picked up in follow-ups as well.

@dylandreimerink dylandreimerink force-pushed the feature/loader-modularization branch from a65974a to e1e7ed2 Compare January 23, 2024 09:38
@dylandreimerink
Copy link
Member Author

/test

This commit unexports all types and functions on the package itself
except for the Loader interface. All functions accessed from outside
the package now are methods of this interface.

This makes the API boundary of the loader package more explicit and
easier to reason about and refactor. It is also a first step towards
turning the loader package into a module.

Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>
This commit changes the loader into a cell. The Datapath object depends
on it and re-distributes it still (for now). All locations that created
a loader now reuse the loader instance from hive. The exception being
tests which did not yet use hive.

Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>
@dylandreimerink
Copy link
Member Author

/test

Copy link
Member

@mhofstetter mhofstetter left a comment

Choose a reason for hiding this comment

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

sig-agent ✔️

Nice - thanks Dylan!

@mhofstetter mhofstetter removed the request for review from danehans January 24, 2024 10:39
@aanm aanm added this pull request to the merge queue Jan 24, 2024
Merged via the queue into cilium:main with commit 502ae0b Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/loader Impacts the loading of BPF programs into the kernel. area/modularization Relates to code modularization and maintenance. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants