From 2d9937518a09f1920b0ecd0fca3a4015a233f2bc Mon Sep 17 00:00:00 2001 From: Herbert Wolverson Date: Thu, 5 Jan 2023 16:28:26 +0000 Subject: [PATCH] Read-only configuration of non-integration portions is working locally, sending upstream for testing. --- src/rust/lqos_config/src/libre_qos_config.rs | 62 ++++++ src/rust/lqos_node_manager/static/config.html | 188 ++++++++++++++---- 2 files changed, 212 insertions(+), 38 deletions(-) diff --git a/src/rust/lqos_config/src/libre_qos_config.rs b/src/rust/lqos_config/src/libre_qos_config.rs index 27ac7eb4..0dadc78b 100644 --- a/src/rust/lqos_config/src/libre_qos_config.rs +++ b/src/rust/lqos_config/src/libre_qos_config.rs @@ -9,6 +9,16 @@ pub struct LibreQoSConfig { pub isp_interface: String, pub on_a_stick_mode: bool, pub stick_vlans: (u16, u16), + pub sqm: String, + pub monitor_mode: bool, + pub total_download_mbps: u32, + pub total_upload_mbps: u32, + pub generated_download_mbps: u32, + pub generated_upload_mbps: u32, + pub use_binpacking: bool, + pub enable_shell_commands: bool, + pub run_as_sudo: bool, + pub override_queue_count: u32, } impl LibreQoSConfig { @@ -31,6 +41,16 @@ impl LibreQoSConfig { isp_interface: String::new(), on_a_stick_mode: false, stick_vlans: (0,0), + sqm: String::new(), + monitor_mode: false, + total_download_mbps: 0, + total_upload_mbps: 0, + generated_download_mbps: 0, + generated_upload_mbps: 0, + use_binpacking: false, + enable_shell_commands: true, + run_as_sudo: false, + override_queue_count: 0, }; result.parse_isp_config(path)?; Ok(result) @@ -61,6 +81,48 @@ impl LibreQoSConfig { let vlan : u16 = vlan_string.parse()?; self.stick_vlans.1 = vlan; } + if line.starts_with("sqm") { + self.sqm = split_at_equals(line); + } + if line.starts_with("upstreamBandwidthCapacityDownloadMbps") { + self.total_download_mbps = split_at_equals(line).parse()?; + } + if line.starts_with("upstreamBandwidthCapacityUploadMbps") { + self.total_upload_mbps = split_at_equals(line).parse()?; + } + if line.starts_with("monitorOnlyMode ") { + let mode = split_at_equals(line); + if mode == "True" { + self.monitor_mode = true; + } + } + if line.starts_with("generatedPNDownloadMbps") { + self.generated_download_mbps = split_at_equals(line).parse()?; + } + if line.starts_with("generatedPNUploadMbps") { + self.generated_upload_mbps = split_at_equals(line).parse()?; + } + if line.starts_with("useBinPackingToBalanceCPU") { + let mode = split_at_equals(line); + if mode == "True" { + self.use_binpacking = true; + } + } + if line.starts_with("enableActualShellCommands") { + let mode = split_at_equals(line); + if mode == "True" { + self.enable_shell_commands = true; + } + } + if line.starts_with("runShellCommandsAsSudo") { + let mode = split_at_equals(line); + if mode == "True" { + self.run_as_sudo = true; + } + } + if line.starts_with("queuesAvailableOverride") { + self.override_queue_count = split_at_equals(line).parse().unwrap_or(0); + } } Ok(()) } diff --git a/src/rust/lqos_node_manager/static/config.html b/src/rust/lqos_node_manager/static/config.html index 5745fe60..dc506397 100644 --- a/src/rust/lqos_node_manager/static/config.html +++ b/src/rust/lqos_node_manager/static/config.html @@ -140,7 +140,7 @@ + @@ -153,48 +153,63 @@

Shaper Settings

-

Tune the LibreQoS traffic shaper to your needs.

-

Traffic Shaping Control

+

Tune the LibreQoS traffic shaper to your needs.

