Commit Graph

892 Commits

Author SHA1 Message Date
Herbert Wolverson
80b79684da #148 - Show quantile utilization on queue details. 2023-01-11 20:44:44 +00:00
Herbert Wolverson
7118ad948f #148 - Show quantile utilization on dashboard for total flow analysis. 2023-01-11 20:07:35 +00:00
Herbert Wolverson
0715f76022 Remove redundant reload link 2023-01-11 18:22:56 +00:00
Herbert Wolverson
7b0715756f Real-time reloading of lqosd tunables and queue check frequency
Extends the bus to include a "reload lqosd" command that reloads
the tunables and queue frequency in real-time, without requiring
a bridge restart.
2023-01-11 18:16:30 +00:00
Herbert Wolverson
7b18ca4196 Add libbpf-dev to the dependency list. 2023-01-11 16:00:24 +00:00
Herbert Wolverson
8d9eee8f47 TESTING: Add a CI build/test step to the Rust project for Github. This will probably fail and require more commits to get working. 2023-01-11 15:53:34 +00:00
Herbert Wolverson
2c829fc09c Add documentation to lqos_config 2023-01-11 15:42:10 +00:00
Herbert Wolverson
d51c1b8622 Add more unit tests to lqos_bus, checking that encode/decode of request and replies is valid. 2023-01-11 15:12:38 +00:00
Herbert Wolverson
5cf20a9afe Clean up and document the lqos_bus crate. 2023-01-11 15:04:26 +00:00
Herbert Wolverson
02c3a835a1 Cargo fmt run - format all code. 2023-01-11 14:12:40 +00:00
Herbert Wolverson
778de71402 Comment out queue diff types we aren't currently using. 2023-01-11 14:12:16 +00:00
Herbert Wolverson
393a489bca Allow logged-in users to update ispConfig.py via web UI
1) lqos_config understands writing to a new ispConfig.py file, copying the
   previous one and amending to avoid changing any not-covered data.
2) The web UI can adjust the config, upload a new one and it is saved.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
2023-01-10 16:12:09 +00:00
Christian Clauss
cfb42895d0
Use requirements.txt 2023-01-10 16:49:27 +01:00
Robert Chacón
86c26bb9d4
Merge pull request #189 from cclauss/patch-2
python3 -m pip install -r requirements.txt
2023-01-10 08:46:20 -07:00
Herbert Wolverson
bebcbaf7c6 Merge branch 'v1.4-pre-alpha-rust-integration' of https://github.com/LibreQoE/LibreQoS into v1.4-pre-alpha-rust-integration 2023-01-10 14:16:34 +00:00
Herbert Wolverson
76077a3de0 Use checked subtraction to avoid overflow when counting hosts. 2023-01-10 14:12:51 +00:00
Herbert Wolverson
add187fa6f Fix warning 2023-01-10 14:12:51 +00:00
Herbert Wolverson
165dae030b Adds an authentication system.
* The new Rust utility "webusers" manages /opt/libreqos/webusers.toml.
* You can add/update/remove/list users from that tool.
* The "allow anonymous" option in webusers.toml permits access for
  unauthenticated users, but won't let them change anything. This is
  for payne demonstrations.
* All web APIs and pages should now be secured, requiring a login.
* The login requires cookies.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
2023-01-10 14:12:51 +00:00
Herbert Wolverson
8060a50f0d Update test instructions to include how to update. 2023-01-10 14:12:50 +00:00
Herbert Wolverson
a95f6d45de Update TESTING-1.4 instructions 2023-01-10 14:12:50 +00:00
Herbert Wolverson
939302af63 Throughput graph is responsive, doesn't fill to zero on unshaped, and has an X-axis label. 2023-01-10 14:12:50 +00:00
Herbert Wolverson
66b5e822af #1 TCP Rtt graph is responsive, has a colour gradient, and an X axis label 2023-01-10 14:12:50 +00:00
Herbert Wolverson
702b8034df CPU graph is responsive, and scales colors based on load. 2023-01-10 14:12:50 +00:00
Herbert Wolverson
bb3358ebcc #183 Flexible layout, no legend and more padding for RAM graph. 2023-01-10 14:12:50 +00:00
Herbert Wolverson
5d92eb7a61 Update lqos.example to more sane defaults, and add a TESTING-1.4.md document to provide some temporary instructions for testing this release. 2023-01-10 14:12:50 +00:00
Herbert Wolverson
0cddf107de Easier to read queue data, now showing graphs for throughput, delays, queue length, etc. 2023-01-10 14:12:50 +00:00
Herbert Wolverson
56f421daed TC Queue Check Frequency and Display
* The frequency with which TC queues are polled for statistics is
  now controled by `queue_check_period_ms` in `/etc/lqos`.
