Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 0/8] DSA selftests
@ 2022-04-22 10:14 Vladimir Oltean
  2022-04-22 10:14 ` [PATCH net-next 1/8] selftests: forwarding: add option to run tests with stable MAC addresses Vladimir Oltean
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Vladimir Oltean @ 2022-04-22 10:14 UTC (permalink / raw)
  To: netdev
  Cc: Jakub Kicinski, David S. Miller, Paolo Abeni, Florian Fainelli,
	Andrew Lunn, Vivien Didelot, Vladimir Oltean, Claudiu Manoil,
	Alexandre Belloni, UNGLinuxDriver, Tobias Waldekranz,
	Mattias Forsblad, Roopa Prabhu, Nikolay Aleksandrov, Jiri Pirko,
	Ido Schimmel, Joachim Wiberg, Marek Behún, Ansuel Smith,
	DENG Qingfang, Kurt Kanzenbach

When working on complex new features or reworks it becomes increasingly
difficult to ensure there aren't regressions being introduced, and
therefore it would be nice if we could go over the functionality we
already have and write some tests for it.

Verbally I know from Tobias Waldekranz that he has been working on some
selftests for DSA, yet I have never seen them, so here I am adding some
tests I have written which have been useful for me. The list is by no
means complete (it only covers elementary functionality), but it's still
good to have as a starting point. I also borrowed some refactoring
changes from Joachim Wiberg that he submitted for his "net: bridge:
forwarding of unknown IPv4/IPv6/MAC BUM traffic" series, but not the
entirety of his selftests. I now think that his selftests have some
overlap with bridge_vlan_unaware.sh and bridge_vlan_aware.sh and they
should be more tightly integrated with each other - yet I didn't do that
either :). Another issue I had with his selftests was that they jumped
straight ahead to configure brport flags on br0 (a radical new idea
still at RFC status) while we have bigger problems, and we don't have
nearly enough coverage for the *existing* functionality.

One idea introduced here which I haven't seen before is the symlinking
of relevant forwarding selftests to the selftests/drivers/net/<my-driver>/
folder, plus a forwarding.config file. I think there's some value in
having things structured this way, since the forwarding dir has so many
selftests that aren't relevant to DSA that it is a bit difficult to find
the ones that are.

While searching for applications that I could use for multicast testing
(not my domain of interest/knowledge really), I found Joachim Wiberg's
mtools, mcjoin and omping, and I tried them all with various degrees of
success. In particular, I was going to use mcjoin, but I faced some
issues getting IPv6 multicast traffic to work in a VRF, and I bothered
David Ahern about it here:
https://lore.kernel.org/netdev/97eaffb8-2125-834e-641f-c99c097b6ee2@gmail.com/t/
It seems that the problem is that this application should use
SO_BINDTODEVICE, yet it doesn't.

So I ended up patching the bare-bones mtools (msend, mreceive) forked by
Joachim from the University of Virginia's Multimedia Networks Group to
include IPv6 support, and to use SO_BINDTODEVICE. This is what I'm using
now for IPv6.

Note that mausezahn doesn't appear to do a particularly good job of
supporting IPv6 really, and I needed a program to emit the actual
IP_ADD_MEMBERSHIP calls, for dev_mc_add(), so I could test RX filtering.
Crafting the IGMP/MLD reports by hand doesn't really do the trick.
While extremely bare-bones, the mreceive application now seems to do
what I need it to.

Feedback appreciated, it is very likely that I could have done things in
a better way.

Joachim Wiberg (2):
  selftests: forwarding: add TCPDUMP_EXTRA_FLAGS to lib.sh
  selftests: forwarding: multiple instances in tcpdump helper

Vladimir Oltean (6):
  selftests: forwarding: add option to run tests with stable MAC
    addresses
  selftests: forwarding: add helpers for IP multicast group joins/leaves
  selftests: forwarding: add helper for retrieving IPv6 link-local
    address of interface
  selftests: forwarding: add a no_forwarding.sh test
  selftests: forwarding: add a test for local_termination.sh
  selftests: drivers: dsa: add a subset of forwarding selftests

 .../drivers/net/dsa/bridge_locked_port.sh     |   1 +
 .../selftests/drivers/net/dsa/bridge_mdb.sh   |   1 +
 .../selftests/drivers/net/dsa/bridge_mld.sh   |   1 +
 .../drivers/net/dsa/bridge_vlan_aware.sh      |   1 +
 .../drivers/net/dsa/bridge_vlan_mcast.sh      |   1 +
 .../drivers/net/dsa/bridge_vlan_unaware.sh    |   1 +
 .../drivers/net/dsa/forwarding.config         |   2 +
 .../testing/selftests/drivers/net/dsa/lib.sh  |   1 +
 .../drivers/net/dsa/local_termination.sh      |   1 +
 .../drivers/net/dsa/no_forwarding.sh          |   1 +
 .../drivers/net/ocelot/tc_flower_chains.sh    |  24 +-
 tools/testing/selftests/net/forwarding/lib.sh | 112 ++++++-
 .../net/forwarding/local_termination.sh       | 299 ++++++++++++++++++
 .../selftests/net/forwarding/no_forwarding.sh | 261 +++++++++++++++
 14 files changed, 687 insertions(+), 20 deletions(-)
 create mode 120000 tools/testing/selftests/drivers/net/dsa/bridge_locked_port.sh
 create mode 120000 tools/testing/selftests/drivers/net/dsa/bridge_mdb.sh
 create mode 120000 tools/testing/selftests/drivers/net/dsa/bridge_mld.sh
 create mode 120000 tools/testing/selftests/drivers/net/dsa/bridge_vlan_aware.sh
 create mode 120000 tools/testing/selftests/drivers/net/dsa/bridge_vlan_mcast.sh
 create mode 120000 tools/testing/selftests/drivers/net/dsa/bridge_vlan_unaware.sh
 create mode 100644 tools/testing/selftests/drivers/net/dsa/forwarding.config
 create mode 120000 tools/testing/selftests/drivers/net/dsa/lib.sh
 create mode 120000 tools/testing/selftests/drivers/net/dsa/local_termination.sh
 create mode 120000 tools/testing/selftests/drivers/net/dsa/no_forwarding.sh
 mode change 100644 => 100755 tools/testing/selftests/net/forwarding/lib.sh
 create mode 100755 tools/testing/selftests/net/forwarding/local_termination.sh
 create mode 100755 tools/testing/selftests/net/forwarding/no_forwarding.sh

-- 
2.25.1


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

end of thread, other threads:[~2022-04-23 11:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-22 10:14 [PATCH net-next 0/8] DSA selftests Vladimir Oltean
2022-04-22 10:14 ` [PATCH net-next 1/8] selftests: forwarding: add option to run tests with stable MAC addresses Vladimir Oltean
2022-04-22 10:14 ` [PATCH net-next 2/8] selftests: forwarding: add TCPDUMP_EXTRA_FLAGS to lib.sh Vladimir Oltean
2022-04-22 10:14 ` [PATCH net-next 3/8] selftests: forwarding: multiple instances in tcpdump helper Vladimir Oltean
2022-04-22 10:15 ` [PATCH net-next 4/8] selftests: forwarding: add helpers for IP multicast group joins/leaves Vladimir Oltean
2022-04-22 10:15 ` [PATCH net-next 5/8] selftests: forwarding: add helper for retrieving IPv6 link-local address of interface Vladimir Oltean
2022-04-22 10:15 ` [PATCH net-next 6/8] selftests: forwarding: add a no_forwarding.sh test Vladimir Oltean
2022-04-22 10:15 ` [PATCH net-next 7/8] selftests: forwarding: add a test for local_termination.sh Vladimir Oltean
2022-04-22 10:15 ` [PATCH net-next 8/8] selftests: drivers: dsa: add a subset of forwarding selftests Vladimir Oltean
2022-04-22 10:22 ` [PATCH net-next 0/8] DSA selftests Vladimir Oltean
2022-04-23 11:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox