Skip to content

Commit 8aad37d

Browse files
committed
Merge branch 'dualpi2-patch'
Chia-Yu Chang says: ==================== DUALPI2 patch This patch serise adds DualPI Improved with a Square (DualPI2) with following features: * Supports congestion controls that comply with the Prague requirements in RFC9331 (e.g. TCP-Prague) * Coupled dual-queue that separates the L4S traffic in a low latency queue (L-queue), without harming remaining traffic that is scheduled in classic queue (C-queue) due to congestion-coupling using PI2 as defined in RFC9332 * Configurable overload strategies * Use of sojourn time to reliably estimate queue delay * Supports ECN L4S-identifier (IP.ECN==0b*1) to classify traffic into respective queues For more details of DualPI2, please refer IETF RFC9332 (https://datatracker.ietf.org/doc/html/rfc9332). ==================== Link: https://patch.msgid.link/20250722095915.24485-1-chia-yu.chang@nokia-bell-labs.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 1cdf3f2 + 68db0ff commit 8aad37d

File tree

9 files changed

+1669
-5
lines changed

9 files changed

+1669
-5
lines changed

Documentation/netlink/specs/tc.yaml

Lines changed: 149 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,23 @@ definitions:
5656
- tundf
5757
- tunoam
5858
- tuncrit
59+
-
60+
name: dualpi2-drop-overload
61+
type: enum
62+
entries: [overflow, drop]
63+
-
64+
name: dualpi2-drop-early
65+
type: enum
66+
entries: [drop-dequeue, drop-enqueue]
67+
-
68+
name: dualpi2-ecn-mask
69+
type: enum
70+
value-start: 1
71+
entries: [l4s-ect, cla-ect, any-ect]
72+
-
73+
name: dualpi2-split-gso
74+
type: enum
75+
entries: [no-split-gso, split-gso]
5976
-
6077
name: tc-stats
6178
type: struct
@@ -825,6 +842,58 @@ definitions:
825842
-
826843
name: drop-overmemory
827844
type: u32
845+
-
846+
name: tc-dualpi2-xstats
847+
type: struct
848+
members:
849+
-
850+
name: prob
851+
type: u32
852+
doc: Current base PI probability
853+
-
854+
name: delay-c
855+
type: u32
856+
doc: Current C-queue delay in microseconds
857+
-
858+
name: delay-l
859+
type: u32
860+
doc: Current L-queue delay in microseconds
861+
-
862+
name: pkts-in-c
863+
type: u32
864+
doc: Number of packets enqueued in the C-queue
865+
-
866+
name: pkts-in-l
867+
type: u32
868+
doc: Number of packets enqueued in the L-queue
869+
-
870+
name: maxq
871+
type: u32
872+
doc: Maximum number of packets seen by the DualPI2
873+
-
874+
name: ecn-mark
875+
type: u32
876+
doc: All packets marked with ECN
877+
-
878+
name: step-mark
879+
type: u32
880+
doc: Only packets marked with ECN due to L-queue step AQM
881+
-
882+
name: credit
883+
type: s32
884+
doc: Current credit value for WRR
885+
-
886+
name: memory-used
887+
type: u32
888+
doc: Memory used in bytes by the DualPI2
889+
-
890+
name: max-memory-used
891+
type: u32
892+
doc: Maximum memory used in bytes by the DualPI2
893+
-
894+
name: memory-limit
895+
type: u32
896+
doc: Memory limit in bytes
828897
-
829898
name: tc-fq-pie-xstats
830899
type: struct
@@ -848,7 +917,7 @@ definitions:
848917
-
849918
name: ecn-mark
850919
type: u32
851-
doc: Packets marked with ecn
920+
doc: Packets marked with ECN
852921
-
853922
name: new-flow-count
854923
type: u32
@@ -991,7 +1060,7 @@ definitions:
9911060
-
9921061
name: ecn-mark
9931062
type: u32
994-
doc: Packets marked with ecn
1063+
doc: Packets marked with ECN
9951064
-
9961065
name: tc-red-xstats
9971066
type: struct
@@ -2284,6 +2353,78 @@ attribute-sets:
22842353
-
22852354
name: quantum
22862355
type: u32
2356+
-
2357+
name: dualpi2-attrs
2358+
name-prefix: tca-dualpi2-
2359+
attributes:
2360+
-
2361+
name: limit
2362+
type: u32
2363+
doc: Limit of total number of packets in queue
2364+
-
2365+
name: memory-limit
2366+
type: u32
2367+
doc: Memory limit of total number of packets in queue
2368+
-
2369+
name: target
2370+
type: u32
2371+
doc: Classic target delay in microseconds
2372+
-
2373+
name: tupdate
2374+
type: u32
2375+
doc: Drop probability update interval time in microseconds
2376+
-
2377+
name: alpha
2378+
type: u32
2379+
doc: Integral gain factor in Hz for PI controller
2380+
-
2381+
name: beta
2382+
type: u32
2383+
doc: Proportional gain factor in Hz for PI controller
2384+
-
2385+
name: step-thresh-pkts
2386+
type: u32
2387+
doc: L4S step marking threshold in packets
2388+
-
2389+
name: step-thresh-us
2390+
type: u32
2391+
doc: L4S Step marking threshold in microseconds
2392+
-
2393+
name: min-qlen-step
2394+
type: u32
2395+
doc: Packets enqueued to the L-queue can apply the step threshold
2396+
when the queue length of L-queue is larger than this value.
2397+
(0 is recommended)
2398+
-
2399+
name: coupling
2400+
type: u8
2401+
doc: Probability coupling factor between Classic and L4S
2402+
(2 is recommended)
2403+
-
2404+
name: drop-overload
2405+
type: u8
2406+
doc: Control the overload strategy (drop to preserve latency or
2407+
let the queue overflow)
2408+
enum: dualpi2-drop-overload
2409+
-
2410+
name: drop-early
2411+
type: u8
2412+
doc: Decide where the Classic packets are PI-based dropped or marked
2413+
enum: dualpi2-drop-early
2414+
-
2415+
name: c-protection
2416+
type: u8
2417+
doc: Classic WRR weight in percentage (from 0 to 100)
2418+
-
2419+
name: ecn-mask
2420+
type: u8
2421+
doc: Configure the L-queue ECN classifier
2422+
enum: dualpi2-ecn-mask
2423+
-
2424+
name: split-gso
2425+
type: u8
2426+
doc: Split aggregated skb or not
2427+
enum: dualpi2-split-gso
22872428
-
22882429
name: ematch-attrs
22892430
name-prefix: tca-ematch-
@@ -3708,6 +3849,9 @@ sub-messages:
37083849
-
37093850
value: drr
37103851
attribute-set: drr-attrs
3852+
-
3853+
value: dualpi2
3854+
attribute-set: dualpi2-attrs
37113855
-
37123856
value: etf
37133857
attribute-set: etf-attrs
@@ -3875,6 +4019,9 @@ sub-messages:
38754019
-
38764020
value: codel
38774021
fixed-header: tc-codel-xstats
4022+
-
4023+
value: dualpi2
4024+
fixed-header: tc-dualpi2-xstats
38784025
-
38794026
value: fq
38804027
fixed-header: tc-fq-qd-stats

include/net/dropreason-core.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
FN(CANFD_RX_INVALID_FRAME) \
127127
FN(CANXL_RX_INVALID_FRAME) \
128128
FN(PFMEMALLOC) \
129+
FN(DUALPI2_STEP_DROP) \
129130
FNe(MAX)
130131

131132
/**
@@ -604,6 +605,11 @@ enum skb_drop_reason {
604605
* reached a path or socket not eligible for use of memory reserves
605606
*/
606607
SKB_DROP_REASON_PFMEMALLOC,
608+
/**
609+
* @SKB_DROP_REASON_DUALPI2_STEP_DROP: dropped by the step drop
610+
* threshold of DualPI2 qdisc.
611+
*/
612+
SKB_DROP_REASON_DUALPI2_STEP_DROP,
607613
/**
608614
* @SKB_DROP_REASON_MAX: the maximum of core drop reasons, which
609615
* shouldn't be used as a real 'reason' - only for tracing code gen

include/uapi/linux/pkt_sched.h

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,4 +1211,72 @@ enum {
12111211

12121212
#define TCA_ETS_MAX (__TCA_ETS_MAX - 1)
12131213

1214+
/* DUALPI2 */
1215+
enum tc_dualpi2_drop_overload {
1216+
TC_DUALPI2_DROP_OVERLOAD_OVERFLOW = 0,
1217+
TC_DUALPI2_DROP_OVERLOAD_DROP = 1,
1218+
__TCA_DUALPI2_DROP_OVERLOAD_MAX,
1219+
};
1220+
#define TCA_DUALPI2_DROP_OVERLOAD_MAX (__TCA_DUALPI2_DROP_OVERLOAD_MAX - 1)
1221+
1222+
enum tc_dualpi2_drop_early {
1223+
TC_DUALPI2_DROP_EARLY_DROP_DEQUEUE = 0,
1224+
TC_DUALPI2_DROP_EARLY_DROP_ENQUEUE = 1,
1225+
__TCA_DUALPI2_DROP_EARLY_MAX,
1226+
};
1227+
#define TCA_DUALPI2_DROP_EARLY_MAX (__TCA_DUALPI2_DROP_EARLY_MAX - 1)
1228+
1229+
enum tc_dualpi2_ecn_mask {
1230+
TC_DUALPI2_ECN_MASK_L4S_ECT = 1,
1231+
TC_DUALPI2_ECN_MASK_CLA_ECT = 2,
1232+
TC_DUALPI2_ECN_MASK_ANY_ECT = 3,
1233+
__TCA_DUALPI2_ECN_MASK_MAX,
1234+
};
1235+
#define TCA_DUALPI2_ECN_MASK_MAX (__TCA_DUALPI2_ECN_MASK_MAX - 1)
1236+
1237+
enum tc_dualpi2_split_gso {
1238+
TC_DUALPI2_SPLIT_GSO_NO_SPLIT_GSO = 0,
1239+
TC_DUALPI2_SPLIT_GSO_SPLIT_GSO = 1,
1240+
__TCA_DUALPI2_SPLIT_GSO_MAX,
1241+
};
1242+
#define TCA_DUALPI2_SPLIT_GSO_MAX (__TCA_DUALPI2_SPLIT_GSO_MAX - 1)
1243+
1244+
enum {
1245+
TCA_DUALPI2_UNSPEC,
1246+
TCA_DUALPI2_LIMIT, /* Packets */
1247+
TCA_DUALPI2_MEMORY_LIMIT, /* Bytes */
1248+
TCA_DUALPI2_TARGET, /* us */
1249+
TCA_DUALPI2_TUPDATE, /* us */
1250+
TCA_DUALPI2_ALPHA, /* Hz scaled up by 256 */
1251+
TCA_DUALPI2_BETA, /* Hz scaled up by 256 */
1252+
TCA_DUALPI2_STEP_THRESH_PKTS, /* Step threshold in packets */
1253+
TCA_DUALPI2_STEP_THRESH_US, /* Step threshold in microseconds */
1254+
TCA_DUALPI2_MIN_QLEN_STEP, /* Minimum qlen to apply STEP_THRESH */
1255+
TCA_DUALPI2_COUPLING, /* Coupling factor between queues */
1256+
TCA_DUALPI2_DROP_OVERLOAD, /* Whether to drop on overload */
1257+
TCA_DUALPI2_DROP_EARLY, /* Whether to drop on enqueue */
1258+
TCA_DUALPI2_C_PROTECTION, /* Percentage */
1259+
TCA_DUALPI2_ECN_MASK, /* L4S queue classification mask */
1260+
TCA_DUALPI2_SPLIT_GSO, /* Split GSO packets at enqueue */
1261+
TCA_DUALPI2_PAD,
1262+
__TCA_DUALPI2_MAX
1263+
};
1264+
1265+
#define TCA_DUALPI2_MAX (__TCA_DUALPI2_MAX - 1)
1266+
1267+
struct tc_dualpi2_xstats {
1268+
__u32 prob; /* current probability */
1269+
__u32 delay_c; /* current delay in C queue */
1270+
__u32 delay_l; /* current delay in L queue */
1271+
__u32 packets_in_c; /* number of packets enqueued in C queue */
1272+
__u32 packets_in_l; /* number of packets enqueued in L queue */
1273+
__u32 maxq; /* maximum queue size */
1274+
__u32 ecn_mark; /* packets marked with ecn*/
1275+
__u32 step_marks; /* ECN marks due to the step AQM */
1276+
__s32 credit; /* current c_protection credit */
1277+
__u32 memory_used; /* Memory used by both queues */
1278+
__u32 max_memory_used; /* Maximum used memory */
1279+
__u32 memory_limit; /* Memory limit of both queues */
1280+
};
1281+
12141282
#endif

net/sched/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,18 @@ config NET_SCH_BPF
415415

416416
If unsure, say N.
417417

418+
config NET_SCH_DUALPI2
419+
tristate "Dual Queue PI Square (DUALPI2) scheduler"
420+
help
421+
Say Y here if you want to use the Dual Queue Proportional Integral
422+
Controller Improved with a Square scheduling algorithm.
423+
For more information, please see https://tools.ietf.org/html/rfc9332
424+
425+
To compile this driver as a module, choose M here: the module
426+
will be called sch_dualpi2.
427+
428+
If unsure, say N.
429+
418430
menuconfig NET_SCH_DEFAULT
419431
bool "Allow override default queue discipline"
420432
help

net/sched/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ obj-$(CONFIG_NET_SCH_CBS) += sch_cbs.o
6363
obj-$(CONFIG_NET_SCH_ETF) += sch_etf.o
6464
obj-$(CONFIG_NET_SCH_TAPRIO) += sch_taprio.o
6565
obj-$(CONFIG_NET_SCH_BPF) += bpf_qdisc.o
66+
obj-$(CONFIG_NET_SCH_DUALPI2) += sch_dualpi2.o
6667

6768
obj-$(CONFIG_NET_CLS_U32) += cls_u32.o
6869
obj-$(CONFIG_NET_CLS_ROUTE4) += cls_route.o

0 commit comments

Comments
 (0)