mbox series

[RFC,net-next,0/2] selftests/tc-testing: initial steps for parallel tdc

Message ID 20230728154059.1866057-1-pctammela@mojatatu.com (mailing list archive)
Headers show
Series selftests/tc-testing: initial steps for parallel tdc | expand

Message

Pedro Tammela July 28, 2023, 3:40 p.m. UTC
As the number of tdc tests is growing, so is our completion wall time.
One of the ideas to improve this is to run tests in parallel, as they
are self contained. Even though they will serialize over the rtnl lock,
we expect it to give a nice boost.

A first step is to make each test independent of each other by
localizing its resource usage. Today tdc shares everything, including
veth / dummy interfaces and netns. In patch 1 we make all of these
resources unique per test.

Patch 2 updates the tests to the new model, which also simplified some
definitions and made them more concise and clearer.

Pedro Tammela (2):
  selftests/tc-testing: localize test resources
  selftests/tc-testing: update test definitions for local resources

 .../testing/selftests/tc-testing/TdcPlugin.py |   4 +-
 .../tc-testing/plugin-lib/nsPlugin.py         | 183 ++++++++---
 .../tc-testing/plugin-lib/rootPlugin.py       |   4 +-
 .../tc-testing/plugin-lib/valgrindPlugin.py   |   5 +-
 .../tc-testing/tc-tests/filters/bpf.json      |  10 +-
 .../tc-testing/tc-tests/filters/fw.json       | 266 ++++++++--------
 .../tc-testing/tc-tests/filters/matchall.json | 141 +++++----
 .../tc-testing/tc-tests/infra/actions.json    | 144 ++++-----
 .../tc-testing/tc-tests/infra/filter.json     |   9 +-
 .../tc-testing/tc-tests/qdiscs/cake.json      |  82 ++---
 .../tc-testing/tc-tests/qdiscs/cbs.json       |  38 +--
 .../tc-testing/tc-tests/qdiscs/choke.json     |  30 +-
 .../tc-testing/tc-tests/qdiscs/codel.json     |  34 +--
 .../tc-testing/tc-tests/qdiscs/drr.json       |  10 +-
 .../tc-testing/tc-tests/qdiscs/etf.json       |  18 +-
 .../tc-testing/tc-tests/qdiscs/ets.json       | 284 ++++++++++--------
 .../tc-testing/tc-tests/qdiscs/fifo.json      |  98 +++---
 .../tc-testing/tc-tests/qdiscs/fq.json        |  68 +----
 .../tc-testing/tc-tests/qdiscs/fq_codel.json  |  54 +---
 .../tc-testing/tc-tests/qdiscs/fq_pie.json    |   5 +-
 .../tc-testing/tc-tests/qdiscs/gred.json      |  28 +-
 .../tc-testing/tc-tests/qdiscs/hfsc.json      |  26 +-
 .../tc-testing/tc-tests/qdiscs/hhf.json       |  36 +--
 .../tc-testing/tc-tests/qdiscs/htb.json       |  46 +--
 .../tc-testing/tc-tests/qdiscs/ingress.json   |  36 ++-
 .../tc-testing/tc-tests/qdiscs/netem.json     |  62 +---
 .../tc-tests/qdiscs/pfifo_fast.json           |  18 +-
 .../tc-testing/tc-tests/qdiscs/plug.json      |  30 +-
 .../tc-testing/tc-tests/qdiscs/prio.json      |  85 +++---
 .../tc-testing/tc-tests/qdiscs/qfq.json       |  39 +--
 .../tc-testing/tc-tests/qdiscs/red.json       |  34 +--
 .../tc-testing/tc-tests/qdiscs/sfb.json       |  48 +--
 .../tc-testing/tc-tests/qdiscs/sfq.json       |  40 +--
 .../tc-testing/tc-tests/qdiscs/skbprio.json   |  16 +-
 .../tc-testing/tc-tests/qdiscs/tbf.json       |  36 +--
 .../tc-testing/tc-tests/qdiscs/teql.json      |  14 +-
 tools/testing/selftests/tc-testing/tdc.py     | 118 +++++---
 37 files changed, 1001 insertions(+), 1198 deletions(-)

