Quality Of Service in AM437x using linux

Manasa Cheela

New Member
Joined
Mar 20, 2024
Messages
8
Reaction score
0
Credits
90
Hi ,

I am implementing QOS in AM437x processor using linux utility traffic control(tc) which comes with iproute/iproute2 package . Implemented at layer 2 i.e have created a bridge and added the two interfaces eth0 and eth1 to it. Setup contains of 4 boards and one test PC. Connections are this way :
PC ethernet is connected to Board1 eth0, Board 1 eth1 is connected to Board 2 eth0 , Board 2 eth1 is connected to Board 3 eth0 , Board 3 eth1 is connected to Board 4 eth0.
Facing one issue while testing this :
Sending the traffic through packet generator tool . For example : Sending 250 packets from packet generator tool . The 250 packets are getting received to the Board 1 qdisc . Only 156 packets are getting received to Board 2 qdisc , 100 packets are only getting received at Board 3 qdisc , 58 packets are getting received at Board 4 Qdisc. All the traffic should flow to all the boards right? As i am using bridge it should mirror the traffic of eth0 and eth1 . The same 250 packets should go to all the 4 boards . Not knowing whether it is a bridge issue or the traffic control qdisc issue ?

Please help me to resolve this issue .
 


make a second bridge with VLAN interfaces :

a first bridge br0 which make the link with eth0, eth1 and eth2.

In parallel, I have a second bridge br1 which links eth0.100, eth1.100, and eth2.100.

With this method, your ethernet frames which are composed by a VLAN tag with a VLAN id of 100 are passed through br1, and so the PCP is used to map the priority of my packets. When you look on your qdisc classes with tc -s -d qdisc ls dev eth0, you should see that it solved the problem and qdisc can now use priority to shape the traffic.
 
Hi GatorsFan,

Currently priority and classification is happening , but packets are being discarded . Wanted to know the reason why all packets are not reaching to 4 boards equally . All 250 packets should go to all 4 boards right as i am using bridge .
 
Hi GatorsFan,

Currently priority and classification is happening , but packets are being discarded . Wanted to know the reason why all packets are not reaching to 4 boards equally . All 250 packets should go to all 4 boards right as i am using bridge .
Have you prioritized your traffic - Sniff traffic with the tcpdump and check ToS/DSCP values in packet headers. And you should attach prio qdisc to the bridge ports too. also check cabling make sure they are all the same CAT6 and not mismatched
 
yes. I am prioritizing the traffic based on the vlan priority field. Sending the traffic through the ostinato tool where in 802.1q packets we can set the vlan priority . Based on this priority the prioritization will happen .
Below is the code :
tc qdisc add dev eth0 handle ffff: ingress
tc filter add dev eth0 parent ffff: protocol 802.1Q u32 match u32 0 0 action mirred egress redirect dev br0
tc qdisc add dev br0 parent root handle 1: hfsc default 11
tc class add dev br0 parent 1: classid 1:1 hfsc sc rate 1000mbit ul rate 1000mbit
tc class add dev br0 parent 1:1 classid 1:14 hfsc sc rate 50mbit
tc class add dev br0 parent 1:1 classid 1:13 hfsc sc rate 40mbit
tc class add dev br0 parent 1:1 classid 1:12 hfsc sc rate 30mbit
tc class add dev br0 parent 1:1 classid 1:11 hfsc sc rate 20mbit
tc filter add dev br0 parent 1:0 protocol 802.1Q flower vlan_prio 0 classid 1:11
tc filter add dev br0 parent 1:0 protocol 802.1Q flower vlan_prio 5 classid 1:12
tc filter add dev br0 parent 1:0 protocol 802.1Q flower vlan_prio 6 classid 1:13
tc filter add dev br0 parent 1:0 protocol 802.1Q flower vlan_prio 7 classid 1:14
watch tc -s -d class show dev br0

In this way the classification and prioritization of qos packets will happen based on the vlan priority . This script is working fine the every packet is getting priotized. But my doubt is that why some packets are getting discarded from device 1 to device 2 ?
 
Generally a packet discard happens when a received packet has a transmission or format error, or when the receiving device doesn’t have enough storage/bandwidth room for it. There are a few things that can cause this
1) A port that doesn’t have enough bandwidth
2) Hardware—like switches, routers, and firewalls— experiencing high CPU or memory usage
3) A network device is misconfigured. Think of mismatched VLANs at two ends of a connection. If one end is a VLAN 9 but the other isn’t, the traffic coming from the VLAN 9 will be discarded because the receiving port isn’t configured for VLAN 9 traffic

After this I have run out of ideas - my knowledge in this area is limited
 
Hi ,
One doubt i am having the eth0 is receiving all 100 packets but the bridge is receiving only 50 packets . why this is happening can you please let me know


In First image, this is the ifconfig log of first device as you can see the bridge is receiving more than eth0 packets . It is transmitting all packets to second device.
In Second image as you can see here the bridge is receiving half packets from eth0. Bridge should receive all the eth0 packets correct ? The ip address and mac address of both bridges are different.
These are two different devices . Sending packets through ping command.
MicrosoftTeams-image (1).jpg
MicrosoftTeams-image (2).jpg
 
Last edited:

Members online


Top