* Example file updated.
* Configuration display updated.

This is designed to act as a compromise: for detailed analysis, it
can be updated to a low number. For regular running, it can be updated
to 1000 or more.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
2023-01-10 14:12:50 +00:00
Herbert Wolverson
c5e8da8159 Oops - forgot to multiply bytes into bits for consistency. 2023-01-10 14:12:50 +00:00
Herbert Wolverson
0422384b21 Show a few more data items per queue 2023-01-10 14:12:50 +00:00
Herbert Wolverson
dbfee1f079 Less horrible graphing code, ringbuffer properly scrolling.
Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
2023-01-10 14:12:50 +00:00
Herbert Wolverson
e3c7245838 Forgot to invert upload
Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
2023-01-10 14:12:50 +00:00
Herbert Wolverson
d8bffa2137 Initial work on displaying queue data. Very early days.
Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
2023-01-10 14:12:50 +00:00
Herbert Wolverson
fbd3c22566 Missing td tags 2023-01-10 14:12:50 +00:00
Herbert Wolverson
2d9937518a Read-only configuration of non-integration portions is working locally, sending upstream for testing. 2023-01-10 14:12:50 +00:00
Herbert Wolverson
8afdc2e0d1 WIP - Basic interface and Bifrost config displayable. 2023-01-10 14:12:50 +00:00
Herbert Wolverson
64ae074fbe Oops - missed an active navlink tag
Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
2023-01-10 14:12:50 +00:00
Herbert Wolverson
97ff2ad288 Work in progress: visual prototype for most of the configuration
system.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
2023-01-10 14:12:50 +00:00
Herbert Wolverson
42c77f3432 Add example systemctl .service files
Add example .service files for lqosd and lqos_node_manager.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
2023-01-10 14:12:50 +00:00
Herbert Wolverson
b01b9520a5 First iteration of a Python module for direct bus interaction
* Adds the `lqos_python` module to the Rust build system.
* `lqos_python` exposes an API for calling bus commands
  directly, instead of via a helper. Currently, "is alive"
  for testing the daemon, and IP mappings are exported.
* Update the build script to build the .so file and put
  it where Python can find it.
* Exclude the binary from Git.
* Update `LibreQoS.py` to use bus commands for clearing,
  deleting IP mappings. Adding is not yet covered, due
  to the way commands are batched - and that not yet being
  supported by the library.
* Add a check to `LibreQoS.py` that the `lqosd` daemon
  is running and accepting connections. Abort if it isn't,
  since nothing else will work anyway.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
2023-01-10 14:12:50 +00:00
Herbert Wolverson
bd5ace9fbf Couple more .gitignore entries to avoid including
Linux TC status and lastRun.txt in the tree.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
2023-01-10 14:12:50 +00:00
Herbert Wolverson
f0a9f045fa Update build_rust.sh to include node manager
Update the Rust build script to include the node manager,
and its required files.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
2023-01-10 14:12:50 +00:00
Herbert Wolverson
deded47cac Add build script and associated path changes
* Adds build_rust.sh:
   * Creates `src/bin` and `src/bin/static` if needed.
   * Compiles all of the executables in the `rust` tree.
   * Copies the executables into `src/bin`
   * Copies the static web data for `lqos_node_manager`
     into `bin/static`.
