-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LS1028ardb set PCP field #80
Comments
You could create an 8021q interface on top of eno0, and create a one-to-one mapping between skb->priority and VLAN PCP as follows:
You need to open your sockets in ptp4l and in your custom application on top of this VLAN interface (example: ptp4l -i eno0.100). Then, how you set the packet priority is up to you. Generally there are two options.
I need to mention that QoS classification via the VLAN PCP is not the only option. At least the LS1028A has the option to do QoS classification based on other frame headers as well. |
This suggests that you are interested in IEEE 802.1Qbv as well. Very well.
|
What is the output of "zcat /proc/config.gz | grep NET_SCH_INGRESS" on your system? |
Also, I tried to follow the method mentioned in #38 to set PCP on ports by adding a script text file (say felix.sh). |
Try "#!/bin/bash" instead of "#!/bin/sh", I think "-o pipefail" is a bashism. |
The LS1028A switch will automatically set a one-to-one mapping between VLAN PCP and traffic class: |
Yes, the output of "cat /proc/iomem" has changed between kernels. This line from the script no longer matches:
I've updated that script and fixed both issues, can you please try again? |
Sorry, where is the update? How to change this line? |
The updated script is in the thread you linked. Just remove the leading ":" from ": ana" to become " ana". |
Can you show the output of "cat /proc/iomem"? It looks like this for me (extracted only the portion for PCIe PF 5, the Felix switch):
It's possible that you don't have this patch applied? |
They aren't port names, they are memory region names. This is why it doesn't work, it searches for the "ANA" region (which stands for Analyzer). You need the linked kernel patch. |
Got it! I will try later. Btw,
So, How could I use this? What's the mapping rule, such as what kinds of traffic class map which PCP number? |
No, I don't think so.
It depends if the packet is injected into the switch from the CPU or from the outside world. For packets received from the outside world, it is sufficient for them to contain a VLAN PCP value i (between 0 and 7), and they will be classified to traffic class i inside the switch. You can look at the following port counters:
These are per-traffic class counters, you can check that the proper one is incrementing when receiving a VLAN-tagged packet. The felix.sh switch only affects the traffic class in case the received packets do not have a VLAN PCP. |
Hi, vladimiroltean. I have enable NET_SCH_INGRESS and could use tc qdisc. I want to ask how to set PCP in the following situation.
I guess this is quite similar to what you said, "the packet is injected into the switch from the CPU." This is my config for swp0-3.
|
So, as mentioned, if you send packets through the "switch" bridge interface, and eno2 is configured as the DSA master, they will exit the system using the DSA injection mechanism (switch -> swp0 -> eno2). This means that the frame analyzer will be bypassed, so the local switch will not look at the VLAN PCP at all, it will just enqueue into the traffic class specified in the QOS_CLASS field of the DSA header (which the driver inserts automatically into the packet based on skb->priority). That is to say, you can still send VLAN-tagged packets, and the VLAN PCP will be interpreted by other nodes in the network, but for the local device, what you need is to set the skb->priority properly. This can be done using the "skbedit priority" tc action, put in the software egress qdisc either of the bridge interface, or of individual switch interfaces:
You can of course also use the SO_PRIORITY kernel API from the application directly such that all packets sent from a specific socket are treated by the kernel with a given skb->priority, and this will translate into the correct QOS_CLASS field of the Felix switch DSA header. |
I got little confuse about it. The messages should flow from (LS1028)cpu -->eno2 -->switch -->swp0 --> node2(ip:192.168.100.1, outside). |
I am talking about the skb path through software interfaces. Your "switch" name for the bridge interface is what is confusing. From the software's perspective, the physical transmission is always done by eno2, so it makes sense that this is the last element in the path I mentioned. The first element in the path is the bridge interface, because that is where the user socket is opened. And the bridge interface selects a lower bridge port interface for transmission (in this case swp0) by looking up its software FDB for that destination MAC address, or performs flooding if an FDB entry is not found. |
If I want to send with PCP=7, VID=1, should I enable vlan_filtering first?
|
Hello,
I am working on a TSN demo set up using two LS1028ardb running on OpenIL. I have camera images that have to be transmitted from one of the board to the other. This is the priority traffic that i need to send. It is my understanding that the PCP – Priority Code Point in 802.1 Q tag, is to be set to assign the priority to the image data. Could you please let me know if there is a way to set the PCP flag? Would I need an application that uses ‘raw socket’ connection to set the PCP flag or is there any tsntool configuration that I can use to set the priority and gate mapping on the eno0 port for the image data?
The idea is to set PCP = say 5 for the image buffer, PCP = 3 for PTP frames etc.
Thanks in advance for your help.
The text was updated successfully, but these errors were encountered: