netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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: Jamal Hadi Salim <jhs@mojatatu.com>,
	Victor Nogueira <victor@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 v2 net-next] net_sched: sch_fq: add three drop_reason
Date: Thu, 05 Dec 2024 12:57:06 +0100	[thread overview]
Message-ID: <875xny9wbx.fsf@toke.dk> (raw)
In-Reply-To: <20241204171950.89829-1-edumazet@google.com>

Eric Dumazet <edumazet@google.com> writes:

> Add three new drop_reason, more precise than generic QDISC_DROP:
>
> "tc -s qd" show aggregate counters, it might be more useful
> to use drop_reason infrastructure for bug hunting.
>
> 1) SKB_DROP_REASON_FQ_BAND_LIMIT
>    Whenever a packet is added while its band limit is hit.
>    Corresponding value in "tc -s qd" is bandX_drops XXXX
>
> 2) SKB_DROP_REASON_FQ_HORIZON_LIMIT
>    Whenever a packet has a timestamp too far in the future.
>    Corresponding value in "tc -s qd" is horizon_drops XXXX
>
> 3) SKB_DROP_REASON_FQ_FLOW_LIMIT
>    Whenever a flow has reached its limit.
>    Corresponding value in "tc -s qd" is flows_plimit XXXX
>
> Tested:
> tc qd replace dev eth1 root fq flow_limit 10 limit 100000
> perf record -a -e skb:kfree_skb sleep 1; perf script
>
>       udp_stream   12329 [004]   216.929492: skb:kfree_skb: skbaddr=0xffff888eabe17e00 rx_sk=(nil) protocol=34525 location=__dev_queue_xmit+0x9d9 reason: FQ_FLOW_LIMIT
>       udp_stream   12385 [006]   216.929593: skb:kfree_skb: skbaddr=0xffff888ef8827f00 rx_sk=(nil) protocol=34525 location=__dev_queue_xmit+0x9d9 reason: FQ_FLOW_LIMIT
>       udp_stream   12389 [005]   216.929871: skb:kfree_skb: skbaddr=0xffff888ecb9ba500 rx_sk=(nil) protocol=34525 location=__dev_queue_xmit+0x9d9 reason: FQ_FLOW_LIMIT
>       udp_stream   12316 [009]   216.930398: skb:kfree_skb: skbaddr=0xffff888eca286b00 rx_sk=(nil) protocol=34525 location=__dev_queue_xmit+0x9d9 reason: FQ_FLOW_LIMIT
>       udp_stream   12400 [008]   216.930490: skb:kfree_skb: skbaddr=0xffff888eabf93d00 rx_sk=(nil) protocol=34525 location=__dev_queue_xmit+0x9d9 reason: FQ_FLOW_LIMIT
>
> tc qd replace dev eth1 root fq flow_limit 100 limit 10000
> perf record -a -e skb:kfree_skb sleep 1; perf script
>
>       udp_stream   18074 [001]  1058.318040: skb:kfree_skb: skbaddr=0xffffa23c881fc000 rx_sk=(nil) protocol=34525 location=__dev_queue_xmit+0x9d9 reason: FQ_BAND_LIMIT
>       udp_stream   18126 [005]  1058.320651: skb:kfree_skb: skbaddr=0xffffa23c6aad4000 rx_sk=(nil) protocol=34525 location=__dev_queue_xmit+0x9d9 reason: FQ_BAND_LIMIT
>       udp_stream   18118 [006]  1058.321065: skb:kfree_skb: skbaddr=0xffffa23df0d48a00 rx_sk=(nil) protocol=34525 location=__dev_queue_xmit+0x9d9 reason: FQ_BAND_LIMIT
>       udp_stream   18074 [001]  1058.321126: skb:kfree_skb: skbaddr=0xffffa23c881ffa00 rx_sk=(nil) protocol=34525 location=__dev_queue_xmit+0x9d9 reason: FQ_BAND_LIMIT
>       udp_stream   15815 [003]  1058.321224: skb:kfree_skb: skbaddr=0xffffa23c9835db00 rx_sk=(nil) protocol=34525 location=__dev_queue_xmit+0x9d9 reason: FQ_BAND_LIMIT
>
> tc -s -d qd sh dev eth1
> qdisc fq 8023: root refcnt 257 limit 10000p flow_limit 100p buckets 1024 orphan_mask 1023
>  bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 weights 589824 196608 65536 quantum 18Kb
>  initial_quantum 92120b low_rate_threshold 550Kbit refill_delay 40ms
>  timer_slack 10us horizon 10s horizon_drop
>  Sent 492439603330 bytes 336953991 pkt (dropped 61724094, overlimits 0 requeues 4463)
>  backlog 14611228b 9995p requeues 4463
>   flows 2965 (inactive 1151 throttled 0) band0_pkts 0 band1_pkts 9993 band2_pkts 0
>   gc 6347 highprio 0 fastpath 30 throttled 5 latency 2.32us flows_plimit 7403693
>  band1_drops 54320401
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Nice to see qdisc-specific drop reasons - guess I should look at this
for sch_cake as well!

Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>


  parent reply	other threads:[~2024-12-05 11:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-04 17:19 [PATCH v2 net-next] net_sched: sch_fq: add three drop_reason Eric Dumazet
2024-12-05  1:07 ` Victor Nogueira
2024-12-05 11:57 ` Toke Høiland-Jørgensen [this message]
2024-12-05 12:41   ` Jamal Hadi Salim
2024-12-08  2:43 ` Jakub Kicinski

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=875xny9wbx.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=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=victor@mojatatu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).