[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CABTgHBsFQo0dvPaNzv+516n3G5_6jU5tvuuZ7HRb5_G8gA3_hw@mail.gmail.com>
Date: Sun, 9 Jul 2023 21:13:48 +0530
From: Nayan Gadre <beejoy.nayan@...il.com>
To: netdev@...r.kernel.org
Subject: Behavior of tc for bridged ports
Hi Experts,
I have a wireless router having the client facing interface wlan0 and
the wired gateway facing interface eth0 under a bridge br0.
/ # brctl show
bridge name bridge id STP enabled interfaces
br0 8000.bce67c4d8fb0 no eth0
wlan0
client get IP 192.168.0.105, and server (connected via eth0) has IP
192.168.0.10.
On server I run "iperf3 -s -p 5678 -V"
On client I run "iperf3 -c 192.168.0.10 -p5678 -i1 -tinf"
All works fine.
Now I want to rate limit the traffic going from wlan0 to eth0 to 5000kbits/sec.
I tried to apply a classless qdisc to eth0 port as well as wlan0 port.
# tc qdisc add dev eth0 root tbf rate 5000kbit latency 50ms burst 15k
# tc qdisc add dev wlan0 root tbf rate 5000kbit latency 50ms burst 15k
However, the qdisc does not take effect.
iperf3 -c 192.168.0.10 -p5678 -i1 -tinf
Connecting to host 192.168.0.10, port 5678
[ 5] local 192.168.0.105 port 43384 connected to 192.168.0.10 port 5678
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 10.7 MBytes 89.6 Mbits/sec 0 526 KBytes
[ 5] 1.00-2.00 sec 8.95 MBytes 75.1 Mbits/sec 0 560 KBytes
[ 5] 2.00-3.00 sec 9.13 MBytes 76.6 Mbits/sec 0 619 KBytes
/ # tc -s qdisc
qdisc tbf 8005: dev eth0 root refcnt 5 rate 5Mbit burst 15Kb lat 50ms
Sent 221305 bytes 469 pkt (dropped 157, overlimits 288 requeues 0)
backlog 0b 0p requeues 0
qdisc tbf 8006: dev wlan16 root refcnt 5 rate 5Mbit burst 15Kb lat 50ms
Sent 7095 bytes 109 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
My kernel is 4.4.60, and I checked that qdisc gets activated in the
egress path after dev_queue_xmit() is called. And for a bridged port,
the path taken by the packet coming to wlan0 is
__br_deliver -> br_forward_finish -> br_dev_queue_push_xmit -> dev_queue_xmit.
So the qdisc should have taken effect even in the bridged case. I see
statistics for eth0 qdisc.
What am I missing in the tc rule ?
If I apply the same rule on the server and client interfaces then I
can see rate limiting taking effect. But on the wireless router linux
bridge it's not working.
Thanks
N Gadre
Powered by blists - more mailing lists