Comments

Jamal Hadi Salim July 28, 2023, 10:49 p.m. UTC | #1
On Fri, Jul 28, 2023 at 11:41 AM Pedro Tammela <pctammela@mojatatu.com> wrote:
>
> As the number of tdc tests is growing, so is our completion wall time.
> One of the ideas to improve this is to run tests in parallel, as they
> are self contained. Even though they will serialize over the rtnl lock,
> we expect it to give a nice boost.
>
> A first step is to make each test independent of each other by
> localizing its resource usage. Today tdc shares everything, including
> veth / dummy interfaces and netns. In patch 1 we make all of these
> resources unique per test.
>
> Patch 2 updates the tests to the new model, which also simplified some
> definitions and made them more concise and clearer.
>

Davide, if you get an opportunity can you please test with these
changes and add your tag?

cheers,
jamal

> Pedro Tammela (2):
>   selftests/tc-testing: localize test resources
>   selftests/tc-testing: update test definitions for local resources
>
>  .../testing/selftests/tc-testing/TdcPlugin.py |   4 +-
>  .../tc-testing/plugin-lib/nsPlugin.py         | 183 ++++++++---
>  .../tc-testing/plugin-lib/rootPlugin.py       |   4 +-
>  .../tc-testing/plugin-lib/valgrindPlugin.py   |   5 +-
>  .../tc-testing/tc-tests/filters/bpf.json      |  10 +-
>  .../tc-testing/tc-tests/filters/fw.json       | 266 ++++++++--------
>  .../tc-testing/tc-tests/filters/matchall.json | 141 +++++----
>  .../tc-testing/tc-tests/infra/actions.json    | 144 ++++-----
>  .../tc-testing/tc-tests/infra/filter.json     |   9 +-
>  .../tc-testing/tc-tests/qdiscs/cake.json      |  82 ++---
>  .../tc-testing/tc-tests/qdiscs/cbs.json       |  38 +--
>  .../tc-testing/tc-tests/qdiscs/choke.json     |  30 +-
>  .../tc-testing/tc-tests/qdiscs/codel.json     |  34 +--
>  .../tc-testing/tc-tests/qdiscs/drr.json       |  10 +-
>  .../tc-testing/tc-tests/qdiscs/etf.json       |  18 +-
>  .../tc-testing/tc-tests/qdiscs/ets.json       | 284 ++++++++++--------
>  .../tc-testing/tc-tests/qdiscs/fifo.json      |  98 +++---
>  .../tc-testing/tc-tests/qdiscs/fq.json        |  68 +----
>  .../tc-testing/tc-tests/qdiscs/fq_codel.json  |  54 +---
>  .../tc-testing/tc-tests/qdiscs/fq_pie.json    |   5 +-
>  .../tc-testing/tc-tests/qdiscs/gred.json      |  28 +-
>  .../tc-testing/tc-tests/qdiscs/hfsc.json      |  26 +-
>  .../tc-testing/tc-tests/qdiscs/hhf.json       |  36 +--
>  .../tc-testing/tc-tests/qdiscs/htb.json       |  46 +--
>  .../tc-testing/tc-tests/qdiscs/ingress.json   |  36 ++-
>  .../tc-testing/tc-tests/qdiscs/netem.json     |  62 +---
>  .../tc-tests/qdiscs/pfifo_fast.json           |  18 +-
>  .../tc-testing/tc-tests/qdiscs/plug.json      |  30 +-
>  .../tc-testing/tc-tests/qdiscs/prio.json      |  85 +++---
>  .../tc-testing/tc-tests/qdiscs/qfq.json       |  39 +--
>  .../tc-testing/tc-tests/qdiscs/red.json       |  34 +--
>  .../tc-testing/tc-tests/qdiscs/sfb.json       |  48 +--
>  .../tc-testing/tc-tests/qdiscs/sfq.json       |  40 +--
>  .../tc-testing/tc-tests/qdiscs/skbprio.json   |  16 +-
>  .../tc-testing/tc-tests/qdiscs/tbf.json       |  36 +--
>  .../tc-testing/tc-tests/qdiscs/teql.json      |  14 +-
>  tools/testing/selftests/tc-testing/tdc.py     | 118 +++++---
>  37 files changed, 1001 insertions(+), 1198 deletions(-)
>
> --
> 2.39.2
>
Davide Caratti July 31, 2023, 8 a.m. UTC | #2
On Sat, Jul 29, 2023 at 12:49 AM Jamal Hadi Salim <jhs@mojatatu.com> wrote:
>
> On Fri, Jul 28, 2023 at 11:41 AM Pedro Tammela <pctammela@mojatatu.com> wrote:
> >
> > As the number of tdc tests is growing, so is our completion wall time.
> > One of the ideas to improve this is to run tests in parallel, as they
> > are self contained. Even though they will serialize over the rtnl lock,
> > we expect it to give a nice boost.

