mirror of
https://github.com/hanzoai/visor.git
synced 2026-10-30 14:46:33 +00:00
Implements a single-rate TBF qdisc modeled on Linux's net/sched/sch_tbf.c and exposes it via --qdisc=tbf, with required --qdisc-tbf-rate and --qdisc-tbf-burst flags. OCI annotations can lower the configured rate and burst ceilings but not raise them without --allow-flag-override. The fifo qdisc's circular packet-buffer list moves into a shared pkg/tcpip/link/qdisc package so both qdiscs share one implementation. Loopback and ingress traffic are not shaped.
47 lines
932 B
Python
47 lines
932 B
Python
load("//pkg/sync/locking:locking.bzl", "declare_mutex")
|
|
load("//tools:defs.bzl", "go_library", "go_test")
|
|
|
|
package(
|
|
default_applicable_licenses = ["//:license"],
|
|
licenses = ["notice"],
|
|
)
|
|
|
|
declare_mutex(
|
|
name = "dispatcher_mutex",
|
|
out = "dispatcher_mutex.go",
|
|
package = "fifo",
|
|
prefix = "queueDispatcher",
|
|
)
|
|
|
|
go_library(
|
|
name = "fifo",
|
|
srcs = [
|
|
"dispatcher_mutex.go",
|
|
"fifo.go",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//pkg/atomicbitops",
|
|
"//pkg/sleep",
|
|
"//pkg/sync",
|
|
"//pkg/sync/locking",
|
|
"//pkg/tcpip",
|
|
"//pkg/tcpip/link/qdisc",
|
|
"//pkg/tcpip/stack",
|
|
],
|
|
)
|
|
|
|
go_test(
|
|
name = "qdisc_test",
|
|
size = "small",
|
|
srcs = ["qdisc_test.go"],
|
|
deps = [
|
|
":fifo",
|
|
"//pkg/buffer",
|
|
"//pkg/refs",
|
|
"//pkg/sync",
|
|
"//pkg/tcpip",
|
|
"//pkg/tcpip/stack",
|
|
],
|
|
)
|