nxp-archive / openil

OpenIL is an open source project based on Buildroot and designed for embedded industrial solution.
Other
136 stars 55 forks source link

Does LS1021A-TSN support priority modification with tc-skbedit? #102

Open JeanPark96 opened 3 years ago

JeanPark96 commented 3 years ago

Hi, I’m having an issue modifying the VLAN priority using tc-skbedit. I’m currently using OpenIL v1.11 202104 on the LS1021A-TSN board connected to two general hosts. I’m sending dpdk packets from Host 1 to Host 2, which are connected to the swp2 and swp3, respectively. Only the MAC headers are attached to the packets and I have verified that the packet flow could be controlled by configuring VLAN TCI (PCP + DEI + VID) on Host 1.

But I plan to use more than one switch, each with a different queue setting. So I don’t want to fix the PCP for each packet when sending from Host 1, but use tc-skbedit to change the priority of the packets on the switch. However, none of the methods I’ve tried worked so far. It seems like the kernel supports the use of skbedit, but the priority modification has never been applied to the forwarded packet.

Following commands have been used for configuring the gates on LS1021A-TSN.  

ip link set dev br0 type bridge vlan_filtering 1
tc qdisc add dev swp3 clsact
tc filter add dev swp3 ingress 802.1Q flower \
dst_mac a0:36:9f:1b:dc:68 action skbedit priority 1
tc qdisc add dev swp3 parent root taprio \
num_tc 8 map 0 1 2 3 4 5 6 7 \
queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \
base-time 0 sched-entry S fe 500000 \ 
sched-entry S fe 500000 flags 2

Host 1 sends packets with PCP 0, DEI 0, VID 0, but given the configuration above, Host 2 cannot receive the packet as queue 0 is closed all the time. Instead of swp3 and ingress, I’ve also tried other combinations: (swp3, egress), (swp2, ingress), and (swp3, egress). None of them worked.

Does the SJA1105 switch support VLAN PCP modification using tc-skbedit? If so, what is the correct way to use it?