mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Martin Ottens <martin.ottens@fau.de>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Jiri Pirko <jiri@resnulli.us>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net/sched: netem: account for backlog updates from child qdisc
Date: Wed, 4 Dec 2024 12:47:15 +0100	[thread overview]
Message-ID: <ce09216d-ccb2-4cf3-8c68-4de468411db5@fau.de> (raw)
In-Reply-To: <20241202191312.3d3c8097@kernel.org>

On 03.12.24 04:13, Jakub Kicinski wrote:
> I don't understand why we need to perform packet accounting 
> in a separate new member (t_len). You seem to fix qlen accounting,
> anyway, and I think sch->limit should apply to the qdisc and all
> its children. Not just qdisc directly (since most classful qdiscs
> don't hold packets).

Netem is a classful qdisc but different from others because it holds 
packets in its internal tfifo and optional additionally in a child 
qdisc. However, sch->limit currently only considers the packets in 
the tfifo and not the packets hold by a child, but child qdiscs 
expect this value to refer to the number of packets that are in 
netem and all its children together. If the children change this 
value (using 'qdisc_tree_reduce_backlog'), then the number of 
packets in the tfifo no longer matches sch->limit.
By adding t_len, the number of packets in the tfifo will be tracked 
independently from sch->limit therefore sch->limit can be changes 
by children without unwanted behavior. t_len is required, because 
currently the limit option of netem refers to the maximum number 
of packets in the tfifo - therefore the behavior of netem is not
changed by this patch.

> I'm not a qdisc expert, so if you feel confident about this code you
> need to explain the thinking in the commit message..

With the patch I try to fix the error without changing the behavior 
of netem (e.g., change the meaning of the limit option to apply to 
the tfifo length and the packets in the child qdisc). Maybe there 
are even better approaches - I am happy about any feedback. I will 
revise the explanation in the patch to make this clearer and 
resubmit it.

  reply	other threads:[~2024-12-04 11:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-25 23:18 Martin Ottens
2024-12-03  3:13 ` Jakub Kicinski
2024-12-04 11:47   ` Martin Ottens [this message]
2024-12-04 12:29   ` [PATCH v2] " Martin Ottens
2024-12-05 12:40     ` Jamal Hadi Salim
2024-12-07 16:37       ` Martin Ottens
2024-12-09 21:13         ` Jamal Hadi Salim
2024-12-09 22:44           ` Jamal Hadi Salim

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=ce09216d-ccb2-4cf3-8c68-4de468411db5@fau.de \
    --to=martin.ottens@fau.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stephen@networkplumber.org \
    --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

all inboxes | Powered by JetHome®