netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Michalik <michal.michalik@intel.com>
To: netdev@vger.kernel.org
Cc: vadim.fedorenko@linux.dev, arkadiusz.kubalewski@intel.com,
	jonathan.lemon@gmail.com, pabeni@redhat.com, poros@redhat.com,
	milena.olech@intel.com, mschmidt@redhat.com,
	linux-clk@vger.kernel.org, bvanassche@acm.org, kuba@kernel.org,
	davem@davemloft.net, edumazet@google.com,
	Michal Michalik <michal.michalik@intel.com>
Subject: [PATCH RFC net-next v4 0/2] selftests/dpll: DPLL subsystem integration tests
Date: Thu, 23 Nov 2023 05:52:41 -0500	[thread overview]
Message-ID: <20231123105243.7992-1-michal.michalik@intel.com> (raw)

The recently merged common DPLL interface discussed on a mailing list[1]
is introducing new, complex subsystem which requires proper integration
testing - this patchset adds such a framework, as well as the initial
test cases. Framework does not require neither any special hardware nor
any special system architecture.

To properly test the DPLL subsystem this patch adds fake DPLL devices
and its pins to netdevsim. Two DPLL devices are added: EEC and PPS.
There are also common pins for each device: PPS and GNSS. Additionally
each netdevsim port register RCLK (recovered clock) pin for itself. That
allow us to check mutliple scenarios which might be problematic in real
implementations (like different ordering etc.)

Patch adds few helper scripts, which are:
1) tools/testing/selftests/drivers/net/netdevsim/dpll/run_dpll_tests.sh
    Script is checking for all dependencies, creates temporary
    environment, installs required libraries and run all tests - can be
    used standalone
2)
tools/testing/selftests/drivers/net/netdevsim/dpll/ynlfamilyhandler.py˙
    Library for easier ynl use in the pytest framework - can be used
    standalone

[1] https://lore.kernel.org/netdev/169494842736.21621.10730860855645661664.git-patchwork-notify@kernel.org/

Changelog:
v3 -> v4:
- return from nsim_dpll_init_owner directly (removed goto)
- fix too long line (was over 80 chars)
- fix uninitialized function returns after goto
- move kfree(name) in nsim_rclk_init to end to avoid double free
- removed unused devid left after refactoring
- rebased on top of main

v2 -> v3:
- updated the cover letter
- moved framework from selftests/dpll to
  selftests/drivers/net/netdevsim/dpll/
- added `nsim_` prefixes to functions and structs
- dropped unecessary casts
- added necessary debugfs entries
- added random clock id
- improved error patchs on init
- removed separate dpll.h header
- removed unnecesary UAPI dpll header import
- changed struct names
- changed private data structs to be embedded
- moved common pin init to device init
- added netdev_dpll_pin_set/clear()

v1 -> v2:
- moved from separate module to implementation in netdevsim

Michal Michalik (2):
  netdevsim: implement DPLL for subsystem selftests
  selftests/dpll: add DPLL system integration selftests

 drivers/net/Kconfig                           |   1 +
 drivers/net/netdevsim/Makefile                |   2 +-
 drivers/net/netdevsim/dev.c                   |  21 +-
 drivers/net/netdevsim/dpll.c                  | 489 ++++++++++++++++++
 drivers/net/netdevsim/netdev.c                |  10 +
 drivers/net/netdevsim/netdevsim.h             |  44 ++
 tools/testing/selftests/Makefile              |   1 +
 .../drivers/net/netdevsim/dpll/Makefile       |   8 +
 .../drivers/net/netdevsim/dpll/__init__.py    |   0
 .../drivers/net/netdevsim/dpll/config         |   2 +
 .../drivers/net/netdevsim/dpll/consts.py      |  40 ++
 .../drivers/net/netdevsim/dpll/dpll_utils.py  |  94 ++++
 .../net/netdevsim/dpll/requirements.txt       |   3 +
 .../net/netdevsim/dpll/run_dpll_tests.sh      |  75 +++
 .../drivers/net/netdevsim/dpll/test_dpll.py   | 376 ++++++++++++++
 .../net/netdevsim/dpll/ynlfamilyhandler.py    |  49 ++
 16 files changed, 1213 insertions(+), 2 deletions(-)
 create mode 100644 drivers/net/netdevsim/dpll.c
 create mode 100644 tools/testing/selftests/drivers/net/netdevsim/dpll/Makefile
 create mode 100644 tools/testing/selftests/drivers/net/netdevsim/dpll/__init__.py
 create mode 100644 tools/testing/selftests/drivers/net/netdevsim/dpll/config
 create mode 100644 tools/testing/selftests/drivers/net/netdevsim/dpll/consts.py
 create mode 100644 tools/testing/selftests/drivers/net/netdevsim/dpll/dpll_utils.py
 create mode 100644 tools/testing/selftests/drivers/net/netdevsim/dpll/requirements.txt
 create mode 100755 tools/testing/selftests/drivers/net/netdevsim/dpll/run_dpll_tests.sh
 create mode 100644 tools/testing/selftests/drivers/net/netdevsim/dpll/test_dpll.py
 create mode 100644 tools/testing/selftests/drivers/net/netdevsim/dpll/ynlfamilyhandler.py


base-commit: 750011e239a50873251c16207b0fe78eabf8577e
-- 
2.39.3


             reply	other threads:[~2023-11-23 10:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-23 10:52 Michal Michalik [this message]
2023-11-23 10:52 ` [PATCH RFC net-next v4 1/2] netdevsim: implement DPLL for subsystem selftests Michal Michalik
2023-11-23 12:24   ` Jiri Pirko
2023-11-30 16:55     ` Michalik, Michal
2023-12-01  7:49       ` Jiri Pirko
2023-11-23 14:41   ` Simon Horman
2023-11-30 17:22     ` Michalik, Michal
2023-11-23 10:52 ` [PATCH RFC net-next v4 2/2] selftests/dpll: add DPLL system integration selftests Michal Michalik
2023-11-29 17:39   ` Jakub Kicinski
2023-11-30 17:46     ` Michalik, Michal
2023-12-01  6:51       ` Jakub Kicinski
2023-12-01 18:33         ` Michalik, Michal
2023-12-01 19:52           ` Jakub Kicinski
2023-12-04 12:44             ` Michalik, Michal
2023-12-05  3:02               ` Jakub Kicinski
2023-12-01 20:03   ` Jakub Kicinski

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=20231123105243.7992-1-michal.michalik@intel.com \
    --to=michal.michalik@intel.com \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=bvanassche@acm.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=milena.olech@intel.com \
    --cc=mschmidt@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=poros@redhat.com \
    --cc=vadim.fedorenko@linux.dev \
    /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;
as well as URLs for NNTP newsgroup(s).