mbox series

[v4,net-next,00/11] Improve the taprio qdisc's relationship with its children

Message ID 20230807193324.4128292-1-vladimir.oltean@nxp.com (mailing list archive)
Headers show
Series Improve the taprio qdisc's relationship with its children | expand

Message

Vladimir Oltean Aug. 7, 2023, 7:33 p.m. UTC
Changes in v4:
- Clean up some leftovers in the ptp_mock driver.
- Add CONFIG_PTP_1588_CLOCK_MOCK to tools/testing/selftests/tc-testing/config
- Wait for taprio schedule to become operational in the selftests

Changes in v3:
Fix ptp_mock compilation as module, fix small mistakes in selftests.

Changes in v2:
It was requested to add test cases for the taprio software and offload modes.
Those are patches 08 and 09.

That implies adding taprio offload support to netdevsim, which is patch 07.

In turn, that implies adding a PHC driver for netdevsim, which is patch 06.

v1 at:
https://lore.kernel.org/lkml/20230531173928.1942027-1-vladimir.oltean@nxp.com/

Original message:

Prompted by Vinicius' request to consolidate some child Qdisc
dereferences in taprio:
https://lore.kernel.org/netdev/87edmxv7x2.fsf@intel.com/

I remembered that I had left some unfinished work in this Qdisc, namely
commit af7b29b1deaa ("Revert "net/sched: taprio: make qdisc_leaf() see
the per-netdev-queue pfifo child qdiscs"").

This patch set represents another stab at, essentially, what's in the
title. Not only does taprio not properly detect when it's grafted as a
non-root qdisc, but it also returns incorrect per-class stats.
Eventually, Vinicius' request is addressed too, although in a different
form than the one he requested (which was purely cosmetic).

Review from people more experienced with Qdiscs than me would be
appreciated. I tried my best to explain what I consider to be problems.
I am deliberately targeting net-next because the changes are too
invasive for net - they were reverted from stable once already.

Vladimir Oltean (11):
  net/sched: taprio: don't access q->qdiscs[] in unoffloaded mode during
    attach()
  net/sched: taprio: keep child Qdisc refcount elevated at 2 in offload
    mode
  net/sched: taprio: try again to report q->qdiscs[] to qdisc_leaf()
  net/sched: taprio: delete misleading comment about preallocating child
    qdiscs
  net/sched: taprio: dump class stats for the actual q->qdiscs[]
  net: ptp: create a mock-up PTP Hardware Clock driver
  net: netdevsim: use mock PHC driver
  net: netdevsim: mimic tc-taprio offload
  selftests/tc-testing: add ptp_mock Kconfig dependency
  selftests/tc-testing: test that taprio can only be attached as root
  selftests/tc-testing: verify that a qdisc can be grafted onto a taprio
    class

 MAINTAINERS                                   |   7 +
 drivers/net/Kconfig                           |   1 +
 drivers/net/netdevsim/ethtool.c               |  11 ++
 drivers/net/netdevsim/netdev.c                |  38 +++-
 drivers/net/netdevsim/netdevsim.h             |   2 +
 drivers/ptp/Kconfig                           |  11 ++
 drivers/ptp/Makefile                          |   1 +
 drivers/ptp/ptp_mock.c                        | 175 ++++++++++++++++++
 include/linux/ptp_mock.h                      |  38 ++++
 net/sched/sch_taprio.c                        |  68 ++++---
 tools/testing/selftests/tc-testing/config     |   3 +-
 .../tc-testing/taprio_wait_for_admin.sh       |  16 ++
 .../tc-testing/tc-tests/qdiscs/taprio.json    | 102 +++++++++-
 13 files changed, 443 insertions(+), 30 deletions(-)
 create mode 100644 drivers/ptp/ptp_mock.c
 create mode 100644 include/linux/ptp_mock.h
 create mode 100755 tools/testing/selftests/tc-testing/taprio_wait_for_admin.sh

Comments

patchwork-bot+netdevbpf@kernel.org Aug. 9, 2023, 11:10 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon,  7 Aug 2023 22:33:13 +0300 you wrote:
> Changes in v4:
> - Clean up some leftovers in the ptp_mock driver.
> - Add CONFIG_PTP_1588_CLOCK_MOCK to tools/testing/selftests/tc-testing/config
> - Wait for taprio schedule to become operational in the selftests
> 
> Changes in v3:
> Fix ptp_mock compilation as module, fix small mistakes in selftests.
> 
> [...]

Here is the summary with links:
  - [v4,net-next,01/11] net/sched: taprio: don't access q->qdiscs[] in unoffloaded mode during attach()
    https://git.kernel.org/netdev/net-next/c/09e0c3bbde90
  - [v4,net-next,02/11] net/sched: taprio: keep child Qdisc refcount elevated at 2 in offload mode
    https://git.kernel.org/netdev/net-next/c/25b0d4e4e41f
  - [v4,net-next,03/11] net/sched: taprio: try again to report q->qdiscs[] to qdisc_leaf()
    https://git.kernel.org/netdev/net-next/c/98766add2d55
  - [v4,net-next,04/11] net/sched: taprio: delete misleading comment about preallocating child qdiscs
    https://git.kernel.org/netdev/net-next/c/6e0ec800c174
  - [v4,net-next,05/11] net/sched: taprio: dump class stats for the actual q->qdiscs[]
    https://git.kernel.org/netdev/net-next/c/665338b2a7a0
  - [v4,net-next,06/11] net: ptp: create a mock-up PTP Hardware Clock driver
    https://git.kernel.org/netdev/net-next/c/40b0425f8ba1
  - [v4,net-next,07/11] net: netdevsim: use mock PHC driver
    https://git.kernel.org/netdev/net-next/c/b63e78fca889
  - [v4,net-next,08/11] net: netdevsim: mimic tc-taprio offload
    https://git.kernel.org/netdev/net-next/c/35da47fe1c47
  - [v4,net-next,09/11] selftests/tc-testing: add ptp_mock Kconfig dependency
    https://git.kernel.org/netdev/net-next/c/355adce3010b
  - [v4,net-next,10/11] selftests/tc-testing: test that taprio can only be attached as root
    https://git.kernel.org/netdev/net-next/c/1890cf08bd99
  - [v4,net-next,11/11] selftests/tc-testing: verify that a qdisc can be grafted onto a taprio class
    https://git.kernel.org/netdev/net-next/c/29c298d2bc82

You are awesome, thank you!