Yeah I know, currently my wrt3200acm has two cpu ports attached to the switch, but with DSA one of them is disabled and in the devicetree the CPU port points to eth1 (and eth0 is disabled). What I propose is to bond eth0 and eth1 into bond0 and point the switch to bond0 instead of eth1.

After some testing with the IPTV issue and I got some results

As you can see from the screenshot In the first output of bridgs mdb there are a lot of multicast networks Wich don't matter, at this moment the TV is playing.
Approximately 10 seconds later the TV stops and the output of the command adds a line, specifically the second and it offloads it to the switch, stays like that for a while but the stb isn't actually receiving any trafic so switch offloading must be broken, either that or igmp snooping, cause maybe the driver doesn't see igmp packets and although it's receiving the trafic it doesn't forward it anywhere.
What do you guys think?

Small update on the limited bandwidth issue.
I switched back to swconfig to test some things.
Now I can only hit ~250 Mbit/s with sqm/cake.
The upload stream starving issue is also always present. tx queue patch makes no difference.
I remember having cake working at full speed's + swconfig. :thinking:
Maybe it has something to do with cake's split gso setting.
gso is enabled according to ethtool.
With DSA, cake always reports a max packet size of ~ 1514. (Seems actually to be disabled)
With swconfig, cake reports packet sizes much large as 1514. (As expected for gso)
With htb+fq_codel the speeds are fine.
:thinking:

I've switched back to swconfig because of some bridging + vlan issue..

I have found a patch for part of the vlan issue. The other ones I have no Idea.
In kernel messages they say these issues aren't a thing with kernel >5.0 but I have no way of testing these kernel versions, so I guess we have to wait for the OpenWRT team to update the kernel version to the latest LTS version (which isn't even released yet).

But I feel you, on one hand I have to switch to DSA because of IGMP snooping, and on the other hand I have to switch to swconfig because I can't get it to work...

On other news, has anyone had trouble building a OpenWrt image in the last month? I always get a make error.

Hey! Does someone here have the default swconfig setup?
I need someone to test something for me

Yes, I'm currently running a build with swconfig and default switch config.

Can you test something for me?
Currently I have an issue where when I bridge wan with tagged vlan 12 for example and another port untagged or tagged with a different vlan traffic doesn't flow. This is with DSA, with swconfig it's a bit difficult to test but if you could it'd be awesome! :smile:

