|
1 | 1 | #!/usr/bin/env bash |
2 | 2 | # fasterdata-tuning.sh |
3 | 3 | # -------------------- |
4 | | -# Version: 1.3.5 |
| 4 | +# Version: 1.3.6 |
5 | 5 | # Author: Shawn McKee, University of Michigan |
6 | 6 | # Acknowledgements: Supported by IRIS-HEP and OSG-LHC |
7 | 7 | # |
@@ -1271,36 +1271,39 @@ iface_apply() { |
1271 | 1271 | iface_packet_pacing_audit() { |
1272 | 1272 | local iface="$1" |
1273 | 1273 | local pacing_rate="$2" |
1274 | | - |
| 1274 | + |
1275 | 1275 | # Only audit packet pacing for DTN nodes |
1276 | 1276 | if [[ "$TARGET_TYPE" != "dtn" ]]; then |
1277 | 1277 | return 0 |
1278 | 1278 | fi |
1279 | | - |
| 1279 | + |
1280 | 1280 | # Check current qdisc - fq enables Linux TCP pacing; tbf indicates explicit rate cap |
1281 | 1281 | local current_qdisc |
1282 | | - current_qdisc=$(tc qdisc show dev "$iface" 2>/dev/null | head -n1) |
1283 | | - |
1284 | | - # If we're not applying pacing, just report current state |
1285 | | - if [[ $APPLY_PACKET_PACING -eq 0 ]]; then |
1286 | | - # Accept either fq (TCP pacing) or tbf (explicit cap) as "pacing applied" |
1287 | | - if [[ "$current_qdisc" == *" fq"* || "$current_qdisc" == fq* || "$current_qdisc" == *" tbf"* ]]; then |
1288 | | - return 0 |
1289 | | - fi |
1290 | | - return 1 |
| 1282 | + current_qdisc=$(tc qdisc show dev "$iface" 2>/dev/null | head -n1 || echo "") |
| 1283 | + |
| 1284 | + # Accept either fq (TCP pacing) or tbf (explicit cap) as "pacing applied" |
| 1285 | + if [[ "$current_qdisc" == *" fq"* || "$current_qdisc" == fq* || "$current_qdisc" == *" tbf"* ]]; then |
| 1286 | + return 0 |
1291 | 1287 | fi |
1292 | | - |
1293 | | - return 0 |
| 1288 | + |
| 1289 | + # Not found |
| 1290 | + return 1 |
1294 | 1291 | } |
1295 | 1292 |
|
1296 | 1293 | iface_apply_packet_pacing() { |
1297 | 1294 | local iface="$1" |
1298 | 1295 | local pacing_rate="$2" |
1299 | | - |
| 1296 | + |
| 1297 | + # Respect DRY_RUN and target type / feature flag |
| 1298 | + if [[ $DRY_RUN -eq 1 ]]; then |
| 1299 | + log_info "Dry-run: would apply packet pacing to $iface (skipped)" |
| 1300 | + return |
| 1301 | + fi |
| 1302 | + |
1300 | 1303 | if [[ "$TARGET_TYPE" != "dtn" ]] || [[ $APPLY_PACKET_PACING -eq 0 ]]; then |
1301 | 1304 | return |
1302 | 1305 | fi |
1303 | | - |
| 1306 | + |
1304 | 1307 | # Decide on tbf vs fq: use tbf if explicitly requested or a cap rate is provided; otherwise fq |
1305 | 1308 | if [[ $USE_TBF_CAP -eq 1 || -n "$TBF_CAP_RATE" ]]; then |
1306 | 1309 | # Determine effective rate: explicit cap wins; else compute fraction of iface speed |
|
0 commit comments