From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Eric Dumazet <edumazet@google.com>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Willem de Bruijn <willemb@google.com>,
Soheil Hassas Yeganeh <soheil@google.com>,
Neal Cardwell <ncardwell@google.com>,
Jamal Hadi Salim <jhs@mojatatu.com>,
Cong Wang <xiyou.wangcong@gmail.com>,
Jiri Pirko <jiri@resnulli.us>,
netdev@vger.kernel.org, eric.dumazet@gmail.com,
Eric Dumazet <edumazet@google.com>
Subject: Re: [PATCH net-next 4/4] net_sched: sch_fq: add TCA_FQ_WEIGHTS attribute
Date: Mon, 02 Oct 2023 13:47:31 +0200 [thread overview]
Message-ID: <87bkdhgsa4.fsf@toke.dk> (raw)
In-Reply-To: <20231001145102.733450-5-edumazet@google.com>
Eric Dumazet <edumazet@google.com> writes:
> This attribute can be used to tune the per band weight
> and report them in "tc qdisc show" output:
>
> qdisc fq 802f: parent 1:9 limit 100000p flow_limit 500p buckets 1024 orphan_mask 1023
> quantum 8364b initial_quantum 41820b low_rate_threshold 550Kbit
> refill_delay 40ms timer_slack 10us horizon 10s horizon_drop
> bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 weights 589824 196608 65536
> Sent 236460814 bytes 792991 pkt (dropped 0, overlimits 0 requeues 0)
> rate 25816bit 10pps backlog 0b 0p requeues 0
> flows 4 (inactive 4 throttled 0)
> gc 0 throttled 19 latency 17.6us fastpath 773882
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
> include/uapi/linux/pkt_sched.h | 3 +++
> net/sched/sch_fq.c | 32 ++++++++++++++++++++++++++++++++
> 2 files changed, 35 insertions(+)
>
> diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
> index ec5ab44d41a2493130670870dc9e68c71187740f..f762a10bfb78ed896d8a5b936045a956d97b3831 100644
> --- a/include/uapi/linux/pkt_sched.h
> +++ b/include/uapi/linux/pkt_sched.h
> @@ -943,12 +943,15 @@ enum {
>
> TCA_FQ_PRIOMAP, /* prio2band */
>
> + TCA_FQ_WEIGHTS, /* Weights for each band */
> +
> __TCA_FQ_MAX
> };
>
> #define TCA_FQ_MAX (__TCA_FQ_MAX - 1)
>
> #define FQ_BANDS 3
> +#define FQ_MIN_WEIGHT 16384
>
> struct tc_fq_qd_stats {
> __u64 gc_flows;
> diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c
> index 1bae145750a66f769bd30f1db09203f725801249..1a411fe36c79a86635f319c230a045d653571700 100644
> --- a/net/sched/sch_fq.c
> +++ b/net/sched/sch_fq.c
> @@ -919,6 +919,10 @@ static const struct nla_policy fq_policy[TCA_FQ_MAX + 1] = {
> .type = NLA_BINARY,
> .len = sizeof(struct tc_prio_qopt),
> },
> + [TCA_FQ_WEIGHTS] = {
> + .type = NLA_BINARY,
> + .len = FQ_BANDS * sizeof(s32),
> + },
> };
>
> /* compress a u8 array with all elems <= 3 to an array of 2-bit fields */
> @@ -941,6 +945,24 @@ static void fq_prio2band_decompress_crumb(const u8 *in, u8 *out)
> out[i] = fq_prio2band(in, i);
> }
>
> +static int fq_load_weights(struct fq_sched_data *q,
> + const struct nlattr *attr,
> + struct netlink_ext_ack *extack)
> +{
> + s32 *weights = nla_data(attr);
> + int i;
> +
> + for (i = 0; i < FQ_BANDS; i++) {
> + if (weights[i] < FQ_MIN_WEIGHT) {
> + NL_SET_ERR_MSG_MOD(extack, "Incorrect weight");
As in the previous patch, can we be a bit more specific here? "Weight %d
less that minimum allowed %d"?
-Toke
next prev parent reply other threads:[~2023-10-02 11:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-01 14:50 [PATCH net-next 0/4] net_sched: sch_fq: add WRR scheduling and 3 bands Eric Dumazet
2023-10-01 14:50 ` [PATCH net-next 1/4] net_sched: sch_fq: remove q->ktime_cache Eric Dumazet
2023-10-01 14:51 ` [PATCH net-next 2/4] net_sched: export pfifo_fast prio2band[] Eric Dumazet
2023-10-01 14:51 ` [PATCH net-next 3/4] net_sched: sch_fq: add 3 bands and WRR scheduling Eric Dumazet
2023-10-01 22:15 ` Soheil Hassas Yeganeh
2023-10-02 11:46 ` Toke Høiland-Jørgensen
2023-10-02 12:23 ` Eric Dumazet
2023-10-01 14:51 ` [PATCH net-next 4/4] net_sched: sch_fq: add TCA_FQ_WEIGHTS attribute Eric Dumazet
2023-10-02 11:47 ` Toke Høiland-Jørgensen [this message]
2023-10-02 12:24 ` Eric Dumazet
2023-10-01 15:10 ` [PATCH net-next 0/4] net_sched: sch_fq: add WRR scheduling and 3 bands Dave Taht
2023-10-02 6:48 ` Willem de Bruijn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bkdhgsa4.fsf@toke.dk \
--to=toke@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=soheil@google.com \
--cc=willemb@google.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.