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

Set bandwidth minimums to 1M for CRM/NMS integrations #640

Merged
merged 12 commits into from
Feb 24, 2025
4 changes: 2 additions & 2 deletions src/integrationCommon.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@ def createShapedDevices(self):
device["mac"],
device["ipv4"],
device["ipv6"],
int(float(circuit["download"]) * committed_bandwidth_multiplier()),
int(float(circuit["upload"]) * committed_bandwidth_multiplier()),
int(1),
int(1),
int(float(circuit["download"]) * bandwidth_overhead_factor()),
int(float(circuit["upload"]) * bandwidth_overhead_factor()),
""
Expand Down
14 changes: 6 additions & 8 deletions src/rust/uisp_integration/src/strategies/flat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,9 @@ pub async fn build_flat_network(
config.queues.generated_pn_download_mbps,
config.queues.generated_pn_upload_mbps,
);
let download_min = (download_max as f32
* config.uisp_integration.commit_bandwidth_multiplier)
let download_min = 1
as u64;
let upload_min = (upload_max as f32
* config.uisp_integration.commit_bandwidth_multiplier)
let upload_min = 1
as u64;
for device in devices.iter() {
let dev = UispDevice::from_uisp(device, &config, &ip_ranges, &ipv4_to_v6);
Expand All @@ -103,10 +101,10 @@ pub async fn build_flat_network(
mac: device.identification.mac.clone().unwrap_or("".to_string()),
ipv4: dev.ipv4_list(),
ipv6: dev.ipv6_list(),
download_min: u64::max(2, download_min),
download_max: u64::max(3, download_max as u64),
upload_min: u64::max(2, upload_min),
upload_max: u64::max(3, upload_max as u64),
download_min: u64::max(1, download_min),
download_max: u64::max(2, download_max as u64),
upload_min: u64::max(1, upload_min),
upload_max: u64::max(2, upload_max as u64),
comment: "".to_string(),
};
shaped_devices.push(sd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ fn traverse(
mac: device.mac.clone(),
ipv4: device.ipv4_list(),
ipv6: device.ipv6_list(),
download_min: u64::max(2, download_min),
download_min: u64::min(1, download_min),
download_max: u64::max(3, download_max),
upload_min: u64::max(2, upload_min),
upload_min: u64::min(1, upload_min),
upload_max: u64::max(3, upload_max),
comment: "".to_string(),
};
Expand Down
Loading