* Updates .gitignore to ignore the bin/ folder
* Updates LibreQoS.py to call bin/xdp_iphash_to_cpu_cmdline
  instead of ./xdp_iphash_to_cpu_cmdline (cleaner).
* Updates graphInfluxDB.py to call the temporary Rust shim
  that provides output like the previous one, hopefully
  (poorly tested) allowing the existing graph system to work
  with the new structure.

See #181

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
2023-01-10 14:12:50 +00:00
Herbert Wolverson
10a674abde Remove cpumap-pping submodule
Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
2023-01-10 14:12:50 +00:00
Herbert Wolverson
e780b1411d Update .gitmodules for removing the cpumap submodule
Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
2023-01-10 14:12:50 +00:00
Herbert Wolverson
32597813e8 Add Rust source tree to the main repo.
Replaces the previously separate repo, merging the Rust
system into the mainline ready for 1.4.

The Rust system currently provides:

* lqos_bus: type definitions for localhost control bus.
* lqos_config: handler for configuration files.
* lqos_node_manager: local web-based monitor and manager.
* lqos_sys: eBPF program that handles all of the tracking,
  CPU assignment, VLAN redirect, TC queue assignment,
  and RTT tracking. Wrapped in a Rust core, providing
  consistent in-Rust building and mostly-safe wrappers
  to C code.
* lqosd: a daemon designed to run continually while
  LibreQoS is operating. On start, it parses the configuration
  files and sets up interface mapping (the Python code is still
  required to actually build queues). It then assigns the various
  eBPF programs to appropriate interfaces. The eBPF systems are
  removed when the daemon terminates.

  lqosd also provides a "bus", listening to requests for changes
  or information on localhost, providing a control plane for
  the rest of the project.
* lqtop: An example program demonstrating how to use the bus,
  acts like "top", showing current network traffic and mappings.
* xdp_iphash_to_cpu_cmdline: a Rust wrapper providing the same
  services as the cpumap originated tool of the same name. This is
  a "shim" - it will go away once the native Python library is
  ready.
* xdp_pping: also a shim, providing equivalent services to the
  cpumap service of the same name.

A helper shell script "remove_pinned_maps.sh" can be used to
remove all pinned eBPF maps from the system, allowing for eBPF
program upgrades that change persistent map structures without
a reboot.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
2023-01-10 14:12:50 +00:00
Herbert Wolverson
b0ff63d278 Update .gitignore, fix syntax in LibreQoS.py
* Add src/rust/target to the .gitignore file,
  to avoid including Rust build artifacts in the
  Git tree.
* Fix the syntax when calling the IP mapping helper
  and deleting IP mappings.

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
2023-01-10 14:12:50 +00:00
Herbert Wolverson
485ce30b45 Patch LibreQoS.py and ispConfig.example.py for Rust Integration
* Modifies ispConfig.example.py to include work-in-progress
  "on a stick" configuration. You can specify 2 VLANs on a
  single interface and operate on a single interface.
* LibreQoS.py no longer calls cpumap commands, but instead
  calls the Rust shims that do the same thing with the new
  Rust environment (which is in the next commit).
* LibreQoS.py detects when running "on a stick", and divides
  the number of available queues by 2. The first half are
  used for download queues, the second for upload queues.
  This allows a single TC hierarchy to be installed on the
  single "stick" interface, and still divide traffic by core.

Part of #181

Signed-off-by: Herbert Wolverson <herberticus@gmail.com>
2023-01-10 14:12:44 +00:00
Christian Clauss
7b1da69ddd
python3 -m pip install -r requirements.txt
https://pip.pypa.io/en/stable/user_guide/#requirements-files
2023-01-10 09:40:36 +01:00
Christian Clauss
98f415ec10
Update lint_python.yml 2023-01-10 09:31:47 +01:00
Christian Clauss
e93b3091c5
Update lint_python.yml 2023-01-10 09:29:15 +01:00