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

Add support for TCX expected_revision #1032

Open
4 tasks
anfredette opened this issue Sep 17, 2024 · 0 comments
Open
4 tasks

Add support for TCX expected_revision #1032

anfredette opened this issue Sep 17, 2024 · 0 comments
Assignees

Comments

@anfredette
Copy link
Contributor

The kernel's TCX support includes the option to specify an expected_revision on attach calls. The expected_revision is compared to the current revision on the attach point by the kernel, which will fail the operation if they don't match. This allows the user to ensure that nothing has changed between the time the state of the attach point was checked and when the attach is being performed if needed.

In order to use this feature effectively, there needs to be a way for the user to get the current state of a TCX attach point which doesn't currently exist in Aya.

expected_revision support was omitted from the initial implementation in pr #921 until it can be fully implemented.

This feature should include the following components:

  • An API to retrieve the state of TCX on a given attach point (i.e., interface + direction) based on the BPF_PROG_QUERY syscall. This API should return at least the current revision and the list of existing TCX programs attached with their position in the chain.
  • Support for expected_revision in the TCX attach code.
  • Extend the TCX integration tests with some expected_revision examples.
  • Use the new API to also validate that the programs in the integration test are attached in the expected order.
@anfredette anfredette mentioned this issue Sep 17, 2024
Merged
dave-tucker added a commit to astoycos/aya that referenced this issue Sep 19, 2024
This adds SchedClassifier::query_tcx() API that is able to return an
ordered list of ProgramInfo (and revision) of an interface that has
TCX programs attached.

This is useful to verify the ordering of the programs in our integration
tests, but also to for aya-rs#1032.

Additionally tidies up the macro used for TCX testing and adds
assertions using this new API.

Signed-off-by: Dave Tucker <[email protected]>
dave-tucker added a commit to astoycos/aya that referenced this issue Sep 19, 2024
This adds SchedClassifier::query_tcx() API that is able to return an
ordered list of ProgramInfo (and revision) of an interface that has
TCX programs attached.

This is useful to verify the ordering of the programs in our integration
tests, but also to for aya-rs#1032.

Additionally tidies up the macro used for TCX testing and adds
assertions using this new API.

Signed-off-by: Dave Tucker <[email protected]>
dave-tucker added a commit to astoycos/aya that referenced this issue Sep 19, 2024
This adds SchedClassifier::query_tcx() API that is able to return an
ordered list of ProgramInfo (and revision) of an interface that has
TCX programs attached.

This is useful to verify the ordering of the programs in our integration
tests, but also to for aya-rs#1032.

Additionally tidies up the macro used for TCX testing and adds
assertions using this new API.

Signed-off-by: Dave Tucker <[email protected]>
dave-tucker added a commit to astoycos/aya that referenced this issue Sep 19, 2024
This adds SchedClassifier::query_tcx() API that is able to return an
ordered list of ProgramInfo (and revision) of an interface that has
TCX programs attached.

This is useful to verify the ordering of the programs in our integration
tests, but also to for aya-rs#1032.

Additionally tidies up the macro used for TCX testing and adds
assertions using this new API.

Signed-off-by: Dave Tucker <[email protected]>
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

No branches or pull requests

1 participant