I'm trying to change the default filtering for a SFQ to one based on source IP, where each IP goes to a class.
I know I can create a SFQ with more divisors with something like:
tc qdisc add ... sfq divisor 512
Then I want to send each src up to one different class using something like:
tc filter add ... flow map key src addend -192.168.0.0 divisor 256
tc filter add ... flow map key src addend -192.168.4.0 divisor 256
The problem, is that the first line will send 192.168.0.x traffic to class 1-256 but the second line will also send traffic from 192.168.4.0 to classes 1-256.
Is there anyway to set an offset? I've been checking bitwise operators, but I'm sure it can be achieved.
I know I could just use a hash like:
tc filter add ... flow hash keys src divisor 512
But, as the source IP address would be hashed, different src IPs could end in the same queue, instead of each one per queue.
This shaping will be installed in a high performance router (20gbps) with 5120 different src IPs, so I cannot really set up one queue per IP or setup plenty of filters, that's why I'm trying to find a more optimal way to do it.
Thanks!