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

Allow bandwidth minimums to be set in network.json nodes #638

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/LibreQoS.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,11 +688,17 @@ def traverseNetwork(data, depth, major, minorByCPU, queue, parentClassID, upPare
# Cap based on this node's max bandwidth, or parent node's max bandwidth, whichever is lower
data[node]['downloadBandwidthMbps'] = min(data[node]['downloadBandwidthMbps'],parentMaxDL)
data[node]['uploadBandwidthMbps'] = min(data[node]['uploadBandwidthMbps'],parentMaxUL)
# Calculations are done in findBandwidthMins(), determine optimal HTB rates (mins) and ceils (maxs)
# Calculations used to be done in findBandwidthMins(), determine optimal HTB rates (mins) and ceils (maxs)
# For some reason that doesn't always yield the expected result, so it's better to play with ceil more than rate
# Here we override the rate as 95% of ceil.
data[node]['downloadBandwidthMbpsMin'] = round(data[node]['downloadBandwidthMbps']*.95)
data[node]['uploadBandwidthMbpsMin'] = round(data[node]['uploadBandwidthMbps']*.95)
# Here we override the rate as 95% of ceil, unless it's specified already in network.json
if ('downloadBandwidthMbps_min' in data[node]):
data[node]['downloadBandwidthMbpsMin'] = data[node]['downloadBandwidthMbps_min']
else:
data[node]['downloadBandwidthMbpsMin'] = round(data[node]['downloadBandwidthMbps']*.95)
if 'uploadBandwidthMbps_min' in data[node]:
data[node]['uploadBandwidthMbpsMin'] = data[node]['uploadBandwidthMbps_min']
else:
data[node]['uploadBandwidthMbpsMin'] = round(data[node]['uploadBandwidthMbps']*.95)

data[node]['classMajor'] = hex(major)
data[node]['up_classMajor'] = hex(major + stickOffset)
Expand Down
Loading