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

Use dendrite's dpd-client rather than rolling our own #7907

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

Nieuwejaar
Copy link
Contributor

No description provided.

@Nieuwejaar
Copy link
Contributor Author

This also pulls in newer versions of lldp, maghemite, and dendrite which all make the same switch to dpd-client.

I tagged @andrewjstone since he asked about this during demos.

@Nieuwejaar Nieuwejaar requested a review from andrewjstone April 2, 2025 22:10
///
/// nat_ipv\[46\]_create are not idempotent (see oxidecomputer/dendrite#343),
/// but this wrapper function is. Call this from sagas instead.
#[allow(clippy::too_many_arguments)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Worth creating a type to avoid the clippy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I generally don't bother unless a function is called from more than one place or from another file/module, but I can if you'd like.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nah, I'm not a stickler.

/// Ensure that a loopback address is created.
///
/// loopback_ipv\[46\]_create are not idempotent (see
/// oxidecomputer/dendrite#343), but this wrapper function is. Call this
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like caller of this function, add_loopback_addresses_to_switch is called from a background task, which seems correct. What does the Call this from sagas instead indicate? Can you flesh that out a little more here please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry - I meant to, and really should have, called out the code that was moved wholesale from clients/dpd-client/src/lib.rs when I deleted it. I don't actually know off the top of my head what that comment means, since I didn't write the code, and didn't dig into it while moving it.

@jmpesp might be able to explain it faster than I could figure it out?

Copy link
Contributor

Choose a reason for hiding this comment

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

Aha thanks for pointing that out. In that case, I think this PR is good to merge. @jmpesp, can you update the comment at some point?

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually the underlying issue was addressed, this comment and function is outdated :) the dpd endpoints referenced in the issue are now all idempotent.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, to be clear: ensure_loopback_created and ensure_loopback_deleted are no longer needed, but dpd_ensure_nat_entry might be.

}
Err(e) => {
if e.status() == Some(http::StatusCode::NOT_FOUND) {
info!(log, "no nat entry found for: {target_ip:#?}");
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be a warn! or error!?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't look like it. This routine just wants to ensure that NAT entry exists, but doesn't have an opinion on whether it should already exist or not. This could indicate an error, or it could just be that the entry was just added by nexus and this is our first attempt to push it to the switch.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense.

@Nieuwejaar Nieuwejaar force-pushed the osd branch 4 times, most recently from 4c756ac to a70fcd8 Compare April 6, 2025 20:31
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