- - + + + + + - + - - + + + + -
FQ_CODEL offers good latency management and low CPU overhead. CAKE requires more CPU, but offers excellent latency management.
+

Traffic Shaping Control

+
SQM Mode... + +
Monitor mode disables all traffic shaping, allowing you to watch your network undisturbed.
Monitor Mode... + + +
+

Bandwidth

+
- -

Bandwidth

- - + - + - + - + - - - - +
Total Download Bandwidth (Mbps)...
Total Upload Bandwidth (Mbps)...
- Devices without a parent will be placed underneath evenly-balanced generated nodes. This defines the + Devices without a parent will be placed underneath evenly-balanced generated nodes. This defines the available bandwidth for those nodes. If in doubt, set to equal your total bandwidth.
Generated Node Download Bandwidth (Mbps)...
Generated Node Upload Bandwidth (Mbps)...
@@ -203,10 +218,12 @@ CPUs.
Use binpacking?...
+ + +
@@ -214,42 +231,105 @@ - - - - - - - + + + + - +
- Disabling actual shell commands stops LibreQoS from actually doing anything. Simulated + Disabling actual shell commands stops LibreQoS from actually doing anything. Simulated output is logged to the console and text files, allowing for debugging.
Enable Actual Shell Commands?...
- Running shell commands with "sudo" isn't necessary on a default configuration. + + +
Run Shell Commands as Sudo?... + Running shell commands with "sudo" isn't necessary on a default configuration. +
+ + +
Overriding the number of queues is only necessary if your NIC is giving - very strange results. Use with extreme caution. + very strange results. Use with extreme caution. Leave this at 0 unless you really know what you are doing.
Override count of available queues?...

Tuning Settings

- - ... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IRQ Balancing should generally be disabled.
+ + +
Network device budget (usec) controls how frequently the kernel passes batches of packets to the processing system. Low numbers tend to reduce latency, higher numbers can improve throughput.
Netdev Budget (usecs)
Network device budget (packets) controls how frequently the kernel passes batches of packets to the processing system. Low numbers tend to reduce latency, higher numbers can improve throughput.
Netdev Budget (packets)
How frequently should the kernel poll for receive packets?
RX Usecs
How frequently should the kernel poll for transmit packets?
TX Usecs
If you are using VLANs, you generally need to enable this feature
+ + +
If you are using VLANs, you generally need to enable this feature
+ + +
Offloads to disable. We've tried to include the important ones.
Disable Offloads (space separated)
Spylnx Settings @@ -317,9 +397,41 @@ // Map Bifrost VLAN mappings html = "

VLAN Mapping

"; - // TODO + html += ""; + html += ""; + html += ""; + for (let i=0; i"; + html += ""; + html += ""; + html += ""; + } + html += "
Parent InterfaceInput TagRemapped Tag
"; $("#bifrostVlans").html(html); } + $("#sqmMode option[value='" + python_config.sqm + "']").prop("selected", true); + $("#maxDownload").val(python_config.total_download_mbps); + $("#maxUpload").val(python_config.total_upload_mbps); + $("#monitorMode").prop('checked', python_config.monitor_mode); + $("#generatedDownload").val(python_config.generated_download_mbps); + $("#generatedUpload").val(python_config.generated_upload_mbps); + $("#binpacking").prop('checked', python_config.use_binpacking); + $("#actualShellCommands").prop('checked', python_config.enable_shell_commands); + $("#useSudo").prop('checked', python_config.run_as_sudo); + $("#overrideQueues").val(python_config.override_queue_count); + $("#stopIrqBalance").prop('checked', lqosd_config.tuning.stop_irq_balance); + $("#netDevUsec").val(lqosd_config.tuning.netdev_budget_usecs); + $("#netDevPackets").val(lqosd_config.tuning.netdev_budget_packets); + $("#rxUsecs").val(lqosd_config.tuning.rx_usecs); + $("#txUsecs").val(lqosd_config.tuning.tx_usecs); + $("#disableRxVlan").prop('checked', lqosd_config.tuning.disable_rxvlan); + $("#disableTxVlan").prop('checked', lqosd_config.tuning.disable_txvlan); + let offloads = ""; + for (let i=0; i