On Sat, 26 Apr 2025 at 18:20, chia-yu.chang@nokia-bell-labs.com wrote:
From: Chia-Yu Chang chia-yu.chang@nokia-bell-labs.com
Introduce the specification of tc qdisc DualPI2 stats and attributes, which is the reference implementation of IETF RFC9332 DualQ Coupled AQM (https://datatracker.ietf.org/doc/html/rfc9332) providing two different queues: low latency queue (L-queue) and classic queue (C-queue).
General comment is that this does not work. Please test it like this:
sudo tc qdisc add dev eth0 handle 1: root dualpi2 ./tools/net/ynl/pyynl/cli.py \ --spec Documentation/netlink/specs/tc.yaml --dump getqdisc
Consider moving this patch to the end of the series so that it can be tested against the implementation patches.
Signed-off-by: Chia-Yu Chang chia-yu.chang@nokia-bell-labs.com
Documentation/netlink/specs/tc.yaml | 166 ++++++++++++++++++++++++++++ 1 file changed, 166 insertions(+)
diff --git a/Documentation/netlink/specs/tc.yaml b/Documentation/netlink/specs/tc.yaml index aacccea5dfe4..9eaab15cc216 100644 --- a/Documentation/netlink/specs/tc.yaml +++ b/Documentation/netlink/specs/tc.yaml @@ -51,6 +51,31 @@ definitions: - tundf - tunoam - tuncrit
- name: tc-dualpi2-drop-overload-flags
- type: flags
- entries:
- drop- overflow
These enums need to be defined as part of the UAPI in pkt_sched.h and this file needs to be in sync with those definitions.
This enum seems to contradict the comment in sch_dualpi2.c:
bool drop_overload; /* Drop (1) on overload, or overflow (0) */
- name: tc-dualpi2-drop-early-flags
- type: flags
- entries:
- drop-enqueue- drop-dequeue
Also contradicts comment in sch_dualpi2.c:
bool drop_early; /* Drop at enqueue instead of dequeue if true */
- name: tc-dualpi2-ecn-mask-flags
- type: flags
- entries:
- l4s-ect- any-ect- none
- name: tc-dualpi2-credit-queue-flags
- type: flags
- entries:
- C-queue- L-queue
- name: tc-stats type: struct
@@ -816,6 +841,64 @@ definitions: - name: drop-overmemory type: u32
- name: tc-dualpi2-xstats
- type: struct
- members:
-name: probtype: u32doc: Current probability-name: delay-ctype: u32doc: Current C-queue delay in microseconds-name: delay-ltype: u32doc: Current L-queue delay in microseconds-name: pkts-in-ctype: u32doc: Number of packets enqueued in the C-queue-name: pkts-in-ltype: u32doc: Number of packets enqueued in the L-queue-name: maxqtype: u32doc: Maximum number of packets seen by the DualPI2-name: ecn-marktype: u32doc: All packets marked with ecn-name: step-marktype: u32doc: Only packets marked with ecn due to L-queue step AQM-name: credittype: s32doc: Current credit value for WRR
The credit member is declared in the wrong place here. The struct members must match those from struct tc_dualpi2_xstats, in exactly the same order.
-name: credit-queuetype: u8doc: Current credit queueenum: tc-dualpi2-credit-queue-flagsenum-as-flags: true
The credit-queue member does not exist in struct tc_dualpi2_xstats so should be removed from here.
-name: memory-usedtype: u32doc: Memory used in bytes by the DualPI2-name: max-memory-usedtype: u32doc: Maximum memory used in bytes by the DualPI2-name: memory-limittype: u32doc: Memory limit in bytes
- name: tc-fq-pie-xstats type: struct
@@ -2299,6 +2382,83 @@ attribute-sets: - name: quantum type: u32
- name: tc-dualpi2-attrs
- attributes:
-name: limittype: uintdoc: Limit of total number of packets in queue-name: memlimit
The convention used in YNL specs is to use the same naming as the enum definition from the header, with the prefix stripped off. For this attribute that would be TCA_DUALPI2_MEMORY_LIMIT -> memory-limit
type: uintdoc: Memory limit of total number of packets in queue-name: targettype: uintdoc: Classic target delay in microseconds-name: tupdatetype: uintdoc: Drop probability update interval time in microseconds-name: alphatype: uintdoc: Integral gain factor in Hz for PI controller-name: betatype: uintdoc: Proportional gain factor in Hz for PI controller-name: step-threshtype: uintdoc: L4S step marking threshold (see also step-packets)-name: step-packetstype: flagdoc: L4S Step marking threshold unit in packets (otherwise is in microseconds)-name: min-qlen-steptype: uintdoc: Packets enqueued to the L-queue can apply the step threshold when the queue length of L-queue is larger than this value. (0 is recommended)-name: coupling-factor
The definition is TCA_DUALPI2_COUPLING so either this should be "coupling" or the enum name should be expanded.
type: uintdoc: Probability coupling factor between Classic and L4S (2 is recommended)-name: overload
The definition is TCA_DUALPI2_DROP_OVERLOAD so this should be "drop-overload"
type: uintdoc: Control the overload strategy (drop to preserve latency or let the queue overflow)enum: tc-dualpi2-drop-overload-flagsenum-as-flags: true-name: drop-earlytype: uintdoc: Decide where the Classic packets are PI-based dropped or markedenum: tc-dualpi2-drop-early-flagsenum-as-flags: true-name: classic-protection
Also does not match the eum definition. Should the enum name be expanded?
type: uintdoc: Classic WRR weight in percentage (from 0 to 100)-name: ecn-masktype: uintdoc: Configure the L-queue ECN classifierenum: tc-dualpi2-ecn-mask-flagsenum-as-flags: true-name: split-gsotype: flagdoc: Split aggregated skb or not-name: max-rtt
Does not exist in the DUALPI2 enum so should be removed.
type: uintdoc: The maximum expected RTT of the traffic that is controlled by DualPI2 in usec-name: typical-rtt
Also does not exist in the DUALPI2 enum so should be removed.
type: uintdoc: The typical base RTT of the traffic that is controlled by DualPI2 in usec
- name: tc-ematch-attrs attributes:
@@ -3679,6 +3839,9 @@ sub-messages: - value: drr attribute-set: tc-drr-attrs
-value: dualpi2attribute-set: tc-dualpi2-attrs - value: etf attribute-set: tc-etf-attrs@@ -3846,6 +4009,9 @@ sub-messages: - value: codel fixed-header: tc-codel-xstats
-value: dualpi2fixed-header: tc-dualpi2-xstats - value: fq fixed-header: tc-fq-qd-stats-- 2.34.1