mbox series

[ovs-dev,v4,0/2] Add pmd sleeping.

Message ID 20230110134715.99051-1-ktraynor@redhat.com
Headers show
Series Add pmd sleeping. | expand

Message

Kevin Traynor Jan. 10, 2023, 1:47 p.m. UTC
This series is to allow PMD threads to sleep under no and low load
conditions.

GHA: https://github.com/kevintraynor/ovs/actions/runs/3883046560

v4:

- Fixed coding stds for xnanosleep fns
- Minor updates to NEWS and docs
- Updated some define names e.g. remove '_PWR_'
- Reformatted Sleep time stat to fit in better with existing stats
- Updated pmd time ctx after sleep so any pending PMD overhead work can be
  done immediately rather than waiting for next iteration.

v3:

- Renamed 'pmd-powersave-maxsleep' to 'pmd-maxsleep'
- Removed 'pmd-powersave' param so 'pmd-maxsleep' can also be used to
  enable (max >0) and disable (max =0) sleeping
- Changed resolution of sleeps to 10 us to avoid requesting
  sleeps < 10 us and to consider that typically sleep resolutions will
  be higher in practice
- Created new xnanosleep_no_queisce() util function and sent this as
  patch 1/2. Used this instead of calling calling nanosleep() directly
  in dpif-netdev.
- Changed no-sleep hit thresh stat to be how many iterations a sleep took
  place in. This is more intuitive for the user
- Some minor changes in logging to account for updates to params and
  stats
- Fixed issue with Tx flush issue where it could be forced even though
  sleeping is disabled
- Moved reset of sleep time to keep sleep code in one block
- Updated docs and unit tests for changes in operation and logging
- Added NEWS
- Other minor updates

v2:

- Updated to mark feature as experimental as there is still discussion
  on it's operation and control knobs
- Added pmd-powersave-maxsleep to set the max requested sleep time
- Added unit tests for pmd-powersave and pmd-powersave-maxsleep config
  knobs
- Added docs to explain that requested sleep time and actual sleep time
  may differ
- Added actual measurement of sleep time instead of reporting requested
  time
- Removed Max sleep hit statistics
- Added total sleep time statistic for the length of the measurement
  period (avg. uS per iteration still exists also)
- Updated other statistics to account for sleep time
- Some renaming
- Replaced xnanosleep with nanosleep to avoid having to start/end
  quiesce for every sleep (this may KO this feature on Windows)
- Limited max requested sleep to max PMD quiesce time (10 ms)
- Adapted ALB measurement about whether a PMD is overloaded to account
  for time spent sleeping

Kevin Traynor (2):
  util: Add non quiesce xnanosleep.
  dpif-netdev: Add PMD load based sleeping.

 Documentation/topics/dpdk/pmd.rst | 54 +++++++++++++++++++++++++
 NEWS                              |  3 ++
 lib/dpif-netdev-perf.c            | 24 +++++++++---
 lib/dpif-netdev-perf.h            |  5 ++-
 lib/dpif-netdev.c                 | 65 +++++++++++++++++++++++++++++--
 lib/util.c                        | 21 ++++++++--
 lib/util.h                        |  1 +
 tests/pmd.at                      | 46 ++++++++++++++++++++++
 vswitchd/vswitch.xml              | 26 +++++++++++++
 9 files changed, 231 insertions(+), 14 deletions(-)