Frame Preemption functional description (using ethtool and tc)
Frame preemption is defined in IEEE 802.1Qbu and 802.3br and allows low priority frames to be suspended by time-critical frames of higher priority.
This section describes how to enable frame preeemption using the tools ethtool
and tc. This is the standard way of enabling the frame preemption.
This is working fine only for the following platforms:
-
lan9645x
To enable the frame preemption the port the following command can be run
# ethtool --set-mm lan2 tx-enabled on verify-enabled on
To see if the frame preemption is enabled, the following command can be used:
# ethtool --show-mm lan2
Where the mm stands for MAC-merge
More information regarding ethtool can be found
here
Now that the frame preemption is enabled, we need to decide which frames can be
preempted. To do that we can use the tc command to set which queues contain
preemptable traffic.
For example the frames in queue 2 to be preemptable the following command can be used:
tc qdisc add dev lan2 root mqprio num_tc 8 hw 1 fp E E P E E E E E
Where:
-
Estands for express traffic -
Pstands for preemptable traffic
More information regarding the tc command can be found
here
Before frames can be preempted, they must be assigned to the queues for which frame preemption is enabled.
A natural way to do this is the pcp value of VLAN tagged frames. It is important to enable trust for pcp on the ingress ports, otherwise this value is ignored in the queue classification.
dcb apptrust set dev lan0 order pcp