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

consider avoid LinkByName for performance #123

Open
glimchb opened this issue Aug 14, 2023 · 0 comments · May be fixed by #148
Open

consider avoid LinkByName for performance #123

glimchb opened this issue Aug 14, 2023 · 0 comments · May be fixed by #148

Comments

@glimchb
Copy link
Member

glimchb commented Aug 14, 2023

netlink library works on link object, see https://github.com/vishvananda/netlink/blob/6afddb37c1f00693528264222a57a3c08dccbab7/link_linux.go#L1700

consider instead of

bridgedev, err := netlink.LinkByName(bridgeName)
netlink.LinkDel(bridgedev)

do create new object with only Name in the attributes and delete it

bridgedev := &netlink.Bridge{LinkAttrs: netlink.LinkAttrs{Name: bridgeName}}
netlink.LinkDel(bridgedev)

maybe...

glimchb added a commit to glimchb/opi-evpn-bridge that referenced this issue Aug 31, 2023
Main reason is perfoamnce.
If we have the relevant info in the cache/DB,
we could just use it instead of netlink get calls.

Fixes opiproject#123

Signed-off-by: Boris Glimcher <[email protected]>
@glimchb glimchb linked a pull request Aug 31, 2023 that will close this issue
glimchb added a commit to glimchb/opi-evpn-bridge that referenced this issue Aug 31, 2023
Main reason is perfoamnce.
If we have the relevant info in the cache/DB,
we could just use it instead of netlink get calls.

Fixes opiproject#123

Signed-off-by: Boris Glimcher <[email protected]>
glimchb added a commit to glimchb/opi-evpn-bridge that referenced this issue Sep 13, 2023
Main reason is perfoamnce.
If we have the relevant info in the cache/DB,
we could just use it instead of netlink get calls.

Fixes opiproject#123

Signed-off-by: Boris Glimcher <[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 a pull request may close this issue.

1 participant