If you can test it for me you could do this:

  1. Create a bridge
  2. Connect eth0.12 and eth1 to it (yes, one with vlan and another without
  3. In the switch config CPU port with an vlan for example 50 for untagged and lan1 for example with untagged vlan 50
  4. Config also for example vlan 12 for CPU port tagged and lan2 with untagged vlan 12

With that setup test if there's any traffic between the ports, and if you can show me your swconfig, interface config and traffic flowing please.

Thank you in advance!

vlan 13 should be tagged too?
And why do you want to bridge eth0.x vlan to eth1 cpu port?

OK, just corrected it @shm0 I mistyped the vlan number, now it makes sense ahahah

That still makes no sense to me. :laughing:
In 3. and 4. which cpu port should be used?

lan1              lan2
   | untagged    | untagged
   |  12         | 50
------------------------
Switch
------------------------
  | untagged    | tagged
  |  12         | 50
eth0           eth1.50
------------------------
Bridge
------------------------

Sorry for the confusion, hope this helps! ahahaha

Now I saw that you wrote support, what do you mean by support?

Sorry for my late response.
But I had no time testing this yet.

But some other question.
Does multicast with DSA work for you?
I can't get this working.
Lan Ports 1 - 4 and Wifi are bridged.
Multicast from Lan to Wifi and vice versa works.
But not between the lan ports.
igmp snooping is not enabled on the bridge.

There's no problem.
Multicast since the switch from 4.14 to 4.19 has been buggy, IPTV for me doesn't work, cause after a while of watching the same channel it freezes and never works again... and when it works switching from channel to channel is slow and painful... I have no idea what's wrong

Hmm strange.
Maybe it is a problem with this pc here.

Btw here are two updated scripts (that I posted earlier) to configure/show rps/xps/rfs:
set.sh

#!/bin/sh

#sleep 30s

interfaces="eth0"
cpu_mask=3   # Use CPU1 + CPU2

num_interfaces=$(echo $interfaces | wc -w)
rfs_max_flows=$(sysctl net.netfilter.nf_conntrack_max | cut -d'=' -f2)

echo $rfs_max_flows > /proc/sys/net/core/rps_sock_flow_entries

	printf "%-25s %5s\n%-25s %5s\n%-25s %5s\n" \
			"Interfaces:" $num_interfaces \
			"CPU Mask:" $cpu_mask \
			"RFS Limit:" $rfs_max_flows

	printf "%42s\n" | tr " " "="

	printf "%-15s %15s %10s \n" \
			"Interface" \
			"TX/RX Queues" \
			"RFS Flows"

for interface in $interfaces
do
	num_rx_queues=$(ls -l /sys/class/net/$interface/queues/ | grep "^d" | grep "rx-" | wc -l)
	num_tx_queues=$(ls -l /sys/class/net/$interface/queues/ | grep "^d" | grep "tx-" | wc -l)
	
	rfs_queue_flows=$(( $rfs_max_flows / $num_interfaces / $num_rx_queues ))
			
	printf "%-15s %15s %10s \n" \
			"$interface" \
			"$num_tx_queues / $num_rx_queues" \
			"$rfs_queue_flows"

	queue=0

	while [ $queue -le $(( $num_rx_queues - 1 )) ]
	do
		echo $cpu_mask > /sys/class/net/$interface/queues/rx-$queue/rps_cpus
		echo $rfs_queue_flows > /sys/class/net/$interface/queues/rx-$queue/rps_flow_cnt
		queue=$(($queue + 1))
	done
	
	queue=0
	
	while [ $queue -le $(( $num_tx_queues - 1 )) ]
	do
		echo $cpu_mask > /sys/class/net/$interface/queues/tx-$queue/xps_cpus
		queue=$(($queue + 1))
	done
done

exit 0

Unfortunately,
the queue count isn't dynamically updated at runtime.
Maybe I will improve this later...

I'm sorry I'm confused, what are those scripts for? :sweat_smile::sweat_smile::sweat_smile:

See post #78
I use those scripts to configure RPS/XPS/RFS.
The first script applies the given CPUmask to the given interfaces queues.
It also sets RFS settings. (Max global flow limit and flow limit per queue)

The second script displays the cpu mask for each RPS/XPSqueue per interface.
It also displays the RFS flow setting for each queue and the RFS global max flow value.

Here is an exmaple output:
eth0 was configured with the script while eth1 was not:

eth0
Queue    RPS   XPS     RFS
1        3     3      8192
2        3     3      8192
3        3     3      8192
4        3     3      8192
5        3     3      8192
6        3     3      8192
7        3     3      8192
8        3     3      8192
eth1
Queue    RPS   XPS     RFS
1        2     2         0
2        2     1         0
3        2     2         0
4        2     1         0
5        2     2         0
6        2     1         0
7        2     2         0
8        2     1         0
RFS Max Flows:       65536

I'm sorry if this is a dumb (autocorrect​:sweat_smile::sweat_smile::sweat_smile:) question, but are you trying to use both eth0 and eth1 as CPU port? So eth1 doesn't get disabled?

Actually that is a good question.
Most ethernet related interrupts happen only on one cpu.
Regardless if both CPU ports are active or not (swconfig vs dsa).
Because the Driver has no RSS support, but I'm not sure.
So Yes, the idea is to use RPS/XPS (runs in software) to distribute the network related processing across multiple CPUs.

I updated the set script one more time.
It now dynamically gets the rx/tx queues and accordingly splits the rfs max flow limit.

You're making me confused.
So, there are two issues as I see it.

There's the issue of the CPU ports. From what I read in the dts files, the cpu port of dsa is configured as eth0 there, so, my question is, can't we just configure it as bond0 and bond eth0 and eth1 together with round-robin as a scheduler?

There's also the issue you mention of the IRQ's. From what I see from cat /proc/interrupts I don't have lots of interrupts from eth0/1, but I don't see them either.
What you can do to simplify this is use this i got from mwlwifi:

#Use CPU0:
echo 1 > /proc/irq/irq number of phy0 or phy1/smp_affinity

#Use CPU1:
echo 2 > /proc/irq/irq number of phy0 or phy1/smp_affinity

This will change the CPU affinity of each phy, but you can adapt this to the interfaces you want. Also, you can use irqbalance to distribute IRQ's.