-
Notifications
You must be signed in to change notification settings - Fork 83
Support for External Jumbo Frames (RFD 689) #10472
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
Open
rcgoodfellow
wants to merge
11
commits into
main
Choose a base branch
from
ry/opte-984
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9c8d3c3
implement RFD 689
rcgoodfellow 653923d
fix install_opte.sh override case for helios 3
rcgoodfellow 96476c4
bump maghemite
rcgoodfellow 9f71c30
bump maghemite
rcgoodfellow 9a6dd5a
deal with maghemite api refactor fallout
rcgoodfellow b5b2d28
cleanup, bump lldpd
rcgoodfellow 7d96ac3
add jumbo to instance view
rcgoodfellow df26643
dont squash lldpd 404 into 500
rcgoodfellow 51b1185
support for v4 over v6 static routes
rcgoodfellow 057d562
proper versioning for instance view
rcgoodfellow f331e2d
kyle's review feedback
rcgoodfellow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| // This Source Code Form is subject to the terms of the Mozilla Public | ||
| // License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| // file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
|
||
| use chrono::{DateTime, Utc}; | ||
| use nexus_db_schema::schema::system_networking_settings; | ||
| use serde::{Deserialize, Serialize}; | ||
|
|
||
| /// Singleton row holding fleet-wide networking settings. | ||
| #[derive( | ||
| Queryable, | ||
| Insertable, | ||
| Debug, | ||
| Clone, | ||
| Selectable, | ||
| Serialize, | ||
| Deserialize, | ||
| AsChangeset, | ||
| )] | ||
| #[diesel(table_name = system_networking_settings)] | ||
| pub struct SystemNetworkingSettings { | ||
| pub singleton: bool, | ||
| pub time_created: DateTime<Utc>, | ||
| pub time_modified: DateTime<Utc>, | ||
| /// When true, end users may opt in to jumbo frames on the primary | ||
| /// interface of an instance. When false, the per-instance opt-in is | ||
| /// ignored and OPTE ports are created with the default MTU. | ||
| pub external_jumbo_frames_opt_in_enabled: bool, | ||
| } | ||
|
|
||
| /// Updates to the [`SystemNetworkingSettings`] singleton. | ||
| #[derive(AsChangeset)] | ||
| #[diesel(table_name = system_networking_settings)] | ||
| pub struct SystemNetworkingSettingsUpdate { | ||
| pub external_jumbo_frames_opt_in_enabled: Option<bool>, | ||
| pub time_modified: DateTime<Utc>, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
nexus/db-queries/src/db/datastore/system_networking_settings.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| // This Source Code Form is subject to the terms of the Mozilla Public | ||
| // License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| // file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
|
||
| //! Datastore access for fleet-wide networking settings. | ||
|
|
||
| use super::DataStore; | ||
| use crate::authz; | ||
| use crate::context::OpContext; | ||
| use async_bb8_diesel::AsyncRunQueryDsl; | ||
| use chrono::Utc; | ||
| use diesel::prelude::*; | ||
| use nexus_db_errors::ErrorHandler; | ||
| use nexus_db_errors::public_error_from_diesel; | ||
| use nexus_db_model::SystemNetworkingSettings; | ||
| use nexus_db_model::SystemNetworkingSettingsUpdate; | ||
| use omicron_common::api::external::Error; | ||
| use omicron_common::api::external::UpdateResult; | ||
|
|
||
| impl DataStore { | ||
| /// Read the singleton fleet networking settings row. | ||
| pub async fn system_networking_settings_view( | ||
| &self, | ||
| opctx: &OpContext, | ||
| ) -> Result<SystemNetworkingSettings, Error> { | ||
| opctx.authorize(authz::Action::Read, &authz::FLEET).await?; | ||
|
|
||
| use nexus_db_schema::schema::system_networking_settings::dsl; | ||
| dsl::system_networking_settings | ||
| .filter(dsl::singleton.eq(true)) | ||
| .first_async(&*self.pool_connection_authorized(opctx).await?) | ||
| .await | ||
| .map_err(|e| public_error_from_diesel(e, ErrorHandler::Server)) | ||
| } | ||
|
|
||
| /// Update the singleton fleet networking settings row. Fields left as | ||
| /// `None` in the supplied update are not modified. | ||
| pub async fn system_networking_settings_update( | ||
| &self, | ||
| opctx: &OpContext, | ||
| external_jumbo_frames_opt_in_enabled: Option<bool>, | ||
| ) -> UpdateResult<SystemNetworkingSettings> { | ||
| opctx.authorize(authz::Action::Modify, &authz::FLEET).await?; | ||
|
|
||
| let updates = SystemNetworkingSettingsUpdate { | ||
| external_jumbo_frames_opt_in_enabled, | ||
| time_modified: Utc::now(), | ||
| }; | ||
|
|
||
| use nexus_db_schema::schema::system_networking_settings::dsl; | ||
| diesel::update(dsl::system_networking_settings) | ||
| .filter(dsl::singleton.eq(true)) | ||
| .set(updates) | ||
| .returning(SystemNetworkingSettings::as_returning()) | ||
| .get_result_async(&*self.pool_connection_authorized(opctx).await?) | ||
| .await | ||
| .map_err(|e| public_error_from_diesel(e, ErrorHandler::Server)) | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not actually reading this anywhere. Should we be sending this down rather than
None? Obviously OPTE will pick the same value, but I being explicit about this as a choice the control plane is making seems beneficial to me.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed