netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2 0/3] net_sched: sch_sfq: reject a derived limit of 1
@ 2025-04-02 16:27 Octavian Purdila
  2025-04-02 16:27 ` [PATCH net v2 1/3] net_sched: sch_sfq: use a temporary work area for validating configuration Octavian Purdila
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Octavian Purdila @ 2025-04-02 16:27 UTC (permalink / raw)
  To: jhs, xiyou.wangcong, jiri
  Cc: davem, edumazet, kuba, pabeni, horms, shuah, netdev,
	Octavian Purdila

Because sfq parameters can influence each other there can be
situations where although the user sets a limit of 2 it can be lowered
to 1:

$ tc qdisc add dev dummy0 handle 1: root sfq limit 2 flows 1 depth 1
$ tc qdisc show dev dummy0
qdisc sfq 1: dev dummy0 root refcnt 2 limit 1p quantum 1514b depth 1 divisor 1024

$ tc qdisc add dev dummy0 handle 1: root sfq limit 2 flows 10 depth 1 divisor 1
$ tc qdisc show dev dummy0
qdisc sfq 2: root refcnt 2 limit 1p quantum 1514b depth 1 divisor 1

As a limit of 1 is invalid, this patch series moves the limit
validation to after all configuration changes have been done. To do
so, the configuration is done in a temporary work area then applied to
the internal state.

The patch series also adds new test cases.

Changes in v2:
 - remove tmp struct and directly use local variables

v1: https://lore.kernel.org/all/20250328201634.3876474-1-tavip@google.com/


Octavian Purdila (3):
  net_sched: sch_sfq: use a temporary work area for validating
    configuration
  net_sched: sch_sfq: move the limit validation
  selftests/tc-testing: sfq: check that a derived limit of 1 is rejected

 net/sched/sch_sfq.c                           | 68 ++++++++++++++-----
 .../tc-testing/tc-tests/qdiscs/sfq.json       | 36 ++++++++++
 2 files changed, 88 insertions(+), 16 deletions(-)

-- 
2.49.0.472.ge94155a9ec-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-04-03 21:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-02 16:27 [PATCH net v2 0/3] net_sched: sch_sfq: reject a derived limit of 1 Octavian Purdila
2025-04-02 16:27 ` [PATCH net v2 1/3] net_sched: sch_sfq: use a temporary work area for validating configuration Octavian Purdila
2025-04-02 20:46   ` Stephen Hemminger
2025-04-03  8:50     ` Octavian Purdila
2025-04-02 16:27 ` [PATCH net v2 2/3] net_sched: sch_sfq: move the limit validation Octavian Purdila
2025-04-02 16:27 ` [PATCH net v2 3/3] selftests/tc-testing: sfq: check that a derived limit of 1 is rejected Octavian Purdila
2025-04-03 21:43 ` [PATCH net v2 0/3] net_sched: sch_sfq: reject a derived limit of 1 Cong Wang

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).