History

net/sched: mqprio: allow per-TC user input of FP adminStatus

IEEE 802.1Q-2018 clause 6.7.2 Frame preemption specifies that each packet priority can be assigned to a "frame preemption status" value of either "express" or "preemptible". Express priorities are transmitted by the local device through the eMAC, and preemptible priorities through the pMAC (the concepts of eMAC and pMAC come from the 802.3 MAC Merge layer). The FP adminStatus is defined per packet priority, but 802.1Q clause 12.30.1.1.1 framePreemptionAdminStatus also says that: | Priorities that all map to the same traffic class should be | constrained to use the same value of preemption status. It is impossible to ignore the cognitive dissonance in the standard here, because it practically means that the FP adminStatus only takes distinct values per traffic class, even though it is defined per priority. I can see no valid use case which is prevented by having the kernel take the FP adminStatus as input per traffic class (what we do here). In addition, this also enforces the above constraint by construction. User space network managers which wish to expose FP adminStatus per priority are free to do so; they must only observe the prio_tc_map of the netdev (which presumably is also under their control, when constructing the mqprio netlink attributes). The reason for configuring frame preemption as a property of the Qdisc layer is that the information about "preemptible TCs" is closest to the place which handles the num_tc and prio_tc_map of the netdev. If the UAPI would have been any other layer, it would be unclear what to do with the FP information when num_tc collapses to 0. A key assumption is that only mqprio/taprio change the num_tc and prio_tc_map of the netdev. Not sure if that's a great assumption to make. Having FP in tc-mqprio can be seen as an implementation of the use case defined in 802.1Q Annex S.2 "Preemption used in isolation". There will be a separate implementation of FP in tc-taprio, for the other use cases.

Vladimir Oltean committed 3 years ago

Commit f62af201 parent c54876c5 files · +160 −1Browse files

Showing the changes to include/uapi (1 of 5 files). Show all

Unified · Split

include/uapi/linux/pkt_sched.h+16−0
@@ -719,6 +719,11 @@ enum { · 718 unmodified lines
719 719
720#define __TC_MQPRIO_SHAPER_MAX (__TC_MQPRIO_SHAPER_MAX - 1)720#define __TC_MQPRIO_SHAPER_MAX (__TC_MQPRIO_SHAPER_MAX - 1)
721 721
722enum {
723 TC_FP_EXPRESS = 1,
724 TC_FP_PREEMPTIBLE = 2,
725};
726
722struct tc_mqprio_qopt {727struct tc_mqprio_qopt {
723 __u8 num_tc;728 __u8 num_tc;
724 __u8 prio_tc_map[TC_QOPT_BITMASK + 1];729 __u8 prio_tc_map[TC_QOPT_BITMASK + 1];
@@ -732,12 +737,23 @@ struct tc_mqprio_qopt { · 7 unmodified lines
732#define TC_MQPRIO_F_MIN_RATE 0x4737#define TC_MQPRIO_F_MIN_RATE 0x4
733#define TC_MQPRIO_F_MAX_RATE 0x8738#define TC_MQPRIO_F_MAX_RATE 0x8
734 739
740enum {
741 TCA_MQPRIO_TC_ENTRY_UNSPEC,
742 TCA_MQPRIO_TC_ENTRY_INDEX, /* u32 */
743 TCA_MQPRIO_TC_ENTRY_FP, /* u32 */
744
745 /* add new constants above here */
746 __TCA_MQPRIO_TC_ENTRY_CNT,
747 TCA_MQPRIO_TC_ENTRY_MAX = (__TCA_MQPRIO_TC_ENTRY_CNT - 1)
748};
749
735enum {750enum {
736 TCA_MQPRIO_UNSPEC,751 TCA_MQPRIO_UNSPEC,
737 TCA_MQPRIO_MODE,752 TCA_MQPRIO_MODE,
738 TCA_MQPRIO_SHAPER,753 TCA_MQPRIO_SHAPER,
739 TCA_MQPRIO_MIN_RATE64,754 TCA_MQPRIO_MIN_RATE64,
740 TCA_MQPRIO_MAX_RATE64,755 TCA_MQPRIO_MAX_RATE64,
756 TCA_MQPRIO_TC_ENTRY,
741 __TCA_MQPRIO_MAX,757 __TCA_MQPRIO_MAX,
742};758};
743 759

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t