From cfd7b7ed8cc99ec119d8f4ad7c82d5a543c04624 Mon Sep 17 00:00:00 2001 From: Sean Khan Date: Sat, 13 Jul 2024 18:56:43 -0400 Subject: [PATCH] iproute2: NSS: sync patch from QSDK 12.5 Signed-off-by: Sean Khan --- .../iproute2/patches/400-add-nss-qdisc.patch | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/package/network/utils/iproute2/patches/400-add-nss-qdisc.patch b/package/network/utils/iproute2/patches/400-add-nss-qdisc.patch index a50b8b81a3..06106df76e 100644 --- a/package/network/utils/iproute2/patches/400-add-nss-qdisc.patch +++ b/package/network/utils/iproute2/patches/400-add-nss-qdisc.patch @@ -36,6 +36,7 @@ + +#define TCA_NSSWRED_MAX (__TCA_NSSWRED_MAX - 1) +#define NSSWRED_CLASS_MAX 6 ++ +struct tc_red_alg_parameter { + __u32 min; /* qlen_avg < min: pkts are all enqueued */ + __u32 max; /* qlen_avg > max: pkts are all dropped */ @@ -247,7 +248,6 @@ + __u8 set_default; /* Sets qdisc to be the default qdisc for enqueue */ + __u8 accel_mode; /* Dictates which data plane offloads the qdisc */ +}; -+ + /* FIFO section */ @@ -264,7 +264,7 @@ --- /dev/null +++ b/tc/q_nss.c -@@ -0,0 +1,1825 @@ +@@ -0,0 +1,1830 @@ +/* + ************************************************************************** + * Copyright (c) 2015, 2018 The Linux Foundation. All rights reserved. @@ -1112,6 +1112,7 @@ +{ + struct rtattr *tb[TCA_NSSTBL_MAX + 1]; + struct tc_nsstbl_qopt *qopt; ++ SPRINT_BUF(b1); + + if (opt == NULL) + return 0; @@ -1126,9 +1127,9 @@ + + qopt = RTA_DATA(tb[TCA_NSSTBL_PARMS]); + -+ print_size(PRINT_FP, NULL, "buffer/maxburst %s ", qopt->burst); ++ fprintf(f, "buffer/maxburst %s ", sprint_size(qopt->burst, b1)); + tc_print_rate(PRINT_FP, NULL, "rate %s ", qopt->rate); -+ print_size(PRINT_FP, NULL, "mtu %s ", qopt->mtu); ++ fprintf(f, "mtu %s ", sprint_size(qopt->mtu, b1)); + fprintf(f, "accel_mode %d ", qopt->accel_mode); + + return 0; @@ -1417,6 +1418,7 @@ +{ + struct rtattr *tb[TCA_NSSBF_MAX + 1]; + struct tc_nssbf_class_qopt *qopt; ++ SPRINT_BUF(b1); + + if (opt == NULL) + return 0; @@ -1431,10 +1433,11 @@ + + qopt = RTA_DATA(tb[TCA_NSSBF_CLASS_PARMS]); + -+ print_size(PRINT_FP, NULL, "burst %s ", qopt->burst); ++ ++ fprintf(f, "burst %s ", sprint_size(qopt->burst, b1)); + tc_print_rate(PRINT_FP, NULL, "rate %s ", qopt->rate); -+ print_size(PRINT_FP, NULL, "quantum %s ", qopt->quantum); -+ print_size(PRINT_FP, NULL, "mtu %s ", qopt->mtu); ++ fprintf(f, "quantum %s ", sprint_size(qopt->quantum, b1)); ++ fprintf(f, "mtu %s ", sprint_size(qopt->mtu, b1)); + + return 0; +} @@ -1593,6 +1596,7 @@ + .print_copt = nsswrr_print_class_opt, +}; + ++ +/* ======================== NSSWFQ =======================*/ + +static void nsswfq_explain_qdisc(void) @@ -1975,6 +1979,7 @@ +{ + struct rtattr *tb[TCA_NSSHTB_MAX + 1]; + struct tc_nsshtb_class_qopt *qopt; ++ SPRINT_BUF(b1); + + if (opt == NULL) + return 0; @@ -1989,13 +1994,13 @@ + + qopt = RTA_DATA(tb[TCA_NSSHTB_CLASS_PARMS]); + -+ print_size(PRINT_FP, NULL, "burst %s ", qopt->burst); ++ fprintf(f, "burst %s ", sprint_size(qopt->burst, b1)); + tc_print_rate(PRINT_FP, NULL, "rate %s ", qopt->rate); -+ print_size(PRINT_FP, NULL, "cburst %s ", qopt->cburst); ++ fprintf(f, "cburst %s ", sprint_size(qopt->cburst, b1)); + tc_print_rate(PRINT_FP, NULL, "crate %s ", qopt->crate); + fprintf(f, "priority %u ", qopt->priority); -+ print_size(PRINT_FP, NULL, "quantum %s ", qopt->quantum); -+ print_size(PRINT_FP, NULL, "overhead %s ", qopt->overhead); ++ fprintf(f, "quantum %s ", sprint_size(qopt->quantum, b1)); ++ fprintf(f, "overhead %s ", sprint_size(qopt->overhead, b1)); + + return 0; +}