Skip to content

Add OifIndex option for RouteGetWithOptions #1060

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

Conversation

dylandreimerink
Copy link
Contributor

The RouteGetWithOptions function currently has a Oif option which gets translated from link name to link index via a LinkByName call. This adds unnecessary overhead when the link index is already known.

This commit adds a new OifIndex option to RouteGetWithOptions which can be specified instead of Oif to skip the internal link index translation.

The `RouteGetWithOptions` function currently has a `Oif` option which
gets translated from link name to link index via a `LinkByName` call.
This adds unnecessary overhead when the link index is already known.

This commit adds a new `OifIndex` option to `RouteGetWithOptions` which
can be specified instead of `Oif` to skip the internal link index
translation.

Signed-off-by: Dylan Reimerink <[email protected]>
@dylandreimerink dylandreimerink marked this pull request as ready for review February 18, 2025 14:35
@dylandreimerink
Copy link
Contributor Author

cc @aboch

@@ -1533,6 +1533,7 @@ type RouteGetOptions struct {
Iif string
IifIndex int
Oif string
OifIndex int
Copy link
Collaborator

@aboch aboch Mar 26, 2025

Choose a reason for hiding this comment

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

I was wondering why not making this uint32 then I see IifIndex is already there as int.

LGTM

@aboch aboch merged commit dc4f225 into vishvananda:main Mar 26, 2025
2 checks passed
dylandreimerink added a commit to dylandreimerink/cilium that referenced this pull request Mar 27, 2025
Update the netlink library to get vishvananda/netlink#1060 which allows
us to pass a link ifindex to RouteGetWithOptions to avoid a second
netlink call.

Signed-off-by: Dylan Reimerink <[email protected]>
dylandreimerink added a commit to dylandreimerink/cilium that referenced this pull request Mar 27, 2025
Update the netlink library to get vishvananda/netlink#1060 which allows
us to pass a link ifindex to RouteGetWithOptions to avoid a second
netlink call.

Signed-off-by: Dylan Reimerink <[email protected]>
dylandreimerink added a commit to dylandreimerink/cilium that referenced this pull request Mar 27, 2025
Update the netlink library to get vishvananda/netlink#1060 which allows
us to pass a link ifindex to RouteGetWithOptions to avoid a second
netlink call.

Signed-off-by: Dylan Reimerink <[email protected]>
dylandreimerink added a commit to dylandreimerink/cilium that referenced this pull request Mar 28, 2025
Update the netlink library to get vishvananda/netlink#1060 which allows
us to pass a link ifindex to RouteGetWithOptions to avoid a second
netlink call.

Signed-off-by: Dylan Reimerink <[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

Successfully merging this pull request may close these issues.

3 participants