• Vladimir Oltean's avatar
    net/sched: mqprio: allow per-TC user input of FP adminStatus · f62af20b
    Vladimir Oltean authored
    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.
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: default avatarFerenc Fejes <fejes@inf.elte.hu>
    Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    f62af20b
sch_mqprio_lib.h 564 Bytes