Files
qos-profiles/qos-profiles.spec
zpericic 86a0d2cdd1 Initial import of qos-profiles
Role subpackages set the system-wide default qdisc and TCP congestion
control via /usr/lib/sysctl.d, without pulling in the base package:

  server   fq + bbr        bare metal, VM guests
  vmhost   fq_codel + bbr  hypervisors, container hosts
  router   fq_codel + cubic
  desktop  fq_codel + cubic

The base package applies cake per interface from
/etc/qos-profiles/<iface>.conf, layered over role defaults and
/etc/qos-profiles/defaults.conf:

- LINK_RATE with per-direction overrides, shaped to SHAPE_PERCENT
  (default 95, per direction overridable)
- outbound fairness per source host and diffserv4; inbound via ifb,
  fairness per destination host, besteffort with DSCP wash
- NAT awareness, extra cake args (shared and per direction), raw
  qdisc overrides
- config parsed without executing it, validated before any change,
  previous state undone on each run

Applied by the qos-profiles@<iface> unit (bound to the device) or the
qos-profiles-networkmanager dispatcher subpackage, installed
automatically on hosts with NetworkManager. Includes ready-made
examples for VM hosts, OVH dual-NIC servers, DC and home routers.
2026-10-10 22:41:12 +02:00

171 lines
5.4 KiB
RPMSpec

Summary: Queueing discipline and TCP congestion control profiles
Name: qos-profiles
Version: 1
Release: 1%{?dist}
License: GPL-2.0-or-later
URL: http://gitea.infomaas.com/rpms-fedora-ims/%{name}
BuildArch: noarch
Source0: README.md
Source1: qos-apply
Source2: qos-profiles@.service
Source3: qos-profiles-modprobe.conf
Source4: example.conf
Source5: 50-qos-profiles
Source10: 60-qos-profiles-server.conf
Source11: 60-qos-profiles-vmhost.conf
Source12: 60-qos-profiles-router.conf
Source13: 60-qos-profiles-desktop.conf
Source20: role-server.conf
Source21: role-vmhost.conf
Source22: role-router.conf
Source23: role-desktop.conf
Source30: example-backup-nic-raw.conf
Source31: example-dc-router-transit.conf
Source32: example-defaults.conf
Source33: example-ovh-public.conf
Source34: example-ovh-vrack-private.conf
Source35: example-router-docsis.conf
Source36: example-router-ftth.conf
Source37: example-router-vdsl-pppoe.conf
Source38: example-vmhost-egress-only.conf
Source39: example-vmhost-nat-guests.conf
Source40: example-vmhost-routed-uplink.conf
BuildRequires: systemd-rpm-macros
Requires: gawk
Requires: iproute
Requires: iproute-tc
Requires: util-linux-core
Recommends: (%{name}-networkmanager if NetworkManager)
%{?systemd_requires}
%description
Per-interface queueing disciplines (cake, with ifb for inbound shaping)
configured in /etc/qos-profiles/<interface>.conf and applied by the
qos-profiles@<interface> systemd unit or the NetworkManager dispatcher.
The role subpackages set the default qdisc, TCP congestion control and
per-interface defaults for servers, VM hosts, routers and desktops.
%package networkmanager
Summary: NetworkManager dispatcher for qos-profiles
Requires: %{name} = %{version}-%{release}
Requires: NetworkManager
%description networkmanager
Applies /etc/qos-profiles/<interface>.conf when NetworkManager brings the
interface up, without enabling the qos-profiles@<interface> unit.
%package server
Summary: Queueing profile for servers and VM guests
Provides: %{name}-role
Conflicts: %{name}-role
%description server
Sets fq as the default qdisc and BBR as TCP congestion control, for machines
that mostly send their own TCP traffic: bare-metal servers and VM guests.
%package vmhost
Summary: Queueing profile for VM and container hosts
Provides: %{name}-role
Conflicts: %{name}-role
%description vmhost
Sets fq_codel as the default qdisc for traffic forwarded from guests and BBR as
TCP congestion control for the host's own traffic. Configure cake on the
uplink for fairness per guest.
%package router
Summary: Queueing profile for routers
Provides: %{name}-role
Conflicts: %{name}-role
%description router
Sets fq_codel as the default qdisc and CUBIC as TCP congestion control, and
enables cake NAT awareness by default. Configure cake on the WAN with the
link rate.
%package desktop
Summary: Queueing profile for desktops
Provides: %{name}-role
Conflicts: %{name}-role
%description desktop
Sets fq_codel as the default qdisc and CUBIC as TCP congestion control.
%prep
cp -p %{SOURCE0} .
%install
install -Dpm 755 %{SOURCE1} %{buildroot}%{_libexecdir}/%{name}/qos-apply
install -Dpm 644 %{SOURCE2} %{buildroot}%{_unitdir}/qos-profiles@.service
install -Dpm 644 %{SOURCE3} %{buildroot}%{_modprobedir}/%{name}.conf
install -Dpm 644 %{SOURCE4} %{buildroot}%{_datadir}/%{name}/example.conf
install -Dpm 755 %{SOURCE5} %{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d/50-qos-profiles
install -dm 755 %{buildroot}%{_sysconfdir}/%{name}
for f in %{SOURCE30} %{SOURCE31} %{SOURCE32} %{SOURCE33} %{SOURCE34} %{SOURCE35} \
%{SOURCE36} %{SOURCE37} %{SOURCE38} %{SOURCE39} %{SOURCE40}; do
n=$(basename "$f")
install -Dpm 644 "$f" %{buildroot}%{_datadir}/%{name}/examples/"${n#example-}"
done
for f in %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13}; do
install -Dpm 644 "$f" %{buildroot}%{_sysctldir}/"$(basename "$f")"
done
for f in %{SOURCE20} %{SOURCE21} %{SOURCE22} %{SOURCE23}; do
install -Dpm 644 "$f" %{buildroot}%{_prefix}/lib/%{name}/"$(basename "$f")"
done
%post
%systemd_post qos-profiles@.service
%preun
%systemd_preun qos-profiles@.service
%post server
%sysctl_apply 60-qos-profiles-server.conf
%post vmhost
%sysctl_apply 60-qos-profiles-vmhost.conf
%post router
%sysctl_apply 60-qos-profiles-router.conf
%post desktop
%sysctl_apply 60-qos-profiles-desktop.conf
%files
%doc README.md
%{_libexecdir}/%{name}/
%{_unitdir}/qos-profiles@.service
%{_modprobedir}/%{name}.conf
%{_datadir}/%{name}/
%dir %{_prefix}/lib/%{name}
%dir %{_sysconfdir}/%{name}
%files networkmanager
%{_prefix}/lib/NetworkManager/dispatcher.d/50-qos-profiles
%files server
%{_sysctldir}/60-qos-profiles-server.conf
%dir %{_prefix}/lib/%{name}
%{_prefix}/lib/%{name}/role-server.conf
%files vmhost
%{_sysctldir}/60-qos-profiles-vmhost.conf
%dir %{_prefix}/lib/%{name}
%{_prefix}/lib/%{name}/role-vmhost.conf
%files router
%{_sysctldir}/60-qos-profiles-router.conf
%dir %{_prefix}/lib/%{name}
%{_prefix}/lib/%{name}/role-router.conf
%files desktop
%{_sysctldir}/60-qos-profiles-desktop.conf
%dir %{_prefix}/lib/%{name}
%{_prefix}/lib/%{name}/role-desktop.conf
%changelog
* Sat Oct 10 2026 Zoran Pericic <zpericic@netst.org> - 1-1
- Initial release