[...]

>
> Davide, if you get an opportunity can you please test with these
> changes and add your tag?

sure, will do and provide feedback in a couple of days. Thanks!
Davide Caratti Aug. 1, 2023, 2:27 p.m. UTC | #3
On Fri, Jul 28, 2023 at 12:40:57PM -0300, Pedro Tammela wrote:
> As the number of tdc tests is growing, so is our completion wall time.
> One of the ideas to improve this is to run tests in parallel, as they
> are self contained. Even though they will serialize over the rtnl lock,
> we expect it to give a nice boost.
> 
> A first step is to make each test independent of each other by
> localizing its resource usage. Today tdc shares everything, including
> veth / dummy interfaces and netns. In patch 1 we make all of these
> resources unique per test.
> 
> Patch 2 updates the tests to the new model, which also simplified some
> definitions and made them more concise and clearer.

hello, 

tests are ok!  A couple of (minor) items:

- the patched code introduces a dependency for python (must be > 3.8).
  That's ok, but maybe we should put this in clear in the commit message
  of patch 1/2.
- TEQL test passes, but the code doesn't look functional for namespaces:
  maybe we can keep teql test not requiring nsPlugin?

other than this, looks good to me, thanks!

Reviewed-and-tested-by: Davide Caratti <dcaratti@redhat.com>
Pedro Tammela Aug. 1, 2023, 2:29 p.m. UTC | #4
On 01/08/2023 11:27, Davide Caratti wrote:
> On Fri, Jul 28, 2023 at 12:40:57PM -0300, Pedro Tammela wrote:
>> As the number of tdc tests is growing, so is our completion wall time.
>> One of the ideas to improve this is to run tests in parallel, as they
>> are self contained. Even though they will serialize over the rtnl lock,
>> we expect it to give a nice boost.
>>
>> A first step is to make each test independent of each other by
>> localizing its resource usage. Today tdc shares everything, including
>> veth / dummy interfaces and netns. In patch 1 we make all of these
>> resources unique per test.
>>
>> Patch 2 updates the tests to the new model, which also simplified some
>> definitions and made them more concise and clearer.
> 
> hello,
> 
> tests are ok!  A couple of (minor) items:
> 
> - the patched code introduces a dependency for python (must be > 3.8).
>    That's ok, but maybe we should put this in clear in the commit message
>    of patch 1/2.

OK! I didn't even notice that.
I will add a runtime check as well.

> - TEQL test passes, but the code doesn't look functional for namespaces:
>    maybe we can keep teql test not requiring nsPlugin?

Sure!

> 
> other than this, looks good to me, thanks!
> 
> Reviewed-and-tested-by: Davide Caratti <dcaratti@redhat.com>
> 

Thank you